diff --git a/module/actor.js b/module/actor.js index 7a0a2b93..f362adae 100644 --- a/module/actor.js +++ b/module/actor.js @@ -3382,6 +3382,8 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ _setBlessure(blessure, encaissement) { blessure.active = true; + blessure.premiers_soins = -1; + blessure.soins_complets = -1; blessure.loc = encaissement.locName; } diff --git a/module/item.js b/module/item.js index 9188ee11..fbdcf600 100644 --- a/module/item.js +++ b/module/item.js @@ -229,12 +229,13 @@ export class RdDItem extends Item { ChatMessage.create(RdDUtility.chatDataSetup(html)); } + /* -------------------------------------------- */ getProprietes() { return this[`_${Misc.data(this).type}ChatData`](); } /* -------------------------------------------- */ - async postItem() { + async postItem( modeOverride ) { console.log(this); let chatData = duplicate(Misc.data(this)); const properties = this.getProprietes(); @@ -317,7 +318,7 @@ export class RdDItem extends Item { }); renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-item.html', chatData).then(html => { - let chatOptions = RdDUtility.chatDataSetup(html); + let chatOptions = RdDUtility.chatDataSetup(html, modeOverride); ChatMessage.create(chatOptions) }); } @@ -558,5 +559,43 @@ export class RdDItem extends Item { ] return properties; } + /* -------------------------------------------- */ + _maladieChatData() { + const tplData = Misc.templateData(this); + let properties + if (tplData.identifie) { + properties = [ + `Malignité: ${tplData.malignite}`, + `Périodicité: ${tplData.periodicite}`, + `Dommages: ${tplData.dommages}` + ] + if (tplData.remedesconnus) { + properties.push(`Remedes: ${tplData.remedes}` ) + } + } else { + properties = [ + `Inconnue` ] + } + return properties; + } + + /* -------------------------------------------- */ + _poisonChatData() { + return this._maladieChatData(); + } + + /* -------------------------------------------- */ + _gemmeChatData() { + const tplData = Misc.templateData(this); + let properties = [ + `Pureté: ${tplData.purete}`, + `Taille: ${tplData.taille}`, + `Inertie: ${tplData.inertie}`, + `Enchantabilité: ${tplData.enchantabilite}`, + `Prix: ${tplData.cout}`, + ] + return properties; + } + } diff --git a/module/rdd-calendrier.js b/module/rdd-calendrier.js index 724d8fa2..f8292a82 100644 --- a/module/rdd-calendrier.js +++ b/module/rdd-calendrier.js @@ -227,7 +227,13 @@ export class RdDCalendrier extends Application { if (actor.type == 'personnage') { let maladies = actor.filterItems( item => (item.type == 'maladie' || item.type == 'poison') && item.data.periodicite.toLowerCase().includes(periode) ); for (let maladie of maladies) { - ChatMessage.create({ content: `${actor.name} souffre de ${maladie.name} (${maladie.type}): vérifiez que les effets ne se sont pas aggravés !` }); + if ( maladie.data.identifie) { + ChatMessage.create({ content: `${actor.name} souffre de ${maladie.name} (${maladie.type}): vérifiez que les effets ne se sont pas aggravés !` }); + } else { + ChatMessage.create({ content: `${actor.name} souffre d'un mal inconnu (${maladie.type}): vérifiez que les effets ne se sont pas aggravés !` }); + } + let itemMaladie = actor.getObjet(maladie.id) + itemMaladie.postItem( 'gmroll'); } } } diff --git a/system.json b/system.json index 6b863738..ed5956dd 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "name": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", "description": "Rêve de Dragon RPG for FoundryVTT", - "version": "1.5.16", + "version": "1.5.17", "manifestPlusVersion": "1.0.0", "minimumCoreVersion": "0.8.0", "compatibleCoreVersion": "0.8.9", diff --git a/templates/item-maladie-sheet.html b/templates/item-maladie-sheet.html index d9dfe3eb..1c032af9 100644 --- a/templates/item-maladie-sheet.html +++ b/templates/item-maladie-sheet.html @@ -2,12 +2,21 @@
+ {{#if (or isGM data.identifie)}}

-
+ {{else}} +

Inconnue

+ {{/if}} +
{{!-- Sheet Body --}}
+ {{#if (or isGM data.identifie)}} +
+ + +
@@ -20,10 +29,17 @@
+
+ + +
+ {{#if (or isGM data.remedesconnus)}}
+ {{/if}} + {{/if}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} diff --git a/templates/item-poison-sheet.html b/templates/item-poison-sheet.html index d9dfe3eb..479f78c6 100644 --- a/templates/item-poison-sheet.html +++ b/templates/item-poison-sheet.html @@ -1,32 +1,48 @@
-
- -
-

+
+ +
+ {{#if (or isGM data.identifie)}} +

+ {{else}} +

Inconnue

+ {{/if}}
-
- - {{!-- Sheet Body --}} -
-
- - -
-
- - -
-
- - -
-
- - -
+
+ + {{!-- Sheet Body --}} +
+ {{#if (or isGM data.identifie)}} +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ {{#if (or isGM data.remedesconnus)}} +
+ + +
+ {{/if}} + {{/if}} - {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} - -
- + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}} + +
+