Feature/allow action healing multiple resources (#437)

* Healing updates

* Remove comments
This commit is contained in:
Dapoulp 2025-07-28 00:11:43 +02:00 committed by GitHub
parent f55698af02
commit fad64c9a35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 130 additions and 98 deletions

View file

@ -1,7 +1,11 @@
<fieldset class="one-column">
<legend>
{{localize "DAGGERHEART.GENERAL.damage"}}
{{#if (eq @root.source.type 'healing')}}
{{localize "DAGGERHEART.GENERAL.healing"}}
{{else}}
{{localize "DAGGERHEART.GENERAL.damage"}}
{{/if}}
{{#unless (eq path 'system.attack.')}}<a><i class="fa-solid fa-plus icon-button" data-action="addDamage"></i></a>{{/unless}}
</legend>
{{#if @root.hasBaseDamage}}
@ -37,7 +41,7 @@
{{/if}}
<div class="nest-inputs">
{{formField ../fields.applyTo value=dmg.applyTo name=(concat ../path "damage.parts." realIndex ".applyTo") localize=true}}
{{#if (eq dmg.applyTo 'hitPoints')}}
{{#if (and (eq dmg.applyTo 'hitPoints') (ne @root.source.type 'healing'))}}
{{formField ../fields.type value=dmg.type name=(concat ../path "damage.parts." realIndex ".type") localize=true}}
{{/if}}
</div>

View file

@ -9,13 +9,15 @@
{{#with (lookup @root.config.GENERAL.healingTypes applyTo)}}
{{localize label}}
{{/with}}
{{#if damageTypes}}
{{#each damageTypes as | type | }}
{{#with (lookup @root.config.GENERAL.damageTypes type)}}
<i class="fa-solid {{icon}}"></i>
{{/with}}
{{/each}}
{{/if}}
{{#unless @root.isHealing}}
{{#if damageTypes}}
{{#each damageTypes as | type | }}
{{#with (lookup @root.config.GENERAL.damageTypes type)}}
<i class="fa-solid {{icon}}"></i>
{{/with}}
{{/each}}
{{/if}}
{{/unless}}
</span>
</div>
<div class="form-group">

View file

@ -6,7 +6,7 @@
{{#if fields.roll}}{{> 'systems/daggerheart/templates/actionTypes/roll.hbs' fields=fields.roll.fields source=source.roll}}{{/if}}
{{#if fields.save}}{{> 'systems/daggerheart/templates/actionTypes/save.hbs' fields=fields.save.fields source=source.save}}{{/if}}
{{#if fields.damage}}{{> 'systems/daggerheart/templates/actionTypes/damage.hbs' fields=fields.damage.fields.parts.element.fields source=source.damage}}{{/if}}
{{#if fields.healing}}{{> 'systems/daggerheart/templates/actionTypes/healing.hbs' fields=fields.healing.fields source=source.healing}}{{/if}}
{{!-- {{#if fields.healing}}{{> 'systems/daggerheart/templates/actionTypes/healing.hbs' fields=fields.healing.fields source=source.healing}}{{/if}} --}}
{{#if fields.resource}}{{> 'systems/daggerheart/templates/actionTypes/resource.hbs' fields=fields.resource.fields source=source.resource}}{{/if}}
{{#if fields.documentUUID}}{{> 'systems/daggerheart/templates/actionTypes/uuid.hbs' fields=fields.documentUUID source=source.documentUUID}}{{/if}}
{{#if fields.effects}}{{> 'systems/daggerheart/templates/actionTypes/effect.hbs' fields=fields.effects.element.fields source=source.effects}}{{/if}}

View file

@ -1,3 +1,4 @@
{{!-- TO DO DELETE ? --}}
{{> 'systems/daggerheart/templates/ui/chat/parts/damage-chat.hbs' damage=this}}
{{> 'systems/daggerheart/templates/ui/chat/parts/target-chat.hbs'}}
<div class="dice-roll daggerheart chat roll">

View file

@ -164,7 +164,13 @@
</div>
</div>
<fieldset class="dice-roll daggerheart chat roll expanded{{#unless damage.roll}} hidden{{/unless}}" data-action="expandRoll">
<legend class="dice-flavor">{{localize "DAGGERHEART.GENERAL.damage"}}</legend>
<legend class="dice-flavor">
{{#if hasHealing}}
{{localize "DAGGERHEART.GENERAL.healing"}}
{{else}}
{{localize "DAGGERHEART.GENERAL.damage"}}
{{/if}}
</legend>
<div class="dice-result">
<div class="dice-tooltip">
<div class="wrapper">
@ -177,16 +183,28 @@
<div class="dice-roll daggerheart chat roll">
<div class="dice-result">
<div class="dice-actions{{#unless (or hasDamage hasHealing)}} duality-alone{{/unless}}">
{{#if hasDamage}}
{{#if (or hasDamage hasHealing)}}
{{#if damage.roll}}
<button class="duality-action damage-button" data-target-hit="true" data-value="{{roll.total}}"><span>{{localize "DAGGERHEART.UI.Chat.damageRoll.dealDamage"}}</span></button>
<button class="duality-action damage-button" data-target-hit="true" data-value="{{roll.total}}"><span>
{{#if hasHealing}}
{{localize "DAGGERHEART.UI.Chat.healingRoll.applyHealing"}}
{{else}}
{{localize "DAGGERHEART.UI.Chat.damageRoll.dealDamage"}}
{{/if}}
</span></button>
{{else}}
<button class="duality-action duality-action-damage" data-value="{{roll.total}}"><span>{{localize "DAGGERHEART.UI.Chat.attackRoll.rollDamage"}}</span></button>
<button class="duality-action duality-action-damage" data-value="{{roll.total}}"><span>
{{#if hasHealing}}
{{localize "DAGGERHEART.UI.Chat.attackRoll.rollHealing"}}
{{else}}
{{localize "DAGGERHEART.UI.Chat.attackRoll.rollDamage"}}
{{/if}}
</span></button>
{{/if}}
{{else}}
{{!-- {{else}}
{{#if hasHealing}}
<button class="duality-action duality-action-healing" data-value="{{roll.total}}"><span>{{localize "DAGGERHEART.UI.Chat.attackRoll.rollHealing"}}</span></button>
{{/if}}
{{/if}} --}}
{{/if}}
{{#if hasEffect}}
<button class="duality-action-effect" data-value="{{roll.total}}"><span>{{localize "DAGGERHEART.UI.Chat.attackRoll.applyEffect"}}</span></button>