<section
    class="tab {{tabs.attack.cssClass}} {{tabs.attack.id}}"
    data-tab="{{tabs.attack.id}}"
    data-group="{{tabs.attack.group}}"
>
    <fieldset class="one-column">
        <legend>{{localize "DAGGERHEART.GENERAL.basics"}}</legend>
        {{formGroup systemFields.attack.fields.img value=document._source.system.attack.img label="DAGGERHEART.GENERAL.imagePath" name="system.attack.img" localize=true}}
        {{formGroup systemFields.attack.fields.name value=document._source.system.attack.name label="DAGGERHEART.ACTIONS.Settings.attackName" name="system.attack.name" localize=true}}
    </fieldset>
    <fieldset class="one-column">
        <legend>{{localize "DAGGERHEART.GENERAL.attack"}}</legend>
        <div class="nest-inputs">
            {{formField systemFields.attack.fields.roll.fields.bonus value=document._source.system.attack.roll.bonus label="DAGGERHEART.ACTIONS.Settings.attackBonus" name="system.attack.roll.bonus" localize=true}}
            {{formField systemFields.attack.fields.range value=document._source.system.attack.range label="DAGGERHEART.GENERAL.range" name="system.attack.range" localize=true}}
            {{#if systemFields.attack.fields.target.fields}}
                {{ formField systemFields.attack.fields.target.fields.type value=document._source.system.attack.target.type label="DAGGERHEART.GENERAL.Target.single" name="system.attack.target.type" localize=true }}
                {{#if (and document._source.system.attack.target.type (not (eq document._source.system.attack.target.type 'self')))}}
                    {{ formField systemFields.attack.fields.target.fields.amount value=document._source.system.attack.target.amount label="DAGGERHEART.GENERAL.amount" name="system.attack.target.amount" localize=true}}
                {{/if}}
            {{/if}}
        </div>
        {{formGroup systemFields.criticalThreshold value=document._source.system.criticalThreshold label="DAGGERHEART.ACTIONS.Settings.criticalThreshold" name="system.criticalThreshold" localize=true}}
    </fieldset>
    {{> 'systems/daggerheart/templates/actionTypes/damage.hbs' fields=systemFields.attack.fields.damage.fields.parts.element.fields source=document.system.attack.damage path="system.attack." directField=systemFields.attack.fields.damage.fields.direct horde=(eq document._source.system.type 'horde')}}
</section>