From ad8354217c0d3268b993d0ad350705330c5582e3 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Sun, 20 Sep 2020 21:14:05 +0200 Subject: [PATCH] Fi creature sheet --- module/actor-creature-sheet.js | 10 ------ module/actor.js | 3 +- styles/simple.css | 3 ++ system.json | 4 +-- template.json | 37 +++++++------------- templates/actor-creature-sheet.html | 52 +++++++++++------------------ 6 files changed, 38 insertions(+), 71 deletions(-) diff --git a/module/actor-creature-sheet.js b/module/actor-creature-sheet.js index fee69960..31c83701 100644 --- a/module/actor-creature-sheet.js +++ b/module/actor-creature-sheet.js @@ -53,8 +53,6 @@ export class RdDActorCreatureSheet extends ActorSheet { data.data.nbGraves = this.actor.GetNumberBlessures(data.data.blessures.graves.liste ); data.data.nbCritiques = this.actor.GetNumberBlessures(data.data.blessures.critiques.liste ); - // low is normal, this the base used to compute the grid. - data.data.fatigueHTML = "" + RdDUtility.makeHTMLfatigueMatrix( data.data.sante.fatigue.value, data.data.sante.endurance.max ).html() + "
"; data.data.competencecreature = data.itemsByType["competencecreature"]; return data; @@ -147,14 +145,6 @@ export class RdDActorCreatureSheet extends ActorSheet { this.actor.santeIncDec("endurance", -1); this.render(true); }); - html.find('#fatigue-plus').click((event) => { - this.actor.santeIncDec("fatigue", 1); - this.render(true); - }); - html.find('#fatigue-moins').click((event) => { - this.actor.santeIncDec("fatigue", -1); - this.render(true); - }); } diff --git a/module/actor.js b/module/actor.js index 492faaa6..9423a2d7 100644 --- a/module/actor.js +++ b/module/actor.js @@ -494,7 +494,7 @@ export class RdDActor extends Actor { //console.log(name, inc, data.value); let diffEndurance = sante.endurance.max - this.data.data.sante.endurance.value; - if ( sante.fatigue.value < diffEndurance) // If endurance lost, then the same amount of fatigue cannot be recovered + if ( sante.fatigue && sante.fatigue.value < diffEndurance) // If endurance lost, then the same amount of fatigue cannot be recovered sante.fatigue.value = diffEndurance; //console.log("SANTE::::", sante); @@ -728,7 +728,6 @@ export class RdDActor extends Actor { armeItem = { name: compName, data: { dommages: compItem.data.dommages} }; } compItem.data.defaut_carac = "carac_creature"; // Fake default competence - console.log("V:", compItem.data.carac_value, compItem) let rollData = { "competence": compItem, "arme": armeItem, diff --git a/styles/simple.css b/styles/simple.css index 474c7996..e8e42027 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -337,6 +337,8 @@ button { .description-label { flex-grow: 2; } +.attribut-value, +.sante-value, .competence-value { flex-grow: 0; flex-basis: 64px; @@ -381,6 +383,7 @@ button { margin-right: 4px; margin-left: 4px; } +.input-sante-header, .stress-style { flex-grow: 0; flex-basis: 64px; diff --git a/system.json b/system.json index 4db2f5d6..be92ce2d 100644 --- a/system.json +++ b/system.json @@ -2,10 +2,10 @@ "name": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", "description": "Rêve de Dragon RPG for FoundryVTT", - "version": "0.9.9", + "version": "0.9.13", "minimumCoreVersion": "0.6.0", "compatibleCoreVersion": "0.6.6", - "templateVersion": 34, + "templateVersion": 37, "author": "LeRatierBretonnien", "esmodules": [ "module/rdd-main.js", "module/hook-renderChatLog.js" ], "styles": ["styles/simple.css"], diff --git a/template.json b/template.json index c2509b89..5179f58d 100644 --- a/template.json +++ b/template.json @@ -67,22 +67,15 @@ "max": 10, "value": 10, "label": "Vie", - "derivee": true + "derivee": false }, "endurance": { "type": "number", "max": 10, "value": 10, "label": "Endurance", - "derivee": true + "derivee": false }, - "fatigue": { - "type": "number", - "max": 0, - "value": 0, - "label": "Fatigue", - "derivee": true - }, "sonne": { "value": false, "label": "Sonné" @@ -105,35 +98,29 @@ } }, "attributs": { - "sconst": { - "type": "number", - "value": 0, - "label": "S. Const", - "derivee": true - }, - "sust": { - "type": "number", - "value": 0, - "label": "Sustentation", - "derivee": true - }, "plusdom": { "type": "number", "value": 0, "label": "+dom", "derivee": true }, + "vitesse": { + "type": "string", + "value": 0, + "label": "Vitesse", + "derivee": true + }, "encombrement": { "type": "number", "value": 0, "label": "Encombrement", - "derivee": true + "derivee": false }, - "malusarmure": { + "protection": { "type": "number", "value": 0, - "label": "Malus Armure", - "derivee": true + "label": "Protection", + "derivee": false } }, "compteurs": { diff --git a/templates/actor-creature-sheet.html b/templates/actor-creature-sheet.html index a74e1e3f..7886088b 100644 --- a/templates/actor-creature-sheet.html +++ b/templates/actor-creature-sheet.html @@ -5,26 +5,6 @@

-
-
-
- Vie + / - - /{{data.sante.vie.max}} -
-
- Endurance + / - - /{{data.sante.endurance.max}} -
-
- Sonné : - -
-
-
- Fatigue + / - - {{{data.fatigueHTML}}} -
-
Blessures légères : {{data.nbLegeres}}
@@ -58,12 +38,7 @@ {{else}} {{carac.label}} {{/if}} - {{#if carac.derivee}} - - {{else}} - - - {{/if}} + {{/each}}
  • @@ -76,14 +51,27 @@
      {{#each data.attributs as |attr key|}}
    1. - {{attr.label}} : {{attr.value}} -
    2. - {{/each}} - {{#each data.sante as |point key|}} -
    3. - {{point.label}} : {{point.value}} / {{point.max}} + {{attr.label}} : +
    4. {{/each}} +
    5. + Vie : + / + +
    6. +
    7. + Endurance : + / + +
    8. +
    9. + Sonné : + +
    10. +
    11. + Etat Général : {{data.compteurs.etat.value}} +