<div class="fvtt-cthulhu-eternal-roll-dialog">
  <fieldSet>
    {{#if (eq rollType "skill")}}
      <legend>{{localize "CTHULHUETERNAL.Label.skill"}}</legend>
    {{/if}}
    {{#if (eq rollType "char")}}
      <legend>{{localize "CTHULHUETERNAL.Label.characteristic"}}</legend>
    {{/if}}

    {{#if (eq rollType "resource")}}
      <legend>{{localize "CTHULHUETERNAL.Label.resourceRating"}}</legend>
      <div class="dialog-skill">{{rollItem.name}}
        :
        <span class="resource-score">{{initialScore}}
          ({{mul initialScore 5}}%)</span></div>
      <div class="dialog-skill">{{localize "CTHULHUETERNAL.Label.Hand"}}
        :
        {{rollItem.hand}}
        <input
          type="checkbox"
          data-action="selectHand"
          {{checked rollItem.enableHand}}
        /></div>
      <div class="dialog-skill">{{localize "CTHULHUETERNAL.Label.Stowed"}}
        :
        {{rollItem.stowed}}
        <input
          type="checkbox"
          data-action="selectStowed"
          {{checked rollItem.enableStowed}}
        /></div>
      <div class="dialog-skill">
        {{localize "CTHULHUETERNAL.Label.Storage"}}
        :
        {{rollItem.storage}}
        <input
          type="checkbox"
          data-action="selectStorage"
          {{checked rollItem.enableStorage}}
        />
      </div>
    {{else}}
      <div class="dialog-skill">{{rollItem.name}} : {{initialScore}}%</div>
    {{/if}}

    {{#if weapon}}
      {{#if isJunk}}
        <div class="dialog-skill red-warning">{{localize
            "CTHULHUETERNAL.Label.JunkWeapon"
          }}</div>
      {{/if}}
      {{#if isWorn}}
        <div class="dialog-skill orange-warning">{{localize
            "CTHULHUETERNAL.Label.WornWeapon"
          }}</div>
      {{/if}}
      <div class="dialog-skill">{{localize "CTHULHUETERNAL.Label.Weapon"}}
        :
        {{weapon.name}}</div>

      {{#if targetName}}
        <div class="dialog-skill">{{localize "CTHULHUETERNAL.Label.Target"}}
          :
          {{targetName}}</div>
      {{/if}}

      {{#if (eq weapon.system.weaponType "melee")}}
        <div class="dialog-skill">
          {{localize "CTHULHUETERNAL.Label.targetMove"}}
          <select name="meleeTargetMoveChoice" class="roll-skill-modifier">
            {{selectOptions
              choiceMeleeTargetMove
              localize=true
              selected=meleeTargetMoveChoice
              valueAttr="id"
              labelAttr="label"
            }}
          </select>
        </div>
      {{/if}}
      {{#if isRangedWeapon}}
        <div class="dialog-skill">
          {{localize "CTHULHUETERNAL.Label.rangedRange"}}
          <select name="rangedRangeChoice" class="roll-skill-modifier">
            {{selectOptions
              choiceRangedRange
              localize=true
              selected=rangedRangeChoice
              valueAttr="id"
              labelAttr="label"
            }}
          </select>
        </div>
        <div class="dialog-skill">
          {{localize "CTHULHUETERNAL.Label.targetMove"}}
          <select name="rangedTargetMoveChoice" class="roll-skill-modifier">
            {{selectOptions
              choiceRangedTargetMove
              localize=true
              selected=rangedTargetMoveChoice
              valueAttr="id"
              labelAttr="label"
            }}
          </select>
        </div>

        <div class="dialog-skill">
          {{localize "CTHULHUETERNAL.Label.aimingLastRound"}}
          <input
            type="checkbox"
            class="aimingLastRound"
            name="aimingLastRound"
          />
        </div>
        {{#if weapon.system.hasSight}}
          <div class="dialog-skill">
            {{localize "CTHULHUETERNAL.Label.aimingWithSight"}}
            <input
              type="checkbox"
              class="aimingWithSight"
              name="aimingWithSight"
            />
          </div>
        {{/if}}

      {{/if}}

      <div class="dialog-skill">
        {{localize "CTHULHUETERNAL.Label.visibility"}}
        <select name="visibilityChoice" class="roll-skill-modifier">
          {{selectOptions
            choiceVisibility
            localize=true
            selected=visibilityChoice
            valueAttr="id"
            labelAttr="label"
          }}
        </select>
      </div>
      <div class="dialog-skill">
        {{localize "CTHULHUETERNAL.Label.attackerState"}}
        <select name="attackerStateChoice" class="roll-skill-modifier">
          {{selectOptions
            choiceAttackerState
            localize=true
            selected=attackerStateChoice
            valueAttr="id"
            labelAttr="label"
          }}
        </select>
      </div>
      <div class="dialog-skill">
        {{localize "CTHULHUETERNAL.Label.targetSize"}}
        <select name="targetSizeChoice" class="roll-skill-modifier">
          {{selectOptions
            choiceTargetSize
            localize=true
            selected=targetSizeChoice
            valueAttr="id"
            labelAttr="label"
          }}
        </select>
      </div>

      {{#if weapon.system.hasSelectiveFire}}
        <div class="dialog-skill">Selective Fire :
          <select name="selectiveFireChoice" class="roll-skill-modifier">
            {{selectOptions
              choiceSelectiveFire
              localize=true
              selected=selectiveFireChoice
              valueAttr="id"
              labelAttr="label"
            }}
          </select>
        </div>
      {{/if}}

    {{/if}}

    {{#if isZeroWP}}
      <div class="dialog-skill red-warning">{{localize
          "CTHULHUETERNAL.Label.ZeroWP"
        }}</div>
    {{else}}
      {{#if isLowWP}}
        <div class="dialog-skill orange-warning">{{localize
            "CTHULHUETERNAL.Label.LowWP"
          }}
          : -20%</div>
      {{/if}}
    {{/if}}

    {{#if isExhausted}}
      <div class="dialog-skill orange-warning">{{localize
          "CTHULHUETERNAL.Label.Exhausted"
        }}
        : -20%</div>
    {{/if}}

  </fieldSet>

  {{#if hasModifier}}
    <fieldSet class="dialog-modifier">
      <legend>{{localize "CTHULHUETERNAL.Label.modifier"}}</legend>
      <select name="modifier" class="roll-skill-modifier">
        {{selectOptions choiceModifier selected=modifier}}
      </select>
    </fieldSet>
  {{/if}}

  {{#if hasMultiplier}}
    <fieldSet class="dialog-modifier">
      <legend>{{localize "CTHULHUETERNAL.Label.multiplier"}}</legend>
      <select
        name="multiplier"
        class="roll-skill-modifier roll-skill-multiplier"
      >
        {{selectOptions choiceMultiplier selected=multiplier}}
      </select>
    </fieldSet>
  {{/if}}

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