mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-21 18:09:54 +02:00
Prevent assigning main damage on healing actions
This commit is contained in:
parent
23ebe6f6b5
commit
2ef78f2c89
2 changed files with 34 additions and 32 deletions
|
|
@ -474,7 +474,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
||||||
source.damage.main = null;
|
source.damage.main = null;
|
||||||
source.damage.resources = {};
|
source.damage.resources = {};
|
||||||
for (const [partKey, part] of Object.entries(source.damage.parts)) {
|
for (const [partKey, part] of Object.entries(source.damage.parts)) {
|
||||||
if (partKey === 'hitPoints') {
|
if (partKey === 'hitPoints' && source.type !== 'healing') {
|
||||||
source.damage.main = {
|
source.damage.main = {
|
||||||
...part,
|
...part,
|
||||||
includeBase: source.damage.includeBase,
|
includeBase: source.damage.includeBase,
|
||||||
|
|
|
||||||
|
|
@ -1,44 +1,46 @@
|
||||||
<fieldset class="one-column">
|
{{#unless (eq @root.source.type 'healing')}}
|
||||||
<legend class="with-icon">
|
<fieldset class="one-column">
|
||||||
{{#if (eq @root.source.type 'healing')}}
|
<legend class="with-icon">
|
||||||
{{localize "DAGGERHEART.GENERAL.healing"}}
|
|
||||||
{{else}}
|
|
||||||
{{localize "DAGGERHEART.GENERAL.damage"}}
|
{{localize "DAGGERHEART.GENERAL.damage"}}
|
||||||
{{/if}}
|
{{#if source.main}}
|
||||||
{{#if source.main}}
|
<a data-action="removeDamage"><i class="fa-solid fa-trash icon-button"></i></a>
|
||||||
<a data-action="removeDamage"><i class="fa-solid fa-trash icon-button"></i></a>
|
{{else}}
|
||||||
{{else}}
|
<a data-action="addDamage"><i class="fa-solid fa-plus icon-button"></i></a>
|
||||||
<a data-action="addDamage"><i class="fa-solid fa-plus icon-button"></i></a>
|
{{/if}}
|
||||||
{{/if}}
|
</legend>
|
||||||
</legend>
|
|
||||||
|
|
||||||
{{#if source.main}}
|
{{#if source.main}}
|
||||||
<div class="nest-inputs">
|
<div class="nest-inputs">
|
||||||
{{#if @root.hasBaseDamage}}
|
{{#if @root.hasBaseDamage}}
|
||||||
{{formField @root.fields.damage.fields.main.fields.includeBase value=@root.source.damage.includeBase name="damage.main.includeBase" classes="checkbox" localize=true }}
|
{{formField @root.fields.damage.fields.main.fields.includeBase value=@root.source.damage.includeBase name="damage.main.includeBase" classes="checkbox" localize=true }}
|
||||||
|
{{/if}}
|
||||||
|
{{#unless (eq @root.source.type 'healing')}}
|
||||||
|
{{formField baseFields.main.fields.direct value=source.main.direct name=(concat path "damage.main.direct") localize=true classes="checkbox"}}
|
||||||
|
{{/unless}}
|
||||||
|
{{#if (and @root.isNPC (not (eq path 'system.attack.')))}}
|
||||||
|
{{formField baseFields.main.fields.groupAttack value=source.main.groupAttack name=(concat path "damage.main.groupAttack") localize=true classes="select"}}
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
{{> damageData damage=source.main fields=fields.main.fields basePath=(concat path "damage.main")}}
|
||||||
|
{{#if horde}}
|
||||||
|
{{> hordeDamage source=source.main fields=fields.main.fields basePath=(concat path "damage.main")}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#unless (eq @root.source.type 'healing')}}
|
{{#if (ne @root.source.type 'healing')}}
|
||||||
{{formField baseFields.main.fields.direct value=source.main.direct name=(concat path "damage.main.direct") localize=true classes="checkbox"}}
|
{{formField fields.main.fields.type value=source.main.type name=(concat path "damage.main.type") localize=true}}
|
||||||
{{/unless}}
|
|
||||||
{{#if (and @root.isNPC (not (eq path 'system.attack.')))}}
|
|
||||||
{{formField baseFields.main.fields.groupAttack value=source.main.groupAttack name=(concat path "damage.main.groupAttack") localize=true classes="select"}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
|
||||||
{{> damageData damage=source.main fields=fields.main.fields basePath=(concat path "damage.main")}}
|
|
||||||
{{#if horde}}
|
|
||||||
{{> hordeDamage source=source.main fields=fields.main.fields basePath=(concat path "damage.main")}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if (ne @root.source.type 'healing')}}
|
</fieldset>
|
||||||
{{formField fields.main.fields.type value=source.main.type name=(concat path "damage.main.type") localize=true}}
|
{{/unless}}
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
{{#unless (eq path 'system.attack.')}}
|
{{#unless (eq path 'system.attack.')}}
|
||||||
{{! In the future, consider allowing this even on NPCs}}
|
{{! In the future, consider allowing this even on NPCs}}
|
||||||
<fieldset class="one-column">
|
<fieldset class="one-column">
|
||||||
<legend class="with-icon">
|
<legend class="with-icon">
|
||||||
{{localize "DAGGERHEART.GENERAL.Resource.plural"}}
|
{{#if (eq @root.source.type 'healing')}}
|
||||||
|
{{localize "DAGGERHEART.GENERAL.healing"}}
|
||||||
|
{{else}}
|
||||||
|
{{localize "DAGGERHEART.GENERAL.Resource.plural"}}
|
||||||
|
{{/if}}
|
||||||
{{#unless @root.allDamageTypesUsed}}<a data-action="addDamageResource"><i class="fa-solid fa-plus icon-button"></i></a>{{/unless}}
|
{{#unless @root.allDamageTypesUsed}}<a data-action="addDamageResource"><i class="fa-solid fa-plus icon-button"></i></a>{{/unless}}
|
||||||
</legend>
|
</legend>
|
||||||
{{#each source.resources as |dmg key|}}
|
{{#each source.resources as |dmg key|}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue