diff --git a/dev-notes.md b/dev-notes.md new file mode 100644 index 00000000..6dd99c00 --- /dev/null +++ b/dev-notes.md @@ -0,0 +1,48 @@ +# Actor notes + +> The Actor#getData default implementation gives you the following for use in sheet rendering: + +``` + actor -> the Actor instance + data -> a cloned copy of Actor#data + items -> a cloned copy of Actor#data#items + effects -> a cloned copy of Actor#data#effects +``` + +> if all you need is a safe copy of `Actor#data`, you'll be much better off by simply defining your own function and avoiding all the wasted work that the parent class does which will slow down your sheet +```js +getData(options) { + return { + data: foundry.utils.deepClone(this.object.data) + } +} +``` + +who knows, maybe you don't even need to copy your actor data, skip the copy and it's even faster: +```js +getData(options) { + return { + data: this.object.data + } +} +``` + + +Atropos19/02/2021 +There are two recommended ways to create owned items in 0.8.0: +```js +await Item.create(itemData, {parent: actor}); +await actor.createEmbeddedDocuments("Item", itemDataArray); +``` + + +You can update an embedded item in one of two ways: +```js +//Method 1: + +const item = actor.items.get(itemId); +item.update(data); + +//Method 2: +actor.updateEmbeddedDocuments("Item", [{_id: itemId, ...}]); +``` \ No newline at end of file diff --git a/module/actor-creature-sheet.js b/module/actor-creature-sheet.js index b9a820d7..3b164097 100644 --- a/module/actor-creature-sheet.js +++ b/module/actor-creature-sheet.js @@ -7,6 +7,8 @@ import { HtmlUtility } from "./html-utility.js"; import { RdDUtility } from "./rdd-utility.js"; import { RdDActorSheet } from "./actor-sheet.js"; +import { Misc } from "./misc.js"; +import { RdDCarac } from "./rdd-carac.js"; /* -------------------------------------------- */ export class RdDActorCreatureSheet extends RdDActorSheet { @@ -26,40 +28,29 @@ export class RdDActorCreatureSheet extends RdDActorSheet { /* -------------------------------------------- */ getData() { - let data = super.getData(); - console.log("Creature : ", data); + let sheetData = super.getData(); + console.log("Creature : ", sheetData); - data.itemsByType = {}; - for (const item of data.items) { - let list = data.itemsByType[item.type]; - if (!list) { - list = []; - data.itemsByType[item.type] = list; + sheetData.itemsByType = Misc.classify(sheetData.items, item => item.type); + sheetData.calc = { + caracTotal: RdDCarac.computeTotal(sheetData.data.data.carac), + blessures: { + resume: sheetData.actor.computeResumeBlessure(sheetData.data.data.blessures) } - list.push(item); } - // Compute current carac sum - let sum = 0; - Object.values(data.data.carac).forEach(carac => { if (!carac.derivee) { sum += parseInt(carac.value) } }); - data.data.caracSum = sum; + sheetData.data.carac.taille.isTaille = true; // To avoid button link; - data.data.carac.taille.isTaille = true; // To avoid button link; - data.data.blessures.resume = this.actor.computeResumeBlessure(data.data.blessures); - data.data.isGM = game.user.isGM; - - data.data.competencecreature = data.itemsByType["competencecreature"]; + sheetData.data.competencecreature = sheetData.itemsByType["competencecreature"]; this.actor.computeEncombrementTotalEtMalusArmure(); - RdDUtility.filterItemsPerTypeForSheet(data); - RdDUtility.buildArbreDeConteneur(this, data); - data.data.encTotal = this.actor.encTotal; - data.data.isGM = game.user.isGM; + RdDUtility.filterItemsPerTypeForSheet(sheetData); + RdDUtility.buildArbreDeConteneur(this, sheetData); - console.log("Creature : ", this.objetVersConteneur, data); + console.log("Creature : ", this.objetVersConteneur, sheetData); - return data; + return sheetData; } /* -------------------------------------------- */ @@ -100,7 +91,7 @@ export class RdDActorCreatureSheet extends RdDActorSheet { /* -------------------------------------------- */ /** @override */ - _updateObject(event, formData) { + async _updateObject(event, formData) { // Update the Actor return this.object.update(formData); } diff --git a/module/actor-entite-sheet.js b/module/actor-entite-sheet.js index 8e9f3c93..7f909e5a 100644 --- a/module/actor-entite-sheet.js +++ b/module/actor-entite-sheet.js @@ -20,33 +20,17 @@ export class RdDActorEntiteSheet extends ActorSheet { }); } - /* -------------------------------------------- */ - _checkNull(items) { - if (items && items.length) { - return items; - } - return []; - } - /* -------------------------------------------- */ getData() { - let data = super.getData(); + let sheetData = super.getData(); - data.itemsByType = {}; - for (const item of data.items) { - let list = data.itemsByType[item.type]; - if (!list) { - list = []; - data.itemsByType[item.type] = list; - } - list.push(item); - } - - data.data.carac.taille.isTaille = true; // To avoid button link; - data.data.competencecreature = data.itemsByType["competencecreature"]; - data.data.isGM = game.user.isGM; + sheetData.data.competencecreature = sheetData.itemsByType["competencecreature"]; - return data; + data.options = { + isGM: game.user.isGM + }; + + return sheetData; } /* -------------------------------------------- */ @@ -135,7 +119,7 @@ export class RdDActorEntiteSheet extends ActorSheet { /* -------------------------------------------- */ /** @override */ - _updateObject(event, formData) { + async _updateObject(event, formData) { // Update the Actor return this.object.update(formData); } diff --git a/module/actor-sheet.js b/module/actor-sheet.js index 19837d4e..a1963dd7 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -10,6 +10,7 @@ import { RdDItemCompetence } from "./item-competence.js"; import { RdDBonus } from "./rdd-bonus.js"; import { Misc } from "./misc.js"; import { RdDCombatManager } from "./rdd-combat.js"; +import { RdDCarac } from "./rdd-carac.js"; /* -------------------------------------------- */ export class RdDActorSheet extends ActorSheet { @@ -31,120 +32,92 @@ export class RdDActorSheet extends ActorSheet { } /* -------------------------------------------- */ - getData() { - let data = super.getData(); - if ( data.actor.type == 'creature' || data.actor.type == 'humanoide') return data; // Shortcut + async getData() { + // Partie commune + let sheetData = await super.getData(); - data.data.editCaracComp = this.options.editCaracComp; - data.data.showCompNiveauBase = this.options.showCompNiveauBase; - data.data.montrerArchetype = this.options.montrerArchetype; + sheetData.options = this.options; + sheetData.itemsByType = Misc.classify(sheetData.items, item => item.type); + sheetData.options.isGM = game.user.isGM; - data.itemsByType = Misc.classify(data.items); + const carac = sheetData.data.data.carac; + // la taille est la taille: on ne peut pas l'utiliser pour un jet + carac.taille.isTaille = true; - // Competence per category - data.data.comptageArchetype = RdDUtility.getLimitesArchetypes(); - data.data.competenceXPTotal = 0; - data.competenceByCategory = Misc.classify( - data.itemsByType.competence, - item => item.data.categorie, - item => { - let archetypeKey = (item.data.niveau_archetype < 0) ? 0 : item.data.niveau_archetype; - if (data.data.comptageArchetype[archetypeKey] == undefined) { - data.data.comptageArchetype[archetypeKey] = { "niveau": archetypeKey, "nombreMax": 0, "nombre": 0}; - } - data.data.comptageArchetype[archetypeKey].nombre = (data.data.comptageArchetype[archetypeKey]?.nombre??0) + 1; //Comptage archetype - item.data.xpNext = RdDItemCompetence.getCompetenceNextXp(item.data.niveau); - item.data.isLevelUp = item.data.xp >= item.data.xpNext; // Flag de niveau à MAJ - //this.actor.checkCompetenceXP(item.name); // Petite vérification experience - item.data.showCompetence = !data.data.showCompNiveauBase || (Number(item.data.niveau) != Number(RdDUtility.getLevelCategory(item.data.categorie))); - // Ignorer les compétences 'troncs' à ce stade - data.data.competenceXPTotal += RdDItemCompetence.computeCompetenceXPCost(item); - return item; - }); - data.data.competenceXPTotal -= RdDItemCompetence.computeEconomieCompetenceTroncXP(data.itemsByType.competence); + if (sheetData.actor.type == 'creature') return sheetData; // Shortcut - // Compute current carac sum - let sum = 0; - for (let caracName in data.data.carac) { - let currentCarac = data.data.carac[caracName]; - if (!currentCarac.derivee) { - sum += parseInt(currentCarac.value); - } - currentCarac.xpNext = RdDUtility.getCaracNextXp(currentCarac.value); - currentCarac.isLevelUp = (currentCarac.xp >= currentCarac.xpNext); - } - sum += (data.data.beaute >= 0) ? (data.data.beaute - 10) : 0; - data.data.caracSum = sum; + /* -- partie spécifique aux personnages -- */ - // Force empty arme, at least for Esquive - if (data.itemsByType.arme == undefined) data.itemsByType.arme = []; - for (const arme of data.itemsByType.arme) { - arme.data.niveau = 0; // Per default, TODO to be fixed - for (const melee of data.competenceByCategory.melee) { - if (melee.name == arme.data.competence) - arme.data.niveau = melee.data.niveau - } - for (const tir of data.competenceByCategory.tir) { - if (tir.name == arme.data.competence) - arme.data.niveau = tir.data.niveau - } - for (const lancer of data.competenceByCategory.lancer) { - if (lancer.name == arme.data.competence) - arme.data.niveau = lancer.data.niveau - } + const competences = sheetData.itemsByType.competence; + // toujours avoir une liste d'armes (pour mettre esquive et corps à corps) + sheetData.itemsByType.arme = sheetData.itemsByType.arme ?? []; + sheetData.competenceByCategory = Misc.classify(competences, comp => comp.data.categorie); + + sheetData.calc = { + comptageArchetype: RdDItemCompetence.computeResumeArchetype(competences), + competenceXPTotal: RdDItemCompetence.computeTotalXP(competences), + caracTotal: RdDCarac.computeTotal(carac), + // Mise à jour de l'encombrement total et du prix de l'équipement + encTotal: await sheetData.actor.computeEncombrementTotalEtMalusArmure(), + prixTotalEquipement: await sheetData.actor.computePrixTotalEquipement(), + surprise: RdDBonus.find(sheetData.actor.getSurprise(false)).descr, + surEncombrementMessage: (sheetData.data.data.compteurs.surenc.value < 0) ? "Sur-Encombrement!" : "", + fatigue: { + malus: RdDUtility.calculMalusFatigue(sheetData.data.data.sante.fatigue.value, sheetData.data.data.sante.endurance.max), + html: "" + RdDUtility.makeHTMLfatigueMatrix(sheetData.data.data.sante.fatigue.value, sheetData.data.data.sante.endurance.max).html() + "
" + }, + resumeBlessures: sheetData.actor.computeResumeBlessure(sheetData.data.data.blessures), + }; + + competences.forEach(it => it.visible = this.isCompetenceAffichable(it)); + RdDItemCompetence.setLevelUp(competences); + RdDCarac.setLevelUp(carac); + + sheetData.armes = sheetData.itemsByType.arme; + RdDItemArme.computeNiveauArmes(sheetData.armes, competences); + RdDItemArme.ajoutCorpsACorps(sheetData.armes, competences, carac); + sheetData.esquive = RdDItemCompetence.getEsquive(competences); + sheetData.armes = RdDCombatManager.finalizeArmeList(sheetData.armes, competences, carac); + + sheetData.data.data.compteurs.chance.isChance = true; + + + RdDUtility.filterItemsPerTypeForSheet(sheetData); + + sheetData.tmr = { + sortsReserve: sheetData.data.data.reve.reserve.list, + rencontres: sheetData.data.data.reve.rencontre.list, + caseSpeciales: sheetData.itemsByType.casetmr } - // To avoid armour and so on... - data.data.combat = duplicate(RdDUtility.checkNull(data.itemsByType['arme'])); - data.data.combat = RdDCombatManager.finalizeArmeList(data.data.combat, data.itemsByType.competence, data.data.carac); + RdDUtility.buildArbreDeConteneur(this, sheetData); - data.esquive = { name: "Esquive", niveau: data.competenceByCategory?.melee.find(it => it.name == 'Esquive')?.data.niveau ?? -6}; - let corpsACorps = data.competenceByCategory?.melee.find(it => it.name == 'Corps à corps'); - if (corpsACorps) { - let cc_init = RdDCombatManager.calculInitiative(corpsACorps.data.niveau, data.data.carac['melee'].value); - data.data.combat.push(RdDItemArme.mainsNues({ niveau: corpsACorps.data.niveau, initiative: cc_init })); - } - this.armesList = duplicate(data.data.combat); - - data.data.carac.taille.isTaille = true; // To avoid button link; - data.data.compteurs.chance.isChance = true; - data.data.blessures.resume = this.actor.computeResumeBlessure(data.data.blessures); - - // Mise à jour de l'encombrement total et du prix de l'équipement - this.actor.computeEncombrementTotalEtMalusArmure(); - this.actor.computePrixTotalEquipement(); - - // Common data - data.data.competenceByCategory = data.competenceByCategory; - data.data.encTotal = this.actor.encTotal; - data.data.prixTotalEquipement = this.actor.prixTotalEquipement; - data.data.surprise = RdDBonus.find(this.actor.getSurprise(false)).descr; - data.data.isGM = game.user.isGM; - data.ajustementsConditions = CONFIG.RDD.ajustementsConditions; - data.difficultesLibres = CONFIG.RDD.difficultesLibres; - - // low is normal, this the base used to compute the grid. - data.data.fatigue = { - malus: RdDUtility.calculMalusFatigue(data.data.sante.fatigue.value, data.data.sante.endurance.max), - html: "" + RdDUtility.makeHTMLfatigueMatrix(data.data.sante.fatigue.value, data.data.sante.endurance.max).html() + "
" + sheetData.subacteurs = { + vehiculesList: sheetData.actor.buildVehiculesList(), + montures: sheetData.actor.buildMonturesList(), + suivants: sheetData.actor.buildSuivantsList() } - RdDUtility.filterItemsPerTypeForSheet(data); - data.data.sortReserve = data.data.reve.reserve.list; - data.data.rencontres = duplicate(data.data.reve.rencontre.list); - data.data.caseSpeciales = data.itemsByType['casetmr']; - RdDUtility.buildArbreDeConteneur(this, data); - data.data.surEncombrementMessage = (data.data.compteurs.surenc.value < 0) ? "Sur-Encombrement!" : ""; - data.data.vehiculesList = this.actor.buildVehiculesList(); - data.data.monturesList = this.actor.buildMonturesList(); - data.data.suivantsList = this.actor.buildSuivantsList(); - return data; + // conserver la liste des armes + this.armesList = sheetData.armes; + return sheetData; + } + + computeNiveauArme(armes, competences) { + for (const arme of armes) { + const compArme = competences.find(it => it.name == arme.data.competence); + arme.data.niveau = compArme?.data.niveau ?? -8; + } + } + + isCompetenceAffichable(competence) { + return !this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(competence); } /* -------------------------------------------- */ async _onDrop(event) { let toSuper = await RdDUtility.processItemDropEvent(this, event); - if ( toSuper) { + if (toSuper) { super._onDrop(event); } } @@ -199,7 +172,7 @@ export class RdDActorSheet extends ActorSheet { html.find('.item-edit').click(ev => { const li = $(ev.currentTarget).parents(".item"); - const item = this.actor.getOwnedItem(li.data("item-id")); + const item = this.actor.items.get(li.data("item-id")); item.sheet.render(true); }); // Update Inventory Item @@ -213,12 +186,12 @@ export class RdDActorSheet extends ActorSheet { html.find('.item-delete').click(ev => { const li = $(ev.currentTarget).parents(".item"); RdDUtility.confirmerSuppression(this, li); - }); + }); html.find('.subacteur-delete').click(ev => { const li = $(ev.currentTarget).parents(".item"); RdDUtility.confirmerSuppressionSubacteur(this, li); }); - + html.find('#encaisser-direct').click(ev => { this.actor.encaisser(); }); @@ -335,12 +308,12 @@ export class RdDActorSheet extends ActorSheet { html.find('.subacteur-label a').click((event) => { const li = $(event.currentTarget).parents(".item"); let actorId = li.data('actor-id'); - let actor = game.actors.get( actorId) ; - if ( actor ) { + let actor = game.actors.get(actorId); + if (actor) { actor.sheet.render(true); } }); - + // Points de reve actuel html.find('.ptreve-actuel a').click((event) => { this.actor.rollCarac('reve-actuel'); @@ -578,7 +551,7 @@ export class RdDActorSheet extends ActorSheet { /* -------------------------------------------- */ /** @override */ - _updateObject(event, formData) { + async _updateObject(event, formData) { // Update the Actor return this.object.update(formData); } diff --git a/module/actor-vehicule-sheet.js b/module/actor-vehicule-sheet.js index a2dd0cb3..0e6a366a 100644 --- a/module/actor-vehicule-sheet.js +++ b/module/actor-vehicule-sheet.js @@ -24,30 +24,26 @@ export class RdDActorVehiculeSheet extends ActorSheet { }); } - /* -------------------------------------------- */ - _checkNull(items) { - if (items && items.length) { - return items; - } - return []; - } - /* -------------------------------------------- */ getData() { - let data = super.getData(); + let sheetData = super.getData(); + sheetData.options = { + isGM: game.user.isGM + }; - data.itemsByType = Misc.classify(data.items); + sheetData.itemsByType = Misc.classify(sheetData.items); - RdDUtility.filterItemsPerTypeForSheet(data); - RdDUtility.buildArbreDeConteneur(this, data); + RdDUtility.filterItemsPerTypeForSheet(sheetData); + RdDUtility.buildArbreDeConteneur(this, sheetData); this.actor.computeEncombrementTotalEtMalusArmure(); - data.data.isGM = game.user.isGM; - data.data.surEncombrementMessage = (this.encTotal > data.capacite_encombrement) ? "Sur-Encombrement!" : ""; + sheetData.calc = { + surEncombrementMessage: (this.encTotal > sheetData.capacite_encombrement) ? "Sur-Encombrement!" : "" + } - console.log("DATA", data); + console.log("DATA", sheetData); - return data; + return sheetData; } /* -------------------------------------------- */ @@ -102,7 +98,7 @@ export class RdDActorVehiculeSheet extends ActorSheet { /* -------------------------------------------- */ /** @override */ - _updateObject(event, formData) { + async _updateObject(event, formData) { // Update the Actor return this.object.update(formData); } diff --git a/module/actor.js b/module/actor.js index 5ee13feb..68e8db57 100644 --- a/module/actor.js +++ b/module/actor.js @@ -60,6 +60,8 @@ export class RdDActor extends Actor { if (data instanceof Array) { return super.create(data, options); } + console.log("****************************************************"); + // 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); @@ -150,25 +152,28 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ async checkMonnaiePresence(items) { // Ajout opportuniste si les pièces n'existent pas. if (!items) return; // Sanity check during import - let piece = items.find(item => item.type == 'monnaie' && Number(item.data.valeur_deniers) == 1); + //console.log("NO MONNAIR FOUND!!!!", items); + + let piece = items.find(item => item.data.type == 'monnaie' && Number(item.data.data.valeur_deniers) == 1 ); let newMonnaie = []; if (!piece) { newMonnaie.push(RdDUtility.createMonnaie("Etain (1 denier)", 1, "systems/foundryvtt-reve-de-dragon/icons/objets/piece_etain_poisson.webp")); } - piece = items.find(item => item.type == 'monnaie' && Number(item.data.valeur_deniers) == 10); + piece = items.find(item => item.data.type == 'monnaie' && Number(item.data.data.valeur_deniers) == 10); if (!piece) { newMonnaie.push(RdDUtility.createMonnaie("Bronze (10 deniers)", 10, "systems/foundryvtt-reve-de-dragon/icons/objets/piece_bronze_epees.webp")); } - piece = items.find(item => item.type == 'monnaie' && Number(item.data.valeur_deniers) == 100); + piece = items.find(item => item.data.type == 'monnaie' && Number(item.data.data.valeur_deniers) == 100); if (!piece) { newMonnaie.push(RdDUtility.createMonnaie("Argent (1 sol)", 100, "systems/foundryvtt-reve-de-dragon/icons/objets/piece_argent_sol.webp")); } - piece = items.find(item => item.type == 'monnaie' && Number(item.data.valeur_deniers) == 1000); + piece = items.find(item => item.data.type == 'monnaie' && Number(item.data.data.valeur_deniers) == 1000); if (!piece) { newMonnaie.push(RdDUtility.createMonnaie("Or (10 sols)", 1000, "systems/foundryvtt-reve-de-dragon/icons/objets/piece_or_sol.webp")); } if (newMonnaie.length > 0) { - await this.createOwnedItem(newMonnaie); + await this.createEmbeddedDocuments("Item", newMonnaie ); + //await this.createOwnedItem(newMonnaie); } } @@ -304,25 +309,26 @@ export class RdDActor extends Actor { } /* -------------------------------------------- */ getBestDraconic() { - const list = this.getDraconicList().sort((a, b) => b.data.niveau - a.data.niveau); + const list = this.getDraconicList().sort((a, b) => b.data.data.niveau - a.data.data.niveau); if (list.length == 0) { return { name: "none", data: { niveau: -11 } }; } return duplicate(list[0]); } + getDemiReve() { + return this.data.data.reve.tmrpos.coord; + } /* -------------------------------------------- */ async deleteSortReserve(sortReserve) { let reserve = duplicate(this.data.data.reve.reserve); - let len = reserve.list.length; - let i = 0; - let newTable = []; - for (i = 0; i < len; i++) { - if (reserve.list[i].coord != sortReserve.coord && reserve.list[i].sort.name != sortReserve.sort.name) - newTable.push(reserve.list[i]); - } - if (newTable.length != len) { - reserve.list = newTable; - await this.update({ "data.reve.reserve": reserve }); + let tmr = TMRUtility.getTMR(sortReserve.coord); + let index = reserve.list.findIndex(tmr.type == 'fleuve' + ? sort => (TMRUtility.getTMR(sort.coord).type == 'fleuve' && sort.sort.name == sortReserve.sort.name) + : sort => (sort.coord == sortReserve.coord && sort.sort.name == sortReserve.sort.name) + ); + if (index >=0 ) { + reserve.list.splice(index,1); + await this.update({ "data.data.reve.reserve": reserve }); } } @@ -352,7 +358,7 @@ export class RdDActor extends Actor { await this._recupererBlessures(message, "legere", blessures.legeres.liste.filter(b => b.active), []); await this._recupererBlessures(message, "grave", blessures.graves.liste.filter(b => b.active), blessures.legeres.liste); await this._recupererBlessures(message, "critique", blessures.critiques.liste.filter(b => b.active), blessures.graves.liste); - await this.update({ "data.blessures": blessures }); + await this.update({ "data.data.blessures": blessures }); await this._recupererVie(message); await this.jetDeMoral('neutre'); @@ -469,7 +475,7 @@ export class RdDActor extends Actor { this._supprimerBlessure(blessure); } } - await this.update({ "data.blessures": blessures }); + await this.update({ "data.data.blessures": blessures }); } if (this.isPersonnage()) { await this.setEthylisme(1); @@ -480,7 +486,7 @@ export class RdDActor extends Actor { if (this.data.data.sante.fatigue) { let fatigue = duplicate(this.data.data.sante.fatigue) fatigue.value = 0; - await this.update({ "data.sante.fatigue": fatigue }); + await this.update({ "data.data.sante.fatigue": fatigue }); } } ChatMessage.create(message); @@ -516,7 +522,7 @@ export class RdDActor extends Actor { message.content += `Vous dégrisez un peu (${RdDUtility.getNomEthylisme(ethylisme.value)}). `; } } - await this.update({ "data.compteurs.ethylisme": ethylisme }); + await this.update({ "data.data.compteurs.ethylisme": ethylisme }); } /* -------------------------------------------- */ @@ -538,7 +544,7 @@ export class RdDActor extends Actor { } fatigue.value = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue.value)); console.log("recupererFatigue", fatigue) - await this.update({ "data.sante.fatigue": fatigue }); + await this.update({ "data.data.sante.fatigue": fatigue }); if (fatigue.value == 0) { message.content += "Vous êtes complêtement reposé. "; } @@ -680,7 +686,7 @@ export class RdDActor extends Actor { async sortMisEnReserve(rollData, sort) { let reserve = duplicate(this.data.data.reve.reserve); reserve.list.push({ coord: rollData.tmr.coord, sort: sort, draconic: duplicate(rollData.competence) }); - await this.update({ "data.reve.reserve": reserve }); + await this.update({ "data.data.reve.reserve": reserve }); this.currentTMR.updateTokens(); } @@ -749,8 +755,8 @@ export class RdDActor extends Actor { content: message }); } - const update = { _id: comp._id, 'data.niveau': maxNiveau }; - const updated = await this.updateEmbeddedEntity("OwnedItem", update); // Updates one EmbeddedEntity + const update = [ { _id: comp.id, 'data.niveau': maxNiveau } ]; + await this.updateEmbeddedDocuments("Item", update); // Updates one EmbeddedEntity } else { console.log("Competence not found", compName); } @@ -761,8 +767,8 @@ export class RdDActor extends Actor { let comp = this.getCompetence(compName); if (comp) { this.checkCompetenceXP(compName, compValue); - const update = { _id: comp._id, 'data.xp': compValue }; - const updated = await this.updateEmbeddedEntity("OwnedItem", update); // Updates one EmbeddedEntity + const update = [ { _id: comp.id, 'data.xp': compValue } ]; + await this.updateEmbeddedDocuments("Item", update); // Updates one EmbeddedEntity } else { console.log("Competence not found", compName); } @@ -773,8 +779,8 @@ export class RdDActor extends Actor { async updateCompetenceXPSort(compName, compValue) { let comp = this.getCompetence(compName); if (comp) { - const update = { _id: comp._id, 'data.xp_sort': compValue }; - const updated = await this.updateEmbeddedEntity("OwnedItem", update); // Updates one EmbeddedEntity + const update = [ { _id: comp.id, 'data.xp_sort': compValue } ]; + await this.updateEmbeddedDocuments("Item", update); // Updates one EmbeddedEntity } else { console.log("Competence not found", compName); } @@ -784,8 +790,8 @@ export class RdDActor extends Actor { async updateCompetenceArchetype(compName, compValue) { let comp = this.getCompetence(compName); if (comp) { - const update = { _id: comp._id, 'data.niveau_archetype': compValue }; - const updated = await this.updateEmbeddedEntity("OwnedItem", update); // Updates one EmbeddedEntity + const update = [ { _id: comp.id, 'data.niveau_archetype': compValue } ]; + await this.updateEmbeddedDocuments("Item", update); // Updates one EmbeddedEntity } else { console.log("Competence not found", compName); } @@ -796,14 +802,14 @@ export class RdDActor extends Actor { //console.log("Update", fieldName, fieldValue); let compteurs = duplicate(this.data.data.compteurs); compteurs[fieldName].value = fieldValue; - await this.update({ "data.compteurs": compteurs }); + await this.update({ "data.data.compteurs": compteurs }); } /* -------------------------------------------- */ async updateProtectionValue(fieldName, fieldValue) { let attributs = duplicate(this.data.data.attributs); attributs[fieldName].value = fieldValue; - await this.update({ "data.attributs": attributs }); + await this.update({ "data.data.attributs": attributs }); } /* -------------------------------------------- */ @@ -890,7 +896,7 @@ export class RdDActor extends Actor { this.buildSubConteneurObjetList(itemId, list); //console.log("List to delete", list); for (let item of list) { - await this.deleteOwnedItem(item.id); + await this.deleteEmbeddedDocuments("Item", [item.id] ); } } @@ -909,7 +915,7 @@ export class RdDActor extends Actor { contenu.splice(index, 1); index = contenu.indexOf(itemId); } - await this.updateEmbeddedEntity("OwnedItem", data2use); + await this.updateEmbeddedDocuments("Item", data2use); } } @@ -922,7 +928,7 @@ export class RdDActor extends Actor { if (conteneur && conteneur.type == 'conteneur') { let data2use = duplicate(conteneur.data); data2use.data.contenu.push(itemId); - await this.updateEmbeddedEntity("OwnedItem", data2use); + await this.updateEmbeddedDocuments("Item", [data2use]); } } @@ -937,7 +943,7 @@ export class RdDActor extends Actor { } } if (conteneurFixedList.length > 0) - await this.updateOwnedItem(conteneurFixedList); + await this.updateEmbeddedDocuments('Item', conteneurFixedList); } /* -------------------------------------------- */ @@ -950,7 +956,7 @@ export class RdDActor extends Actor { let itemMap = {}; for (let item of itemsList) { let srcItem = sourceActor.data.items.find(subItem => subItem._id == item.id); - let newItem = await this.createOwnedItem(duplicate(srcItem)); + let newItem = await this.createEmbeddedDocuments("Item", [ duplicate(srcItem) ] ); console.log('New object', newItem, srcItem); itemMap[srcItem._id] = newItem._id; // Pour garder le lien ancien / nouveau } @@ -965,11 +971,11 @@ export class RdDActor extends Actor { console.log('New conteneur filling!', newConteneur, newItemId, item); let contenu = duplicate(newConteneur.data.contenu); contenu.push(newItemId); - await this.updateOwnedItem({ _id: newConteneurId, 'data.contenu': contenu }); + await this.updateEmbeddedDocuments( "Item", [{ _id: newConteneurId, 'data.contenu': contenu } ]); } } for (let item of itemsList) { - await sourceActor.deleteOwnedItem(item.id); + await sourceActor.deleteEmbeddedDocuments("Item", [ item.id] ); } } @@ -1012,8 +1018,9 @@ export class RdDActor extends Actor { // Mise à jour éventuelle du malus armure if (this.data.data.attributs && this.data.data.attributs.malusarmure && newMalusArmure != malusArmureData.value) { malusArmureData.value = newMalusArmure; - await this.update({ "data.attributs.malusarmure": malusArmureData }); + await this.update({ "data.data.attributs.malusarmure": malusArmureData }); } + return this.encTotal; } /* -------------------------------------------- */ @@ -1031,6 +1038,7 @@ export class RdDActor extends Actor { } // Mise à jour valeur totale de l'équipement this.prixTotalEquipement = prixTotalEquipement; + return this.prixTotalEquipement; } /* -------------------------------------------- */ @@ -1098,7 +1106,7 @@ export class RdDActor extends Actor { ret = "souffle"; } - await this.update({ "data.reve.refoulement": refoulement }); + await this.update({ "data.data.reve.refoulement": refoulement }); return ret; } @@ -1123,7 +1131,7 @@ export class RdDActor extends Actor { queue = await RdDRollTables.getOmbre(); let myReve = duplicate(this.data.data.reve.reve); myReve.thanatosused = false; - await this.update({ "data.reve.reve": myReve } ); + await this.update({ "data.data.reve.reve": myReve } ); } else { queue = await RdDRollTables.getQueue(); @@ -1156,26 +1164,6 @@ export class RdDActor extends Actor { return tmrInnaccessibles.map(it => it.data.coord); } - /* -------------------------------------------- */ - displayTMRQueueSouffleInformation() { - let messages = []; - for (let item of this.data.items) { - if (EffetsDraconiques.isUrgenceDraconique(item)) { - messages.push("Vous souffrez d'une Urgence Draconique : " + item.data.description); - } - if (EffetsDraconiques.isPeriple(item)) { - messages.push("Vous souffrez du Souffle Périple. Vous devez gérer manuellement le détail du Périple.
" + item.data.description); - } - } - - if (messages.length > 0) { - ChatMessage.create({ - whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name), - content: "RAPPEL !
" + messages.join('
') - }); - } - } - /* -------------------------------------------- */ getTMRRencontres() { return this.data.data.reve.rencontre; @@ -1189,13 +1177,13 @@ export class RdDActor extends Actor { //console.log("List", rencontres, len); let newTable = []; for (i = 0; i < len; i++) { - if (rencontres.list[i].coord != this.data.data.reve.tmrpos.coord) + if (rencontres.list[i].coord != this.getDemiReve()) newTable.push(rencontres.list[i]); } if (newTable.length != len) { rencontres.list = newTable; //console.log("Result: ", rencontres); - await this.update({ "data.reve.rencontre": rencontres }); + await this.update({ "data.data.reve.rencontre": rencontres }); } } @@ -1206,12 +1194,12 @@ export class RdDActor extends Actor { let i = 0; let already = false; for (i = 0; i < len; i++) { - if (rencontres.list[i].coord == this.data.data.reve.tmrpos.coord) + if (rencontres.list[i].coord == this.getDemiReve()) already = true; } if (!already) { rencontres.list.push(currentRencontre); - await this.update({ "data.reve.rencontre": rencontres }); + await this.update({ "data.data.reve.rencontre": rencontres }); } } @@ -1223,21 +1211,19 @@ export class RdDActor extends Actor { if ( i != rencontreKey) newList.push( list[i]); } - await this.update({ "data.reve.rencontre.list": newList }); + await this.update({ "data.data.reve.rencontre.list": newList }); } /* -------------------------------------------- */ async updateCoordTMR(coord) { - let tmrPos = duplicate(this.data.data.reve.tmrpos); - tmrPos.coord = coord; - await this.update({ "data.reve.tmrpos": tmrPos }); + await this.update({ "data.data.reve.tmrpos.coord": coord }); } /* -------------------------------------------- */ async reveActuelIncDec(value) { let reve = duplicate(this.data.data.reve.reve); reve.value = Math.max(reve.value + value, 0); - await this.update({ "data.reve.reve": reve }); + await this.update({ "data.data.reve.reve": reve }); } /* -------------------------------------------- */ @@ -1251,16 +1237,16 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ async setPointsDeSeuil(value) { - let seuil = duplicate(this.data.data.reve.seuil); - seuil.value = value; - await this.update({ "data.reve.seuil": seuil }); + // let seuil = duplicate(this.data.data.reve.seuil); + // seuil.value = value; + await this.update({ "data.data.reve.seuil.value": value }); } /* -------------------------------------------- */ async setPointsDeChance(value) { let chance = duplicate(this.data.data.compteurs.chance); chance.value = value; - await this.update({ "data.compteurs.chance": chance }); + await this.update({ "data.data.compteurs.chance": chance }); } /* -------------------------------------------- */ @@ -1301,7 +1287,7 @@ export class RdDActor extends Actor { let sonneData = duplicate(this.data.data.sante.sonne); sonneData.value = sonne; sonneData.round = round; - await this.update({ "data.sante.sonne": sonneData }); + await this.update({ "data.data.sante.sonne": sonneData }); } /* -------------------------------------------- */ @@ -1323,7 +1309,7 @@ export class RdDActor extends Actor { } if (roll.total == 1) { let xp = Misc.toInt(this.data.data.carac.constitution.xp) + 1; - this.update({ "data.carac.constitution.xp": xp }); // +1 XP ! + this.update({ "data.data.carac.constitution.xp": xp }); // +1 XP ! ChatMessage.create( { content: `${this.name} a obenu 1 sur son Jet d'Endurance et a gagné 1 point d'Expérience en Constitution. Ce point d'XP a été ajouté automatiquement).`}); } if (result.sonne) { @@ -1356,7 +1342,7 @@ export class RdDActor extends Actor { msgText += `et gagne 1 Point d'Experience en Constitution`; let constit = duplicate(this.data.data.carac.constitution) constit.xp += 1; - await this.update({ "data.carac.constitution": constit }); + await this.update({ "data.data.carac.constitution": constit }); } } else { msgText += `${this.name} a échoué son Jet d'Endurance et devient Sonné`; @@ -1440,7 +1426,7 @@ export class RdDActor extends Actor { if (sante.fatigue && fatigue > 0) { sante.fatigue.value = Math.max(sante.fatigue.value + fatigue, this._computeFatigueMin()); } - await this.update({ "data.sante": sante }); + await this.update({ "data.data.sante": sante }); if (this.isDead()) { await this.addStatusEffectById('dead'); } @@ -1553,7 +1539,7 @@ export class RdDActor extends Actor { if (degre == 1) { ethylisme.jet_moral = false; } - await this.update({ "data.compteurs.ethylisme": ethylisme }); + await this.update({ "data.data.compteurs.ethylisme": ethylisme }); } /* -------------------------------------------- */ @@ -1665,7 +1651,7 @@ export class RdDActor extends Actor { compteurs.experience.value += stressRollData.xp; compteurs.dissolution.value = dissolution - perteDissolution; compteurs.exaltation.value = 0; - await this.update({ "data.compteurs": compteurs }); + await this.update({ "data.data.compteurs": compteurs }); } /* -------------------------------------------- */ @@ -1985,7 +1971,7 @@ export class RdDActor extends Actor { } myReve.value = Math.max(myReve.value - rollData.depenseReve, 0); - await this.update({ "data.reve.reve": myReve }); + await this.update({ "data.data.reve.reve": myReve }); if (closeTMR) { this.currentTMR.close(); // Close TMR ! @@ -2327,7 +2313,7 @@ export class RdDActor extends Actor { if (limit) { chance.value = Math.min(chance.value, this.getChance()) } - await this.update({ "data.compteurs.chance": chance }); + await this.update({ "data.data.compteurs.chance": chance }); } /* -------------------------------------------- */ @@ -2336,7 +2322,7 @@ export class RdDActor extends Actor { ChatMessage.create({ content: `${this.name} a fait appel à la Destinée !` }); let destinee = duplicate(this.data.data.compteurs.destinee); destinee.value = destinee.value - 1; - await this.update({ "data.compteurs.destinee": destinee }); + await this.update({ "data.data.compteurs.destinee": destinee }); onSuccess(); } else { @@ -2389,7 +2375,7 @@ export class RdDActor extends Actor { let selectedCarac = RdDActor._findCaracByName(carac, caracName); if (!selectedCarac.derivee) { selectedCarac.xp = Misc.toInt(selectedCarac.xp) + xpCarac; - await this.update({ "data.carac": carac }); + await this.update({ "data.data.carac": carac }); } else { ChatMessage.create({ content: `Vous avez ${xpCarac} à répartir pour la caractéristique dérivée ${caracName}. Vous devez le faire manuellement.`, @@ -2767,7 +2753,7 @@ export class RdDActor extends Actor { } encaissement.endurance = Math.max(encaissement.endurance, -endActuelle); - this.update({ "data.blessures": blessures }); + this.update({ "data.data.blessures": blessures }); } /* -------------------------------------------- */ @@ -2873,7 +2859,7 @@ export class RdDActor extends Actor { return; } resonnance.actors.push(attaquant._id); - await this.update({ "data.sante.resonnance": resonnance }); + await this.update({ "data.data.sante.resonnance": resonnance }); return; } /* -------------------------------------------- */ @@ -3152,7 +3138,7 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ _deleteStatusEffectsByIds(effectIds, options) { - this.deleteEmbeddedEntity('ActiveEffect', effectIds, options); + this.deleteEmbeddedDocuments('ActiveEffect', effectIds, options); this.applyActiveEffects(); } @@ -3167,7 +3153,7 @@ export class RdDActor extends Actor { this.deleteStatusEffectById(statusEffect.id, options); const effet = duplicate(statusEffect); effet["flags.core.statusId"] = effet.id; - await this.createEmbeddedEntity('ActiveEffect', effet, options); + await this.createEmbeddedDocuments('ActiveEffect', [effet], options); this.applyActiveEffects(); } @@ -3199,6 +3185,9 @@ export class RdDActor extends Actor { case 'souffle': await this.onDeleteOwnedDraconique(item, options, id); break; + case 'casetmr': + await this.onDeleteOwnedCaseTmr(item, options, id); + break; } } @@ -3220,6 +3209,13 @@ export class RdDActor extends Actor { } } + async onDeleteOwnedCaseTmr(item, options, id) { + let draconique = Draconique.all().find(it => it.isCase(item)); + if (draconique) { + draconique.onActorDeleteCaseTmr(this, item) + } + } + notifyGestionTeteSouffleQueue(item, manualMessage=true){ ChatMessage.create({ whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name), diff --git a/module/chat-utility.js b/module/chat-utility.js index d38514ca..ea6b4772 100644 --- a/module/chat-utility.js +++ b/module/chat-utility.js @@ -13,7 +13,7 @@ export class ChatUtility { /* -------------------------------------------- */ static onRemoveMessages(part, gmId) { - if (game.user._id == gmId) { + if (game.user.data._id == gmId) { const toDelete = game.messages.filter(it => it.data.content.includes(part)); toDelete.forEach(it => it.delete()); } @@ -22,10 +22,10 @@ export class ChatUtility { /* -------------------------------------------- */ static removeChatMessageContaining(part) { - const gmId = game.user.isGM ? game.user._id : game.users.entities.find(u => u.isGM)?.id; + const gmId = game.user.isGM ? game.user.data._id : game.users.entities.find(u => u.isGM)?.data.id; if (!gmId || game.user.isGM) { - ChatUtility.onRemoveMessages(part, game.user._id); + ChatUtility.onRemoveMessages(part, game.user.data._id); } else { game.socket.emit("system.foundryvtt-reve-de-dragon", { diff --git a/module/grammar.js b/module/grammar.js index e75bdc77..7a35cebc 100644 --- a/module/grammar.js +++ b/module/grammar.js @@ -26,7 +26,7 @@ export class Grammar { /* -------------------------------------------- */ static articleDetermine(genre) { - switch (toLowerCaseNoAccent(genre)) { + switch (Grammar.toLowerCaseNoAccent(genre)) { case 'f': case 'feminin': return 'la'; case 'p': case 'mp': case 'fp': case 'pluriel': return 'les'; default: @@ -35,8 +35,8 @@ export class Grammar { } /* -------------------------------------------- */ - static articleIndétermine(genre) { - switch (toLowerCaseNoAccent(genre)) { + static articleIndetermine(genre) { + switch (Grammar.toLowerCaseNoAccent(genre)) { case 'f': case 'feminin': return 'une'; case 'p': case 'fp': case 'mp': case 'pluriel': return 'des'; case 'n': case 'neutre': return 'du' @@ -58,7 +58,7 @@ export class Grammar { * @param {...any} mots */ static accord(genre, ...mots) { - switch (toLowerCaseNoAccent(genre)) { + switch (Grammar.toLowerCaseNoAccent(genre)) { default: case 'n': case 'neutre': case 'm': case 'masculin': return mots[0]; diff --git a/module/item-arme.js b/module/item-arme.js index 68e3cafb..00e6fe8b 100644 --- a/module/item-arme.js +++ b/module/item-arme.js @@ -1,4 +1,5 @@ import { RdDItemCompetenceCreature } from "./item-competencecreature.js" +import { RdDCombatManager } from "./rdd-combat.js" const nomCategorieParade = { "sans-armes": "Sans arme / armes naturelles", @@ -167,4 +168,24 @@ export class RdDItemArme extends Item { } return mainsNues } -} + + static ajoutCorpsACorps(armes, competences, carac) { + let corpsACorps = competences.find(it => it.name == 'Corps à corps'); + if (corpsACorps) { + let cc_init = RdDCombatManager.calculInitiative(corpsACorps.data.niveau, carac['melee'].value); + armes.push(RdDItemArme.mainsNues({ niveau: corpsACorps.data.niveau, initiative: cc_init })); + } + } + + static computeNiveauArmes(armes, competences) { + for (const arme of armes) { + arme.data.niveau = RdDItemArme.computeNiveauArme(arme, competences); + } + } + + static computeNiveauArme(arme, competences) { + const compName = arme.data.competence; + const compArme = competences.find(it => it.name == compName); + return compArme?.data.niveau ?? -8; + } +} \ No newline at end of file diff --git a/module/item-competence.js b/module/item-competence.js index deca47f1..40d32513 100644 --- a/module/item-competence.js +++ b/module/item-competence.js @@ -1,3 +1,4 @@ +import { RdDUtility } from "./rdd-utility.js"; const competenceTroncs = [["Esquive", "Dague", "Corps à corps"], ["Epée à 1 main", "Epée à 2 mains", "Hache à 1 main", "Hache à 2 mains", "Lance", "Masse à 1 main", "Masse à 2 mains"]]; @@ -55,33 +56,70 @@ export class RdDItemCompetence extends Item { } return false; } + /* -------------------------------------------- */ - static computeCompetenceXPCost(competence) { - let xp = RdDItemCompetence.getDeltaXp(competence.data.base, competence.data.niveau ?? competence.data.base); - xp += competence.data.xp ?? 0; - if ( competence.name.includes('Thanatos') ) xp *= 2; /// Thanatos compte double ! - xp += competence.data.xp_sort ?? 0; - return xp; + static computeTotalXP(competences) { + const total = competences.map(c => RdDItemCompetence.computeXP(c)) + .reduce((a, b) => a + b, 0); + const economieTronc = RdDItemCompetence.computeEconomieXPTronc(competences); + return total - economieTronc; } /* -------------------------------------------- */ - static computeEconomieCompetenceTroncXP(competences) { - let economie = 0; - for (let troncList of competenceTroncs) { - let list = troncList.map(name => RdDItemCompetence.findCompetence(competences, name)) - .sort( (c1, c2) => c2.data.niveau - c1.data.niveau); // tri du plus haut au plus bas - list.splice(0,1); // ignorer la plus élevée - list.forEach(c => { - economie += RdDItemCompetence.getDeltaXp(c.data.base, Math.min(c.data.niveau, 0) ); - }); - } - return economie; + static computeXP(competence) { + // Thanatos compte double ! + const factor = competence.name.includes('Thanatos') ? 2 : 1 + const xpNiveau = RdDItemCompetence.computeDeltaXP(competence.data.base, competence.data.niveau ?? competence.data.base); + const xp = competence.data.xp ?? 0; + const xpSort = competence.data.xp_sort ?? 0; + return factor * (xpNiveau + xp) + xpSort; + } + + /* -------------------------------------------- */ + static computeEconomieXPTronc(competences) { + return competenceTroncs.map( + list => list.map(name => RdDItemCompetence.findCompetence(competences, name)) + // calcul du coût xp jusqu'au niveau 0 maximum + .map(it => RdDItemCompetence.computeDeltaXP(it.data.base, Math.min(it.data.niveau, 0))) + .sort((a, b) => b - a) // tri descendant + .splice(0, 1) // ignorer le coût xp le plus élevé + .reduce((a, b) => a + b, 0) + ).reduce((a, b) => a + b, 0); + } + + static setLevelUp(competences) { + competences.forEach(it => { + it.data.xpNext = RdDItemCompetence.getCompetenceNextXp(it.data.niveau); + it.data.isLevelUp = it.data.xp >= it.data.xpNext; + }); + } + + static computeResumeArchetype(competences) { + const archetype = RdDUtility.getLimitesArchetypes(); + competences.forEach(item => { + let niveau = (item.data.niveau_archetype < 0) ? 0 : item.data.niveau_archetype; + archetype[niveau] = archetype[niveau] ?? { "niveau": niveau, "nombreMax": 0, "nombre": 0 }; + archetype[niveau].nombre = (archetype[niveau]?.nombre ?? 0) + 1; + }); + return archetype; + } + + static isVisible(competence) { + return Number(competence.data.niveau) != RdDUtility.getCategorieNiveauBase(competence.data.categorie); + } + + static isNiveauBase(competence) { + return Number(competence.data.niveau) == RdDUtility.getCategorieNiveauBase(competence.data.categorie); } /* -------------------------------------------- */ static findCompetence(list, name) { name = name.toLowerCase(); - return list.find(item => item.name.toLowerCase() == name && (item.type == "competence" || item.type == "competencecreature")) + return list.find(it => it.name.toLowerCase() == name && (it.type == "competence" || it.type == "competencecreature")) + } + + static getEsquive(competences) { + return { name: "Esquive", niveau: RdDItemCompetence.findCompetence(competences, 'Esquive')?.data.niveau ?? -6 }; } /* -------------------------------------------- */ @@ -96,14 +134,14 @@ export class RdDItemCompetence extends Item { } /* -------------------------------------------- */ - static getDeltaXp(from, to) { + static computeDeltaXP(from, to) { RdDItemCompetence._valideNiveau(from); RdDItemCompetence._valideNiveau(to); return competence_xp_cumul[to] - competence_xp_cumul[from]; } /* -------------------------------------------- */ - static _valideNiveau(niveau){ + static _valideNiveau(niveau) { if (niveau < -11 || niveau > competence_niveau_max) { console.warn("Niveau en dehors des niveaux de compétences: [-11, " + competence_niveau_max + "]", niveau) } diff --git a/module/item-sheet.js b/module/item-sheet.js index f70e3483..a5275f94 100644 --- a/module/item-sheet.js +++ b/module/item-sheet.js @@ -47,26 +47,27 @@ export class RdDItemSheet extends ItemSheet { /* -------------------------------------------- */ async getData() { - let data = super.getData(); - data.categorieCompetences = RdDUtility.getCategorieCompetences(); - if ( data.item.type == 'tache' || data.item.type == 'livre' || data.item.type == 'meditation' || data.item.type == 'oeuvre') { - data.caracList = duplicate(game.system.model.Actor.personnage.carac); - data.competences = await RdDUtility.loadCompendiumNames( 'foundryvtt-reve-de-dragon.competences' ); + let sheetData = super.getData(); + + sheetData.categorieCompetences = RdDUtility.getCategorieCompetences(); + if ( sheetData.item.type == 'tache' || sheetData.item.type == 'livre' || sheetData.item.type == 'meditation' || sheetData.item.type == 'oeuvre') { + sheetData.caracList = duplicate(game.system.model.Actor.personnage.carac); + sheetData.competences = await RdDUtility.loadCompendiumNames( 'foundryvtt-reve-de-dragon.competences' ); } - if (data.item.type == 'arme') { - data.competences = await RdDUtility.loadCompendium( 'foundryvtt-reve-de-dragon.competences', it => RdDItemCompetence.isCompetenceArme(it)); + if (sheetData.item.type == 'arme') { + sheetData.competences = await RdDUtility.loadCompendium( 'foundryvtt-reve-de-dragon.competences', it => RdDItemCompetence.isCompetenceArme(it)); } - if ( data.item.type == 'recettealchimique' ) { - RdDAlchimie.processManipulation(data.item, this.actor && this.actor._id ); + if ( sheetData.item.type == 'recettealchimique' ) { + RdDAlchimie.processManipulation(sheetData.item, this.actor && this.actor.id ); } if ( this.actor ) { - data.isOwned = true; - data.actorId = this.actor._id; + sheetData.isOwned = true; + sheetData.actorId = this.actor.id; } - data.bonusCaseList = RdDItemSort.getBonusCaseList(data, true); - data.isGM = game.user.isGM; // Pour verrouiller certaines éditions + sheetData.bonusCaseList = RdDItemSort.getBonusCaseList(sheetData, true); + sheetData.isGM = game.user.isGM; // Pour verrouiller certaines éditions - return data; + return sheetData; } /* -------------------------------------------- */ @@ -111,7 +112,7 @@ export class RdDItemSheet extends ItemSheet { async _onClickSelectCategorie(event) { event.preventDefault(); - let level = RdDUtility.getLevelCategory(event.currentTarget.value); + let level = RdDUtility.getCategorieNiveauBase(event.currentTarget.value); this.object.data.data.base = level; $("#base").val( level ); } @@ -126,10 +127,10 @@ export class RdDItemSheet extends ItemSheet { /* -------------------------------------------- */ /** @override */ - _updateObject(event, formData) { + async _updateObject(event, formData) { // Données de bonus de cases ? formData = RdDItemSort.buildBonusCaseStringFromFormData( formData ); - + //console.log("HERE", this, formData, this.object.data ); return this.object.update(formData); } } diff --git a/module/poetique.js b/module/poetique.js index 58127bf8..e448d6e7 100644 --- a/module/poetique.js +++ b/module/poetique.js @@ -4,25 +4,25 @@ const poesieHautReve = [ { reference: 'Le Ratier Bretonien', extrait: `Le courant du Fleuve -
Te domine et te Porte -
Avant que tu te moeuves -
Combat le, ou il t'emporte` +
Te domine et te Porte +
Avant que tu te moeuves +
Combat le, ou il t'emporte` }, { reference: 'Incompatibilité, Charles Beaudelaire', extrait: `Et lorsque par hasard une nuée errante -
Assombrit dans son vol le lac silencieux, -
On croirait voir la robe ou l'ombre transparente -
D'un esprit qui voyage et passe dans les cieux.` +
Assombrit dans son vol le lac silencieux, +
On croirait voir la robe ou l'ombre transparente +
D'un esprit qui voyage et passe dans les cieux.` }, { reference: 'Au fleuve de Loire, Joachim du Bellay', extrait: `Ô de qui la vive course -
Prend sa bienheureuse source, -
D’une argentine fontaine, -
Qui d’une fuite lointaine, -
Te rends au sein fluctueux -
De l’Océan monstrueux` +
Prend sa bienheureuse source, +
D’une argentine fontaine, +
Qui d’une fuite lointaine, +
Te rends au sein fluctueux +
De l’Océan monstrueux` }, { reference: 'Denis Gerfaud', @@ -61,10 +61,188 @@ const poesieHautReve = [ Nul ne sait qui est le créateur des Dragons, ni qui est leur maître. Mais l'on peut supposer qui est le maître du Rêve des Dragons, c'est Oniros»` }, + { + reference: "La chevelure, Charles Baudelaire", + extrait: `J'irai là-bas où l'arbre et l'homme, pleins de sève, +
Se pâment longuement sous l'ardeur des climats ; +
Fortes tresses, soyez la houle qui m'enlève !` + }, + { + reference: "Rêve de Dragon, Denis Gerfaud", + extrait: `En réalité, tous les éléments du rêve des Dragons expriment + le Draconic : chaque pierre, chaque fleur, chaque goutte d'eau, + chaque nuage est porteur d'un message dans la langue des Dragons` + }, + { + reference: "Femmes damnées (2), Charles Baudelaire", + extrait: `Comme je descendais des Fleuves impassibles, +
Je ne me sentis plus guidé par les haleurs : +
Des Peaux-Rouges criards les avaient pris pour cibles, +
Les ayant cloués nus aux poteaux de couleurs.` + }, + { + reference: "Le bateau ivre, Arthur Rimbaud", + extrait: `Loin des peuples vivants, errantes, condamnées, +
A travers les déserts courez comme les loups ; +
Faites votre destin, âmes désordonnées, +
Et fuyez l'infini que vous portez en vous !` + }, + { + reference: "L'Ennemi, Charles Baudelaire", + extrait: `Et qui sait si les fleurs nouvelles que je rêve +
Trouveront dans ce sol lavé comme une grève +
Le mystique aliment qui ferait leur vigueur ?` + }, + { + reference: "Une charogne, Charles Baudelaire", + extrait: `Et le ciel regardait la carcasse superbe +
Comme une fleur s'épanouir. +
La puanteur était si forte, que sur l'herbe +
Vous crûtes vous évanouir.` + }, + { + reference: "Conseil, Victor Hugo", + extrait: `Rois ! la bure est souvent jalouse du velours. +
Le peuple a froid l'hiver, le peuple a faim toujours. +
Rendez-lui son sort plus facile. +
Le peuple souvent porte un bien rude collier. +
Ouvrez l'école aux fils, aux pères l'atelier, +
À tous vos bras, auguste asile !` + }, + { + reference: "El Desdichado, Gérard de Nerval", + extrait: `Suis-je Amour ou Phébus ?... Lusignan ou Biron ? +
Mon front est rouge encor du baiser de la Reine ; +
J'ai rêvé dans la Grotte où nage la sirène...` + }, + { + reference: "Caligula - IIIème chant, Gérard de Nerval", + extrait: `Allez, que le caprice emporte +
Chaque âme selon son désir, +
Et que, close après vous, la porte +
Ne se rouvre plus qu'au plaisir.` + }, + { + reference: "Rêve de Dragon, Denis Gerfaud", + extrait: `Les sages ont encore coutume de dire : +
« Mais comment les Dragons peuvent-ils + être influencés par une créature qui, tout + bien considéré, n'existe pas vraiment pour eux, + qui n'est que le fantasme de leur activité nocturne ? »` + }, + { + reference: "Rêve de Dragon, Denis Gerfaud", + extrait: `La légende affirme que ce sont les Gnomes qui furent + les premiers haut-rêvants. En observant les pierres précieuses, + les gemmes qui sont les larmes de joie des Dragons, ils parvinrent à + en comprendre la langue. Et l'ayant comprise, ils purent s'en servir + pour influencer le cours du rêve`, + }, + { + reference: "Quand le rêve se brise, Cypora Sebagh", + extrait: `Quand le rêve se brise, +
Dans la plainte du jour, +
Ma mémoire devient grise +
Et sombre, tour à tour, +
Dans le puits du silence +
Et de la solitude ; +
Elle reprend son errance +
Parmi la multitude.` + } + , + { + reference: "Une charogne, Charles Baudelaire", + extrait: `Les formes s'effaçaient et n'étaient plus qu'un rêve, +
Une ébauche lente à venir +
Sur la toile oubliée, et que l'artiste achève +
Seulement par le souvenir.` + }, + { + reference: "La chevelure, Charles Baudelaire", + extrait: `Longtemps ! toujours ! ma main dans ta crinière lourde +
Sèmera le rubis, la perle et le saphir, +
Afin qu'à mon désir tu ne sois jamais sourde ! +
N'es-tu pas l'oasis où je rêve, et la gourde +
Où je hume à longs traits le vin du souvenir` + }, + { + reference: "Un Fou et un Sage, Jean de La Fontaine", + extrait: `Certain Fou poursuivait à coups de pierre un Sage. +
Le Sage se retourne et lui dit : Mon ami, +
C'est fort bien fait à toi ; reçois cet écu-ci : +
Tu fatigues assez pour gagner davantage.` + }, + { + reference: "Guitare, Victor Hugo", + extrait: `Je la voyais passer de ma demeure, +
Et c'était tout. +
Mais à présent je m'ennuie à toute heure, +
Plein de dégoût, +
Rêveur oisif, l'âme dans la campagne, +
La dague au clou ... – +
Le vent qui vient à travers la montagne +
M'a rendu fou !` + }, + { + reference: "Rêve de Dragon, Denis Gerfaud", + extrait: `Le Premier Âge fut appelé l'Âge des Dragons. Ce fut le commencement + des temps, le commencement des rêves. Durant cette période plus mythique + que réellement historique, les Dragons aimaient à se rêver eux-mêmes.` + }, + { + reference: "Les Djinns, Victor Hugo", + extrait: `C'est l'essaim des Djinns qui passe, +
Et tourbillonne en sifflant ! +
Les ifs, que leur vol fracasse, +
Craquent comme un pin brûlant.`}, + { + reference: "Rêve de Dragon, Denis Gerfaud", + extrait: `Car le Second Âge fut bel et bien celui des Magiciens. Durant cette période, les + Gnomes s'enfoncèrent profondément sous les montagnes et la magie passa aux + mains des Humains qui en usèrent et abusèrent, se croyant devenus les maîtres du monde` + }, + { + reference: "Lily, Pierre Perret", + extrait: `Elle aurait pas cru sans le voir +
Que la couleur du désespoir +
Là-bas aussi ce fût le noir.` + }, + + { + reference: "Qu'est-ce de votre vie ? une bouteille molle, Jean-Baptiste Chassignet", + extrait: `Qu'est-ce de votre vie ? un tourbillon rouant +
De fumière à flot gris, parmi l'air se jouant, +
Qui passe plus soudain que foudre meurtrière.` + }, + { + reference: "Les Djinns, poème Victor Hugo", + extrait: `Cris de l'enfer! voix qui hurle et qui pleure ! +
L'horrible essaim, poussé par l'aquilon, +
Sans doute, ô ciel ! s'abat sur ma demeure. +
Le mur fléchit sous le noir bataillon. +
La maison crie et chancelle penchée, +
Et l'on dirait que, du sol arrachée, +
Ainsi qu'il chasse une feuille séchée, +
Le vent la roule avec leur tourbillon !` + }, + { + reference: "Rêve de Dragon, Denis Gerfaud", + extrait: `Le monde est Rêve de Dragons, mais nous ne savons +
ni leur apparence ni qui sont les dragons. +
En dépit de l'iconographie qui les clame +
immenses créatures ailées crachant des flammes` + }, + { + reference: "El Desdichado, Gérard de Nerval", + extrait: `Je suis le Ténébreux, – le Veuf, – l'Inconsolé, +
Le Prince d'Aquitaine à la Tour abolie : +
Ma seule Etoile est morte, – et mon luth constellé +
Porte le Soleil noir de la Mélancolie.` + }, ] export class Poetique { - static getExtrait(){ + static getExtrait() { return Misc.rollOneOf(poesieHautReve); } diff --git a/module/rdd-carac.js b/module/rdd-carac.js index 337212b2..c8472f46 100644 --- a/module/rdd-carac.js +++ b/module/rdd-carac.js @@ -1,4 +1,5 @@ import { Grammar } from "./grammar.js"; +import { RdDUtility } from "./rdd-utility.js"; export class RdDCarac { @@ -20,6 +21,21 @@ export class RdDCarac { RdDCarac.isChance(selectedCarac) || (RdDCarac.isReve(selectedCarac) && !competence); } + + static computeTotal(carac, beaute=undefined) { + const total = Object.values(carac).filter(c => !c.derivee) + .map(it => parseInt(it.value)) + .reduce((a, b) => a + b, 0); + const beauteSuperieur10 = Math.max((beaute ?? 10) - 10, 0); + return total + beauteSuperieur10; + } + + static setLevelUp(carac) { + Object.values(carac).forEach(it => { + it.xpNext = RdDUtility.getCaracNextXp(it.value); + it.isLevelUp = (it.xp >= it.xpNext); + }); + } /** * L’appel à la chance n’est possible que pour recommencer les jets d’actions physiques : diff --git a/module/rdd-commands.js b/module/rdd-commands.js index b085c758..8a091058 100644 --- a/module/rdd-commands.js +++ b/module/rdd-commands.js @@ -23,6 +23,8 @@ export class RdDCommands { rddCommands.registerCommand({ path: ["/aide"], func: (content, msg, params) => rddCommands.help(msg), descr: "Affiche l'aide pour toutes les commandes" }); rddCommands.registerCommand({ path: ["/help"], func: (content, msg, params) => rddCommands.help(msg), descr: "Affiche l'aide pour toutes les commandes" }); rddCommands.registerCommand({ path: ["/table", "queues"], func: (content, msg, params) => RdDRollTables.getQueue(true), descr: "Tire une Queue de Dragon" }); + rddCommands.registerCommand({ path: ["/table", "ideefixe"], func: (content, msg, params) => RdDRollTables.getIdeeFixe(true), descr: "Tire une Idée fixe" }); + rddCommands.registerCommand({ path: ["/table", "desir"], func: (content, msg, params) => RdDRollTables.getDesirLancinant(true), descr: "Tire un Désir Lancinant" }); rddCommands.registerCommand({ path: ["/table", "ombre"], func: (content, msg, params) => RdDRollTables.getOmbre(true), descr: "Tire une Ombre de Dragon" }); rddCommands.registerCommand({ path: ["/table", "tetehr"], func: (content, msg, params) => RdDRollTables.getTeteHR(true), descr: "Tire une Tête de Dragon pour Hauts Revants" }); rddCommands.registerCommand({ path: ["/table", "tete"], func: (content, msg, params) => RdDRollTables.getTete(true), descr: "Tire une Tête de Dragon" }); @@ -255,7 +257,7 @@ export class RdDCommands { if (params && (params.length == 1 || params.length == 2)) { let to = params.length == 1 ? Number(params[0]) : Number(params[1]); let from = params.length == 1 ? to - 1 : Number(params[0]); - RdDCommands._chatAnswer(msg, `Coût pour passer une compétence de ${from} à ${to}: ${RdDItemCompetence.getDeltaXp(from, to)}`); + RdDCommands._chatAnswer(msg, `Coût pour passer une compétence de ${from} à ${to}: ${RdDItemCompetence.computeDeltaXP(from, to)}`); } else { return false; diff --git a/module/rdd-main.js b/module/rdd-main.js index 2b7d2e43..1c45db7a 100644 --- a/module/rdd-main.js +++ b/module/rdd-main.js @@ -133,7 +133,8 @@ Hooks.once("init", async function () { /* -------------------------------------------- */ // Define custom Entity classes - CONFIG.Actor.entityClass = RdDActor; + CONFIG.Actor.documentClass = RdDActor; + //CONFIG.Actor.entityClass = RdDActor; CONFIG.RDD = { resolutionTable: RdDResolutionTable.resolutionTable, carac_array: RdDUtility.getCaracArray(), @@ -150,7 +151,8 @@ Hooks.once("init", async function () { Actors.registerSheet("foundryvtt-reve-de-dragon", RdDActorEntiteSheet, { types: ["entite"], makeDefault: true }); Items.unregisterSheet("core", ItemSheet); Items.registerSheet("foundryvtt-reve-de-dragon", RdDItemSheet, { makeDefault: true }); - CONFIG.Combat.entityClass = RdDCombatManager; + //CONFIG.Combat.entityClass = RdDCombatManager; + CONFIG.Combat.documentClass = RdDCombatManager; // préparation des différents modules RdDCommands.init(); @@ -171,7 +173,7 @@ function messageDeBienvenue() { if (game.user.isGM) { ChatUtility.removeChatMessageContaining('
'); ChatMessage.create({ - user: game.user._id, + user: game.user.data._id, content: `
Bienvenue dans le Rêve des Dragons !
Vous trouverez quelques informations pour démarrer dans ce document : @Compendium[foundryvtt-reve-de-dragon.rappel-des-regles.7uGrUHGdPu0EmIu2]{Documentation MJ/Joueurs}
La commande /aide dans le chat permet de voir les commandes spécifiques à Rêve de Dragon.
diff --git a/module/rdd-roll.js b/module/rdd-roll.js index 079fc277..11a83bf4 100644 --- a/module/rdd-roll.js +++ b/module/rdd-roll.js @@ -142,8 +142,8 @@ export class RdDRoll extends Dialog { // Update html, according to data if (rollData.competence) { // Set the default carac from the competence item - rollData.selectedCarac = rollData.carac[rollData.competence.data.defaut_carac]; - $("#carac").val(rollData.competence.data.defaut_carac); + rollData.selectedCarac = rollData.carac[rollData.competence.data.data.defaut_carac]; + $("#carac").val(rollData.competence.data.data.defaut_carac); } if (rollData.selectedSort) { $("#draconic").val(rollData.selectedSort.data.listIndex); // Uniquement a la selection du sort, pour permettre de changer @@ -296,10 +296,10 @@ export class RdDRoll extends Dialog { /* -------------------------------------------- */ _computeDiffCompetence(rollData) { if (rollData.competence) { - return Misc.toInt(rollData.competence.data.niveau); + return Misc.toInt(rollData.competence.data.data.niveau); } if (rollData.draconicList) { - return Misc.toInt(rollData.competence.data.niveau); + return Misc.toInt(rollData.competence.data.data.niveau); } return 0; } @@ -336,7 +336,7 @@ export class RdDRoll extends Dialog { return compName + " - " + rollData.selectedSort.name; } // If a weapon is there, add it in the title - const niveau = Misc.toSignedString(rollData.competence.data.niveau); + const niveau = Misc.toSignedString(rollData.competence.data.data.niveau); if (compName == carac) { // cas des créatures return carac + " " + niveau diff --git a/module/rdd-rolltables.js b/module/rdd-rolltables.js index 957c130a..74d06152 100644 --- a/module/rdd-rolltables.js +++ b/module/rdd-rolltables.js @@ -48,14 +48,22 @@ export class RdDRollTables { static async getQueue(toChat = false) { let queue = await RdDRollTables.drawItemFromRollTable("Queues de dragon", toChat); if (queue.name.toLowerCase().includes('lancinant') ) { - queue = await RdDRollTables.drawItemFromRollTable("Désirs lancinants", toChat); + return await RdDRollTables.getDesirLancinant(toChat); } if (queue.name.toLowerCase().includes('fixe') ) { - queue = await RdDRollTables.drawItemFromRollTable("Idées fixes", toChat); + return await RdDRollTables.getIdeeFixe(toChat); } return queue; } + static async getDesirLancinant(toChat = false) { + return await RdDRollTables.drawItemFromRollTable("Désirs lancinants", toChat); + } + + static async getIdeeFixe(toChat = false) { + return await RdDRollTables.drawItemFromRollTable("Idées fixes", toChat); + } + /* -------------------------------------------- */ static async getTeteHR(toChat = false) { return await RdDRollTables.drawItemFromRollTable("Têtes de Dragon pour haut-rêvants", toChat); diff --git a/module/rdd-tmr-dialog.js b/module/rdd-tmr-dialog.js index a3bcff7e..2312b1d7 100644 --- a/module/rdd-tmr-dialog.js +++ b/module/rdd-tmr-dialog.js @@ -108,6 +108,11 @@ export class RdDTMRDialog extends Dialog { this._createTokens(); } + removeToken(tmr, casetmr) { + this._removeTokens(t => t.coordTMR() == tmr.coord && t.caseSpeciale?._id == casetmr._id); + this.updateTokens() + } + /* -------------------------------------------- */ _getTokensCasesTmr() { return this.casesSpeciales.map(c => this._tokenCaseSpeciale(c)).filter(token => token); @@ -142,7 +147,7 @@ export class RdDTMRDialog extends Dialog { async activateListeners(html) { super.activateListeners(html); - document.getElementById("tmrrow1").insertCell(1).append(this.pixiApp.view); + document.getElementById("tmrrow1").insertCell(0).append(this.pixiApp.view); if (this.viewOnly) { html.find('#lancer-sort').remove(); @@ -168,7 +173,6 @@ export class RdDTMRDialog extends Dialog { let tmr = TMRUtility.getTMR(this.actor.data.data.reve.tmrpos.coord); await this.manageRencontre(tmr, () => { this.postRencontre(tmr); - this.actor.displayTMRQueueSouffleInformation(); }); } @@ -176,7 +180,7 @@ export class RdDTMRDialog extends Dialog { updateValuesDisplay() { let ptsreve = document.getElementById("tmr-pointsreve-value"); ptsreve.innerHTML = this.actor.data.data.reve.reve.value; - + console.log( this.actor.data.data ); let tmrpos = document.getElementById("tmr-pos"); let tmr = TMRUtility.getTMR(this.actor.data.data.reve.tmrpos.coord); tmrpos.innerHTML = this.actor.data.data.reve.tmrpos.coord + " (" + tmr.label + ")"; @@ -498,9 +502,7 @@ export class RdDTMRDialog extends Dialog { } async _resultatMaitriseCaseHumide(rollData) { - if (rollData.rolled.isETotal) { - rollData.souffle = await this.actor.ajouterSouffle({ chat: false }); - } + await this.souffleSiEchecTotal(rollData); this.toclose = rollData.rolled.isEchec; if (rollData.rolled.isSuccess && rollData.double) { rollData.previous = { rolled: rollData.rolled, ajustements: rollData.ajustements }; @@ -518,6 +520,12 @@ export class RdDTMRDialog extends Dialog { } } + async souffleSiEchecTotal(rollData) { + if (rollData.rolled.isETotal) { + rollData.souffle = await this.actor.ajouterSouffle({ chat: false }); + } + } + /* -------------------------------------------- */ isCaseHumide(tmr) { if (!(TMRUtility.isCaseHumide(tmr) || this.isCaseHumideAdditionelle(tmr))) { @@ -558,16 +566,29 @@ export class RdDTMRDialog extends Dialog { await this._conquerir(tmr, { difficulte: -9, action: 'Conquérir la cité', - onConqueteReussie: r => EffetsDraconiques.fermetureCites.onConquete(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)), - onConqueteEchec: r => this.close(), + onConqueteReussie: r => EffetsDraconiques.fermetureCites.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)), + onConqueteEchec: r => { + this.souffleSiEchecTotal(rollData); + this.close() + }, canClose: false }); } } - - removeToken(tmr, casetmr) { - this._removeTokens(t => t.coordTMR() == tmr.coord && t.caseSpeciale?._id == casetmr._id); - this.updateTokens() + /* -------------------------------------------- */ + async purifierPeriple(tmr) { + if (EffetsDraconiques.periple.find(this.casesSpeciales, tmr.coord)) { + await this._conquerir(tmr, { + difficulte: EffetsDraconiques.periple.getDifficulte(tmr), + action: 'Purifier ' + TMRUtility.getTMRDescr(tmr.coord), + onConqueteReussie: r => EffetsDraconiques.periple.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)), + onConqueteEchec: r => { + this.souffleSiEchecTotal(rollData); + this.close() + }, + canClose: false + }); + } } /* -------------------------------------------- */ @@ -576,8 +597,8 @@ export class RdDTMRDialog extends Dialog { await this._conquerir(tmr, { difficulte: -7, action: 'Conquérir', - onConqueteReussie: r => EffetsDraconiques.conquete.onConquete(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)), - onConqueteEchec: r => { }, + onConqueteReussie: r => EffetsDraconiques.conquete.onVisiteSupprimer(r.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)), + onConqueteEchec: r => this.close(), canClose: false }); } @@ -639,8 +660,9 @@ export class RdDTMRDialog extends Dialog { dialog.render(true); } - async validerPelerinage(tmr) { - await EffetsDraconiques.pelerinage.onFinPelerinage(this.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)); + async validerVisite(tmr) { + await EffetsDraconiques.pelerinage.onVisiteSupprimer(this.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)); + await EffetsDraconiques.urgenceDraconique.onVisiteSupprimer(this.actor, tmr, (casetmr) => this.removeToken(tmr, casetmr)); } @@ -649,11 +671,12 @@ export class RdDTMRDialog extends Dialog { let sortReserveList = TMRUtility.getSortReserveList(this.sortsReserves, coord); if (sortReserveList.length > 0) { - if (EffetsDraconiques.isSortImpossible(this.actor)) { + if (EffetsDraconiques.isSortReserveImpossible(this.actor)) { ui.notifications.error("Une queue ou un souffle vous empèche de déclencher de sort!"); return; } - if (EffetsDraconiques.isReserveEnSecurite(this.actor) || this.isReserveExtensible(coord)) { + if (!EffetsDraconiques.isUrgenceDraconique(this.actor) && + (EffetsDraconiques.isReserveEnSecurite(this.actor) || this.isReserveExtensible(coord))) { let msg = "Vous êtes sur une case avec un Sort en Réserve. Grâce à votre Tête Reserve en Sécurité ou Réserve Exensible, vous pouvez contrôler le déclenchement. Cliquez si vous souhaitez le déclencher :
- {{data.blessures.resume}} + {{calc.resumeBlessures}}
- {{#if data.surprise}}{{data.surprise}}! {{/if}} + {{#if calc.surprise}}{{calc.surprise}}! {{/if}} {{#if actor.effects}} {{#each actor.effects as |effect key|}} {{effect.label}} {{/each}} - {{#if data.isGM}} + {{#if options.isGM}} (enlever tout) {{/if}} {{else}} @@ -67,7 +68,7 @@ {{/each}}
  • Total Caractéristiques - {{data.caracSum}} + {{calc.caracTotal}}
  • @@ -199,9 +200,9 @@ {{!-- Equipment Tab --}}
    - Encombrement total/max : {{numberFormat data.encTotal decimals=1}} / {{data.attributs.encombrement.value}} {{data.surEncombrementMessage}} - + Encombrement total/max : {{numberFormat calc.encTotal decimals=1}} / {{data.attributs.encombrement.value}} {{armes}} - Créer un objet - {{#if data.isGM}} + {{#if options.isGM}} - Vider tout les conteneurs {{/if}}
    - {{data.blessures.resume}} + {{calc.resumeBlessures}}
    @@ -52,7 +53,7 @@ {{/each}}
  • Total Caractéristiques - {{data.caracSum}} + {{calc.caracTotal}}
  • @@ -185,7 +186,7 @@ {{!-- Equipment Tab --}}
    - Encombrement total/max : {{numberFormat data.encTotal decimals=1}} / {{data.attributs.encombrement.value}} + Encombrement total/max : {{numberFormat calc.encTotal decimals=1}} / {{data.attributs.encombrement.value}}
    1. Nom diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 80f64dea..bb5e1bef 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -1,4 +1,4 @@ -{{log "handlebar actor-sheet" this}} +{{log "handlebar" this}} {{!-- Sheet Header --}} @@ -14,8 +14,8 @@
    2. @@ -23,33 +23,33 @@
    3. @@ -65,24 +65,25 @@ Regarder les Terres Médianes
    - Malus de fatigue : {{data.fatigue.malus}} - {{{data.fatigue.html}}} + Malus de fatigue : {{calc.fatigue.malus}} + {{{calc.fatigue.html}}} - {{data.blessures.resume}} + {{calc.blessures.resume}}
    - {{data.compteurs.etat.label}}: {{data.compteurs.etat.value}} - {{data.compteurs.surenc.label}}: {{data.compteurs.surenc.value}} + {{data.data.compteurs.etat.label}}: {{data.data.compteurs.etat.value}} + {{data.data.compteurs.surenc.label}}: {{data.data.compteurs.surenc.value}}
    - {{#if data.surprise}}{{data.surprise}}! {{/if}} + {{#if calc.surprise}}{{calc.surprise}}! {{/if}} {{#if actor.effects}} {{#each actor.effects as |effect key|}} - - {{effect.label}} + {{log "handlebar effect" effect}} + + {{effect.data.label}} {{/each}} - {{#if data.isGM}} + {{#if options.isGM}} (enlever tout) {{/if}} {{else}} @@ -113,10 +114,10 @@
    blocker/débloquer{{#if data.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}} + src="systems/foundryvtt-reve-de-dragon/icons/{{#if @root.options.editCaracComp}}unlocked.svg{{else}}locked.svg{{/if}}" alt="blocker/débloquer" + >{{#if @root.options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}}
      - {{#each data.carac as |carac key|}} + {{#each data.data.carac as |carac key|}} {{#if carac.isLevelUp}}
    • {{else}} @@ -124,12 +125,12 @@ {{/if}} {{#if carac.isTaille}} {{carac.label}} - +
    • {{/each}}
    • Total Caractéristiques - {{data.caracSum}} + {{calc.caracTotal}}
    • - Beauté : - + Beauté : +
    • {{#each data.attributs as |attr key|}}
    • - {{attr.label}} : + {{attr.label}} : {{#if (eq key 'protection')}} {{else}} @@ -175,10 +176,10 @@
      • Chance actuelle - + Utiliser
      • - {{#each data.compteurs as |compteur key|}} + {{#each data.data.compteurs as |compteur key|}} {{#if compteur.isChance}} {{else if compteur.isInput}}
      • @@ -218,14 +219,14 @@
        blocker/débloquer{{#if data.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}} + src="systems/foundryvtt-reve-de-dragon/icons/{{#if @root.options.editCaracComp}}unlocked.svg{{else}}locked.svg{{/if}}" alt="blocker/débloquer" + >{{#if @root.options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}} filter/montrer tout{{#if data.showCompNiveauBase}}Montrer tout{{else}}Filtrer{{/if}} + src="systems/foundryvtt-reve-de-dragon/icons/{{#if @root.options.showCompNiveauBase}}no-filter.svg{{else}}filter.svg{{/if}}" alt="filter/montrer tout" + >{{#if @root.options.showCompNiveauBase}}Montrer tout{{else}}Filtrer{{/if}} filter/montrer l'archétype{{#if data.montrerArchetype}}Masquer l'archétype{{else}}Voir l'archétype{{/if}} + src="systems/foundryvtt-reve-de-dragon/icons/{{#if @root.options.montrerArchetype}}no-filter.svg{{else}}filter.svg{{/if}}" alt="filter/montrer l'archétype" + >{{#if @root.options.montrerArchetype}}Masquer l'archétype{{else}}Voir l'archétype{{/if}}
        @@ -233,8 +234,8 @@ Compétences de base
          - {{#each data.competenceByCategory.generale as |comp key|}} - {{#if data.showCompetence}} + {{#each competenceByCategory.generale as |comp key|}} + {{#if visible}} {{#if comp.data.isLevelUp}}
        • {{else}} @@ -250,14 +251,14 @@ {{else}} {{comp.name}} {{/if}} - - + +
          - {{#if ../data.montrerArchetype}} - + {{#if @root.options.montrerArchetype}} + {{/if}}
        • {{/if}} @@ -268,8 +269,8 @@ Compétences Particulières
            - {{#each data.competenceByCategory.particuliere as |comp key|}} - {{#if data.showCompetence}} + {{#each competenceByCategory.particuliere as |comp key|}} + {{#if visible}} {{#if comp.data.isLevelUp}}
          • {{else}} @@ -285,14 +286,14 @@ {{else}} {{comp.name}} {{/if}} - - + +
            - {{#if ../data.montrerArchetype}} - + {{#if @root.options.montrerArchetype}} + {{/if}}
          • {{/if}} @@ -302,8 +303,8 @@ Compétences Spécialisées
              - {{#each data.competenceByCategory.specialisee as |comp key|}} - {{#if data.showCompetence}} + {{#each competenceByCategory.specialisee as |comp key|}} + {{#if visible}} {{#if comp.data.isLevelUp}}
            • {{else}} @@ -319,14 +320,14 @@ {{else}} {{comp.name}} {{/if}} - - + +
              - {{#if ../data.montrerArchetype}} - + {{#if @root.options.montrerArchetype}} + {{/if}}
            • {{/if}} @@ -339,8 +340,8 @@ Compétences de Mêlée
                - {{#each data.competenceByCategory.melee as |comp key|}} - {{#if data.showCompetence}} + {{#each competenceByCategory.melee as |comp key|}} + {{#if visible}} {{#if comp.data.isLevelUp}}
              • {{else}} @@ -356,14 +357,14 @@ {{else}} {{comp.name}} {{/if}} - - + +
                - {{#if ../data.montrerArchetype}} - + {{#if @root.options.montrerArchetype}} + {{/if}}
              • {{/if}} @@ -374,8 +375,8 @@ Compétences de Tir
                  - {{#each data.competenceByCategory.tir as |comp key|}} - {{#if data.showCompetence}} + {{#each competenceByCategory.tir as |comp key|}} + {{#if visible}} {{#if comp.data.isLevelUp}}
                • {{else}} @@ -391,14 +392,14 @@ {{else}} {{comp.name}} {{/if}} - - + +
                  - {{#if ../data.montrerArchetype}} - + {{#if @root.options.montrerArchetype}} + {{/if}}
                • {{/if}} @@ -409,8 +410,8 @@ Compétences de Lancer
                    - {{#each data.competenceByCategory.lancer as |comp key|}} - {{#if data.showCompetence}} + {{#each competenceByCategory.lancer as |comp key|}} + {{#if visible}} {{#if comp.data.isLevelUp}}
                  • {{else}} @@ -426,14 +427,14 @@ {{else}} {{comp.name}} {{/if}} - - + +
                    - {{#if ../data.montrerArchetype}} - + {{#if @root.options.montrerArchetype}} + {{/if}}
                  • {{/if}} @@ -444,8 +445,8 @@ Connaissances
                      - {{#each data.competenceByCategory.connaissance as |comp key|}} - {{#if data.showCompetence}} + {{#each competenceByCategory.connaissance as |comp key|}} + {{#if visible}} {{#if comp.data.isLevelUp}}
                    • {{else}} @@ -461,14 +462,14 @@ {{else}} {{comp.name}} {{/if}} - - + +
                      - {{#if ../data.montrerArchetype}} - + {{#if @root.options.montrerArchetype}} + {{/if}}
                    • {{/if}} @@ -479,8 +480,8 @@ Draconic
                        - {{#each data.competenceByCategory.draconic as |comp key|}} - {{#if data.showCompetence}} + {{#each competenceByCategory.draconic as |comp key|}} + {{#if visible}} {{#if comp.data.isLevelUp}}
                      • {{else}} @@ -496,15 +497,15 @@ {{else}} {{comp.name}} {{/if}} - - - + + +
                        - {{#if ../data.montrerArchetype}} - + {{#if @root.options.montrerArchetype}} + {{/if}}
                      • {{/if}} @@ -514,10 +515,10 @@
                        • Total XP compétences - {{data.competenceXPTotal}} + {{calc.competenceXPTotal}}
                        • - {{#if data.montrerArchetype}} - {{#each data.comptageArchetype as |archetype key|}} + {{#if @root.options.montrerArchetype}} + {{#each calc.comptageArchetype as |archetype key|}}
                        • @@ -534,27 +535,27 @@

                          Armes et Défenses:

                          • - Armes - Initiative - Comp. - Niveau - +dom + Armes + Initiative + Comp. + Niveau + +dom
                          • - {{#each data.combat as |arme key|}} + {{#each armes as |arme key|}}
                          • {{arme.name}} {{arme.data.initiative}} - {{arme.data.competence}} - {{numberFormat arme.data.niveau decimals=0 sign=true}} - {{numberFormat arme.data.dommages decimals=0 sign=true}} + {{arme.data.competence}} + {{numberFormat arme.data.niveau decimals=0 sign=true}} + {{numberFormat arme.data.dommages decimals=0 sign=true}}
                          • {{/each}}
                          • {{esquive.name}} - - {{numberFormat esquive.niveau decimals=0 sign=true}} - + + {{numberFormat esquive.niveau decimals=0 sign=true}} +

                          @@ -748,32 +749,32 @@

                          Haut rêve:

                          • - Position en TMR : + Position en TMR : - {{#if data.isGM}} - + {{#if options.isGM}} + {{else}} - {{data.reve.tmrpos.coord}} + {{data.data.reve.tmrpos.coord}} {{/if}}
                          • - Seuil de Rêve : + Seuil de Rêve : - {{#if data.isGM}} - + {{#if options.isGM}} + {{else}} - {{data.reve.seuil.value}} + {{data.data.reve.seuil.value}} {{/if}}
                          • - Refoulement : + Refoulement : - {{#if data.isGM}} - + {{#if options.isGM}} + {{else}} - {{data.reve.refoulement.value}} + {{data.data.reve.refoulement.value}} {{/if}}
                          • @@ -801,7 +802,7 @@

                            Sorts en Réserve:

                              - {{#each data.sortReserve as |reserve key|}} + {{#each tmr.sortsReserve as |reserve key|}}
                            • {{reserve.sort.name}} - {{reserve.coord}}
                            • @@ -827,7 +828,7 @@

                              Cases Spéciales:

                                - {{#each data.caseSpeciales as |casetmr key|}} + {{#each tmr.caseSpeciales as |casetmr key|}}
                              • {{casetmr.name}}
                                @@ -841,7 +842,7 @@

                                Rencontres présentes:

                                  - {{#each data.rencontres as |rencontre key|}} + {{#each tmr.rencontres as |rencontre key|}}
                                • {{rencontre.rencontre.name}} - {{rencontre.coord}} ({{rencontre.rencontre.date}} - {{rencontre.rencontre.heure}})
                                  @@ -921,22 +922,22 @@

                                  Equipement porté

                                  - Encombrement total/max : {{numberFormat data.encTotal decimals=1}} / {{data.attributs.encombrement.value}} {{data.surEncombrementMessage}} - - Estimation de l'équipement : {{numberFormat data.prixTotalEquipement decimals=2}} Sols + Encombrement total/max : {{numberFormat calc.encTotal decimals=1}} / {{data.data.attributs.encombrement.value}} {{calc.surEncombrementMessage}} - + Estimation de l'équipement : {{numberFormat calc.prixTotalEquipement decimals=2}} Sols
                                  Créer un objet - {{#if data.isGM}} + {{#if options.isGM}} - Vider tout les conteneurs {{/if}}
                                  • - Nom - Q. - Enc. - Equiper/Editer/Suppr. + Nom + Q. + Enc. + Equiper/Editer/Suppr.
                                  • {{#each data.objets as |item id|}} {{#unless item.estContenu}} @@ -962,7 +963,7 @@

                                    Montures

                                      - {{#each data.monturesList as |monture id|}} + {{#each subacteurs.montures as |monture id|}}
                                    • {{monture.name}} @@ -975,7 +976,7 @@

                                      Véhicules

                                        - {{#each data.vehiculesList as |vehicule id|}} + {{#each subacteurs.vehicules as |vehicule id|}}
                                      • {{vehicule.name}} @@ -990,7 +991,7 @@

                                        Suivants

                                          - {{#each data.suivantsList as |suivant id|}} + {{#each subacteurs.suivants as |suivant id|}}
                                        • {{suivant.name}} @@ -1008,40 +1009,40 @@
                                          • -
                                          • -
                                          • -
                                          • -
                                          • -
                                          • -
                                          • -
                                          • -
                                          • -
                                          diff --git a/templates/actor-vehicule-sheet.html b/templates/actor-vehicule-sheet.html index 4b7bfcde..703a9a8c 100644 --- a/templates/actor-vehicule-sheet.html +++ b/templates/actor-vehicule-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{!-- Sheet Header --}} @@ -68,9 +69,9 @@ {{!-- Equipment Tab --}}
                                          - Encombrement total/max : {{numberFormat data.encTotal decimals=1}} / {{data.capacite_encombrement}} {{data.surEncombrementMessage}} - + Encombrement total/max : {{numberFormat calc.encTotal decimals=1}} / {{data.capacite_encombrement}} {{calc.surEncombrementMessage}} - Créer un objet - {{#if data.isGM}} + {{#if options.isGM}} - Vider tout les conteneurs {{/if}}
                                            diff --git a/templates/calendar-astrologie-template.html b/templates/calendar-astrologie-template.html index aa554949..b893b1d7 100644 --- a/templates/calendar-astrologie-template.html +++ b/templates/calendar-astrologie-template.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                            diff --git a/templates/calendar-editor-template.html b/templates/calendar-editor-template.html index e28f019a..da18b215 100644 --- a/templates/calendar-editor-template.html +++ b/templates/calendar-editor-template.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                            diff --git a/templates/calendar-template.html b/templates/calendar-template.html index e1d65073..2b19111e 100644 --- a/templates/calendar-template.html +++ b/templates/calendar-template.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                            {{#if isGM}} diff --git a/templates/casetmr-specific-list.html b/templates/casetmr-specific-list.html index ccedfd1f..136f1f6d 100644 --- a/templates/casetmr-specific-list.html +++ b/templates/casetmr-specific-list.html @@ -1,12 +1,13 @@ + + + + + + + + + + - - - - - - - - - - + diff --git a/templates/chat-actor-competence-xp.html b/templates/chat-actor-competence-xp.html index c14373f1..5b750829 100644 --- a/templates/chat-actor-competence-xp.html +++ b/templates/chat-actor-competence-xp.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                            {{alias}} peut progresser dans sa compétence {{competence}} !

                                            Son niveau en {{competence}} peut évoluer à {{niveau}} pour un archétype de {{archetype}} !
                                            Son experience dans cette compétence est de {{xp}}.
                                            diff --git a/templates/chat-actor-turn-summary.html b/templates/chat-actor-turn-summary.html index f0f89a1e..202c75d7 100644 --- a/templates/chat-actor-turn-summary.html +++ b/templates/chat-actor-turn-summary.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                            C'est au tour de {{alias}} !

                                            {{blessuresStatus}}
                                            Son état général est de : {{etatGeneral}} {{#if isSonne}} et est sonné{{/if}}
                                            diff --git a/templates/chat-demande-attaque-etotal.html b/templates/chat-demande-attaque-etotal.html index 77ef3a99..7eb475b8 100644 --- a/templates/chat-demande-attaque-etotal.html +++ b/templates/chat-demande-attaque-etotal.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                            Echec total en attaque


                                            diff --git a/templates/chat-demande-attaque-particuliere.html b/templates/chat-demande-attaque-particuliere.html index e6a32ad8..44cb0b19 100644 --- a/templates/chat-demande-attaque-particuliere.html +++ b/templates/chat-demande-attaque-particuliere.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                            {{alias}} réussit une attaque particulière!


                                            diff --git a/templates/chat-demande-defense.html b/templates/chat-demande-defense.html index c9d2fe76..4193a61e 100644 --- a/templates/chat-demande-defense.html +++ b/templates/chat-demande-defense.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                            {{#if (eq surprise 'totale')}} {{defender.name}} est totalement surpris diff --git a/templates/chat-info-appel-au-moral.html b/templates/chat-info-appel-au-moral.html index 6ceef396..e58a9b0a 100644 --- a/templates/chat-info-appel-au-moral.html +++ b/templates/chat-info-appel-au-moral.html @@ -1,4 +1,4 @@ {{#if use.appelAuMoral}}
                                            - {{alias}} fait appel {{#if (gt moral 0)}}au moral{{else}}à l'énergie du déspoir{{/if}} {{#if moralDiminuer}}et échoue, diminuant son moral.{{else}} et réussit.{{/if}} + {{alias}} utilise {{#if (gt moral 0)}}le moral{{else}} l'énergie du déspoir{{/if}} et {{#if moralDiminuer}}échoue, diminuant son moral.{{else}}réussit.{{/if}} {{^jetEchouerMoralDiminuer}} Son moral reste inchangé à {{moral}}.{{/jetEchouerMoralDiminuer}}
                                            {{/if}} diff --git a/templates/chat-infojet.html b/templates/chat-infojet.html index 957ec522..093eaec7 100644 --- a/templates/chat-infojet.html +++ b/templates/chat-infojet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                            {{rolled.caracValue}} à {{numberFormat rolled.finalLevel decimals=0 sign=true}} diff --git a/templates/chat-initiative-premier-round.html b/templates/chat-initiative-premier-round.html index 291563f8..5aac3c6b 100644 --- a/templates/chat-initiative-premier-round.html +++ b/templates/chat-initiative-premier-round.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                            L'initiative de {{alias}} a été modifiée !


                                            diff --git a/templates/chat-poesie.html b/templates/chat-poesie.html index dd1c9308..cbde58ea 100644 --- a/templates/chat-poesie.html +++ b/templates/chat-poesie.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{#if description}}
                                            diff --git a/templates/chat-rencontre-tmr.html b/templates/chat-rencontre-tmr.html index 4d49510d..ecf43016 100644 --- a/templates/chat-rencontre-tmr.html +++ b/templates/chat-rencontre-tmr.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{competence.name}}

                                            {{alias}} rencontre {{#if (eq genre 'f')}}une{{else}}un{{/if}} {{rencontre.name}} de force {{rencontre.force}} diff --git a/templates/chat-resultat-accorder-cauchemar.html b/templates/chat-resultat-accorder-cauchemar.html index 0cb65da3..b6f41b5a 100644 --- a/templates/chat-resultat-accorder-cauchemar.html +++ b/templates/chat-resultat-accorder-cauchemar.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                            {{alias}} s'accorde: {{entite}}

                                            diff --git a/templates/chat-resultat-alchimie.html b/templates/chat-resultat-alchimie.html index 38273c82..1485c5f6 100644 --- a/templates/chat-resultat-alchimie.html +++ b/templates/chat-resultat-alchimie.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} préparation alchimique

                                            {{alias}} essaye de réaliser sa recette Alchimique : {{recette.name}} diff --git a/templates/chat-resultat-appelchance.html b/templates/chat-resultat-appelchance.html index c022da52..59d6ab6d 100644 --- a/templates/chat-resultat-appelchance.html +++ b/templates/chat-resultat-appelchance.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                            {{alias}} fait appel à la chance

                                            diff --git a/templates/chat-resultat-attaque.html b/templates/chat-resultat-attaque.html index 3f3ed617..ab60c410 100644 --- a/templates/chat-resultat-attaque.html +++ b/templates/chat-resultat-attaque.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{competence.name}}

                                            {{alias}} attaque à {{diffLibre}}: {{arme.name}}

                                            {{selectedCarac.label}}{{#unless (eq selectedCarac.label competence.name)}} / {{competence.name}}{{/unless}}
                                            diff --git a/templates/chat-resultat-chant.html b/templates/chat-resultat-chant.html index 6af6e9d6..f40d972f 100644 --- a/templates/chat-resultat-chant.html +++ b/templates/chat-resultat-chant.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{oeuvre.data.competence}}

                                            {{alias}} tente de chanter la chanson : {{oeuvre.name}} (niveau {{oeuvre.data.niveau}}) diff --git a/templates/chat-resultat-competence.html b/templates/chat-resultat-competence.html index 8a46b0a8..b9d23e4b 100644 --- a/templates/chat-resultat-competence.html +++ b/templates/chat-resultat-competence.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{competence.name}}

                                            {{alias}} {{show.title}}: diff --git a/templates/chat-resultat-danse.html b/templates/chat-resultat-danse.html index 9d12528b..56df83f1 100644 --- a/templates/chat-resultat-danse.html +++ b/templates/chat-resultat-danse.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{oeuvre.data.competence}}

                                            {{alias}} tente de danser : {{oeuvre.name}} (niveau {{oeuvre.data.niveau}}) diff --git a/templates/chat-resultat-encaissement.html b/templates/chat-resultat-encaissement.html index 86fa9811..c9f07305 100644 --- a/templates/chat-resultat-encaissement.html +++ b/templates/chat-resultat-encaissement.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{#if isGM}} {{#if (gt endurance 0)}} diff --git a/templates/chat-resultat-esquive.html b/templates/chat-resultat-esquive.html index e6aab0f0..1f49291e 100644 --- a/templates/chat-resultat-esquive.html +++ b/templates/chat-resultat-esquive.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{competence.name}}

                                            {{alias}} esquive une attaque à {{diffLibre}}

                                            {{selectedCarac.label}}{{#unless (eq selectedCarac.label competence.name)}} / {{competence.name}}{{/unless}}
                                            diff --git a/templates/chat-resultat-ethylisme.html b/templates/chat-resultat-ethylisme.html index c6c374eb..a1bc83df 100644 --- a/templates/chat-resultat-ethylisme.html +++ b/templates/chat-resultat-ethylisme.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                            {{alias}} {{#if isSortReserve}}met en réserve{{else}}lance{{/if}} le {{#if selectedSort.data.isrituel}}rituel{{else}}sort{{/if}} diff --git a/templates/chat-resultat-general.html b/templates/chat-resultat-general.html index 2bc62cb6..087e22f7 100644 --- a/templates/chat-resultat-general.html +++ b/templates/chat-resultat-general.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{#if competence.img}} {{competence.name}} {{/if}} diff --git a/templates/chat-resultat-jeu.html b/templates/chat-resultat-jeu.html index 6b8c01f3..0445c1dd 100644 --- a/templates/chat-resultat-jeu.html +++ b/templates/chat-resultat-jeu.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{oeuvre.data.competence}}

                                            {{alias}} joue à : {{oeuvre.name}} diff --git a/templates/chat-resultat-maitrise-tmr.html b/templates/chat-resultat-maitrise-tmr.html index e5f4fa6f..efe33817 100644 --- a/templates/chat-resultat-maitrise-tmr.html +++ b/templates/chat-resultat-maitrise-tmr.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{competence.name}}

                                            {{alias}} tente de {{maitrise.verbe}} {{le tmr.genre}} {{tmr.label}} ({{tmr.coord}}) diff --git a/templates/chat-resultat-meditation.html b/templates/chat-resultat-meditation.html index 91f096fb..0515e381 100644 --- a/templates/chat-resultat-meditation.html +++ b/templates/chat-resultat-meditation.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{competence.name}}

                                            {{alias}} a médité : {{meditation.name}} diff --git a/templates/chat-resultat-musique.html b/templates/chat-resultat-musique.html index 0b0a6d0b..17b62d63 100644 --- a/templates/chat-resultat-musique.html +++ b/templates/chat-resultat-musique.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{oeuvre.data.competence}}

                                            {{alias}} tente de jouer le morceau : {{oeuvre.name}} (niveau {{oeuvre.data.niveau}}) diff --git a/templates/chat-resultat-oeuvre.html b/templates/chat-resultat-oeuvre.html index d7e349e5..11145969 100644 --- a/templates/chat-resultat-oeuvre.html +++ b/templates/chat-resultat-oeuvre.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                            {{oeuvre.data.competence}} {{alias}} tente d'interpréter {{oeuvre.name}} (niveau {{oeuvre.data.niveau}}) diff --git a/templates/chat-resultat-parade.html b/templates/chat-resultat-parade.html index e6638f0e..f2d4ec7b 100644 --- a/templates/chat-resultat-parade.html +++ b/templates/chat-resultat-parade.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{competence.name}}

                                            {{alias}} pare une attaque à {{diffLibre}} - {{arme.name}}

                                            {{selectedCarac.label}}{{#unless (eq selectedCarac.label competence.name)}} / {{competence.name}}{{/unless}}
                                            diff --git a/templates/chat-resultat-recettecuisine.html b/templates/chat-resultat-recettecuisine.html index 5eb098fd..28628c1f 100644 --- a/templates/chat-resultat-recettecuisine.html +++ b/templates/chat-resultat-recettecuisine.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{oeuvre.data.competence}}

                                            {{alias}} tente de cuisiner la recette : {{oeuvre.name}} (niveau {{oeuvre.data.niveau}}) diff --git a/templates/chat-resultat-reve-de-dragon.html b/templates/chat-resultat-reve-de-dragon.html index f1aa7992..4f8e2a2f 100644 --- a/templates/chat-resultat-reve-de-dragon.html +++ b/templates/chat-resultat-reve-de-dragon.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} Rêve de Dragon

                                            {{alias}} tente de maîtriser un Rêve de Dragon! diff --git a/templates/chat-resultat-sort.html b/templates/chat-resultat-sort.html index b17920a9..0ae4e437 100644 --- a/templates/chat-resultat-sort.html +++ b/templates/chat-resultat-sort.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{competence.name}}

                                            {{alias}} {{#if isSortReserve}}met en réserve{{else}}lance{{/if}} diff --git a/templates/chat-resultat-tache.html b/templates/chat-resultat-tache.html index b9792039..3fdb76a9 100644 --- a/templates/chat-resultat-tache.html +++ b/templates/chat-resultat-tache.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{competence.name}}

                                            {{alias}} travaille à sa tâche {{tache.name}} diff --git a/templates/chat-resultat-transformer-stress.html b/templates/chat-resultat-transformer-stress.html index 0bef2112..0cd037fa 100644 --- a/templates/chat-resultat-transformer-stress.html +++ b/templates/chat-resultat-transformer-stress.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                            {{alias}} transforme {{rolled.factor}}% de son stress

                                            diff --git a/templates/dialog-astrologie-joueur.html b/templates/dialog-astrologie-joueur.html index 67eb084b..f2f629be 100644 --- a/templates/dialog-astrologie-joueur.html +++ b/templates/dialog-astrologie-joueur.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                            diff --git a/templates/dialog-competence.html b/templates/dialog-competence.html index a099493b..a9f97692 100644 --- a/templates/dialog-competence.html +++ b/templates/dialog-competence.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                            diff --git a/templates/dialog-roll-ajustements.html b/templates/dialog-roll-ajustements.html index b249f046..cc390f03 100644 --- a/templates/dialog-roll-ajustements.html +++ b/templates/dialog-roll-ajustements.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                            Ajustement Final: diff --git a/templates/dialog-roll-alchimie.html b/templates/dialog-roll-alchimie.html index 87323064..c4f301f4 100644 --- a/templates/dialog-roll-alchimie.html +++ b/templates/dialog-roll-alchimie.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                              diff --git a/templates/dialog-roll-carac.html b/templates/dialog-roll-carac.html index 95fac6ab..b3b7c0c2 100644 --- a/templates/dialog-roll-carac.html +++ b/templates/dialog-roll-carac.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                              diff --git a/templates/dialog-roll-chant.html b/templates/dialog-roll-chant.html index 6fa436b5..c8474a6d 100644 --- a/templates/dialog-roll-chant.html +++ b/templates/dialog-roll-chant.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                diff --git a/templates/dialog-roll-danse.html b/templates/dialog-roll-danse.html index 55e44775..04469162 100644 --- a/templates/dialog-roll-danse.html +++ b/templates/dialog-roll-danse.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                  diff --git a/templates/dialog-roll-encaisser.html b/templates/dialog-roll-encaisser.html index 73244852..b99d72fc 100644 --- a/templates/dialog-roll-encaisser.html +++ b/templates/dialog-roll-encaisser.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                                  diff --git a/templates/dialog-roll-ethylisme.html b/templates/dialog-roll-ethylisme.html index 2a74d639..c3bb618b 100644 --- a/templates/dialog-roll-ethylisme.html +++ b/templates/dialog-roll-ethylisme.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                  diff --git a/templates/dialog-roll-jeu.html b/templates/dialog-roll-jeu.html index 0ccf3b77..a33a8b33 100644 --- a/templates/dialog-roll-jeu.html +++ b/templates/dialog-roll-jeu.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                    diff --git a/templates/dialog-roll-maitrise-tmr.html b/templates/dialog-roll-maitrise-tmr.html index 314668dc..cbf4a832 100644 --- a/templates/dialog-roll-maitrise-tmr.html +++ b/templates/dialog-roll-maitrise-tmr.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                    diff --git a/templates/dialog-roll-meditation.html b/templates/dialog-roll-meditation.html index 85d089a6..5a6fd583 100644 --- a/templates/dialog-roll-meditation.html +++ b/templates/dialog-roll-meditation.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                      diff --git a/templates/dialog-roll-musique.html b/templates/dialog-roll-musique.html index faa65989..50a8759f 100644 --- a/templates/dialog-roll-musique.html +++ b/templates/dialog-roll-musique.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                        diff --git a/templates/dialog-roll-oeuvre.html b/templates/dialog-roll-oeuvre.html index f6dc0d41..03a7f14c 100644 --- a/templates/dialog-roll-oeuvre.html +++ b/templates/dialog-roll-oeuvre.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          diff --git a/templates/dialog-roll-recettecuisine.html b/templates/dialog-roll-recettecuisine.html index ef52543e..551a794e 100644 --- a/templates/dialog-roll-recettecuisine.html +++ b/templates/dialog-roll-recettecuisine.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          diff --git a/templates/dialog-roll-resolution.html b/templates/dialog-roll-resolution.html index a7df5ca6..0f0fc73d 100644 --- a/templates/dialog-roll-resolution.html +++ b/templates/dialog-roll-resolution.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          diff --git a/templates/dialog-roll-reve-de-dragon.html b/templates/dialog-roll-reve-de-dragon.html index 6b584c51..26e7e36b 100644 --- a/templates/dialog-roll-reve-de-dragon.html +++ b/templates/dialog-roll-reve-de-dragon.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                                          Rêve de Dragon de force {{rencontre.force}}!

                                                          diff --git a/templates/dialog-roll-sort.html b/templates/dialog-roll-sort.html index c32366ef..5ca2102c 100644 --- a/templates/dialog-roll-sort.html +++ b/templates/dialog-roll-sort.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          diff --git a/templates/dialog-roll-surenc.html b/templates/dialog-roll-surenc.html index ae07c1bf..3d3d9aa6 100644 --- a/templates/dialog-roll-surenc.html +++ b/templates/dialog-roll-surenc.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}} {{#if surencMalusFlag}}
                                                          diff --git a/templates/dialog-tmr.html b/templates/dialog-tmr.html index a266ccfa..a1b3a89f 100644 --- a/templates/dialog-tmr.html +++ b/templates/dialog-tmr.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                                          diff --git a/templates/editor-notes-mj.html b/templates/editor-notes-mj.html index 54566eb1..54cfebb9 100644 --- a/templates/editor-notes-mj.html +++ b/templates/editor-notes-mj.html @@ -1,4 +1,4 @@ -{{#if data.isGM}} +{{#if options.isGM}}

                                                          Notes du MJ :

                                                          {{editor content=data.notesmj target="data.notesmj" button=true owner=owner editable=editable}} diff --git a/templates/hud-actor-attaque.html b/templates/hud-actor-attaque.html index 9d3a7926..50d895d8 100644 --- a/templates/hud-actor-attaque.html +++ b/templates/hud-actor-attaque.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          diff --git a/templates/hud-actor-init.html b/templates/hud-actor-init.html index 9865510a..f2fb1e01 100644 --- a/templates/hud-actor-init.html +++ b/templates/hud-actor-init.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          diff --git a/templates/item-arme-sheet.html b/templates/item-arme-sheet.html index 3d5f9a69..b2046a19 100644 --- a/templates/item-arme-sheet.html +++ b/templates/item-arme-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -11,83 +12,83 @@
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          @@ -95,7 +96,7 @@
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-armure-sheet.html b/templates/item-armure-sheet.html index e2bcb8af..b648e158 100644 --- a/templates/item-armure-sheet.html +++ b/templates/item-armure-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,28 +11,28 @@
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-casetmr-sheet.html b/templates/item-casetmr-sheet.html index c6fc3ea9..d83349fd 100644 --- a/templates/item-casetmr-sheet.html +++ b/templates/item-casetmr-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,12 +11,12 @@
                                                          - +
                                                          @@ -23,7 +24,7 @@
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-chant-sheet.html b/templates/item-chant-sheet.html index 1d9af9ff..3d97461c 100644 --- a/templates/item-chant-sheet.html +++ b/templates/item-chant-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,16 +11,16 @@
                                                          - +
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-competence-sheet.html b/templates/item-competence-sheet.html index 17fefbb0..fdedcc11 100644 --- a/templates/item-competence-sheet.html +++ b/templates/item-competence-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -17,23 +18,23 @@
                                                          - +
                                                          - +
                                                          @@ -41,29 +42,29 @@
                                                          - +
                                                          - {{#if (eq data.categorie 'draconic')}} + {{#if (eq data.data.categorie 'draconic')}}
                                                          - +
                                                          {{/if}}
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-competencecreature-sheet.html b/templates/item-competencecreature-sheet.html index 11760d4f..c14a9fd7 100644 --- a/templates/item-competencecreature-sheet.html +++ b/templates/item-competencecreature-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,39 +11,39 @@
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-conteneur-sheet.html b/templates/item-conteneur-sheet.html index 6f291219..48017308 100644 --- a/templates/item-conteneur-sheet.html +++ b/templates/item-conteneur-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,24 +11,24 @@
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-danse-sheet.html b/templates/item-danse-sheet.html index ea410cf4..a454d82f 100644 --- a/templates/item-danse-sheet.html +++ b/templates/item-danse-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -11,7 +12,7 @@
                                                          +
                                                          - +
                                                          - +
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-herbe-sheet.html b/templates/item-herbe-sheet.html index baec3279..b8d6fba8 100644 --- a/templates/item-herbe-sheet.html +++ b/templates/item-herbe-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -11,24 +12,24 @@
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          @@ -36,7 +37,7 @@
                                                          @@ -44,7 +45,7 @@
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-ingredient-sheet.html b/templates/item-ingredient-sheet.html index 96d9e54b..bdf8235d 100644 --- a/templates/item-ingredient-sheet.html +++ b/templates/item-ingredient-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -11,29 +12,29 @@
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          @@ -41,7 +42,7 @@
                                                          @@ -49,7 +50,7 @@
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-jeu-sheet.html b/templates/item-jeu-sheet.html index 11649435..9b4a8409 100644 --- a/templates/item-jeu-sheet.html +++ b/templates/item-jeu-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -11,7 +12,7 @@
                                                          +
                                                          - +
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-livre-sheet.html b/templates/item-livre-sheet.html index 88d60e54..cb2936d4 100644 --- a/templates/item-livre-sheet.html +++ b/templates/item-livre-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,12 +11,12 @@
                                                          - +
                                                          +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          {{#if isOwned}}
                                                          @@ -62,7 +63,7 @@
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-maladie-sheet.html b/templates/item-maladie-sheet.html index 8c2601d9..8c48adbd 100644 --- a/templates/item-maladie-sheet.html +++ b/templates/item-maladie-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,24 +11,24 @@
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-meditation-sheet.html b/templates/item-meditation-sheet.html index 0b484acb..cf971b7b 100644 --- a/templates/item-meditation-sheet.html +++ b/templates/item-meditation-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -11,7 +12,7 @@
                                                          +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          @@ -58,7 +59,7 @@ {{#if isGM}} {{else}} - + {{/if}}
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-monnaie-sheet.html b/templates/item-monnaie-sheet.html index 3133a691..9a72d4e7 100644 --- a/templates/item-monnaie-sheet.html +++ b/templates/item-monnaie-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,19 +11,19 @@
                                                          - +
                                                          {{#if isGM}} - + {{else}} {{/if}}
                                                          - +
                                                          diff --git a/templates/item-munition-sheet.html b/templates/item-munition-sheet.html index eed1dc1d..c165a038 100644 --- a/templates/item-munition-sheet.html +++ b/templates/item-munition-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,24 +11,24 @@
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-musique-sheet.html b/templates/item-musique-sheet.html index 1d9af9ff..3d97461c 100644 --- a/templates/item-musique-sheet.html +++ b/templates/item-musique-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,16 +11,16 @@
                                                          - +
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-objet-sheet.html b/templates/item-objet-sheet.html index 89a40b0f..4af07c08 100644 --- a/templates/item-objet-sheet.html +++ b/templates/item-objet-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,28 +11,28 @@
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-oeuvre-sheet.html b/templates/item-oeuvre-sheet.html index 82f2c2b0..5e312b31 100644 --- a/templates/item-oeuvre-sheet.html +++ b/templates/item-oeuvre-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -11,7 +12,7 @@
                                                          @@ -19,7 +20,7 @@
                                                          +
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-ombre-sheet.html b/templates/item-ombre-sheet.html index 216e1638..fe9450f5 100644 --- a/templates/item-ombre-sheet.html +++ b/templates/item-ombre-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,11 +11,11 @@
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-poison-sheet.html b/templates/item-poison-sheet.html index 8c2601d9..8c48adbd 100644 --- a/templates/item-poison-sheet.html +++ b/templates/item-poison-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,24 +11,24 @@
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-potion-sheet.html b/templates/item-potion-sheet.html index a78d1e35..6082d104 100644 --- a/templates/item-potion-sheet.html +++ b/templates/item-potion-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,20 +11,20 @@
                                                          - +
                                                          - +
                                                          - +
                                                          @@ -31,7 +32,7 @@
                                                          @@ -39,7 +40,7 @@
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-queue-sheet.html b/templates/item-queue-sheet.html index 4ffbc24c..5f003fa7 100644 --- a/templates/item-queue-sheet.html +++ b/templates/item-queue-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,12 +11,12 @@
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-recettealchimique-sheet.html b/templates/item-recettealchimique-sheet.html index c8211a92..e567126a 100644 --- a/templates/item-recettealchimique-sheet.html +++ b/templates/item-recettealchimique-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,36 +11,36 @@
                                                          - +
                                                          - {{editor content=data.manipulation_update target="data.manipulation" button=true owner=owner editable=editable}} + {{editor content=data.data.manipulation_update target="data.manipulation" button=true owner=owner editable=editable}}
                                                          - {{editor content=data.utilisation target="data.utilisation" button=true owner=owner editable=editable}} + {{editor content=data.data.utilisation target="data.utilisation" button=true owner=owner editable=editable}}
                                                          - {{editor content=data.enchantement target="data.enchantement" button=true owner=owner editable=editable}} + {{editor content=data.data.enchantement target="data.enchantement" button=true owner=owner editable=editable}}
                                                          - {{editor content=data.sureffet target="data.sureffet" button=true owner=owner editable=editable}} + {{editor content=data.data.sureffet target="data.sureffet" button=true owner=owner editable=editable}}
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-recettecuisine-sheet.html b/templates/item-recettecuisine-sheet.html index 2d64730c..4628c3e9 100644 --- a/templates/item-recettecuisine-sheet.html +++ b/templates/item-recettecuisine-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -10,34 +11,34 @@
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - {{editor content=data.ingredients target="data.ingredients" button=true owner=owner editable=editable}} + {{editor content=data.data.ingredients target="data.ingredients" button=true owner=owner editable=editable}}
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-rencontresTMR-sheet.html b/templates/item-rencontresTMR-sheet.html index 3f153150..c3259c82 100644 --- a/templates/item-rencontresTMR-sheet.html +++ b/templates/item-rencontresTMR-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -11,7 +12,7 @@
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-sheet.html b/templates/item-sheet.html deleted file mode 100644 index c8acc8e5..00000000 --- a/templates/item-sheet.html +++ /dev/null @@ -1,64 +0,0 @@ - -
                                                          - -
                                                          -

                                                          -
                                                          - - -
                                                          -
                                                          - - -
                                                          -
                                                          -
                                                          - - {{!-- Sheet Tab Navigation --}} - - - {{!-- Sheet Body --}} -
                                                          - - {{!-- Description Tab --}} -
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} -
                                                          - - {{!-- Attributes Tab --}} -
                                                          -
                                                          - Attribute Key - Value - Label - Data Type - -
                                                          - -
                                                            - {{#each data.attributes as |attr key|}} -
                                                          1. - - {{#if attr.isCheckbox}} - - {{else}} - - {{/if}} - - - -
                                                          2. - {{/each}} -
                                                          -
                                                          -
                                                          - diff --git a/templates/item-sort-sheet.html b/templates/item-sort-sheet.html index a77801a0..03a1a86e 100644 --- a/templates/item-sort-sheet.html +++ b/templates/item-sort-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -11,7 +12,7 @@
                                                          @@ -19,7 +20,7 @@
                                                          +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          {{#if owner}} {{#each bonusCaseList as |bcData key|}} @@ -77,7 +78,7 @@
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-souffle-sheet.html b/templates/item-souffle-sheet.html index 3f153150..c3259c82 100644 --- a/templates/item-souffle-sheet.html +++ b/templates/item-souffle-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -11,7 +12,7 @@
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-tache-sheet.html b/templates/item-tache-sheet.html index 1fccfcdf..782052b0 100644 --- a/templates/item-tache-sheet.html +++ b/templates/item-tache-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -11,7 +12,7 @@
                                                          - {{#select item.data.competence}} + {{#select item.data.data.competence}} {{#each competences as |competence key|}} {{/each}} @@ -30,27 +31,27 @@
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - +
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-tarot-sheet.html b/templates/item-tarot-sheet.html index 752b39ef..8429ec21 100644 --- a/templates/item-tarot-sheet.html +++ b/templates/item-tarot-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -11,12 +12,12 @@
                                                          - +
                                                          @@ -24,7 +25,7 @@
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/item-tete-sheet.html b/templates/item-tete-sheet.html index 3f153150..c3259c82 100644 --- a/templates/item-tete-sheet.html +++ b/templates/item-tete-sheet.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                          @@ -11,7 +12,7 @@
                                                          - {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} + {{editor content=data.data.description target="data.description" button=true owner=owner editable=editable}}
                                                          diff --git a/templates/post-item.html b/templates/post-item.html index 60bccdd1..fcb03ae1 100644 --- a/templates/post-item.html +++ b/templates/post-item.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                                          {{name}}

                                                          {{#if img}} diff --git a/templates/regles-optionelles.html b/templates/regles-optionelles.html index 47e97354..f91585c3 100644 --- a/templates/regles-optionelles.html +++ b/templates/regles-optionelles.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}

                                                          Règles de combat

                                                            diff --git a/templates/status-effects-settings.html b/templates/status-effects-settings.html index a6862f12..40dc7a23 100644 --- a/templates/status-effects-settings.html +++ b/templates/status-effects-settings.html @@ -1,3 +1,4 @@ +{{log "handlebar" this}}
                                                              {{#each effects as |effect key|}}