diff --git a/module/actor.js b/module/actor.js index 34ad3486..681a3123 100644 --- a/module/actor.js +++ b/module/actor.js @@ -3309,6 +3309,23 @@ export class RdDActor extends Actor { } } + /* -------------------------------------------- */ + consommerPotionGenerique( potionData ) { + potionData.alias = this.name; + + if (potionData.data.categorie.includes('Enchante')) { + potionData.enchanteTexte = "enchantée"; + potionData.isEnchante = true; + } else { + potionData.enchanteTexte = ""; + potionData.isEnchante = false; + } + ChatMessage.create({ + whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name), + content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-generique.html`, potionData ) + }); +} + /* -------------------------------------------- */ async consommerPotion( potion ) { const potionData = Misc.data(potion); @@ -3318,9 +3335,9 @@ export class RdDActor extends Actor { } else if( potionData.data.categorie.includes('Repos')) { this.consommerPotionRepos(potionData); } else { - //TODO + this.consommerPotionGenerique(potionData); } - await this.deleteEmbeddedDocuments('Item', [ potion._id ] ); + await this.deleteEmbeddedDocuments('Item', [ potion.id ] ); } /* -------------------------------------------- */