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}}