{{#if (eq @root.source.type 'healing')}} {{localize "DAGGERHEART.GENERAL.healing"}} {{else}} {{localize "DAGGERHEART.GENERAL.damage"}} {{/if}} {{#if source.main}} {{else}} {{/if}} {{#if source.main}}
{{#if @root.hasBaseDamage}} {{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}}
{{> damageData data=source.main fields=fields.main.fields basePath=(concat path "damage.main")}} {{/if}}
{{localize "DAGGERHEART.GENERAL.Resource.plural"}} {{#unless (eq path 'system.attack.')}}{{/unless}} {{!-- Handlebars uses Symbol.Iterator to produce index|key. This isn't compatible with our parts object, so we instead use applyTo, which is the same value --}} {{#each source.resources as |dmg key|}}
{{localize (concat "DAGGERHEART.CONFIG.HealingType." dmg.applyTo ".name")}} {{#unless (or dmg.base ../path)}} {{/unless}} {{> damageData data=dmg fields=../fields.resources.element.fields basePath=(concat path "damage.resources." dmg.applyTo)}}
{{/each}} {{#*inline "formula"}} {{#unless dmg.base}} {{formField fields.custom.fields.enabled value=source.custom.enabled name=(concat basePath "." target ".custom.enabled") classes="checkbox" localize=true}} {{/unless}} {{#if source.custom.enabled}} {{formField fields.custom.fields.formula value=source.custom.formula name=(concat basePath "." target ".custom.formula") localize=true}} {{else}}
{{#unless @root.isNPC}} {{formField fields.multiplier value=source.multiplier name=(concat basePath "." target ".multiplier") localize=true}} {{/unless}} {{#if (eq source.multiplier 'flat')}}{{formField fields.flatMultiplier value=source.flatMultiplier name=(concat basePath "." target ".flatMultiplier") localize=true }}{{/if}} {{formField fields.dice value=source.dice name=(concat basePath "." target ".dice") localize=true}} {{formField fields.bonus value=source.bonus name=(concat basePath "." target ".bonus") localize=true}}
{{/if}} {{#if @root.isNPC}} {{/if}} {{/inline}} {{#*inline "damageData"}} {{#if (and (not @root.isNPC) @root.hasRoll (not data.base))}} {{formField fields.resultBased value=data.resultBased name=(concat basePath ".resultBased") localize=true classes="checkbox"}} {{/if}} {{#if (and (not @root.isNPC) @root.hasRoll (not data.base) data.resultBased)}}
{{localize "DAGGERHEART.GENERAL.withThing" thing=(localize "DAGGERHEART.GENERAL.hope")}} {{> formula fields=fields.value.fields type=fields.type dmg=data source=data.value target="value" key=data.applyTo path=../path}}
{{localize "DAGGERHEART.GENERAL.withThing" thing=(localize "DAGGERHEART.GENERAL.fear")}} {{> formula fields=fields.valueAlt.fields type=fields.type dmg=data source=data.valueAlt target="valueAlt" key=data.applyTo path=../path}}
{{else}} {{> formula fields=fields.value.fields type=fields.type dmg=data source=data.value basePath=basePath target="value" key=data.applyTo path=../path}} {{/if}} {{#if (ne @root.source.type 'healing')}} {{formField fields.type value=data.type name=(concat basePath ".type") localize=true}} {{/if}} {{#if ../horde}}
{{localize "DAGGERHEART.ACTORS.Adversary.hordeDamage"}}
{{formField fields.valueAlt.fields.flatMultiplier value=data.valueAlt.flatMultiplier name=(concat basePath ".valueAlt.flatMultiplier") label="DAGGERHEART.ACTIONS.Settings.multiplier" classes="inline-child" localize=true }} {{formField fields.valueAlt.fields.dice value=data.valueAlt.dice name=(concat basePath ".valueAlt.dice") classes="inline-child" localize=true}} {{formField fields.valueAlt.fields.bonus value=data.valueAlt.bonus name=(concat basePath ".valueAlt.bonus") localize=true classes="inline-child"}}
{{/if}} {{/inline}}