<section>
    <fieldset>
        <legend>Waffe auswählen</legend>
        <ul>
            {{#each weapons}}
                <li class="weapon {{#if isSelected}}selected{{/if}}" data-action="selectWeaponAndSkill"
                    data-weapon-id="{{this.weaponId}}" data-skill-id="{{this.skillId}}">
                    {{#if this.img}}<img src="{{this.img}}" style="width: 32px; height: 32px"/>{{else}}
                        <span style="width: 32px"></span> {{/if}}
                    <span>{{this.name}}
                        {{#if (ne this.skillName this.name)}}({{this.skillName}}){{/if}}</span>
                    <span>{{#if this.combatStatistics}}
                        (AT: {{this.combatStatistics.at}} PA: {{this.combatStatistics.pa}}){{/if}}</span></li>
            {{/each}}
        </ul>
    </fieldset>

    <fieldset>
        <legend>Manöver auswählen</legend>
        <ul>
            {{#each maneuver}}
                <li class="maneuver {{#if isSelected}}selected{{/if}} name-only" data-action="selectManeuver"
                    data-maneuver-id="{{this.id}}" class="{{this.source}}">{{this.name}}</li>
            {{/each}}
        </ul>
    </fieldset>

    <fieldset class="modding">
        <legend>Erschwernisse und Ansagen</legend>
        <div class="malus-and-mod">
            <label><span>Umstände</span>
                <input name="circumstance" type="number">
            </label>
            <label><span>Ansage</span>
                <input name="mod" type="number" {{disabled (not canMod)}}>
            </label>
            <label><span>Erschwernis</span>
                <input name="penalty" type="number" {{disabled true}}>
            </label>
        </div>
        <output class="modResult"></output>
    </fieldset>


    <div class="actions">
        <button type="button" data-action="defend" {{#if ready}}class="ready" {{else}}data-tooltip="{{notReadyReason}}"{{/if}}><i
                class="fa-solid fa-shield"></i>Verteidigen <span
                class="value"></span></button>
    </div>

</section>