From ef2cb495424fbb075f24f4458d1f7ed6dcd16c01 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Fri, 18 Dec 2020 23:35:53 +0100 Subject: [PATCH] Fix ethylisme --- module/actor.js | 3 ++- module/rdd-roll-ethylisme.js | 2 +- module/rdd-utility.js | 1 + template.json | 2 +- templates/actor-sheet.html | 8 ++++++++ templates/niveau-ethylisme.html | 9 +++++++++ 6 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 templates/niveau-ethylisme.html diff --git a/module/actor.js b/module/actor.js index 5b0d4d53..ba777e43 100644 --- a/module/actor.js +++ b/module/actor.js @@ -679,8 +679,9 @@ export class RdDActor extends Actor { state = state - (data.sante.vie.max - data.sante.vie.value); if (data.sante.fatigue) // Creatures n'ont pas de fatigue state = state + RdDUtility.currentFatigueMalus(data.sante.fatigue.value, data.sante.endurance.max); - if (data.compteurs && data.compteurs.ethylisme) // Ajout de l'éthylisme + if (data.compteurs && data.compteurs.ethylisme && data.compteurs.ethylisme.value < 0 ) { // Ajout de l'éthylisme state = state + data.compteurs.ethylisme.value; + } state = state; data.compteurs.etat.value = state; if ( data.compteurs && data.compteurs.surenc) { diff --git a/module/rdd-roll-ethylisme.js b/module/rdd-roll-ethylisme.js index ca8918ba..e0f1ca87 100644 --- a/module/rdd-roll-ethylisme.js +++ b/module/rdd-roll-ethylisme.js @@ -19,7 +19,7 @@ export class RdDRollDialogEthylisme extends Dialog { let dialogOptions = { classes: ["rdddialog"], width: 400, height: 400, 'z-index': 99999 } super(dialogConf, dialogOptions) - console.log("ETH", rollData); + //console.log("ETH", rollData); this.rollData = rollData; this.actor = actor; } diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 0768aa13..b6aeb54f 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -171,6 +171,7 @@ export class RdDUtility { 'systems/foundryvtt-reve-de-dragon/templates/arme-competence.html', 'systems/foundryvtt-reve-de-dragon/templates/sort-draconic.html', 'systems/foundryvtt-reve-de-dragon/templates/sort-tmr.html', + 'systems/foundryvtt-reve-de-dragon/templates/niveau-ethylisme.html', // Dialogs 'systems/foundryvtt-reve-de-dragon/templates/dialog-competence.html', 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html', diff --git a/template.json b/template.json index a3a9339c..86f7ff96 100644 --- a/template.json +++ b/template.json @@ -498,7 +498,7 @@ "label": "Sur-encombrement" }, "ethylisme": { - "value": 0, + "value": 1, "label": "Ethylisme", "isInput": true, "nb_doses": 0 diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 6ccaff32..bfd5950c 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -146,7 +146,15 @@ {{else if compteur.isInput}}
  • {{compteur.label}} + {{#if (eq compteur.label 'Ethylisme')}} + + {{else}} + {{/if}} {{#if compteur.isStress}} Transformer diff --git a/templates/niveau-ethylisme.html b/templates/niveau-ethylisme.html new file mode 100644 index 00000000..9a1efcbd --- /dev/null +++ b/templates/niveau-ethylisme.html @@ -0,0 +1,9 @@ + + + + + + + + +