<div class="fvtt-ftl-nomad-roll-dialog">

  <fieldSet>

    {{#if (eq rollType "skill")}}
      <legend>{{localize "FTLNOMAD.Label.skill"}}</legend>
    {{/if}}

    {{#if (eq rollType "damage")}}
      <div class="dialog-skill">Damage : {{weapon.system.damage}}</div>
      <div class="dialog-skill">Weapon : {{weapon.name}}</div>
    {{else}}
      {{#if availableSkills}}
        <label>{{localize "FTLNOMAD.Label.selectSkill"}}</label>
        <select name="selectedSkill" class="roll-skill-selector">
          {{#each availableSkills as |skill|}}
            <option
              value="{{skill.id}}"
              {{#if skill.selected}}selected{{/if}}
            >{{localize skill.label}} (2d6+{{skill.value}})</option>
          {{/each}}
        </select>
      {{else}}
        <div class="dialog-skill">{{localize rollItem.label}}
          : 2d6+{{rollItem.value}}</div>
      {{/if}}
    {{/if}}

    {{#if (eq rollType "weapon")}}
      <div class="dialog-skill">Weapon : {{weapon.name}}</div>
    {{/if}}

    {{#if isEncumbered}}
      <div class="dialog-skill red-warning">Encumbered : -1D for Physical Attacks</div>
    {{/if}}

  </fieldSet>

  <fieldSet class="dialog-modifier">

    {{#if (eq rollType "damage")}}
      <legend>Damage advantages/disadvantages</legend>
      <select name="damageModifier" class="roll-damage-modifier">
        {{selectOptions
          choiceDamageModifier
          selected=damageModifier
          localize=true
        }}
      </select>
    {{else}}
      <legend>{{localize "FTLNOMAD.Label.modifier"}}</legend>
      <select name="modifier" class="roll-skill-modifier">
        {{selectOptions choiceModifier selected=modifier localize=true}}
      </select>
      <label>{{localize "FTLNOMAD.Label.numericModifier"}}</label>
      <select name="numericModifierSelect" class="roll-numeric-modifier">
        {{selectOptions choiceNumericModifier selected=numericModifierSelect}}
      </select>
      {{#if vehicleBonus}}
        <div class="vehicle-bonus-info">
          <label>
            <input
              type="checkbox"
              name="useVehicleBonus"
              class="use-vehicle-bonus"
              checked
            />
            {{localize "FTLNOMAD.Label.vehicleBonus"}}
          </label>
          <span class="vehicle-bonus-value">+{{vehicleBonus}}</span>
        </div>
      {{/if}}
    {{/if}}

    {{#if (eq rollType "weapon")}}
      <select name="range-modifier" class="roll-skill-range-modifier">
        {{selectOptions choiceRangeModifier selected=rangeModifier}}
      </select>
      <ul>
        <li>Two Attacks :
          <input
            type="checkbox"
            name="isAiming"
            data-field="two-attacks"
            class="select-combat-option"
          />
        </li>
        <li>Aiming :
          <input
            type="checkbox"
            data-field="aiming"
            class="select-combat-option"
          /></li>
        <li>Dim Lightning :
          <input
            type="checkbox"
            data-field="dim"
            class="select-combat-option"
          /></li>
        <li>Darkness :
          <input
            type="checkbox"
            data-field="darkness"
            class="select-combat-option"
          /></li>
        <li>Target Prone/Obscured :
          <input
            type="checkbox"
            data-field="prone"
            class="select-combat-option"
          /></li>
        <li>Target Cover :
          <input
            type="checkbox"
            data-field="cover"
            class="select-combat-option"
          /></li>
        <li>1/2 Auto Fire Recoil :
          <input
            type="checkbox"
            data-field="recoil-first"
            class="select-combat-option"
          /></li>
        <li>2+ Auto Fire Recoil :
          <input
            type="checkbox"
            data-field="recoil-third"
            class="select-combat-option"
          /></li>
        <li>Target Aware :
          <input
            type="checkbox"
            data-field="aware"
            class="select-combat-option"
          /></li>
      </ul>
    {{/if}}

  </fieldSet>

  <fieldSet class="dialog-formula">
    <legend>{{localize "FTLNOMAD.Label.formula"}}</legend>
    <label
      name="fullFormula"
      id="roll-dialog-full-formula"
    >{{fullFormula}}</label>
  </fieldSet>

  <fieldSet>
    <legend>{{localize "FTLNOMAD.Label.rollView"}}</legend>
    <select name="visibility">
      {{selectOptions rollModes localize=true selected=visibility}}
    </select>
  </fieldSet>

</div>