diff --git a/module/actor.js b/module/actor.js index 8817b883..0b9dd08c 100644 --- a/module/actor.js +++ b/module/actor.js @@ -131,6 +131,7 @@ export class RdDActor extends Actor { async _prepareCharacterData(actorData) { // Initialize empty items RdDCarac.computeCarac(actorData.data); + this.computeIsHautRevant(); this.computeEncombrementTotalEtMalusArmure(); this.computePrixTotalEquipement(); this.computeEtatGeneral(); @@ -947,6 +948,14 @@ export class RdDActor extends Actor { return Math.max(0, Math.ceil(diffEnc)); } + /* -------------------------------------------- */ + async computeIsHautRevant() { + const tplData = Misc.templateData(this); + tplData.attributs.hautrevant.value = this.data.items.find(it => it.type == 'tete' && Grammar.toLowerCaseNoAccent(it.name) == 'don de haut-reve') + ? "Haut rêvant" + : ""; + } + /* -------------------------------------------- */ async computeEncombrementTotalEtMalusArmure() { let encTotal = 0; diff --git a/system.json b/system.json index d003b074..06e92146 100644 --- a/system.json +++ b/system.json @@ -6,7 +6,7 @@ "manifestPlusVersion": "1.0.0", "minimumCoreVersion": "0.7.5", "compatibleCoreVersion": "0.7.9", - "templateVersion": 96, + "templateVersion": 98, "author": "LeRatierBretonnien", "authors": [ { diff --git a/template.json b/template.json index f8496590..a4e51428 100644 --- a/template.json +++ b/template.json @@ -430,6 +430,12 @@ "value": 0, "label": "Protection naturelle", "derivee": false + }, + "hautrevant": { + "type": "string", + "value": "", + "label": "Haut rêvant", + "derivee": true } }, "reve": { diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 89d92f4a..955d12bd 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -1,3 +1,5 @@ +{{log 'calc' calc}} +