<div class="coc7 chat-card damage">

  <header class="card-header flexcol-coc7">
    <div class="flexrow-coc7">
      {{#if displayActorOnCard}}
        <img class="open-actor" data-actor-key="{{actorKey}}" style="flex: none;" src="{{actorImg}}" title="{{name}}" width="36" height="36" />
      {{/if}}
      <img class="open-actor" data-actor-key="{{actorKey}}" style="flex: none;" src="{{item.img}}" title="{{item.name}}" width="36" height="36" />
      <h3 style="text-align: center;font-weight: bolder;" class="item-name card-title">{{item.name}}</h3>
      <img class="open-actor" style="flex: none;" data-actor-key="{{targetKey}}" src="{{targetImg}}" title="{{targetName}}" width="36" height="36" />
    </div>

    <div class="card-content">
      {{{weapon.system.description.value}}}
    </div>

    <div class="options gm-select-only">
      {{#if hardrolled}}
        {{#if critical}}
          <span class='tag' title="{{localize 'CoC7.CriticalTitle'}}">{{localize 'CoC7.Critical'}}</span>
          {{#if impale}}
            <span class='tag' title="{{localize 'CoC7.ImpaleTitle'}}">{{localize 'CoC7.Impale'}}</span>
          {{/if}}
        {{/if}}
      {{else}}
        <span class='ic-switch{{#if critical}} switched-on{{/if}}' data-flag='critical' title="{{localize 'CoC7.CriticalTitle'}}">{{localize 'CoC7.Critical'}}</span>
        {{#if critical}}
          <span class='ic-switch{{#if impale}} switched-on{{/if}}' data-flag='impale' title="{{localize 'CoC7.ImpaleTitle'}}">{{localize 'CoC7.Impale'}}</span>
        {{/if}}
      {{/if}}
      {{#if damageInflicted}}
        {{#if ignoreArmor}}
          <span class='tag gm-visible-only'>{{localize 'CoC7.ArmorIgnored'}}</span>
        {{else if (and (ne armor '') (ne armor null))}}
          <span class='tag gm-visible-only'>{{localize 'CoC7.Armor'}}: {{armor}}</span>
          <span class='tag owner-visible-only'>{{localize 'CoC7.Armor'}}: {{armor}}</span>
        {{/if}}
      {{else}}
        <div class="armor flexrow-coc7">
          <div class="flexrow-coc7 flex-end gm-visible-only">
            <a class='ic-switch gm-visible-only{{#unless ignoreArmor}} switched-on{{/unless}}' data-flag='ignoreArmor'>
              {{#if ignoreArmor}}
                <i class="game-icon game-icon-armor-downgrade"></i>
              {{else}}
                <i class="game-icon game-icon-armor-upgrade"></i>
              {{/if}}
            </a>
            {{#unless ignoreArmor}}
              <label>{{localize 'CoC7.Armor'}}:</label>
              <form>
                <input type='text' name='armor' value='{{armor}}' />
              </form>
              {{#if isArmorForula}}
                <a class='ic-switch gm-visible-only' data-action='rollArmor'>
                  <i class="fas fa-dice"></i>
                </a>
              {{/if}}
            {{/unless}}
          </div>
          <div class="flexrow-coc7 flex-end owner-visible-only owner-info" data-actor-key="{{targetKey}}">
            {{#unless ignoreArmor}}
              <label>{{localize 'CoC7.Armor'}}:</label>
              <span>{{armor}}</span>
            {{/unless}}
          </div>
        </div>
      {{/if}}
    </div>

  </header>

  {{#if rolled}}
    {{{_htmlRoll}}}
    {{#if targetKey}}
      {{#if damageInflicted}}
        <div class='card-result'>{{ localize 'CoC7.DamageInflicted'}} : {{totalDamageString}}</div>
      {{else}}
        <div class="card-buttons gm-visible-only">
          <button data-action="dealDamage">{{ localize 'CoC7.InflictPain' }} ({{totalDamageString}})</button>
        </div>
      {{/if}}
    {{else}}
      <div class='card-result'>{{ localize 'CoC7.TotalDamage' }} : {{totalDamageString}}
        <div class="die-result-overlay-br">
          <span>
            <button data-action="dealDamageToSelectedTarget">
              <i class="fas fa-user-minus noRemove"></i>
            </button>
          </span>
        </div>
      </div>
    {{/if}}
  {{else}}
    <div class="card-buttons owner-only">
      <button data-action="rollDamage">{{ localize 'CoC7.RollDamage' }}: {{damageFormula}}</button>
    </div>
  {{/if}}
</div>