Limiter le draconic aux Haut rêvant - #174

This commit is contained in:
Vincent Vandemeulebrouck 2021-04-01 21:33:43 +02:00
parent ac8610cd6c
commit 87440cf7f9
4 changed files with 30 additions and 4 deletions

View File

@ -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;

View File

@ -6,7 +6,7 @@
"manifestPlusVersion": "1.0.0",
"minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.9",
"templateVersion": 96,
"templateVersion": 98,
"author": "LeRatierBretonnien",
"authors": [
{

View File

@ -430,6 +430,12 @@
"value": 0,
"label": "Protection naturelle",
"derivee": false
},
"hautrevant": {
"type": "string",
"value": "",
"label": "Haut rêvant",
"derivee": true
}
},
"reve": {

View File

@ -1,3 +1,5 @@
{{log 'calc' calc}}
<form class="{{cssClass}}" autocomplete="off">
{{!-- Sheet Header --}}
@ -59,9 +61,11 @@
<span class="gm-only remise-a-neuf"><a title="Remise à neuf"><img class="button-img" src="icons/svg/regen.svg" alt="Remise à neuf"/></a></span>
<span id="dormir-une-heure"><a title="Dormir une heure"><img class="button-img" src="icons/svg/sleep.svg" alt="Dormir une heure"/></a></span>
<span id="dormir-chateau-dormant"><a title="Chateau Dormant"><img class="button-img" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd12.svg" alt="Chateau Dormant"/></a></span>
{{#if (eq data.attributs.hautrevant.value 'Haut rêvant')}}
<span id="monte-tmr"><a title="Montée dans les Terres M&eacute;dianes !"><img class="button-img" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-normal.svg" alt="Montée dans les Terres M&eacute;dianes !"/></a></span>
<span id="monte-tmr-rapide"><a title="Montée accélérée dans les Terres M&eacute;dianes !"><img class="button-img" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-rapide.svg" alt="Montée accélérée dans les Terres M&eacute;dianes !"/></a></span>
<span id="visu-tmr"><a title="Regarder les Terres M&eacute;dianes"><img class="button-img" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-view.svg" alt="Regarder les Terres M&eacute;dianes"/></a></span>
{{/if}}
</div>
<div class="flexrow">
<span class="tooltip">Malus de fatigue : {{calc.fatigue.malus}}
@ -295,14 +299,17 @@
{{/each}}
</ul>
{{#if (eq data.attributs.hautrevant.value 'Haut rêvant')}}
<header class="competence-header flexrow">
<span class="competence-title">Draconic</span>
<span class="competence-title">Draconic</span>
</header>
<ul class="item-list alterne-list">
{{#each data.competenceByCategory.draconic as |comp key|}}
{{#each competenceByCategory.draconic as |comp key|}}
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-competence-partial.html" comp}}
{{/each}}
</ul>
{{/if}}
<div>
<ul class="item-list">
<li class="item flexrow">
@ -548,6 +555,7 @@
<div>
<h3>Haut rêve:</h3>
<ul class="item-list">
{{#if (eq data.attributs.hautrevant.value 'Haut rêvant')}}
<li class="item flexrow">
<span class="competence-label">Position en TMR :</span>
<span>
@ -558,6 +566,7 @@
{{/if}}
</span>
</li>
{{/if}}
<li class="item flexrow">
<span class="competence-label">Seuil de Rêve :</span>
<span>
@ -581,6 +590,7 @@
</ul>
</div>
<hr>
{{#if (eq data.attributs.hautrevant.value 'Haut rêvant')}}
<div>
<h3>Sorts:</h3>
<ul class="item-list">
@ -649,9 +659,10 @@
{{/each}}
</ul>
</div>
<hr>
{{/if}}
{{!-- Queues, Souffles, Tetes, Ombre --}}
<hr>
<h3>Queues:</h3>
<ul class="flex-group-left">
{{#each data.queues as |queue key|}}