From 576088c2bbc864e99bb0de19dd4ac06d19372dbc Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Tue, 30 Mar 2021 21:51:53 +0200 Subject: [PATCH 1/8] Fix moral (cas ajustement 0) Lors de Chateau Dormant, si le moral ne change pas, on utilise le retour de moralIncDec pour avoir la valeur courante du moral --- module/actor.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/module/actor.js b/module/actor.js index 6822a9d6..7c907b2a 100644 --- a/module/actor.js +++ b/module/actor.js @@ -1435,22 +1435,21 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ async moralIncDec(ajustementMoral) { - let actorData + let tplData = Misc.templateData(this); if (ajustementMoral != 0) { - actorData = Misc.data(this); - let moral = Misc.toInt(actorData.data.compteurs.moral.value) + ajustementMoral + let moral = Misc.toInt(tplData.compteurs.moral.value) + ajustementMoral if (moral > 3) { // exaltation - const exaltation = Misc.toInt(actorData.data.compteurs.exaltation.value) + moral - 3; + const exaltation = Misc.toInt(tplData.compteurs.exaltation.value) + moral - 3; await this.updateCompteurValue('exaltation', exaltation); } if (moral < -3) { // dissolution - const dissolution = Misc.toInt(actorData.data.compteurs.dissolution.value) + 3 - moral; + const dissolution = Misc.toInt(tplData.compteurs.dissolution.value) + 3 - moral; await this.updateCompteurValue('dissolution', dissolution); } moral = Math.max(-3, Math.min(moral, 3)); await this.updateCompteurValue('moral', moral); } - return actorData.data.compteurs.moral.value; + return tplData.compteurs.moral.value; } /* -------------------------------------------- */ From 2efb942beae0ee6ef77e56fa9d729f190fd6c89a Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Tue, 30 Mar 2021 21:56:18 +0200 Subject: [PATCH 2/8] Fix typo getEmbeddedDocument --- module/actor-entite-sheet.js | 2 +- module/actor-sheet.js | 6 +++--- module/actor-vehicule-sheet.js | 2 +- module/actor.js | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/module/actor-entite-sheet.js b/module/actor-entite-sheet.js index b7a02afd..7b953e00 100644 --- a/module/actor-entite-sheet.js +++ b/module/actor-entite-sheet.js @@ -71,7 +71,7 @@ export class RdDActorEntiteSheet extends ActorSheet { // Update Inventory Item html.find('.item-edit').click(ev => { const li = $(ev.currentTarget).parents(".item"); - const item = this.actor.getEmbeddedDocuments('Item', li.data("itemId")); + const item = this.actor.getEmbeddedDocument('Item', li.data("itemId")); item.sheet.render(true); }); diff --git a/module/actor-sheet.js b/module/actor-sheet.js index 5cd04ee4..76eaf475 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -407,19 +407,19 @@ export class RdDActorSheet extends ActorSheet { // Display info about queue html.find('.queuesouffle-label a').click((event) => { let myID = event.currentTarget.attributes['data-item-id'].value; - const item = this.actor.getEmbeddedDocuments('Item', myID); + const item = this.actor.getEmbeddedDocument('Item', myID); item.sheet.render(true); }); // Info sort html.find('.sort-label a').click((event) => { let myID = event.currentTarget.attributes['data-id'].value; - const item = this.actor.getEmbeddedDocuments('Item', myID); + const item = this.actor.getEmbeddedDocument('Item', myID); item.sheet.render(true); }); // Info sort html.find('.case-label a').click((event) => { let myID = event.currentTarget.attributes['data-id'].value; - const item = this.actor.getEmbeddedDocuments('Item', myID); + const item = this.actor.getEmbeddedDocument('Item', myID); item.sheet.render(true); }); diff --git a/module/actor-vehicule-sheet.js b/module/actor-vehicule-sheet.js index c6c62235..5ef1944c 100644 --- a/module/actor-vehicule-sheet.js +++ b/module/actor-vehicule-sheet.js @@ -87,7 +87,7 @@ export class RdDActorVehiculeSheet extends ActorSheet { // Update Inventory Item html.find('.item-edit').click(ev => { const li = $(ev.currentTarget).parents(".item"); - const item = this.actor.getEmbeddedDocuments('Item', li.data("itemId")); + const item = this.actor.getEmbeddedDocument('Item', li.data("itemId")); item.sheet.render(true); }); // Delete Inventory Item diff --git a/module/actor.js b/module/actor.js index 7c907b2a..2a7c9cdf 100644 --- a/module/actor.js +++ b/module/actor.js @@ -2531,7 +2531,7 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ getArmeParade(armeParadeId) { - const item = armeParadeId ? this.getEmbeddedDocuments('Item', armeParadeId) : undefined; + const item = armeParadeId ? this.getEmbeddedDocument('Item', armeParadeId) : undefined; return RdDItemArme.getArmeData(item); } @@ -2548,7 +2548,7 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ async equiperObjet(itemID) { - let item = this.getEmbeddedDocuments('Item', itemID); + let item = this.getEmbeddedDocument('Item', itemID); if (item?.data?.data) { let itemData = Misc.itemData(item); const isEquipe = !itemData.data.equipe; From 5e654bdfa4250506a07f01a78623fc427c4abc7f Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Tue, 30 Mar 2021 22:27:03 +0200 Subject: [PATCH 3/8] Fix protection armure --- module/actor.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/module/actor.js b/module/actor.js index 2a7c9cdf..0a01966f 100644 --- a/module/actor.js +++ b/module/actor.js @@ -2566,7 +2566,8 @@ export class RdDActor extends Actor { let dmg = (attackerRoll.dmg.dmgArme ?? 0) + (attackerRoll.dmg.dmgActor ?? 0); let armeData = attackerRoll.arme; let protection = 0; - const armures = this.data.items.filter(it => it.type == "armure" && it.data.equipe); + const armures = this.items.map(it => Misc.data(it)) + .filter(it => it.type == "armure" && it.data.equipe); for (const itemData of armures) { protection += new Roll(itemData.data.protection.toString()).roll().total; if (dmg > 0) { @@ -2574,7 +2575,7 @@ export class RdDActor extends Actor { dmg = 0; } } - const penetration = armeData ? Misc.toInt(armeData.data.penetration) : 0; + const penetration = Misc.toInt(armeData?.data.penetration ?? 0); protection = Math.max(protection - penetration, 0); protection += this.getProtectionNaturelle(); // Gestion des cas particuliers sur la fenêtre d'encaissement @@ -2864,7 +2865,7 @@ export class RdDActor extends Actor { } let updates = [] for (const [valeur, nombre] of Object.entries(fortune)) { - updates.push( { _id: parValeur[valeur]._id, 'data.quantite': nombre }); + updates.push({ _id: parValeur[valeur]._id, 'data.quantite': nombre }); } await this.updateEmbeddedDocuments('Item', updates); } @@ -3148,7 +3149,7 @@ export class RdDActor extends Actor { } } - async onPreUpdateItem(item, change, options, id) { + async onPreUpdateItem(item, change, options, id) { const itemData = Misc.data(item); if (itemData.type == 'competence' && itemData.data.defaut_carac && itemData.data.xp) { await this.checkCompetenceXP(itemData.name, itemData.data.xp); From ee34fad8b1a8ce88b4f47c773e9603e68380ae6c Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Tue, 30 Mar 2021 22:27:30 +0200 Subject: [PATCH 4/8] Fix encaissement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Amélioration du message d'encaissement (suppressions d'espaces en excédent) - Encaissement "cauchemar" réservé aux entités et inversement --- module/rdd-roll-encaisser.js | 24 +++++++++++++++-------- templates/chat-resultat-encaissement.html | 18 ++++++++++------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/module/rdd-roll-encaisser.js b/module/rdd-roll-encaisser.js index 5dca7b5c..a8e0d6e5 100644 --- a/module/rdd-roll-encaisser.js +++ b/module/rdd-roll-encaisser.js @@ -7,17 +7,23 @@ export class RdDEncaisser extends Dialog { /* -------------------------------------------- */ constructor(html, actor) { // Common conf + const buttonsCreatures = { + "mortel": { label: "mortel", callback: html => this.performEncaisser("mortel") }, + "non-mortel": { label: "non-mortel", callback: html => this.performEncaisser("non-mortel") }, + }; + const buttonsEntitesCauchemar = { + "cauchemar": { label: "cauchemar", callback: html => this.performEncaisser("cauchemar") } + }; + const buttons = actor.isEntiteCauchemar() ? buttonsEntitesCauchemar : buttonsCreatures; + let dialogConf = { title: "Jet d'Encaissement", content: html, - buttons: { - "mortel": { label: "mortel", callback: html => this.performEncaisser(html, "mortel") }, - "non-mortel": { label: "non-mortel", callback: html => this.performEncaisser(html, "non-mortel") }, - "cauchemar": { label: "cauchemar", callback: html => this.performEncaisser(html, "cauchemar") } - }, + buttons: buttons, default: "coupMortel" } + let dialogOptions = { classes: ["rdddialog"], width: 320, @@ -32,13 +38,15 @@ export class RdDEncaisser extends Dialog { this.encaisserSpecial = "aucun"; } + + /* -------------------------------------------- */ - performEncaisser(html, mortalite = "mortel") { + performEncaisser(mortalite) { this.actor.encaisserDommages({ - dmg:{ + dmg: { total: Number(this.modifier), encaisserSpecial: this.encaisserSpecial, - loc: { result: 0, label: "Corps" }, + loc: { result: 0, label: "" }, mortalite: mortalite } }); diff --git a/templates/chat-resultat-encaissement.html b/templates/chat-resultat-encaissement.html index 8e1621f6..6d80ae34 100644 --- a/templates/chat-resultat-encaissement.html +++ b/templates/chat-resultat-encaissement.html @@ -17,9 +17,9 @@
Je d'encaissement de {{roll.total}} - {{#unless (eq armure 0)}}, l'armure a protègé de {{armure}} {{#unless (eq penetration 0)}}(pénétration de {{penetration}}) - {{/unless}} - {{/unless}}, total: {{total}} + {{#unless (eq armure 0)}}, l'armure a protègé de {{armure}} + {{~#unless (eq penetration 0)}} (pénétration de {{penetration}}){{/unless}} + {{~/unless}}, total: {{total}}
{{alias}} {{#if (eq dmg.mortalite 'cauchemar')}}subit le coup @@ -29,10 +29,14 @@ {{else if critiques}}subit une blessure critique {{else if mort}}vient de mourir {{else}}s'en sort sans une égratignure - {{/if}} - ({{dmg.loc.label}}) - {{#if (gt endurance 0)}} - {{#if hasPlayerOwner}}, a perdu {{endurance}} points d'endurance + {{~/if~}} + {{~#unless (eq dmg.mortalite 'cauchemar')}} + {{#if dmg.loc.label}} + {{#if (gt roll.total 0)}}({{dmg.loc.label}}){{/if}} + {{/if}} + {{/unless~}} + {{~#if (gt endurance 0)}} + {{~#if hasPlayerOwner}}, a perdu {{endurance}} points d'endurance {{#if (ne vie 0)}}, {{vie}} points de vie{{/if}} {{/if}} {{#if (ne dmg.mortalite 'cauchemar')}} From 5383bd228d1544b6346999083499ed039b5ef7a7 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Tue, 30 Mar 2021 23:01:09 +0200 Subject: [PATCH 5/8] =?UTF-8?q?Fix=20r=C3=A9cup=C3=A9ration=20chance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor.js | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/module/actor.js b/module/actor.js index 0a01966f..98c55c03 100644 --- a/module/actor.js +++ b/module/actor.js @@ -343,13 +343,11 @@ export class RdDActor extends Actor { async _recupereChance() { // On ne récupère un point de chance que si aucun appel à la chance dans la journée - if (this.getFlag('foundryvtt-reve-de-dragon', 'utilisationChance')) { - // Nouveau jour, suppression du flag - await this.unsetFlag('foundryvtt-reve-de-dragon', 'utilisationChance'); - } - else { - await this.chanceActuelleIncDec(1); + if (this.getChanceActuel() < this.getChance() && !this.getFlag('foundryvtt-reve-de-dragon', 'utilisationChance')) { + await this.chanceActuelleIncDec(1); } + // Nouveau jour, suppression du flag + await this.unsetFlag('foundryvtt-reve-de-dragon', 'utilisationChance'); } /* -------------------------------------------- */ @@ -651,14 +649,14 @@ export class RdDActor extends Actor { return; } } - const actorData = Misc.data(this); + const tplData = Misc.templateData(this); if (caracName == "reve") { - if (caracValue > Misc.toInt(actorData.data.reve.seuil.value)) { + if (caracValue > Misc.toInt(tplData.reve.seuil.value)) { this.setPointsDeSeuil(caracValue); } } if (caracName == "chance") { - if (caracValue > Misc.toInt(actorData.data.compteurs.chance.value)) { + if (caracValue > Misc.toInt(tplData.compteurs.chance.value)) { this.setPointsDeChance(caracValue); } } @@ -2260,9 +2258,6 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ async rollAppelChance(onSuccess = () => { }, onEchec = () => { }) { // Stocke si utilisation de la chance - await this.unsetFlag('foundryvtt-reve-de-dragon', 'utilisationChance'); - await this.setFlag('foundryvtt-reve-de-dragon', 'utilisationChance', true); - let rollData = { selectedCarac: this.getCaracByName('chance-actuelle'), surprise: '' }; const dialog = await RdDRoll.create(this, rollData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html' }, @@ -2282,6 +2277,7 @@ export class RdDActor extends Actor { async _appelChanceResult(rollData, onSuccess = () => { }, onEchec = () => { }) { await RdDResolutionTable.displayRollData(rollData, this, 'chat-resultat-appelchance.html') if (rollData.rolled.isSuccess) { + await this.setFlag('foundryvtt-reve-de-dragon', 'utilisationChance', true); await this.chanceActuelleIncDec(-1); onSuccess(); } @@ -2291,11 +2287,8 @@ export class RdDActor extends Actor { } /* -------------------------------------------- */ - async chanceActuelleIncDec(value, limit = true) { - chance = Math.max(Misc.templateData(this).compteurs.chance.value + value, 0); - if (limit) { - chance = Math.min(chance.value, this.getChance()) - } + async chanceActuelleIncDec(value) { + const chance = Math.min(this.getChance(), Math.max(this.getChanceActuel() + value, 0)); await this.updateCompteurValue("chance", chance); } From e0eb04d829346503428c3d1a3d08573acaddcdeb Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 31 Mar 2021 00:11:35 +0200 Subject: [PATCH 6/8] =?UTF-8?q?Cr=C3=A9ation=20d'oeuvres?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor-sheet.js | 40 +++++++++++++++++++++++------ templates/actor-creature-sheet.html | 2 +- templates/actor-sheet.html | 5 ++-- templates/actor-vehicule-sheet.html | 2 +- 4 files changed, 37 insertions(+), 12 deletions(-) diff --git a/module/actor-sheet.js b/module/actor-sheet.js index 76eaf475..0e6b2402 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -173,16 +173,16 @@ export class RdDActorSheet extends ActorSheet { /* -------------------------------------------- */ async creerObjet() { - let itemType = $("#creer-equipement").val(); + let itemType = $(".item-type").val(); await this.createItem('Nouveau ' + itemType, itemType); } /* -------------------------------------------- */ async selectObjetType() { - let itemType = ["objet", "arme", "armure", "conteneur", "herbe", "ingredient", "livre", "potion", "munition", "monnaie"]; - let options = 'Selectionnez le type d\'équipement`; + for (let typeName of typeObjets) { + options += `` } options += ''; let d = new Dialog({ @@ -198,7 +198,28 @@ export class RdDActorSheet extends ActorSheet { }); d.render(true); } - + + /* -------------------------------------------- */ + async selectTypeOeuvre() { + let typeOeuvres = ["oeuvre", "recettecuisine", "musique", "chant", "danse", "jeu" ]; + let options = `Selectionnez le type d'oeuvre'; + let d = new Dialog({ + title: "Créer une oeuvre", + content: options, + buttons: { + one: { + icon: '', + label: "Créer l'oeuvre", + callback: () => this.creerObjet() + } + } + }); + d.render(true); + } /* -------------------------------------------- */ /** @override */ activateListeners(html) { @@ -246,12 +267,15 @@ export class RdDActorSheet extends ActorSheet { ev.preventDefault(); } }); - html.find('#creer-tache').click(ev => { + html.find('.creer-tache').click(ev => { this.createEmptyTache(); }); - html.find('#creer-un-objet').click(ev => { + html.find('.creer-un-objet').click(ev => { this.selectObjetType(); }); + html.find('.creer-une-oeuvre').click(ev => { + this.selectTypeOeuvre(); + }); html.find('#nettoyer-conteneurs').click(ev => { this.actor.nettoyerConteneurs(); }); diff --git a/templates/actor-creature-sheet.html b/templates/actor-creature-sheet.html index 6509b75c..24409eb9 100644 --- a/templates/actor-creature-sheet.html +++ b/templates/actor-creature-sheet.html @@ -197,7 +197,7 @@ {{!-- Equipment Tab --}}
Encombrement total/max : {{numberFormat calc.encTotal decimals=2}} / {{data.attributs.encombrement.value}} {{calc.surEncombrementMessage}} - - Créer un objet + Créer un objet {{#if options.isGM}} - Vider tout les conteneurs {{/if}} diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 222e0e70..47bf86d4 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -461,6 +461,7 @@ {{!-- Connaissances Tab --}}
+ Créer une oeuvre

Oeuvres diverses :

    {{#each chants as |chant id|}} @@ -526,7 +527,7 @@ {{/each}}
-

Tâches

Créer une nouvelle Tâche +

Tâches

Créer une nouvelle Tâche
- Créer un objet + Créer un objet {{#if options.isGM}} - Vider tout les conteneurs {{/if}} diff --git a/templates/actor-vehicule-sheet.html b/templates/actor-vehicule-sheet.html index af4165cf..fe06733a 100644 --- a/templates/actor-vehicule-sheet.html +++ b/templates/actor-vehicule-sheet.html @@ -69,7 +69,7 @@ {{!-- Equipment Tab --}}
Encombrement total/max : {{numberFormat calc.encTotal decimals=2}} / {{data.capacite_encombrement}} {{calc.surEncombrementMessage}} - - Créer un objet + Créer un objet {{#if options.isGM}} - Vider tout les conteneurs {{/if}} From 036456e5dfeb4c2acead662531c630ca90980500 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 31 Mar 2021 01:15:55 +0200 Subject: [PATCH 7/8] Fix token HUD Utilisation de Misc.data pour: - combattants - armes - competences d'armes --- module/actor.js | 4 ++-- module/misc.js | 13 +------------ module/rdd-combat.js | 25 +++++++++++++------------ module/rdd-token-hud.js | 3 ++- 4 files changed, 18 insertions(+), 27 deletions(-) diff --git a/module/actor.js b/module/actor.js index 98c55c03..c2e5d737 100644 --- a/module/actor.js +++ b/module/actor.js @@ -2542,8 +2542,8 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ async equiperObjet(itemID) { let item = this.getEmbeddedDocument('Item', itemID); - if (item?.data?.data) { - let itemData = Misc.itemData(item); + let itemData = Misc.data(item); + if (itemData?.data) { const isEquipe = !itemData.data.equipe; let update = { _id: item._id, "data.equipe": isEquipe }; await this.updateEmbeddedDocuments('Item', [update]); diff --git a/module/misc.js b/module/misc.js index d1f5eb9a..c6e2597f 100644 --- a/module/misc.js +++ b/module/misc.js @@ -97,19 +97,8 @@ export class Misc { return [...new Set(array)]; } - static actorData(actor) { - return Misc.data(actor); - } - - static itemData(item) { - return Misc.data(item); - } - static data(it) { - if (it instanceof Item) { - return it.data; - } - if (it instanceof Actor) { + if (it instanceof Actor || it instanceof Item || it instanceof Combatant) { return it.data; } return it; diff --git a/module/rdd-combat.js b/module/rdd-combat.js index f9788418..40786e0f 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -143,18 +143,20 @@ export class RdDCombatManager extends Combat { // Gestion des armes 1/2 mains let armesEquipe = []; for (const arme of armes) { - if (arme.data.equipe) { - armesEquipe.push(arme); - let comp = competences.find(c => c.name == arme.data.competence); - arme.data.initiative = RdDCombatManager.calculInitiative(arme.data.niveau, carac[comp.data.defaut_carac].value); + let armeData = Misc.data(arme); + if (armeData.data.equipe) { + let compData = competences.map(c => Misc.data(c)).find(c => c.name == armeData.data.competence); + + armesEquipe.push(armeData); + armeData.data.initiative = RdDCombatManager.calculInitiative(armeData.data.niveau, carac[compData.data.defaut_carac].value); // Dupliquer les armes pouvant être à 1 main et 2 mains en patchant la compétence - if (arme.data.unemain && !arme.data.deuxmains) { - arme.data.mainInfo = "(1m)"; - } else if (!arme.data.unemain && arme.data.deuxmains) { - arme.data.mainInfo = "(2m)"; - } else if (arme.data.unemain && arme.data.deuxmains) { - arme.data.mainInfo = "(1m)"; - let arme2main = duplicate(arme); + if (armeData.data.unemain && !armeData.data.deuxmains) { + armeData.data.mainInfo = "(1m)"; + } else if (!armeData.data.unemain && armeData.data.deuxmains) { + armeData.data.mainInfo = "(2m)"; + } else if (armeData.data.unemain && armeData.data.deuxmains) { + armeData.data.mainInfo = "(1m)"; + let arme2main = duplicate(armeData); arme2main.data.mainInfo = "(2m)"; arme2main.data.dommages = arme2main.data.dommages.split("/")[1]; // Existence temporaire uniquement dans la liste des armes, donc OK arme2main.data.competence = arme2main.data.competence.replace(" 1 main", " 2 mains"); // Replace ! @@ -182,7 +184,6 @@ export class RdDCombatManager extends Combat { } else { // Recupération des items 'arme' let armes = items.filter(it => RdDItemArme.isArmeUtilisable(it)) - .map(arme => duplicate(arme)) /* pas de changements aux armes d'origine */ .concat(RdDItemArme.mainsNues()); let competences = items.filter(it => it.type == 'competence'); diff --git a/module/rdd-token-hud.js b/module/rdd-token-hud.js index 27c96c46..21a651b7 100644 --- a/module/rdd-token-hud.js +++ b/module/rdd-token-hud.js @@ -1,5 +1,6 @@ /* -------------------------------------------- */ import { HtmlUtility } from "./html-utility.js"; +import { Misc } from "./misc.js"; import { RdDCombatManager } from "./rdd-combat.js"; import { RdDUtility } from "./rdd-utility.js"; @@ -24,7 +25,7 @@ export class RdDTokenHud { let token = canvas.tokens.get(tokenId); let actor = token.actor; - let combatant = game.combat.data.combatants.find(c => c.tokenId == token.data._id); + let combatant = game.combat.combatants.find(c => Misc.data(c).tokenId == tokenId); app.hasExtension = true; let armesList = RdDCombatManager.buildListeActionsCombat(combatant) ; From 81d68e5ba39c000485e1cc8b176e76966d2c4fd3 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 31 Mar 2021 01:21:53 +0200 Subject: [PATCH 8/8] =?UTF-8?q?Fix=20jet=20cr=C3=A9atures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/item-competencecreature.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/item-competencecreature.js b/module/item-competencecreature.js index e6140035..ca2dc607 100644 --- a/module/item-competencecreature.js +++ b/module/item-competencecreature.js @@ -5,8 +5,8 @@ export class RdDItemCompetenceCreature extends Item { /* -------------------------------------------- */ static setRollDataCreature(rollData) { + rollData.competence = Misc.data(rollData.competence); rollData.carac = { "carac_creature": { label: rollData.competence.name, value: rollData.competence.data.carac_value } }; - rollData.competence = duplicate(rollData.competence); rollData.competence.data.defaut_carac = "carac_creature"; rollData.competence.data.categorie = "creature"; rollData.selectedCarac = rollData.carac.carac_creature;