diff --git a/module/actor.js b/module/actor.js index 3e037ff2..56959ff2 100644 --- a/module/actor.js +++ b/module/actor.js @@ -349,7 +349,7 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ async verifierPotionsEnchantees() { - let potionsEnchantees = this.filterItemsData(it => it.type == 'potion' && it.data.isEnchante); + let potionsEnchantees = this.filterItemsData(it => it.type == 'potion' && it.data.magique); for (let potion of potionsEnchantees) { if (!potion.prpermanent) { console.log(potion); @@ -3444,7 +3444,7 @@ export class RdDActor extends Actor { potionData.alias = this.name; potionData.supprimer = true; - if (potionData.data.isEnchante) { + if (potionData.data.magique) { ChatMessage.create({ whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name), content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-soin.html`, potionData) @@ -3476,7 +3476,7 @@ export class RdDActor extends Actor { potionData.alias = this.name; potionData.supprimer = true; - if (potionData.data.isEnchante) { + if (potionData.data.magique) { ChatMessage.create({ whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name), content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-repos.html`, potionData) diff --git a/module/item-sheet.js b/module/item-sheet.js index d8eaeede..41f57438 100644 --- a/module/item-sheet.js +++ b/module/item-sheet.js @@ -64,8 +64,7 @@ export class RdDItemSheet extends ItemSheet { owner: this.document.isOwner, editable: this.isEditable, cssClass: this.isEditable ? "editable" : "locked", - isSoins: false, - isEnchante: false + isSoins: false } if ( this.actor ) { formData.isOwned = true; diff --git a/module/item.js b/module/item.js index b1de3222..e20021ab 100644 --- a/module/item.js +++ b/module/item.js @@ -43,6 +43,9 @@ export class RdDItem extends Item { return itemData.type == 'objet' && Grammar.toLowerCaseNoAccent(itemData.name) == 'cristal alchimique' && itemData.data.quantite > 0; } + isMagique(){ + return Misc.templateData(this.object).magique; + } getEnc() { const itemData = Misc.data(this); @@ -68,8 +71,8 @@ export class RdDItem extends Item { prepareDataPotion() { const tplData = Misc.templateData(this); const categorie = Grammar.toLowerCaseNoAccent(tplData.categorie); - tplData.isEnchante = categorie.includes('enchante'); - if (tplData.isEnchante) { + tplData.magique = categorie.includes('enchante'); + if (tplData.magique) { if (categorie.includes('soin') || categorie.includes('repos')) { tplData.puissance = tplData.herbebonus * tplData.pr; } diff --git a/templates/chat-consommer-potion-generique.html b/templates/chat-consommer-potion-generique.html index 8f2b5838..e3d514ca 100644 --- a/templates/chat-consommer-potion-generique.html +++ b/templates/chat-consommer-potion-generique.html @@ -1,9 +1,9 @@