From 2586fe7e27d6c37c1c5ef542e69f0fa883fca3e4 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 3 Apr 2021 03:04:48 +0200 Subject: [PATCH] =?UTF-8?q?Draconic=20que=20pour=20les=20Haut=20r=C3=AAvan?= =?UTF-8?q?t=20#174?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/rdd-combat.js | 9 ++++++--- templates/actor-sheet.html | 20 ++++++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/module/rdd-combat.js b/module/rdd-combat.js index 40786e0f..f4520908 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -176,6 +176,7 @@ export class RdDCombatManager extends Combat { ui.notifications.warn(`Le combatant ${combatant.name} n'est pas associé à un acteur, impossible de déterminer ses actions de combat!`) return []; } + const actorData = Misc.data(combatant.actor); let items = combatant.actor.data.items; let actions = [] if (combatant.actor.isCreature()) { @@ -187,9 +188,11 @@ export class RdDCombatManager extends Combat { .concat(RdDItemArme.mainsNues()); let competences = items.filter(it => it.type == 'competence'); - actions = actions.concat(RdDCombatManager.finalizeArmeList(armes, competences, Misc.data(combatant.actor).data.carac)); - - actions.push({ name: "Draconic", data: { initOnly: true, competence: "Draconic" } }); + actions = actions.concat(RdDCombatManager.finalizeArmeList(armes, competences, actorData.data.carac)); + + if (actorData.data.attributs.hautrevant.value){ + actions.push({ name: "Draconic", data: { initOnly: true, competence: "Draconic" } }); + } } actions.push({ name: "Autre action", data: { initOnly: true, competence: "Autre action" } }); diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index b89f29c4..3c3d37b7 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -61,7 +61,7 @@ Remise à neuf Dormir une heure Chateau Dormant - {{#if (eq data.attributs.hautrevant.value 'Haut rêvant')}} + {{#if data.attributs.hautrevant.value}} Montée dans les Terres Médianes ! Montée accélérée dans les Terres Médianes ! Regarder les Terres Médianes @@ -164,15 +164,17 @@ {{#each data.attributs as |attr key|}} + {{#unless (eq key 'hautrevant')}}
  • {{attr.label}} : - {{#if (eq key 'protection')}} + {{#if (eq key 'protection')}} - {{else}} + {{else}} {{attr.value}} - {{/if}} + {{/if}}
  • + {{/unless}} {{/each}} - {{#if (eq data.attributs.hautrevant.value 'Haut rêvant')}} + {{#if data.attributs.hautrevant.value}}
    Draconic
    @@ -553,9 +555,11 @@ {{!-- hautreve Tab --}}
    -

    Haut rêve:

    + {{#if data.attributs.hautrevant.value}} +

    Haut rêvant

    + {{/if}}
      - {{#if (eq data.attributs.hautrevant.value 'Haut rêvant')}} + {{#if data.attributs.hautrevant.value}}
    • Position en TMR : @@ -590,7 +594,7 @@

    - {{#if (eq data.attributs.hautrevant.value 'Haut rêvant')}} + {{#if data.attributs.hautrevant.value}}

    Sorts: