diff --git a/module/actor.js b/module/actor.js index c4fb17c4..f5deebdc 100644 --- a/module/actor.js +++ b/module/actor.js @@ -137,6 +137,7 @@ export class RdDActor extends Actor { async _prepareCharacterData(actorData) { // Initialize empty items RdDCarac.computeCarac(actorData.data); + this.computeIsHautRevant(); this.computeEncombrementTotalEtMalusArmure(); this.computePrixTotalEquipement(); this.computeEtatGeneral(); @@ -955,6 +956,12 @@ export class RdDActor extends Actor { : Misc.templateData(this).attributs.encombrement.value; } + /* -------------------------------------------- */ + async computeIsHautRevant() { + const tplData = Misc.templateData(this); + tplData.attributs.hautrevant.value = this.listItemsData('tete').find(it => Grammar.toLowerCaseNoAccent(it.name) == 'don de haut-reve') + ? "Haut rêvant" + : ""; } /* -------------------------------------------- */ diff --git a/system.json b/system.json index 19c1932e..89b0f15b 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": 97, "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 149670f2..b89f29c4 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -1,3 +1,5 @@ +{{log 'calc' calc}} +