Initial push

This commit is contained in:
sladecraven 2022-10-22 11:09:48 +02:00
commit 45273e5e43
75 changed files with 5099 additions and 0 deletions

23
README.md Normal file
View File

@ -0,0 +1,23 @@
# Système Foundry pour Mournblade (French RPG, Titam France/Sombres Projets)
## EN
Unofficial system for Mournblade (French version from Titam France).
Books are mandatory to play and are available at : http://www.titam-france.fr
## FR
Système non-officiel pour le JDR Mournblade (Titam France).
Ce système a été autorisé par Ludospherik ( http://www.ludospherik.fr/ ), merci à eux !
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : http://www.titam-france.fr
# Credits
Mournblade, le jeu de rôle de Sword & Sorcery, is a property of Titam France/Sombres Projets.
# Developmement
LeRatierBretonnien

BIN
assets/fonts/CentaurMT.otf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
assets/icons/adresse.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
assets/icons/arme.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
assets/icons/capacite.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
assets/icons/don.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

BIN
assets/icons/eclat.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
assets/icons/heritage.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
assets/icons/monnaie.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
assets/icons/origine.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
assets/icons/pacte.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

BIN
assets/icons/presence.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
assets/icons/puissance.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
assets/icons/rune.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
assets/icons/tendance.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
assets/icons/trempe.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

BIN
assets/ui/pc_sheet_bg.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,170 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { HawkmoonUtility } from "./hawkmoon-utility.js";
import { HawkmoonRollDialog } from "./hawkmoon-roll-dialog.js";
/* -------------------------------------------- */
export class HawkmoonActorSheet extends ActorSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["fvtt-hawkmoon", "sheet", "actor"],
template: "systems/fvtt-hawkmoon-cyd/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
});
}
/* -------------------------------------------- */
async getData() {
const objectData = duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: duplicate(this.actor.getWeapons()),
protections: duplicate(this.actor.getArmors()),
dons: duplicate(this.actor.getDons()),
alignement: this.actor.getAlignement(),
aspect: this.actor.getAspect(),
marge: this.actor.getMarge(),
tendances:duplicate(this.actor.getTendances()),
runes:duplicate(this.actor.getRunes()),
origine: duplicate(this.actor.getOrigine() || {}),
heritage: duplicate(this.actor.getHeritage() || {}),
metier: duplicate(this.actor.getMetier() || {}),
combat: this.actor.getCombatValues(),
equipements: duplicate(this.actor.getEquipments()),
description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get( itemId )
item.sheet.render(true)
})
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
HawkmoonUtility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.quantity-minus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), -1 );
} );
html.find('.quantity-plus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), +1 );
} );
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-rune').click((event) => {
const li = $(event.currentTarget).parents(".item")
let runeId = li.data("item-id")
this.actor.rollRune(runeId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem( li.data("item-id") );
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
/*async _onDropItem(event, dragData) {
let item = await HawkmoonUtility.searchItem( dragData)
this.actor.preprocessItem( event, item, true )
super._onDropItem(event, dragData)
}*/
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
// Update the Actor
return this.object.update(formData);
}
}

505
modules/hawkmoon-actor.js Normal file
View File

@ -0,0 +1,505 @@
/* -------------------------------------------- */
import { HawkmoonUtility } from "./hawkmoon-utility.js";
import { HawkmoonRollDialog } from "./hawkmoon-roll-dialog.js";
/* -------------------------------------------- */
const __degatsBonus = [-2, -2, -1, -1, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 8, 8, 9, 9, 10, 10]
const __vitesseBonus = [-2, -2, -1, -1, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8]
/* -------------------------------------------- */
/**
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
* @extends {Actor}
*/
export class HawkmoonActor extends Actor {
/* -------------------------------------------- */
/**
* Override the create() function to provide additional SoS functionality.
*
* This overrided create() function adds initial items
* Namely: Basic skills, money,
*
* @param {Object} data Barebones actor data which this function adds onto.
* @param {Object} options (Unused) Additional options which customize the creation workflow.
*
*/
static async create(data, options) {
// Case of compendium global import
if (data instanceof Array) {
return super.create(data, options);
}
// If the created actor has items (only applicable to duplicated actors) bypass the new actor creation logic
if (data.items) {
let actor = super.create(data, options);
return actor;
}
if (data.type == 'personnage') {
const skills = await HawkmoonUtility.loadCompendium("fvtt-hawkmoon-cyd.skills")
data.items = skills.map(i => i.toObject())
}
if (data.type == 'pnj') {
}
return super.create(data, options);
}
/* -------------------------------------------- */
prepareArme(arme) {
arme = duplicate(arme)
let combat = this.getCombatValues()
if (arme.system.typearme == "contact" || arme.system.typearme == "contactjet") {
arme.system.competence = duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "mêlée"))
arme.system.attrKey = "pui"
arme.system.totalDegats = arme.system.degats + "+" + combat.bonusDegatsTotal
arme.system.totalOffensif = this.system.attributs.pui.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff
if (arme.system.isdefense) {
arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.bonusmaniementdef
}
}
if (arme.system.typearme == "jet" || arme.system.typearme == "tir") {
arme.system.competence = duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "armes à distance"))
arme.system.attrKey = "adr"
arme.system.totalOffensif = this.system.attributs.adr.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff
arme.system.totalDegats = arme.system.degats
if (arme.system.isdefense) {
arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.bonusmaniementdef
}
}
return arme
}
/* -------------------------------------------- */
prepareBouclier(bouclier) {
bouclier = duplicate(bouclier)
let combat = this.getCombatValues()
bouclier.system.competence = duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "mêlée"))
bouclier.system.attrKey = "pui"
bouclier.system.totalDegats = bouclier.system.degats + "+" + combat.bonusDegatsTotal
bouclier.system.totalOffensif = this.system.attributs.pui.value + bouclier.system.competence.system.niveau
bouclier.system.isdefense = true
bouclier.system.bonusmaniementoff = 0
bouclier.system.totalDefensif = combat.defenseTotal + bouclier.system.competence.system.niveau + bouclier.system.bonusdefense
return bouclier
}
/* -------------------------------------------- */
getWeapons() {
let armes = []
for (let arme of this.items) {
if (arme.type == "arme") {
armes.push(this.prepareArme(arme))
}
if (arme.type == "bouclier") {
armes.push(this.prepareBouclier(arme))
}
}
return armes
}
/* -------------------------------------------- */
getDons() {
return this.items.filter(item => item.type == "don")
}
/* -------------------------------------------- */
getTendances() {
return this.items.filter(item => item.type == "tendance")
}
getRunes() {
return this.items.filter(item => item.type == "rune")
}
/* -------------------------------------------- */
getEquipments() {
return this.items.filter(item => item.type == "equipement")
}
/* -------------------------------------------- */
getArmors() {
return this.items.filter(item => item.type == "protection")
}
getOrigine() {
return this.items.find(item => item.type == "origine")
}
getMetier() {
return this.items.find(item => item.type == "metier")
}
getHeritage() {
return this.items.find(item => item.type == "heritage")
}
/* -------------------------------------------- */
getSkills() {
let comp = []
for (let item of this.items) {
item = duplicate(item)
if (item.type == "competence") {
item.system.attribut1total = item.system.niveau + (this.system.attributs[item.system.attribut1]?.value || 0)
item.system.attribut2total = item.system.niveau + (this.system.attributs[item.system.attribut2]?.value || 0)
item.system.attribut3total = item.system.niveau + (this.system.attributs[item.system.attribut3]?.value || 0)
if (item.system.niveau == 0) {
item.system.attribut1total -= 3
item.system.attribut2total -= 3
item.system.attribut3total -= 3
}
item.system.attribut1label = this.system.attributs[item.system.attribut1]?.label || ""
item.system.attribut2label = this.system.attributs[item.system.attribut2]?.label || ""
item.system.attribut3label = this.system.attributs[item.system.attribut3]?.label || ""
comp.push(item)
}
}
return comp.sort(function (a, b) {
let fa = a.name.toLowerCase(),
fb = b.name.toLowerCase();
if (fa < fb) {
return -1;
}
if (fa > fb) {
return 1;
}
return 0;
})
}
/* -------------------------------------------- */
getAspect() {
return (this.system.balance.loi > this.system.balance.chaos) ? this.system.balance.loi : this.system.balance.chaos
}
getMarge() {
return Math.abs( this.system.balance.loi - this.system.balance.chaos)
}
getAlignement() {
return (this.system.balance.loi > this.system.balance.chaos) ? "loyal" : "chaotique"
}
/* -------------------------------------------- */
getDefenseBase() {
return this.system.attributs.tre.value + 5
}
/* -------------------------------------------- */
getVitesseBase() {
return 5 + __vitesseBonus[this.system.attributs.adr.value]
}
/* -------------------------------------------- */
getCombatValues() {
let combat = {
initBase: this.system.attributs.adr.value,
initTotal: this.system.attributs.adr.value + this.system.combat.initbonus,
bonusDegats: this.getBonusDegats(),
bonusDegatsTotal: this.getBonusDegats() + this.system.combat.bonusdegats,
vitesseBase: this.getVitesseBase(),
vitesseTotal: this.getVitesseBase() + this.system.combat.vitessebonus,
defenseBase: this.getDefenseBase(),
defenseTotal: this.getDefenseBase() + this.system.combat.defensebonus
}
return combat
}
/* -------------------------------------------- */
prepareBaseData() {
}
/* -------------------------------------------- */
async prepareData() {
super.prepareData();
}
/* -------------------------------------------- */
prepareDerivedData() {
if (this.type == 'personnage') {
let newSante = this.system.sante.bonus + (this.system.attributs.pui.value + this.system.attributs.tre.value) * 2 + 5
if (this.system.sante.base != newSante) {
this.update({ 'system.sante.base': newSante })
}
let newAme = (this.system.attributs.cla.value + this.system.attributs.tre.value) * this.system.biodata.amemultiplier + 5
if (this.system.ame.fullmax != newAme) {
this.update({ 'system.ame.fullmax': newAme })
}
}
super.prepareDerivedData()
}
/* -------------------------------------------- */
_preUpdate(changed, options, user) {
super._preUpdate(changed, options, user);
}
/* -------------------------------------------- */
getItemById(id) {
let item = this.items.find(item => item.id == id);
if (item) {
item = duplicate(item)
}
return item;
}
/* -------------------------------------------- */
async equipItem(itemId) {
let item = this.items.find(item => item.id == itemId)
if (item && item.system) {
let update = { _id: item.id, "system.equipped": !item.system.equipped }
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */
editItemField(itemId, itemType, itemField, dataType, value) {
let item = this.items.find(item => item.id == itemId)
if (item) {
console.log("Item ", item, itemField, dataType, value)
if (dataType.toLowerCase() == "number") {
value = Number(value)
} else {
value = String(value)
}
let update = { _id: item.id, [`system.${itemField}`]: value };
this.updateEmbeddedDocuments("Item", [update])
}
}
/* -------------------------------------------- */
getBonneAventure() {
return this.system.bonneaventure.actuelle
}
/* -------------------------------------------- */
changeBonneAventure(value) {
let newBA = this.system.bonneaventure.actuelle
newBA += value
this.update({ 'system.bonneaventure.actuelle': newBA })
}
/* -------------------------------------------- */
getEclat() {
return this.system.eclat.value
}
/* -------------------------------------------- */
changeEclat(value) {
let newE = this.system.eclat.value
newE += value
this.update({ 'system.eclat.value': newE })
}
/* -------------------------------------------- */
canEclatDoubleD20() {
return (this.getAlignement() == "loyal" && this.system.eclat.value > 0)
}
/* -------------------------------------------- */
subPointsAme(runeMode, value) {
let ame = duplicate(this.system.ame)
if(runeMode == "prononcer") {
ame.value -= value
} else {
ame.currentmax -= value
}
this.update( {'system.ame': ame})
}
/* -------------------------------------------- */
compareName(a, b) {
if (a.name < b.name) {
return -1;
}
if (a.name > b.name) {
return 1;
}
return 0;
}
/* -------------------------------------------- */
getAttribute(attrKey) {
return this.system.attributes[attrKey]
}
/* -------------------------------------------- */
getBonusDegats() {
return __degatsBonus[this.system.attributs.pui.value]
}
/* -------------------------------------------- */
async equipGear(equipmentId) {
let item = this.items.find(item => item.id == equipmentId);
if (item && item.system.data) {
let update = { _id: item.id, "system.equipped": !item.system.equipped };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */
getSubActors() {
let subActors = [];
for (let id of this.system.subactors) {
subActors.push(duplicate(game.actors.get(id)));
}
return subActors;
}
/* -------------------------------------------- */
async addSubActor(subActorId) {
let subActors = duplicate(this.system.subactors);
subActors.push(subActorId);
await this.update({ 'system.subactors': subActors });
}
/* -------------------------------------------- */
async delSubActor(subActorId) {
let newArray = [];
for (let id of this.system.subactors) {
if (id != subActorId) {
newArray.push(id);
}
}
await this.update({ 'system.subactors': newArray });
}
/* -------------------------------------------- */
async incDecQuantity(objetId, incDec = 0) {
let objetQ = this.items.get(objetId)
if (objetQ) {
let newQ = objetQ.system.quantity + incDec;
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.quantity': newQ }]); // pdates one EmbeddedEntity
}
}
/* -------------------------------------------- */
getCompetence(compId) {
return this.items.get(compId)
}
/* -------------------------------------------- */
async setPredilectionUsed(compId, predIdx) {
let comp = this.items.get(compId)
let pred = duplicate(comp.system.predilections)
pred[predIdx].used = true
await this.updateEmbeddedDocuments('Item', [{ _id: compId, 'system.predilections': pred }])
}
/* -------------------------------------------- */
getInitiativeScore( ) {
return Number(this.system.attributs.adr.value) + Number(this.system.combat.initbonus)
}
/* -------------------------------------------- */
getBestDefenseValue() {
let defenseList = this.items.filter(item => (item.type =="arme" || item.type == "bouclier") && item.system.equipped)
let maxDef = 0
let bestArme
for(let arme of defenseList) {
if (arme.type == "arme" && arme.system.isdefense) {
arme = this.prepareArme(arme)
}
if (arme.type == "bouclier" ) {
arme = this.prepareBouclier(arme)
}
if ( arme.system.totalDefensif > maxDef) {
maxDef = arme.system.totalDefensif
bestArme = duplicate(arme)
}
}
return bestArme
}
/* -------------------------------------------- */
getCommonRollData(attrKey = undefined, compId = undefined, compName = undefined) {
let rollData = HawkmoonUtility.getBasicRollData()
rollData.alias = this.name
rollData.actorImg = this.img
rollData.actorId = this.id
rollData.img = this.img
rollData.canEclatDoubleD20 = this.canEclatDoubleD20()
rollData.doubleD20 = false
rollData.attributs = HawkmoonUtility.getAttributs()
if (attrKey) {
rollData.attrKey = attrKey
if (attrKey != "tochoose") {
rollData.actionImg = "systems/fvtt-mournblade/assets/icons/" + this.system.attributs[attrKey].labelnorm + ".webp"
rollData.attr = duplicate(this.system.attributs[attrKey])
}
}
if (compId) {
rollData.competence = duplicate(this.items.get(compId) || {})
rollData.actionImg = rollData.competence?.img
}
if (compName) {
rollData.competence = duplicate(this.items.find( item => item.name.toLowerCase() == compName.toLowerCase()) || {})
rollData.actionImg = rollData.competence?.img
}
return rollData
}
/* -------------------------------------------- */
async rollAttribut(attrKey) {
let rollData = this.getCommonRollData(attrKey)
let rollDialog = await HawkmoonRollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollCompetence(attrKey, compId) {
let rollData = this.getCommonRollData(attrKey, compId)
console.log("RollDatra", rollData)
let rollDialog = await HawkmoonRollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollRune(runeId) {
let comp = this.items.find(comp => comp.type == "competence" && comp.name.toLowerCase() == "savoir : runes")
if ( !comp) {
ui.notifications.warn("La compétence Savoirs : Runes n'a pas été trouvée, abandon.")
return
}
let rollData = this.getCommonRollData("cla", undefined, "Savoir : Runes")
rollData.rune = duplicate(this.items.get(runeId) || {})
rollData.difficulte = rollData.rune?.system?.seuil || 0
rollData.runemode = "prononcer"
rollData.runeame = 1
console.log("runeData", rollData)
let rollDialog = await HawkmoonRollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollArmeOffensif(armeId) {
let arme = this.items.get(armeId)
if (arme.type == "arme") {
arme = this.prepareArme(arme)
}
if (arme.type == "bouclier") {
arme = this.prepareBouclier(arme)
}
let rollData = this.getCommonRollData(arme.system.attrKey, arme.system.competence._id)
rollData.arme = arme
console.log("ARME!", rollData)
let rollDialog = await HawkmoonRollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollArmeDegats(armeId) {
let arme = this.items.get(armeId)
if (arme.type == "arme") {
arme = this.prepareArme(arme)
}
if (arme.type == "bouclier") {
arme = this.prepareBouclier(arme)
}
let roll = new Roll(arme.system.totalDegats).roll({ async: false })
await HawkmoonUtility.showDiceSoNice(roll, game.settings.get("core", "rollMode"));
let rollData = {
arme: arme,
finalResult: roll.total,
alias: this.name,
actorImg: this.img,
actorId: this.id,
actionImg: arme.img,
}
HawkmoonUtility.createChatWithRollMode(rollData.alias, {
content: await renderTemplate(`systems/fvtt-mournblade/templates/chat-degats-result.html`, rollData)
})
}
}

View File

@ -0,0 +1,27 @@
import { HawkmoonUtility } from "./hawkmoon-utility.js";
/* -------------------------------------------- */
export class HawkmoonCombat extends Combat {
/* -------------------------------------------- */
async rollInitiative(ids, formula = undefined, messageOptions = {} ) {
ids = typeof ids === "string" ? [ids] : ids;
for (let cId = 0; cId < ids.length; cId++) {
const c = this.combatants.get(ids[cId]);
let id = c._id || c.id;
let initBonus = c.actor ? c.actor.getInitiativeScore() : 0
let roll = new Roll("1d10 + "+initBonus).roll({ async: false})
await HawkmoonUtility.showDiceSoNice(roll, game.settings.get("core", "rollMode"))
//console.log("Init bonus", initBonus, roll.total)
await this.updateEmbeddedDocuments("Combatant", [ { _id: id, initiative: roll.total } ]);
}
return this;
}
/* -------------------------------------------- */
_onUpdate(changed, options, userId) {
}
}

View File

@ -0,0 +1,123 @@
/* -------------------------------------------- */
import { HawkmoonUtility } from "./hawkmoon-utility.js";
import { HawkmoonRollDialog } from "./hawkmoon-roll-dialog.js";
/* -------------------------------------------- */
export class HawkmoonCommands {
static init() {
if (!game.system.mournblade.commands) {
//const HawkmoonCommands = new HawkmoonCommands()
//HawkmoonCommands.registerCommand({ path: ["/char"], func: (content, msg, params) => HawkmoonCommands.createChar(msg), descr: "Create a new character" });
//game.system.mournblade.commands = HawkmoonCommands
}
}
constructor() {
this.commandsTable = {}
}
/* -------------------------------------------- */
registerCommand(command) {
this._addCommand(this.commandsTable, command.path, '', command);
}
/* -------------------------------------------- */
_addCommand(targetTable, path, fullPath, command) {
if (!this._validateCommand(targetTable, path, command)) {
return;
}
const term = path[0];
fullPath = fullPath + term + ' '
if (path.length == 1) {
command.descr = `<strong>${fullPath}</strong>: ${command.descr}`;
targetTable[term] = command;
}
else {
if (!targetTable[term]) {
targetTable[term] = { subTable: {} };
}
this._addCommand(targetTable[term].subTable, path.slice(1), fullPath, command)
}
}
/* -------------------------------------------- */
_validateCommand(targetTable, path, command) {
if (path.length > 0 && path[0] && command.descr && (path.length != 1 || targetTable[path[0]] == undefined)) {
return true;
}
console.warn("HawkmoonCommands._validateCommand failed ", targetTable, path, command);
return false;
}
/* -------------------------------------------- */
/* Manage chat commands */
processChatCommand(commandLine, content = '', msg = {}) {
// Setup new message's visibility
let rollMode = game.settings.get("core", "rollMode");
if (["gmroll", "blindroll"].includes(rollMode)) msg["whisper"] = ChatMessage.getWhisperRecipients("GM");
if (rollMode === "blindroll") msg["blind"] = true;
msg["type"] = 0;
let command = commandLine[0].toLowerCase();
let params = commandLine.slice(1);
return this.process(command, params, content, msg);
}
/* -------------------------------------------- */
process(command, params, content, msg) {
return this._processCommand(this.commandsTable, command, params, content, msg);
}
/* -------------------------------------------- */
_processCommand(commandsTable, name, params, content = '', msg = {}, path = "") {
console.log("===> Processing command")
let command = commandsTable[name];
path = path + name + " ";
if (command && command.subTable) {
if (params[0]) {
return this._processCommand(command.subTable, params[0], params.slice(1), content, msg, path)
}
else {
this.help(msg, command.subTable);
return true;
}
}
if (command && command.func) {
const result = command.func(content, msg, params);
if (result == false) {
RdDCommands._chatAnswer(msg, command.descr);
}
return true;
}
return false;
}
/* -------------------------------------------- */
async createChar(msg) {
game.system.Hawkmoon.creator = new HawkmoonActorCreate();
game.system.Hawkmoon.creator.start();
}
/* -------------------------------------------- */
static _chatAnswer(msg, content) {
msg.whisper = [game.user.id];
msg.content = content;
ChatMessage.create(msg);
}
/* -------------------------------------------- */
async poolRoll( msg) {
let rollData = HawkmoonUtility.getBasicRollData()
rollData.alias = "Dice Pool Roll",
rollData.mode = "generic"
rollData.title = `Dice Pool Roll`;
let rollDialog = await HawkmoonRollDialog.create( this, rollData);
rollDialog.render( true );
}
}

View File

@ -0,0 +1,178 @@
import { HawkmoonUtility } from "./hawkmoon-utility.js";
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class HawkmoonItemSheet extends ItemSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["fvtt-hawkmoon", "sheet", "item"],
template: "systems/fvtt-hawkmoon-cyd/templates/item-sheet.html",
dragDrop: [{ dragSelector: null, dropSelector: null }],
width: 620,
height: 550
//tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}]
});
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
// Add "Post to chat" button
// We previously restricted this to GM and editable items only. If you ever find this comment because it broke something: eh, sorry!
buttons.unshift(
{
class: "post",
icon: "fas fa-comment",
onclick: ev => { }
})
return buttons
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
if (this.item.type.includes('weapon')) {
position.width = 640;
}
return position;
}
/* -------------------------------------------- */
async getData() {
const objectData = duplicate(this.object)
let formData = {
title: this.title,
id: this.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
attributs: HawkmoonUtility.getAttributs(),
system: objectData.system,
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
mr: (this.object.type == 'specialisation'),
isGM: game.user.isGM
}
if ( objectData.type == "don") {
formData.sacrifice = await TextEditor.enrichHTML(this.object.system.sacrifice, {async: true})
}
//this.options.editable = !(this.object.origin == "embeddedItem");
console.log("ITEM DATA", formData, this);
return formData;
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
buttons.unshift({
class: "post",
icon: "fas fa-comment",
onclick: ev => this.postItem()
});
return buttons
}
/* -------------------------------------------- */
postItem() {
let chatData = duplicate(HawkmoonUtility.data(this.item));
if (this.actor) {
chatData.actor = { id: this.actor.id };
}
// Don't post any image for the item (which would leave a large gap) if the default image is used
if (chatData.img.includes("/blank.png")) {
chatData.img = null;
}
// JSON object for easy creation
chatData.jsondata = JSON.stringify(
{
compendium: "postedItem",
payload: chatData,
});
renderTemplate('systems/fvtt-Hawkmoon-rpg/templates/post-item.html', chatData).then(html => {
let chatOptions = HawkmoonUtility.chatDataSetup(html);
ChatMessage.create(chatOptions)
});
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
const item = this.object.options.actor.getOwnedItem(li.data("item-id"))
item.sheet.render(true);
});
html.find('.delete-subitem').click(ev => {
this.deleteSubitem(ev);
})
html.find('.edit-prediction').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = duplicate(this.object.system.predilections)
pred[index].name = ev.currentTarget.value
this.object.update( { 'data.predilections': pred })
})
html.find('.delete-prediction').click(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = duplicate(this.object.system.predilections)
pred.splice(index,1)
this.object.update( { 'data.predilections': pred })
})
html.find('.use-prediction').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = duplicate(this.object.system.predilections)
pred[index].used = ev.currentTarget.checked
this.object.update( { 'data.predilections': pred })
})
html.find('#add-predilection').click(ev => {
let pred = duplicate(this.object.system.predilections)
pred.push( { name: "Nouvelle prédilection", used: false })
this.object.update( { 'data.predilections': pred })
})
// Update Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id");
let itemType = li.data("item-type");
});
}
/* -------------------------------------------- */
get template() {
let type = this.item.type;
return `systems/fvtt-mournblade/templates/item-${type}-sheet.html`;
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
return this.object.update(formData);
}
}

31
modules/hawkmoon-item.js Normal file
View File

@ -0,0 +1,31 @@
import { HawkmoonUtility } from "./hawkmoon-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-hawkmoon-cyd/assets/icons/competence.webp",
arme: "systems/fvtt-hawkmoon-cyd/assets/icons/arme.webp",
capacite: "systems/fvtt-hawkmoon-cyd/assets/icons/capacite.webp",
don: "systems/fvtt-hawkmoon-cyd/assets/icons/don.webp",
equipement: "systems/fvtt-hawkmoon-cyd/assets/icons/equipement.webp",
monnaie: "systems/fvtt-hawkmoon-cyd/assets/icons/monnaie.webp",
pacte: "systems/fvtt-hawkmoon-cyd/assets/icons/pacte.webp",
predilection: "systems/fvtt-hawkmoon-cyd/assets/icons/predilection.webp",
protection: "systems/fvtt-hawkmoon-cyd/assets/icons/protection.webp",
rune: "systems/fvtt-hawkmoon-cyd/assets/icons/rune.webp",
tendance: "systems/fvtt-hawkmoon-cyd/assets/icons/tendance.webp",
traitchaotique: "systems/fvtt-hawkmoon-cyd/assets/icons/traitchaotique.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class HawkmoonItem extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}

134
modules/hawkmoon-main.js Normal file
View File

@ -0,0 +1,134 @@
/**
* Hawkmoon system
* Author: Uberwald
* Software License: Prop
*/
/* -------------------------------------------- */
/* -------------------------------------------- */
// Import Modules
import { HawkmoonActor } from "./hawkmoon-actor.js";
import { HawkmoonItemSheet } from "./hawkmoon-item-sheet.js";
import { HawkmoonActorSheet } from "./hawkmoon-actor-sheet.js";
import { HawkmoonUtility } from "./hawkmoon-utility.js";
import { HawkmoonCombat } from "./hawkmoon-combat.js";
import { HawkmoonItem } from "./hawkmoon-item.js";
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
/************************************************************************************/
Hooks.once("init", async function () {
console.log(`Initializing Hawkmoon RPG`);
/* -------------------------------------------- */
// preload handlebars templates
HawkmoonUtility.preloadHandlebarsTemplates();
/* -------------------------------------------- */
// Set an initiative formula for the system
CONFIG.Combat.initiative = {
formula: "1d6",
decimals: 1
};
/* -------------------------------------------- */
game.socket.on("system.fvtt-hawkmoon-cyd", data => {
HawkmoonUtility.onSocketMesssage(data);
});
/* -------------------------------------------- */
// Define custom Entity classes
CONFIG.Combat.documentClass = HawkmoonCombat
CONFIG.Actor.documentClass = HawkmoonActor
CONFIG.Item.documentClass = HawkmoonItem
game.system.hawkmon = {
HawkmoonUtility
}
/* -------------------------------------------- */
// Register sheet application classes
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("fvtt-hawkmoon-cyd", HawkmoonActorSheet, { types: ["personnage"], makeDefault: true })
//Actors.registerSheet("fvtt-hawkmoon-cyd", HawkmoonNPCSheet, { types: ["npc"], makeDefault: false });
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("fvtt-hawkmoon-cyd", HawkmoonItemSheet, { makeDefault: true })
HawkmoonUtility.init();
});
/* -------------------------------------------- */
function welcomeMessage() {
ChatMessage.create({
user: game.user.id,
whisper: [game.user.id],
content: `<div id="welcome-message-Hawkmoon"><span class="rdd-roll-part">
<strong>Bienvenue dans Hawkmoon !</strong>
<p>Les livres de Hawkmoon sont nécessaires pour jouer : https://www.titam-france.fr</p>
<p>Hawkmoon est jeude rôle publié par Titam France/Sombres projets, tout les droits leur appartiennent.<p>
` });
}
/* -------------------------------------------- */
// Register world usage statistics
function registerUsageCount( registerKey ) {
if ( game.user.isGM ) {
game.settings.register(registerKey, "world-key", {
name: "Unique world key",
scope: "world",
config: false,
default: "",
type: String
});
let worldKey = game.settings.get(registerKey, "world-key")
if ( worldKey == undefined || worldKey == "" ) {
worldKey = randomID(32)
game.settings.set(registerKey, "world-key", worldKey )
}
// Simple API counter
let regURL = `https://www.uberwald.me/fvtt_appcount/count.php?name="${registerKey}"&worldKey="${worldKey}"&version="${game.release.generation}.${game.release.build}"&system="${game.system.id}"&systemversion="${game.system.version}"`
//$.ajaxSetup({
//headers: { 'Access-Control-Allow-Origin': '*' }
//})
$.ajax(regURL)
}
}
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.once("ready", function () {
HawkmoonUtility.ready();
// User warning
if (!game.user.isGM && game.user.character == undefined) {
ui.notifications.info("Attention ! Aucun personnage n'est relié au joueur !");
ChatMessage.create({
content: "<b>ATTENTION</b> Le joueur " + game.user.name + " n'est relié à aucun personnage !",
user: game.user._id
});
}
registerUsageCount('fvtt-hawkmoon-cyd')
welcomeMessage()
});
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.on("chatMessage", (html, content, msg) => {
if (content[0] == '/') {
let regExp = /(\S+)/g;
let commands = content.match(regExp);
if (game.system.mournblade.commands.processChatCommand(commands, content, msg)) {
return false;
}
}
return true;
});

View File

@ -0,0 +1,79 @@
import { HawkmoonUtility } from "./hawkmoon-utility.js";
export class HawkmoonRollDialog extends Dialog {
/* -------------------------------------------- */
static async create(actor, rollData ) {
let options = { classes: ["HawkmoonDialog"], width: 340, height: 420, 'z-index': 99999 };
let html = await renderTemplate('systems/fvtt-hawkmoon-cyd/templates/roll-dialog-generic.html', rollData);
return new HawkmoonRollDialog(actor, rollData, html, options );
}
/* -------------------------------------------- */
constructor(actor, rollData, html, options, close = undefined) {
let conf = {
title: "Test de Capacité",
content: html,
buttons: {
rolld10: {
icon: '<i class="fas fa-check"></i>',
label: "Lancer 1d10",
callback: () => { this.roll("1d10") }
},
rolld20: {
icon: '<i class="fas fa-check"></i>',
label: "Lancer 1d20",
callback: () => { this.roll("1d20") }
},
cancel: {
icon: '<i class="fas fa-times"></i>',
label: "Annuler",
callback: () => { this.close() }
} },
close: close
}
super(conf, options);
this.actor = actor
this.rollData = rollData
}
/* -------------------------------------------- */
roll ( dice) {
this.rollData.mainDice = dice
HawkmoonUtility.rollHawkmoon( this.rollData )
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);
var dialog = this;
function onLoad() {
}
$(function () { onLoad(); });
html.find('#modificateur').change(async (event) => {
this.rollData.modificateur = Number(event.currentTarget.value)
})
html.find('#difficulte').change(async (event) => {
this.rollData.difficulte = Number(event.currentTarget.value)
})
html.find('#attrKey').change(async (event) => {
this.rollData.attrKey = String(event.currentTarget.value)
})
html.find('#runemode').change(async (event) => {
this.rollData.runemode = String(event.currentTarget.value)
})
html.find('#runeame').change(async (event) => {
this.rollData.runeame = Number(event.currentTarget.value)
})
html.find('#doubleD20').change(async (event) => {
this.rollData.doubleD20 = event.currentTarget.checked
})
}
}

662
modules/hawkmoon-utility.js Normal file
View File

@ -0,0 +1,662 @@
/* -------------------------------------------- */
import { HawkmoonCombat } from "./hawkmoon-combat.js";
import { HawkmoonCommands } from "./hawkmoon-commands.js";
/* -------------------------------------------- */
export class HawkmoonUtility {
/* -------------------------------------------- */
static async init() {
Hooks.on('renderChatLog', (log, html, data) => HawkmoonUtility.chatListeners(html))
Hooks.on("getChatLogEntryContext", (html, options) => HawkmoonUtility.chatRollMenu(html, options))
Hooks.on("getCombatTrackerEntryContext", (html, options) => {
HawkmoonUtility.pushInitiativeOptions(html, options);
})
Hooks.on("dropCanvasData", (canvas, data) => {
HawkmoonUtility.dropItemOnToken(canvas, data)
});
this.rollDataStore = {}
this.defenderStore = {}
HawkmoonCommands.init();
Handlebars.registerHelper('count', function (list) {
return list.length;
})
Handlebars.registerHelper('includes', function (array, val) {
return array.includes(val);
})
Handlebars.registerHelper('upper', function (text) {
return text.toUpperCase();
})
Handlebars.registerHelper('lower', function (text) {
return text.toLowerCase()
})
Handlebars.registerHelper('upperFirst', function (text) {
if (typeof text !== 'string') return text
return text.charAt(0).toUpperCase() + text.slice(1)
})
Handlebars.registerHelper('notEmpty', function (list) {
return list.length > 0;
})
Handlebars.registerHelper('mul', function (a, b) {
return parseInt(a) * parseInt(b);
})
}
/* -------------------------------------------- */
static getModificateurOptions() {
let opt = []
for (let i = -15; i <= 15; i++) {
opt.push(`<option value="${i}">${i}</option>`)
}
return opt.concat("\n")
}
/* -------------------------------------------- */
static getPointAmeOptions() {
let opt = []
for (let i = 1; i <= 20; i++) {
opt.push(`<option value="${i}">${i}</option>`)
}
return opt.concat("\n")
}
/* -------------------------------------------- */
static getAttributs() {
return { adr: "Adresse", pui: "Puissance", cla: "Clairvoyance", pre: "Présence", tre: "Trempe" }
}
/* -------------------------------------------- */
static pushInitiativeOptions(html, options) {
}
/* -------------------------------------------- */
static getSkills() {
return this.skills
}
/* -------------------------------------------- */
static async ready() {
const skills = await HawkmoonUtility.loadCompendium("fvtt-hawkmoon-cyd.skills")
this.skills = skills.map(i => i.toObject())
}
/* -------------------------------------------- */
static async loadCompendiumData(compendium) {
const pack = game.packs.get(compendium);
return await pack?.getDocuments() ?? [];
}
/* -------------------------------------------- */
static async loadCompendium(compendium, filter = item => true) {
let compendiumData = await HawkmoonUtility.loadCompendiumData(compendium);
return compendiumData.filter(filter);
}
/* -------------------------------------------- */
static getOptionsStatusList() {
return this.optionsStatusList;
}
/* -------------------------------------------- */
static async chatListeners(html) {
html.on("click", '.predilection-reroll', async event => {
let predIdx = $(event.currentTarget).data("predilection-index")
let messageId = HawkmoonUtility.findChatMessageId(event.currentTarget)
let message = game.messages.get(messageId)
let rollData = message.getFlag("world", "mournblade-roll")
let actor = game.actors.get(rollData.actorId)
await actor.setPredilectionUsed(rollData.competence._id, predIdx)
rollData.competence = duplicate(actor.getCompetence(rollData.competence._id))
HawkmoonUtility.rollHawkmoon(rollData)
})
}
/* -------------------------------------------- */
static async preloadHandlebarsTemplates() {
const templatePaths = [
'systems/fvtt-hawkmoon-cyd/templates/editor-notes-gm.html',
'systems/fvtt-hawkmoon-cyd/templates/partial-item-description.html',
'systems/fvtt-hawkmoon-cyd/templates/partial-list-niveau.html'
]
return loadTemplates(templatePaths);
}
/* -------------------------------------------- */
static removeChatMessageId(messageId) {
if (messageId) {
game.messages.get(messageId)?.delete();
}
}
static findChatMessageId(current) {
return HawkmoonUtility.getChatMessageId(HawkmoonUtility.findChatMessage(current));
}
static getChatMessageId(node) {
return node?.attributes.getNamedItem('data-message-id')?.value;
}
static findChatMessage(current) {
return HawkmoonUtility.findNodeMatching(current, it => it.classList.contains('chat-message') && it.attributes.getNamedItem('data-message-id'))
}
static findNodeMatching(current, predicate) {
if (current) {
if (predicate(current)) {
return current;
}
return HawkmoonUtility.findNodeMatching(current.parentElement, predicate);
}
return undefined;
}
/* -------------------------------------------- */
static createDirectOptionList(min, max) {
let options = {};
for (let i = min; i <= max; i++) {
options[`${i}`] = `${i}`;
}
return options;
}
/* -------------------------------------------- */
static buildListOptions(min, max) {
let options = ""
for (let i = min; i <= max; i++) {
options += `<option value="${i}">${i}</option>`
}
return options;
}
/* -------------------------------------------- */
static getTarget() {
if (game.user.targets && game.user.targets.size == 1) {
for (let target of game.user.targets) {
return target;
}
}
return undefined;
}
/* -------------------------------------------- */
static getDefenseState(actorId) {
return this.defenderStore[actorId];
}
/* -------------------------------------------- */
static updateRollData(rollData) {
let id = rollData.rollId;
let oldRollData = this.rollDataStore[id] || {};
let newRollData = mergeObject(oldRollData, rollData);
this.rollDataStore[id] = newRollData;
}
/* -------------------------------------------- */
static saveRollData(rollData) {
game.socket.emit("system.fvtt-hawkmoon-cyd", {
name: "msg_update_roll", data: rollData
}); // Notify all other clients of the roll
this.updateRollData(rollData);
}
/* -------------------------------------------- */
static getRollData(id) {
return this.rollDataStore[id];
}
/* -------------------------------------------- */
static onSocketMesssage(msg) {
//console.log("SOCKET MESSAGE", msg.name, game.user.character.id, msg.data.defenderId);
if (msg.name == "msg_update_defense_state") {
this.updateDefenseState(msg.data.defenderId, msg.data.rollId);
}
if (msg.name == "msg_update_roll") {
this.updateRollData(msg.data);
}
}
/* -------------------------------------------- */
static chatDataSetup(content, modeOverride, isRoll = false, forceWhisper) {
let chatData = {
user: game.user.id,
rollMode: modeOverride || game.settings.get("core", "rollMode"),
content: content
};
if (["gmroll", "blindroll"].includes(chatData.rollMode)) chatData["whisper"] = ChatMessage.getWhisperRecipients("GM").map(u => u.id);
if (chatData.rollMode === "blindroll") chatData["blind"] = true;
else if (chatData.rollMode === "selfroll") chatData["whisper"] = [game.user];
if (forceWhisper) { // Final force !
chatData["speaker"] = ChatMessage.getSpeaker();
chatData["whisper"] = ChatMessage.getWhisperRecipients(forceWhisper);
}
return chatData;
}
/* -------------------------------------------- */
static async showDiceSoNice(roll, rollMode) {
if (game.modules.get("dice-so-nice")?.active) {
if (game.dice3d) {
let whisper = null;
let blind = false;
rollMode = rollMode ?? game.settings.get("core", "rollMode");
switch (rollMode) {
case "blindroll": //GM only
blind = true;
case "gmroll": //GM + rolling player
whisper = this.getUsers(user => user.isGM);
break;
case "roll": //everybody
whisper = this.getUsers(user => user.active);
break;
case "selfroll":
whisper = [game.user.id];
break;
}
await game.dice3d.showForRoll(roll, game.user, true, whisper, blind);
}
}
}
/* -------------------------------------------- */
static computeResult(rollData) {
if (rollData.mainDice == "1d20") {
let diceValue = rollData.roll.terms[0].results[0].result
diceValue *= (rollData.doubleD20) ? 2 : 1
//console.log("PAIR/IMP", diceValue)
if (diceValue % 2 == 1) {
//console.log("PAIR/IMP2", diceValue)
rollData.finalResult -= rollData.roll.terms[0].results[0].result // Substract value
if (diceValue == 1 || diceValue == 11) {
rollData.isDramatique = true
rollData.isSuccess = false
}
}
}
//console.log("Result : ", rollData)
if (rollData.difficulte > 0 && !rollData.isDramatique) {
rollData.isSuccess = (rollData.finalResult >= rollData.difficulte)
rollData.isHeroique = ((rollData.finalResult - rollData.difficulte) >= 10)
rollData.isDramatique = ((rollData.finalResult - rollData.difficulte) <= -10)
}
}
/* -------------------------------------------- */
static async rollHawkmoon(rollData) {
let actor = game.actors.get(rollData.actorId)
if (rollData.attrKey == "tochoose") { // No attr selected, force address
rollData.attrKey = "adr"
}
if (!rollData.attr) {
rollData.actionImg = "systems/fvtt-hawkmoon-cyd/assets/icons/" + actor.system.attributs[rollData.attrKey].labelnorm + ".webp"
rollData.attr = duplicate(actor.system.attributs[rollData.attrKey])
}
rollData.diceFormula = rollData.mainDice
if (rollData.doubleD20) { // Multiply result !
rollData.diceFormula += "*2"
if (!rollData.isReroll) {
actor.changeEclat(-1)
}
}
//console.log("BEFORE COMP", rollData)
if (rollData.competence) {
rollData.predilections = duplicate(rollData.competence.system.predilections.filter(pred => !pred.used) || [])
let compmod = (rollData.competence.system.niveau == 0) ? -3 : 0
rollData.diceFormula += `+${rollData.attr.value}+${rollData.competence.system.niveau}+${rollData.modificateur}+${compmod}`
} else {
rollData.diceFormula += `+${rollData.attr.value}*2+${rollData.modificateur}`
}
if (rollData.arme && rollData.arme.type == "arme") {
rollData.diceFormula += `+${rollData.arme.system.bonusmaniementoff}`
}
if (rollData.rune) {
rollData.runeduree = Math.ceil((rollData.runeame + 3) / 3)
if (rollData.runemode == "inscrire") {
rollData.runeduree *= 2
}
if (rollData.runemode == "prononcer") {
rollData.runeduree = 1
}
}
let myRoll = new Roll(rollData.diceFormula).roll({ async: false })
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
rollData.roll = myRoll
console.log(">>>> ", myRoll)
rollData.finalResult = myRoll.total
this.computeResult(rollData)
if (rollData.rune) {
let subAme = rollData.runeame
if (rollData.isEchec && !rollData.isDramatique) {
subAme = Math.ceil((subAme + 1) / 2)
}
actor.subPointsAme(rollData.runemode, subAme)
}
this.createChatWithRollMode(rollData.alias, {
content: await renderTemplate(`systems/fvtt-hawkmoon-cyd/templates/chat-generic-result.html`, rollData)
}, rollData)
}
/* -------------------------------------------- */
static async bonusRollHawkmoon(rollData) {
rollData.bonusFormula = rollData.addedBonus
let bonusRoll = new Roll(rollData.bonusFormula).roll({ async: false })
await this.showDiceSoNice(bonusRoll, game.settings.get("core", "rollMode"));
rollData.bonusRoll = bonusRoll
rollData.finalResult += rollData.bonusRoll.total
this.computeResult(rollData)
this.createChatWithRollMode(rollData.alias, {
content: await renderTemplate(`systems/fvtt-hawkmoon-cyd/templates/chat-generic-result.html`, rollData)
}, rollData)
}
/* -------------------------------------------- */
static getUsers(filter) {
return game.users.filter(filter).map(user => user.data._id);
}
/* -------------------------------------------- */
static getWhisperRecipients(rollMode, name) {
switch (rollMode) {
case "blindroll": return this.getUsers(user => user.isGM);
case "gmroll": return this.getWhisperRecipientsAndGMs(name);
case "selfroll": return [game.user.id];
}
return undefined;
}
/* -------------------------------------------- */
static getWhisperRecipientsAndGMs(name) {
let recep1 = ChatMessage.getWhisperRecipients(name) || [];
return recep1.concat(ChatMessage.getWhisperRecipients('GM'));
}
/* -------------------------------------------- */
static blindMessageToGM(chatOptions) {
let chatGM = duplicate(chatOptions);
chatGM.whisper = this.getUsers(user => user.isGM);
chatGM.content = "Blinde message of " + game.user.name + "<br>" + chatOptions.content;
console.log("blindMessageToGM", chatGM);
game.socket.emit("system.fvtt-weapons-of-the-gods", { msg: "msg_gm_chat_message", data: chatGM });
}
/* -------------------------------------------- */
static async searchItem(dataItem) {
let item;
if (dataItem.pack) {
item = await fromUuid("Compendium." + dataItem.pack + "." + dataItem.id);
} else {
item = game.items.get(dataItem.id)
}
return item
}
/* -------------------------------------------- */
static split3Columns(data) {
let array = [[], [], []];
if (data == undefined) return array;
let col = 0;
for (let key in data) {
let keyword = data[key];
keyword.key = key; // Self-reference
array[col].push(keyword);
col++;
if (col == 3) col = 0;
}
return array;
}
/* -------------------------------------------- */
static async createChatMessage(name, rollMode, chatOptions, rollData = undefined) {
switch (rollMode) {
case "blindroll": // GM only
if (!game.user.isGM) {
this.blindMessageToGM(chatOptions);
chatOptions.whisper = [game.user.id];
chatOptions.content = "Message only to the GM";
}
else {
chatOptions.whisper = this.getUsers(user => user.isGM);
}
break;
default:
chatOptions.whisper = this.getWhisperRecipients(rollMode, name);
break;
}
chatOptions.alias = chatOptions.alias || name
let msg = await ChatMessage.create(chatOptions)
console.log("=======>", rollData)
msg.setFlag("world", "mournblade-roll", rollData)
}
/* -------------------------------------------- */
static getBasicRollData() {
let rollData = {
rollId: randomID(16),
rollMode: game.settings.get("core", "rollMode"),
modificateursOptions: this.getModificateurOptions(),
pointAmeOptions: this.getPointAmeOptions(),
difficulte: 0,
modificateur: 0,
}
HawkmoonUtility.updateWithTarget(rollData)
return rollData
}
/* -------------------------------------------- */
static updateWithTarget(rollData) {
let target = HawkmoonUtility.getTarget()
if (target) {
rollData.defenderTokenId = target.id
let defender = game.canvas.tokens.get(rollData.defenderTokenId).actor
rollData.armeDefense = defender.getBestDefenseValue()
if ( rollData.armeDefense) {
rollData.difficulte = rollData.armeDefense.system.totalDefensif
} else {
ui.notifications.warn("Aucune arme de défense équipée, difficulté manuelle à positionner.")
}
}
}
/* -------------------------------------------- */
static createChatWithRollMode(name, chatOptions, rollData = undefined) {
this.createChatMessage(name, game.settings.get("core", "rollMode"), chatOptions, rollData)
}
/* -------------------------------------------- */
static applyBonneAventureRoll(li, changed, addedBonus) {
let msgId = li.data("message-id")
let msg = game.messages.get(msgId)
if (msg) {
let rollData = msg.getFlag("world", "mournblade-roll")
let actor = game.actors.get(rollData.actorId)
actor.changeBonneAventure(changed)
rollData.isReroll = true
rollData.textBonus = "Bonus de Points d'Aventure"
if (addedBonus == "reroll") {
HawkmoonUtility.rollHawkmoon(rollData)
} else {
rollData.addedBonus = addedBonus
HawkmoonUtility.bonusRollHawkmoon(rollData)
}
}
}
/* -------------------------------------------- */
static applyEclatRoll(li, changed, addedBonus) {
let msgId = li.data("message-id")
let msg = game.messages.get(msgId)
if (msg) {
let rollData = msg.getFlag("world", "mournblade-roll")
let actor = game.actors.get(rollData.actorId)
actor.changeEclat(changed)
rollData.isReroll = true
rollData.textBonus = "Bonus d'Eclat"
rollData.addedBonus = addedBonus
HawkmoonUtility.bonusRollHawkmoon(rollData)
}
}
/* -------------------------------------------- */
static chatRollMenu(html, options) {
let canApply = li => canvas.tokens.controlled.length && li.find(".mournblade-roll").length
let canApplyBALoyal = function (li) {
let message = game.messages.get(li.attr("data-message-id"))
let rollData = message.getFlag("world", "mournblade-roll")
let actor = game.actors.get(rollData.actorId)
return (!rollData.isReroll && actor.getBonneAventure() > 0 && actor.getAlignement() == "loyal")
}
let canApplyPELoyal = function (li) {
let message = game.messages.get(li.attr("data-message-id"))
let rollData = message.getFlag("world", "mournblade-roll")
let actor = game.actors.get(rollData.actorId)
return (!rollData.isReroll && actor.getEclat() > 0 && actor.getAlignement() == "loyal")
}
let canApplyBAChaotique = function (li) {
let message = game.messages.get(li.attr("data-message-id"))
let rollData = message.getFlag("world", "mournblade-roll")
let actor = game.actors.get(rollData.actorId)
return (!rollData.isReroll && actor.getBonneAventure() > 0 && actor.getAlignement() == "chaotique")
}
let canApplyBAChaotique3 = function (li) {
let message = game.messages.get(li.attr("data-message-id"))
let rollData = message.getFlag("world", "mournblade-roll")
let actor = game.actors.get(rollData.actorId)
return (!rollData.isReroll && actor.getBonneAventure() > 2 && actor.getAlignement() == "chaotique")
}
let canApplyPEChaotique = function (li) {
let message = game.messages.get(li.attr("data-message-id"))
let rollData = message.getFlag("world", "mournblade-roll")
let actor = game.actors.get(rollData.actorId)
return (!rollData.isReroll && actor.getEclat() > 0 && actor.getAlignement() == "chaotique")
}
let hasPredilection = function (li) {
let message = game.messages.get(li.attr("data-message-id"))
let rollData = message.getFlag("world", "mournblade-roll")
let actor = game.actors.get(rollData.actorId)
if (rollData.competence) {
let nbPred = rollData.competence.data.predilections.filter(pred => !pred.used).length
return (!rollData.isReroll && rollData.competence && nbPred > 0)
}
return false
}
let canCompetenceDouble = function (li) {
let message = game.messages.get(li.attr("data-message-id"))
let rollData = message.getFlag("world", "mournblade-roll")
let actor = game.actors.get(rollData.actorId)
if (rollData.competence) {
return rollData.competence.data.doublebonus
}
return false
}
options.push(
{
name: "Ajouer +3 (1 point de Bonne Aventure)",
icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyBALoyal,
callback: li => HawkmoonUtility.applyBonneAventureRoll(li, -1, "+3")
}
)
options.push(
{
name: "Ajouer +6 (1 point de Bonne Aventure)",
icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyBALoyal && canCompetenceDouble,
callback: li => HawkmoonUtility.applyBonneAventureRoll(li, -1, "+6")
}
)
options.push(
{
name: "Ajouer +1d6 (1 point de Bonne Aventure)",
icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyBAChaotique,
callback: li => HawkmoonUtility.applyBonneAventureRoll(li, -1, "+1d6")
}
)
options.push(
{
name: "Ajouer +2d6 (1 point de Bonne Aventure)",
icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyBAChaotique && canCompetenceDouble,
callback: li => HawkmoonUtility.applyBonneAventureRoll(li, -1, "+2d6")
}
)
options.push(
{
name: "Relancer le dé (3 points de Bonne Aventure)",
icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyBAChaotique3,
callback: li => HawkmoonUtility.applyBonneAventureRoll(li, -3, "reroll")
}
)
options.push(
{
name: "Ajouter +10 (1 Point d'Eclat)",
icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyPELoyal,
callback: li => HawkmoonUtility.applyEclatRoll(li, -1, "+10")
}
)
options.push(
{
name: "Ajouter +20 (1 Point d'Eclat)",
icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyPELoyal && canCompetenceDouble,
callback: li => HawkmoonUtility.applyEclatRoll(li, -1, "+20")
}
)
return options
}
/* -------------------------------------------- */
static async confirmDelete(actorSheet, li) {
let itemId = li.data("item-id");
let msgTxt = "<p>Are you sure to remove this Item ?";
let buttons = {
delete: {
icon: '<i class="fas fa-check"></i>',
label: "Yes, remove it",
callback: () => {
actorSheet.actor.deleteEmbeddedDocuments("Item", [itemId]);
li.slideUp(200, () => actorSheet.render(false));
}
},
cancel: {
icon: '<i class="fas fa-times"></i>',
label: "Cancel"
}
}
msgTxt += "</p>";
let d = new Dialog({
title: "Confirm removal",
content: msgTxt,
buttons: buttons,
default: "cancel"
});
d.render(true);
}
}

1372
styles/simple.css Normal file

File diff suppressed because it is too large Load Diff

134
system.json Normal file
View File

@ -0,0 +1,134 @@
{
"id": "fvtt-hawkmoon-cyd",
"description": "Hawmoon RPG for FoundryVTT (CYD system - French)",
"version": "10.0.0",
"authors": [
{
"name": "Uberwald/LeRatierBretonnien",
"flags": {}
}
],
"esmodules": [
"modules/hawkmon-main.js"
],
"gridDistance": 5,
"gridUnits": "m",
"license": "LICENSE.txt",
"manifest": "https://www.uberwald.me/gitea/public/fvtt-hawkmoon-cyd/raw/branch/v10/system.json",
"download": "https://www.uberwald.me/gitea/public/fvtt-hawkmoon-cyd/archive/fvtt-hawkmoon-cyd-10.0.0.zip",
"packs": [
{
"type": "Item",
"label": "Compétences",
"name": "skills",
"path": "packs/skills.db",
"system": "fvtt-hawkmoon-cyd",
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Armes & Boucliers",
"name": "armes",
"path": "packs/armes.db",
"system": "fvtt-hawkmoon-cyd",
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Protections",
"name": "protection",
"path": "packs/protection.db",
"system": "fvtt-hawkmoon-cyd",
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Equipement",
"name": "equipement",
"path": "packs/equipement.db",
"system": "fvtt-hawkmoon-cyd",
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Origines",
"name": "origines",
"path": "packs/origines.db",
"system": "fvtt-hawkmoon-cyd",
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Héritages",
"name": "heritages",
"path": "packs/heritages.db",
"system": "fvtt-hawkmoon-cyd",
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Métiers",
"name": "metiers",
"path": "packs/metiers.db",
"system": "fvtt-hawkmoon-cyd",
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Tendances",
"name": "tendances",
"path": "packs/tendances.db",
"system": "fvtt-hawkmoon-cyd",
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Traits chaotiques",
"name": "traits-chaotiques",
"path": "packs/traits-chaotiques.db",
"system": "fvtt-hawkmoon-cyd",
"private": false,
"flags": {}
},
{
"type": "Item",
"label": "Runes",
"name": "runes",
"path": "packs/runes.db",
"system": "fvtt-hawkmoon-cyd",
"private": false,
"flags": {}
},
{
"type": "RollTable",
"label": "Tables",
"name": "tables",
"path": "packs/tables.db",
"system": "fvtt-hawkmoon-cyd",
"private": false,
"flags": {}
}
],
"primaryTokenAttribute": "secondary.health",
"secondaryTokenAttribute": "secondary.delirium",
"socket": true,
"styles": [
"styles/simple.css"
],
"title": "Mournblade",
"url": "https://www.uberwald.me/gitea/public/fvtt-hawkmoon-cyd",
"background": "systems/fvtt-hawkmoon-cyd/assets/ui/fond_hawkmoon.webp",
"compatibility": {
"minimum": "10",
"verified": "10",
"maximum": "10"
}
}

264
template.json Normal file
View File

@ -0,0 +1,264 @@
{
"Actor": {
"types": [
"personnage"
],
"templates": {
"biodata": {
"biodata": {
"name": "",
"age": 0,
"alignement": "",
"poids": "",
"taille": "",
"cheveux": "",
"sexe": "",
"yeux": "",
"description": "",
"amemultiplier": 2,
"notes": "",
"gmnotes": ""
}
},
"core": {
"subactors": [],
"attributs": {
"adr": {
"label": "Adresse",
"labelnorm": "adresse",
"abbrev": "adr",
"value": 1
},
"pui": {
"label": "Puissance",
"labelnorm": "puissance",
"abbrev": "pui",
"value": 1
},
"cla": {
"label": "Clairvoyance",
"labelnorm": "clairvoyance",
"abbrev": "cla",
"value": 1
},
"pre": {
"label": "Présence",
"labelnorm": "presence",
"abbrev": "pre",
"value": 0
},
"tre": {
"label": "Trempe",
"labelnorm": "trempe",
"abbrev": "tre",
"value": 0
}
},
"bonneaventure": {
"base": 0,
"actuelle": 0
},
"experience": {
"value": 0
},
"eclat": {
"value": 0
},
"sante": {
"base": 0,
"bonus": 0,
"nonletaux": 0,
"letaux": 0,
"sequelles": ""
},
"ame": {
"fullmax": 0,
"currentmax": 0,
"value": 0,
"traumatismes": ""
},
"combat": {
"initbonus": 0,
"vitessebonus": 0,
"bonusdegats": 0,
"defensebonus": 0
},
"balance": {
"loi": 0,
"chaos": 0,
"aspect": 0,
"marge": 0,
"pointschaos": 0,
"pointsloi": 0
}
},
"npccore": {
"npctype": "",
"description": ""
}
},
"personnage": {
"templates": [
"biodata",
"core"
]
},
"pnj": {
"templates": [
"npccore"
]
}
},
"Item": {
"templates": {
"base": {
"description": ""
}
},
"types": [
"arme",
"competence",
"protection",
"pacte",
"traitchaotique",
"monnaie",
"don",
"tendance",
"rune",
"equipement",
"capacite",
"origine",
"heritage",
"metier",
"runeeffect",
"bouclier"
],
"runeeffect": {
"rune": "",
"mode": "",
"duree": "",
"pointame": 0,
"templates": [
"base"
]
},
"origine": {
"templates": [
"base"
]
},
"heritage": {
"templates": [
"base"
]
},
"metier": {
"templates": [
"base"
]
},
"capacite": {
"templates": [
"base"
]
},
"equipement": {
"rarete": 0,
"prix": 0,
"templates": [
"base"
]
},
"arme": {
"typearme": "",
"isdefense": false,
"bonusmaniementoff": 0,
"bonusmaniementdef": 0,
"degats": "",
"nonletaux": false,
"deuxmains": false,
"courte": 0,
"moyenne": 0,
"longue": 0,
"tr": 0,
"rarete": 0,
"prix": 0,
"equipped": false,
"templates": [
"base"
]
},
"competence": {
"niveau": 0,
"attribut1": "",
"attribut2": "",
"attribut3": "",
"doublebonus": false,
"predilections": [],
"templates": [
"base"
]
},
"protection": {
"typeprotection": "",
"protection": 0,
"degats": "",
"rarete": 0,
"prix": 0,
"equipped": false,
"templates": [
"base"
]
},
"bouclier": {
"bonusdefense": 0,
"degats": "",
"nonletaux": false,
"rarete": 0,
"prix": 0,
"equipped": false,
"templates": [
"base"
]
},
"pacte": {
"allegeance": "",
"templates": [
"base"
]
},
"traitchaotique": {
"templates": [
"base"
]
},
"monnaie": {
"templates": [
"base"
]
},
"don": {
"allegeance": "",
"prerequis": "",
"sacrifice": "",
"templates": [
"base"
]
},
"tendance": {
"allegeance": "",
"templates": [
"base"
]
},
"rune": {
"formule": "",
"seuil": 0,
"prononcee": "",
"tracee": "",
"templates": [
"base"
]
}
}
}

554
templates/actor-sheet.html Normal file
View File

@ -0,0 +1,554 @@
<form class="{{cssClass}}" autocomplete="off">
{{!-- Sheet Header --}}
<header class="sheet-header">
<div class="header-fields">
<div class="flexrow">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
<div class="flexcol">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
<div class="flexrow">
<ul class="item-list alternate-list">
<li class="item flexrow ">
<label class="item-name-label competence-name item-field-label-short"><strong>Loi</strong></label>
<label class="item-name-label competence-name item-field-label-short">Niveau</label><input type="text" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.balance.loi" value="{{data.balance.loi}}" data-dtype="Number" />
<label class="item-name-label competence-name item-field-label-short">Points</label>
<select class="status-small-label color-class-common item-field-label-short" type="text"
name="system.balance.pointsloi" value="{{data.balance.pointsloi}}" data-dtype="Number">
{{#select data.balance.pointsloi}}
{{> systems/fvtt-hawkmoon-cyd/templates/partial-list-niveau.html}}
{{/select}}
</select>
<label class="item-name-label competence-name item-field-label-medium">Aspect {{aspect}}</label>
</li>
<li class="item flexrow ">
<label class="item-name-label competence-name item-field-label-short"><strong>Chaos</strong></label>
<label class="item-name-label competence-name item-field-label-short">Niveau</label><input type="text" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.balance.chaos" value="{{data.balance.chaos}}" data-dtype="Number" />
<label class="item-name-label competence-name item-field-label-short">Points</label><select class="status-small-label color-class-common item-field-label-short" type="text"
name="system.balance.pointschaos" value="{{data.balance.pointschaos}}" data-dtype="Number">
{{#select data.balance.pointschaos}}
{{> systems/fvtt-hawkmoon-cyd/templates/partial-list-niveau.html}}
{{/select}}
</select>
<label class="item-name-label competence-name item-field-label-medium">Marge {{marge}}</label>
</li>
<li class="item flexrow ">
<h4 class="item-name-label competence-name">Bonne Aventure</h4>
<label class="item-name-label competence-name item-field-label-short">Base</label>
<input type="text" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.bonneaventure.base" value="{{data.bonneaventure.base}}" data-dtype="Number" />
<label class="item-name-label competence-name item-field-label-short">Actuelle</label>
<input type="text" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.bonneaventure.actuelle" value="{{data.bonneaventure.actuelle}}" data-dtype="Number" />
</li>
<li class="item flexrow ">
<h4 class="item-name-label competence-name">Alignement {{alignement}}</h4>
<h4 class="item-name-label competence-name item-field-label-short">Eclat</h4>
<input type="text" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.eclat.value" value="{{data.eclat.value}}" data-dtype="Number" />
<h4 class="item-name-label competence-name item-field-label-medium">Expérience</h4>
<input type="text" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.experience.value" value="{{data.experience.value}}" data-dtype="Number" />
</li>
</ul>
</div>
</div>
</div>
</header>
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="principal">Attributs</a>
<a class="item" data-tab="competences">Compétences</a>
<a class="item" data-tab="dons">Dons/Pactes</a>
<a class="item" data-tab="equipement">Equipement</a>
<a class="item" data-tab="biodata">Bio&Notes</a>
</nav>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Main Tab --}}
<div class="tab principal" data-group="primary" data-tab="principal">
<div class="grid grid-2col">
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
{{#each data.attributs as |attr key|}}
<li class="item flexrow " data-attr-key="{{key}}">
<img class="item-name-img" src="systems/fvtt-hawkmoon-cyd/assets/icons/{{attr.labelnorm}}.webp">
<span class="item-name-label competence-name item-field-label-medium"><a
class="roll-attribut">{{attr.label}}</a></span>
<select class="status-small-label color-class-common item-field-label-short" type="text"
name="system.attributs.{{key}}.value" value="{{attr.value}}" data-dtype="Number">
{{#select attr.value}}
{{> systems/fvtt-hawkmoon-cyd/templates/partial-list-niveau.html}}
{{/select}}
</select>
</li>
{{/each}}
</ul>
</div>
<div class="sheet-box color-bg-archetype">
<h4 class="item-name-label competence-name">Santé</h4>
<ul class="item-list alternate-list">
<li class="item flexrow">
<label class="label-name">Bonus</label>
<input type="text" class="input-numeric-short" name="system.sante.bonus" value="{{data.sante.bonus}}"
data-dtype="Number" />
<label class="label-name">Total</label>
<label class="label-name">{{data.sante.base}}</label>
</li>
<li class="item flexrow">
<label class="label-name">Non létaux</label>
<input type="text" class="input-numeric-short" name="system.sante.nonletaux"
value="{{data.sante.nonletaux}}" data-dtype="Number" />
<label class="label-name">Létaux</label>
<input type="text" class="input-numeric-short" name="system.sante.letaux" value="{{data.sante.letaux}}"
data-dtype="Number" />
</li>
</ul>
<h4 class="item-name-label competence-name">Ame</h4>
<ul class="item-list alternate-list">
<li class="item flexrow">
<label class="label-name">Max</label>
<input type="text" class="input-numeric-short" name="system.ame.fullmax" value="{{data.ame.fullmax}}"
data-dtype="Number" />
<label class="label-name">Max Actuel</label>
<input type="text" class="input-numeric-short" name="system.ame.currentmax" value="{{data.ame.currentmax}}"
data-dtype="Number" />
<label class="label-name">Courante</label>
<input type="text" class="input-numeric-short" name="system.ame.value" value="{{data.ame.value}}"
data-dtype="Number" />
</li>
</ul>
<h4 class="item-name-label competence-name">Combat</h4>
<ul class="item-list alternate-list">
<li class="item flexrow">
<label class="competence-name">Initiative</label>
<label class="competence-name">{{combat.initBase}}</label>
<input type="text" class="input-numeric-short" name="system.combat.initbonus"
value="{{data.combat.initbonus}}" data-dtype="Number" />
<label class="competence-name">{{combat.initTotal}}</label>
</li>
<li class="item flexrow">
<label class="competence-name">B. Dégats</label>
<label class="competence-name">+{{combat.bonusDegats}}</label>
<input type="text" class="input-numeric-short" name="system.combat.bonusdegats"
value="{{data.combat.bonusdegats}}" data-dtype="Number" />
<label class="competence-name">+{{combat.bonusDegatsTotal}}</label>
</li>
<li class="item flexrow">
<label class="competence-name">Vitesse</label>
<label class="competence-name">{{combat.vitesseBase}}</label>
<input type="text" class="input-numeric-short" name="system.combat.vitessebonus"
value="{{data.combat.vitessebonus}}" data-dtype="Number" />
<label class="competence-name">{{combat.vitesseTotal}}</label>
</li>
<li class="item flexrow">
<label class="competence-name">Défense</label>
<label class="competence-name">{{combat.defenseBase}}</label>
<input type="text" class="input-numeric-short" name="system.combat.defensebonus"
value="{{data.combat.defensebonus}}" data-dtype="Number" />
<label class="competence-name">{{combat.defenseTotal}}</label>
</li>
</ul>
</div>
</div>
</div>
{{!-- Competence Tab --}}
<div class="tab competences" data-group="primary" data-tab="competences">
<div class="flexrow">
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow">
<span class="item-name-label-header">
<h3><label class="items-title-text">Compétences</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Niveau</label>
</span>
<div class="item-filler">&nbsp;</div>
</li>
{{#each skills as |skill key|}}
<li class="item flexrow " data-item-id="{{skill._id}}" data-item-type="competence">
<img class="item-name-img" src="{{skill.img}}" />
<span class="item-name-label competence-name"><a class="roll-competence"
data-attr-key="tochoose">{{skill.name}}</a></span>
<select class="status-small-label color-class-common edit-item-data competence-niveau" type="text"
data-item-field="niveau" value="{{skill.system.niveau}}" data-dtype="Number">
{{#select skill.system.niveau}}
{{> systems/fvtt-hawkmoon-cyd/templates/partial-list-niveau.html}}
{{/select}}
</select>
{{#if (ne skill.system.attribut1 "none")}}
<span class="item-field-label-short">
<button class="roll-competence button-sheet-roll" data-attr-key="{{skill.system.attribut1}}">{{upper
skill.system.attribut1}} : {{skill.system.attribut1total}}</button>
</span>
{{/if}}
{{#if (ne skill.system.attribut2 "none")}}
<span class="item-field-label-short">
<button class="roll-competence button-sheet-roll" data-attr-key="{{skill.system.attribut2}}">{{upper
skill.system.attribut2}} : {{skill.system.attribut2total}}</button>
</span>
{{/if}}
{{#if (ne skill.system.attribut3 "none")}}
<span class="item-field-label-short">
<button class="roll-competence button-sheet-roll" data-attr-key="{{skill.system.attribut3}}">{{upper
skill.system.attribut3}} : {{skill.system.attribut3total}}</button>
</span>
{{/if}}
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
{{!-- Dons/Pactes Tab --}}
<div class="tab dons" data-group="primary" data-tab="dons">
<div class="flexcol">
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Dons</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Allégeance</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
</div>
</li>
{{#each dons as |don key|}}
<li class="item flexrow " data-item-id="{{don._id}}" data-item-type="don">
<img class="item-name-img" src="{{don.img}}" />
<span class="item-name-label competence-name">{{don.name}}</span>
<span class="item-field-label-short">{{don.system.allegeance}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Runes</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Haut parler</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Difficulté</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
</div>
</li>
{{#each runes as |rune key|}}
<li class="item flexrow " data-item-id="{{rune._id}}" data-item-type="rune">
<img class="item-name-img" src="{{rune.img}}" />
<span class="item-name-label competence-name"><a class="roll-rune">{{rune.name}}</a></span>
<span class="item-field-label-short">{{rune.system.formule}}</span>
<span class="item-field-label-short">{{rune.system.seuil}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Tendances</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Allégeance</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
</div>
</li>
{{#each tendances as |tendance key|}}
<li class="item flexrow " data-item-id="{{tendance._id}}" data-item-type="tendance">
<img class="item-name-img" src="{{tendance.img}}" />
<span class="item-name-label competence-name">{{tendance.name}}</span>
<span class="item-field-label-short">{{tendance.system.allegeance}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
{{!-- Equipement Tab --}}
<div class="tab equipement" data-group="primary" data-tab="equipement">
<div class="flexcol">
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Armes</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Attaque</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Défense</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Dégats</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="arme" title="Ajouter une arme"><i
class="fas fa-plus"></i></a>
</div>
</li>
{{#each armes as |arme key|}}
<li class="item flexrow " data-item-id="{{arme._id}}" data-item-type="arme">
<img class="item-name-img" src="{{arme.img}}" />
<span class="item-name-label competence-name">{{arme.name}}</span>
<span class="item-field-label-short">
{{#if arme.system.equipped}}
<button class="roll-arme-offensif button-sheet-roll" >{{arme.system.totalOffensif}}</button>
{{else}}
<button disabled class="roll-arme-offensif button-sheet-roll" >{{arme.system.totalOffensif}}</button>
{{/if}}
</span>
{{#if arme.system.isdefense}}
<span class="item-field-label-short arme-defensif"><label class="arme-defensif">{{arme.system.totalDefensif}}</label></span>
{{else}}
<span class="item-field-label-short arme-defensif"><label class="arme-defensif">-</label></span>
{{/if}}
<span class="item-field-label-short">
{{#if arme.system.equipped}}
<button class="roll-arme-degats button-sheet-roll">{{arme.system.totalDegats}}</button>
{{else}}
<button disabled class="roll-arme-degats button-sheet-roll">{{arme.system.totalDegats}}</button>
{{/if}}
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-equip" title="Worn">{{#if arme.system.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Protections</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Protection</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="arme" title="Ajouter une arme"><i
class="fas fa-plus"></i></a>
</div>
</li>
{{#each protections as |protection key|}}
<li class="item flexrow " data-item-id="{{protection._id}}" data-item-type="protection">
<img class="item-name-img" src="{{protection.img}}" />
<span class="item-name-label competence-name">{{protection.name}}</span>
<span class="item-field-label-short arme-defensif"><label
class="arme-defensif">{{protection.system.protection}}</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Equipements</label></h3>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="arme" title="Ajouter une arme"><i
class="fas fa-plus"></i></a>
</div>
</li>
{{#each equipements as |equipement key|}}
<li class="item flexrow " data-item-id="{{equipement._id}}" data-item-type="equipement">
<img class="item-name-img" src="{{equipement.img}}" />
<span class="item-name-label competence-name">{{equipement.name}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
{{!-- Biography Tab --}}
<div class="tab biodata" data-group="primary" data-tab="biodata">
<div class="grid grid-3col">
<div>
<ul class="item-list alternate-list">
<li class="item flexrow" data-item-id="{{origine._id}}">
<label class="generic-label">Origine : </label>
<label class="generic-label">{{origine.name}}</label>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
<li class="item flexrow" data-item-id="{{heritage._id}}">
<label class="generic-label">Héritage : </label>
<label class="generic-label">{{heritage.name}}</label>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
<li class="item flexrow" data-item-id="{{metier._id}}">
<label class="generic-label">Métier : </label>
<label class="generic-label">{{metier.name}}</label>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
<li class="flexrow item">
<label class="generic-label">Multiplicateur d'âme</label>
<input type="text" class="" name="system.biodata.amemultiplier" value="{{data.biodata.amemultiplier}}"
data-dtype="Number" />
</li>
</ul>
</div>
<div>
<ul>
<li class="flexrow item">
<label class="generic-label">Sexe</label>
<input type="text" class="" name="system.biodata.sex" value="{{data.biodata.sex}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Age</label>
<input type="text" class="" name="system.biodata.age" value="{{data.biodata.age}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Taille</label>
<input type="text" class="" name="system.biodata.size" value="{{data.biodata.size}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Cheveux</label>
<input type="text" class="" name="system.biodata.hair" value="{{data.biodata.hair}}" data-dtype="String" />
</li>
</ul>
</div>
<div>
<li class="item flexrow">
<label class="generic-label">Yeux</label>
<input type="text" class="" name="system.biodata.eyes" value="{{data.biodata.eyes}}" data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label">Main préférée</label>
<input type="text" class="" name="system.biodata.preferredhand" value="{{data.biodata.preferredhand}}"
data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label">Poids</label>
<input type="text" class="" name="system.biodata.weight" value="{{data.biodata.weight}}"
data-dtype="String" />
</li>
</div>
</div>
<span>
<h3>Description</h3>
</span>
<div class="medium-editor item-text-long-line">
{{editor description target="system.biodata.description" button=true owner=owner editable=editable}}
</div>
</div>
</section>
</form>

View File

@ -0,0 +1,26 @@
<div class="chat-message-header">
{{#if actorImg}}
<img class="actor-icon" src="{{actorImg}}" alt="{{alias}}" />
{{/if}}
<h4 class=chat-actor-name>{{alias}}</h4>
</div>
<hr>
{{#if actionImg}}
<div>
<img class="chat-icon" src="{{actionImg}}" alt="{{name}}" />
</div>
{{/if}}
<div class="flexcol">
</div>
<div>
<ul>
<li>Arme : {{arme.name}} (+{{arme.system.totalDegats}})</li>
<li>Dégats : {{finalResult}} {{#if arme.system.nonletaux}}(Non létaux){{else}}(Létaux){{/if}}</li>
</ul>
</div>
</div>

View File

@ -0,0 +1,68 @@
<div class="chat-message-header">
{{#if actorImg}}
<img class="actor-icon" src="{{actorImg}}" alt="{{alias}}" />
{{/if}}
<h4 class=chat-actor-name>{{alias}}</h4>
</div>
<hr>
{{#if actionImg}}
<div>
<img class="chat-icon" src="{{actionImg}}" alt="{{name}}" />
</div>
{{/if}}
<div class="flexcol">
</div>
<div>
<ul>
<li class="mournblade-roll">Attribut : {{attr.label}}</li>
{{#if competence}}
<li>Compétence : {{competence.name}}</li>
{{/if}}
{{#if rune}}
<li>Rune : {{rune.name}}</li>
<li>Mode : {{runemode}}</li>
<li>Points d'Ame : {{runeame}}</li>
<li>Durée : {{runeduree}} actions complexes</li>
{{/if}}
{{#if bonusRoll}}
<li>{{textBonus}} : {{bonusRoll.total}}</li>
{{/if}}
{{#if arme}}
<li>Arme : {{arme.name}} (+{{arme.system.bonusmaniementoff}})</li>
{{/if}}
<li>Formule : {{diceFormula}}</li>
<li>Total : {{finalResult}}</li>
{{#if difficulte}}
{{#if isSuccess}}
<li>Succés!!!</li>
{{else}}
<li>Echec ...</li>
{{/if}}
{{/if}}
{{#if isHeroique}}
<li>Succés Héroïque!!!</li>
{{/if}}
{{#if isDramatique}}
<li>Echec Dramatique!!!</li>
{{/if}}
{{#each predilections as |pred key|}}
<li>
<button class="chat-card-button predilection-reroll" data-predilection-index="{{key}}">Predilection : {{pred.name}}</button>
</li>
{{/each}}
</ul>
</div>
</div>

View File

@ -0,0 +1,6 @@
{{#if data.isGM}}
<h3>GM Notes : </h3>
<div class="form-group editor">
{{editor data.biodata.gmnotes target="system.biodata.gmnotes" button=true owner=owner editable=editable}}
</div>
{{/if}}

View File

@ -0,0 +1,84 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexcol">
<span class="flexrow">
<label class="generic-label">Type d'arme : </label>
<select class="status-small-label color-class-common" type="text" name="system.typearme" value="{{data.typearme}}" data-dtype="string" >
{{#select data.typearme}}
<option value="contact">Arme de contact</option>
<option value="contactjet">Arme de contact et de Jet</option>
<option value="jet">Arme de Jet</option>
<option value="tir">Arme de Tir</option>
{{/select}}
</select>
</span>
<span class="flexrow">
<label class="generic-label">Bonus de maniement (offensif) : </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.bonusmaniementoff" value="{{data.bonusmaniementoff}}" data-dtype="Number" />
</span>
<span class="flexrow">
<label class="generic-label">Défensive ? </label>
<input type="checkbox" name="system.isdefense" {{checked data.isdefense}}/>
</span>
{{#if data.isdefense}}
<span class="flexrow">
<label class="generic-label">Bonus de maniement (défensif) : </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.bonusmaniementdef" value="{{data.bonusmaniementdef}}" data-dtype="Number" />
</span>
{{/if}}
<span class="flexrow">
<label class="generic-label">Dégâts : </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.degats" value="{{data.degats}}" data-dtype="String" />
</span>
<span class="flexrow">
<label class="generic-label">Dégâts non létaux ? </label>
<input type="checkbox" name="system.nonletaux" {{checked data.nonletaux}}/>
</span>
<span class="flexrow">
<label class="generic-label">Equipé ? </label>
<input type="checkbox" name="system.equipped" {{checked data.equipped}}/>
</span>
<span class="flexrow">
<label class="generic-label">A deux mains ? </label>
<input type="checkbox" name="system.deuxmains" {{checked data.deuxmains}}/>
</span>
<span class="flexrow">
<label class="generic-label">Portée courte </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.courte" value="{{data.courte}}" data-dtype="Number" />
</span>
<span class="flexrow">
<label class="generic-label">Portée moyenne </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.moyenne" value="{{data.moyenne}}" data-dtype="Number" />
</span>
<span class="flexrow">
<label class="generic-label">Portée longue </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.longue" value="{{data.longue}}" data-dtype="Number" />
</span>
<span class="flexrow">
<label class="generic-label">Temps de rechargement </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.tr" value="{{data.tr}}" data-dtype="Number" />
</span>
<span class="flexrow">
<label class="generic-label">Rareté </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.rarete" value="{{data.rarete}}" data-dtype="Number" />
</span>
<span class="flexrow">
<label class="generic-label">Prix </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.prix" value="{{data.prix}}" data-dtype="Number" />
</span>
{{> systems/fvtt-hawkmoon-cyd/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,43 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexcol">
<span class="flexrow">
<label class="generic-label">Bonus de défense : </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.bonusdefense" value="{{data.bonusdefense}}" data-dtype="Number" />
</span>
<span class="flexrow">
<label class="generic-label">Degats : </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.degats" value="{{data.degats}}" data-dtype="String" />
</span>
<span class="flexrow">
<label class="generic-label">Dégâts non létaux ? </label>
<input type="checkbox" name="system.nonletaux" {{checked data.nonletaux}}/>
</span>
<span class="flexrow">
<label class="generic-label">Equipé ? </label>
<input type="checkbox" name="system.equipped" {{checked data.equipped}}/>
</span>
<span class="flexrow">
<label class="generic-label">Rareté </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.rarete" value="{{data.rarete}}" data-dtype="Number" />
</span>
<span class="flexrow">
<label class="generic-label">Prix </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.prix" value="{{data.prix}}" data-dtype="Number" />
</span>
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,18 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexcol">
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,81 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}" />
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexcol">
<span class="flexrow">
<label class="generic-label">Niveau : </label>
<input type="text" class="padd-right status-small-label color-class-common" name="data.niveau"
value="{{data.niveau}}" data-dtype="Number" />
</span>
<span class="flexrow">
<label class="generic-label">Attribut 1 : </label>
<select class="status-small-label color-class-common" type="text" name="system.attribut1"
value="{{data.attribut1}}" data-dtype="string">
{{#select data.attribut1}}
{{#each attributs as |attrLabel attrKey|}}
<option value="{{attrKey}}">{{attrLabel}}</option>
{{/each}}
{{/select}}
</select>
</span>
<span class="flexrow">
<label class="generic-label">Attribut 2 : </label>
<select class="status-small-label color-class-common" type="text" name="system.attribut2"
value="{{data.attribut2}}" data-dtype="string">
<option value="none">Aucun</option>
{{#select data.attribut2}}
{{#each attributs as |attrLabel attrKey|}}
<option value="{{attrKey}}">{{attrLabel}}</option>
{{/each}}
{{/select}}
</select>
</span>
<span class="flexrow">
<label class="generic-label">Attribut 3 : </label>
<select class="status-small-label color-class-common" type="text" name="system.attribut3"
value="{{data.attribut3}}" data-dtype="string">
<option value="none">Aucun</option>
{{#select data.attribut3}}
{{#each attributs as |attrLabel attrKey|}}
<option value="{{attrKey}}">{{attrLabel}}</option>
{{/each}}
{{/select}}
</select>
</span>
<span class="flexrow">
<label class="generic-label">Les bonus de Bonne Aventure et d'Eclat peuvent être doublés (cf. Métier) ? </label>
<input class="" type="checkbox" name="system.doublebonus" {{checked data.doublebonus}}/>
</span>
<span class="flexrow">
<h3>Prédilections</h3>
</span>
<ul>
{{#each data.predilections as |predilection key|}}
<li class="prediction-item item flexrow" data-prediction-index="{{key}}">
<input type="text" class="padd-right color-class-common edit-prediction"
name="system.predilections[{{key}}]" value="{{predilection.name}}" data-dtype="String" />
<label class="generic-label">Utilisée ? <input class="use-prediction" type="checkbox" name="predilection.used" {{checked predilection.used}} /></label>
<a class="item-control delete-prediction" title="Supprimer une predilection"><i class="fas fa-trash"></i></a>
</li>
{{/each}}
</ul>
<span class="flexrow">
<button id="add-predilection" class="chat-card-button">Ajouter une prédilection</button>
</span>
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,43 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexcol">
<span class="flexrow">
<label class="generic-label">Allégeance : </label>
<select class="status-small-label color-class-common" type="text" name="system.allegeance" value="{{data.allegeance}}" data-dtype="string" >
{{#select data.allegeance}}
<option value="tous">Tous</option>
<option value="chaos">Chaos</option>
<option value="loi">Loi</option>
<option value="betes">Seigneurs des Bêtes</option>
<option value="elementaires">Seigneurs Elementaires</option>
{{/select}}
</select>
</span>
<span class="flexrow">
<label class="generic-label">Prérequis : </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.prerequis" value="{{data.prerequis}}" data-dtype="String" />
</span>
<span>
<h3>Sacrifices</h3>
</span>
<div class="small-editor item-text-long-line">
{{editor sacrifice target="system.sacrifice" button=true owner=owner editable=editable}}
</div>
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,27 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexcol">
<span class="flexrow">
<label class="generic-label">Rareté </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.rarete" value="{{data.rarete}}" data-dtype="Number" />
</span>
<span class="flexrow">
<label class="generic-label">Prix </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.prix" value="{{data.prix}}" data-dtype="Number" />
</span>
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,18 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexcol">
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,18 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexcol">
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,19 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexcol">
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,18 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexcol">
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,31 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexcol">
<span class="flexrow">
<label class="generic-label">Allégeance : </label>
<select class="status-small-label color-class-common" type="text" name="system.allegeance" value="{{data.allegeance}}" data-dtype="string" >
{{#select data.allegeance}}
<option value="tous">Tous</option>
<option value="chaos">Chaos</option>
<option value="loi">Loi</option>
<option value="betes">Seigneurs des Bêtes</option>
<option value="elementaires">Seigneurs Elementaires</option>
{{/select}}
</select>
</span>
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,23 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexcol">
<span class="flexrow">
<label class="generic-label">Compétence : </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.competence" value="{{data.competence}}" data-dtype="String" />
</span>
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,35 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexcol">
<span class="flexrow">
<label class="generic-label">Protection : </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.protection" value="{{data.protection}}" data-dtype="Number" />
</span>
<span class="flexrow">
<label class="generic-label">Equipé ? </label>
<input type="checkbox" name="system.equipped" {{checked data.equipped}}/>
</span>
<span class="flexrow">
<label class="generic-label">Rareté </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.rarete" value="{{data.rarete}}" data-dtype="Number" />
</span>
<span class="flexrow">
<label class="generic-label">Prix </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.prix" value="{{data.prix}}" data-dtype="Number" />
</span>
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,39 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexcol">
<span class="flexrow">
<label class="generic-label">Haut-Parler : </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.formule" value="{{data.formule}}" data-dtype="String" />
</span>
<span class="flexrow">
<label class="generic-label">Seuil de difficulté : </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.seuil" value="{{data.seuil}}" data-dtype="Number" />
</span>
<span class="flexrow">
<label class="generic-label">Rune prononcée : </label>
</span>
<span class="flexrow">
<input type="text" class="padd-right status-small-label color-class-common" name="system.prononcee" value="{{data.prononcee}}" data-dtype="String" />
</span>
<span class="flexrow">
<label class="generic-label">Rune tracée : </label>
</span>
<span class="flexrow">
<input type="text" class="padd-right status-small-label color-class-common" name="system.tracee" value="{{data.tracee}}" data-dtype="String" />
</span>
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,44 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<span class="flexrow">
<label class="generic-label">Rune </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.rune" value="{{data.rune}}" data-dtype="String" />
</span>
<span class="flexrow">
<label class="generic-label">Mode </label>
<select class="status-small-label color-class-common" type="text" name="system.mode"
value="{{data.mode}}" data-dtype="string">
{{@select data.mode}}
<option value="prononcee">Prononcée</option>
<option value="inscrite">Inscrite</option>
{{/select}}
</select>
</span>
<span class="flexrow">
<label class="generic-label">Points d'âme </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.pointame" value="{{data.pointame}}" data-dtype="Number" />
</span>
<span class="flexrow">
<label class="generic-label">Durée </label>
<input type="text" class="padd-right status-small-label color-class-common" name="system.duree" value="{{data.duree}}" data-dtype="String" />
</span>
<div class="flexcol">
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,31 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexcol">
<span class="flexrow">
<label class="generic-label">Allégeance : </label>
<select class="status-small-label color-class-common" type="text" name="system.allegeance" value="{{data.allegeance}}" data-dtype="string" >
{{#select data.allegeance}}
<option value="tous">Tous</option>
<option value="chaos">Chaos</option>
<option value="loi">Loi</option>
<option value="betes">Seigneurs des Bêtes</option>
<option value="elementaires">Seigneurs Elementaires</option>
{{/select}}
</select>
</span>
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,19 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexcol">
{{> systems/fvtt-mournblade/templates/partial-item-description.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,23 @@
<li class="item flexrow list-item list-item-shadow" data-item-id="{{equip._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" src="{{equip.img}}" /></a>
{{#if (eq level 1)}}
<span class="item-name-label">{{equip.name}}</span>
{{else}}
<span class="item-name-label-level2">{{equip.name}}</span>
{{/if}}
<span class="item-field-label-long"><label>
{{equip.system.quantity}}
(<a class="quantity-minus plus-minus-button"> -</a>/<a class="quantity-plus plus-minus-button">+</a>)
</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
{{#if (eq level 1)}}
<a class="item-control item-equip" title="Worn">{{#if equip.system.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
{{/if}}
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>

View File

@ -0,0 +1,6 @@
<span>
<h3>Description</h3>
</span>
<div class="medium-editor item-text-long-line">
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>

View File

@ -0,0 +1,11 @@
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>

8
templates/post-item.html Normal file
View File

@ -0,0 +1,8 @@
<div class="post-item" data-transfer="{{transfer}}">
<h3><b>{{name}}</b></h3>
{{#if img}}
<img class="chat-img" src="{{img}}" title="{{name}}" />
{{/if}}
<h4><b>Description : </b></h4>
<p class="card-content">{{{system.description}}}</p>
</div>

View File

@ -0,0 +1,104 @@
<form class="skill-roll-dialog">
<header class="roll-dialog-header">
{{#if img}}
<img class="actor-icon" src="{{img}}" data-edit="img" title="{{name}}" />
{{/if}}
<h1 class="dialog-roll-title roll-dialog-header">{{title}}</h1>
</header>
<div class="flexcol">
<div class="flexrow">
{{#if (eq attrKey "tochoose")}}
<span class="roll-dialog-label">Attribut</span>
<select class="status-small-label color-class-common" id ="attrKey" type="text" name="attrKey" value="attrKey" data-dtype="string" >
{{#select attrKey}}
{{#each attributs as |attrLabel attrKey|}}
<option value="{{attrKey}}">{{attrLabel}}</option>
{{/each}}
{{/select}}
</select>
{{else}}
<span class="roll-dialog-label">{{attr.label}}</span>
<span class="small-label">{{attr.value}}</span>
{{/if}}
</div>
{{#if competence}}
<div class="flexrow">
<span class="roll-dialog-label">{{competence.name}}</span>
<span class="small-label">{{competence.system.niveau}}</span>
</div>
{{/if}}
{{#if rune}}
<div class="flexrow">
<span class="roll-dialog-label">{{rune.name}}</span>
<span class="small-label">{{rune.system.formule}}</span>
</div>
<div class="flexrow">
<span class="roll-dialog-label">Lancement</span>
<select class="roll-dialog-label" id="runemode" type="text" name="runemode" value="{{runemode}}"
data-dtype="String">
{{#select runemode}}
<option value="prononcer">Prononcer la rune</option>
<option value="inscrire">Inscrire la rune</option>
{{/select}}
</select>
</div>
<div class="flexrow">
<span class="roll-dialog-label">Points d'Ame</span>
<select class="roll-dialog-label" id="runeame" type="text" name="runeame" value="{{runeame}}"
data-dtype="Number">
{{#select runeame}}
{{{pointAmeOptions}}}
{{/select}}
</select>
</div>
{{/if}}
<div class="flexrow">
<span class="roll-dialog-label">Modificateur : </span>
<select class="roll-dialog-label" id="modificateur" type="text" name="modificateur" value="{{modificateur}}"
data-dtype="Number">
{{#select modificateur}}
{{{modificateursOptions}}}
{{/select}}
</select>
</div>
{{#if armeDefense}}
<div class="flexrow">
<span class="roll-dialog-label">Défense adversaire : </span>
<span class="roll-dialog-label"><strong>{{difficulte}}</strong> </span>
</div>
{{else}}
<div class="flexrow">
<span class="roll-dialog-label">Difficulté : </span>
<select class="roll-dialog-label" id="difficulte" type="text" name="difficulte" value="{{difficulte}}"
data-dtype="Number">
{{#select difficulte}}
<option value="0">Aucune/Inconnue</option>
<option value="5">Facile (5)</option>
<option value="10">Moyenne (10)</option>
<option value="15">Ardue (15)</option>
<option value="20">Hasardeuse (20)</option>
<option value="25">Insensée (25)</option>
<option value="30">Pure Folie (30)</option>
{{/select}}
</select>
</div>
{{/if}}
{{#if canEclatDoubleD20}}
<div class="flexrow">
<span class="roll-dialog-label">Doubler le d20 (1 Point d'Eclat)</span>
<input class="" id="doubleD20" type="checkbox" name="doubleD20" value="{{doubleD20}}" {{checked doubleD20}}/>
</div>
{{/if}}
</div>
</form>