From a6b46cb4ad76d719ddcdc9c2c38a844581e92908 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Wed, 27 May 2020 21:57:00 +0200 Subject: [PATCH] Various fixes and update template --- module/rdd-utility.js | 13 ++++++---- template.json | 49 ++++++++++++++++++++++++++++++++++++++ templates/actor-sheet.html | 2 ++ 3 files changed, 60 insertions(+), 4 deletions(-) diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 3359b812..ba855a35 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -184,14 +184,19 @@ export class RdDUtility { data.attributs.plusdom.value = 0; else if (bonusDomKey < 14) data.attributs.plusdom.value = 1; + data.attributs.encombrement.value = (parseInt(data.carac.force.value) + parseInt(data.carac.taille.value)) / 2; data.carac.melee.value = Math.floor( (parseInt(data.carac.force.value) + parseInt(data.carac.agilite.value)) / 2); data.carac.tir.value = Math.floor( (parseInt(data.carac.vue.value) + parseInt(data.carac.dexterite.value)) / 2); data.carac.lancer.value = Math.floor( (parseInt(data.carac.tir.value) + parseInt(data.carac.force.value)) / 2); data.sante.vie.max = Math.ceil( parseInt(data.carac.taille.value) + parseInt(data.carac.constitution.value) /2 ); + data.sante.vie.value = data.sante.vie.max; let endurance = Math.max( parseInt(data.carac.taille.value) + parseInt(data.carac.constitution.value), parseInt(data.sante.vie.max) + parseInt(data.carac.volonte.value) ); data.sante.endurance.max = endurance; + data.sante.endurance.value = endurance; + data.sante.fatigue.max = endurance; + data.sante.fatigue.value = endurance; data.attributs.sconst.value = 5; // Max ! if ( data.carac.constitution.value < 9 ) @@ -202,10 +207,10 @@ export class RdDUtility { data.attributs.sconst.value = 4; data.attributs.sust.value = 4; // Max ! - if ( data.carac.constitution.value < 10 ) - data.attributs.sconst.value = 2; - else if (data.carac.constitution.value < 14 ) - data.attributs.sconst.value = 3; + if ( data.carac.taille.value < 10 ) + data.attributs.sust.value = 2; + else if (data.carac.taille.value < 14 ) + data.attributs.sust.value = 3; } /* -------------------------------------------- */ diff --git a/template.json b/template.json index 226c1327..d468144b 100644 --- a/template.json +++ b/template.json @@ -163,6 +163,27 @@ "value": 10, "label": "Points de Fatigue", "derivee": true + }, + "legeres": { + "nombre": 0, + "liste": [ { "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" }, + { "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" }, + { "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" }, + { "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" }, + { "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ] + }, + "graves": { + "nombre": 0, + "liste": [ { "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" }, + { "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ] + }, + "critiques": { + "nombre": 0, + "liste": [ { "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ] + }, + "ethylisme": { + "value": 0, + "label": "" } }, "attributs": { @@ -197,6 +218,34 @@ "derivee": true } }, + "compteurs": { + "reve": { + "max": 0, + "value": 0 + }, + "sust": { + "value": 0 + }, + "eau": { + "value": 0 + }, + "moral": { + "value": 0, + "exaltation": 0, + "dissolution": 0 + }, + "chance": { + "value": 0, + "destinee": 0 + }, + "stress": { + "value": 0 + }, + "etat": { + "value": 0, + "label": "" + } + }, "argent": { "deniers": { "label": "Denier", diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index a901b3aa..a3a87309 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -7,9 +7,11 @@

+ Vie /{{data.sante.vie.max}}
+ Endurance /{{data.sante.fatigue.max}}