#171 - Gestion potions / consommation

This commit is contained in:
sladecraven 2021-04-09 17:30:32 +02:00
parent 31d2c01ebb
commit cc24471926

View File

@ -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 ] );
}
/* -------------------------------------------- */