<div class="tab stats sheet-part {{#if @root.tabs.stats.active}}active{{/if}}" data-group="sheet" data-tab="stats">
  <h3>{{ localize 'VERMINE.base_values' }}</h3>

  {{!-- Total attaque (lancable) --}}
  <div class="mdb align-center">
    <h4>{{ localize 'VERMINE.total_attack' }}</h4>
    <a class="rollable" data-type="creature-attack" data-label="attack" title="{{ localize 'VERMINE.roll' }}">{{ system.computed.attack }}<i class="fas fa-dice-d10"></i></a>
  </div>

  {{!-- Réaction (lancable) --}}
  <div class="mdb align-center">
    <h4>{{ localize 'ADVERSITY.reaction' }}</h4>
    <a class="rollable" data-type="creature-reaction" data-label="reaction" title="{{ localize 'VERMINE.roll' }}">{{ system.computed.reaction }}{{#if system.computed.reactionBonus}}+{{system.computed.reactionBonus}}{{/if}}<i class="fas fa-dice-d10"></i></a>
  </div>

  <section class="grid grid-3col gap-md">
    <div class="mdb">
      <h4 class="align-center">{{ localize 'ADVERSITY.pattern' }}: {{ patternLabel }}</h4>
      <ul class="unstyled">
        <li>{{ localize 'ADVERSITY.attack' }}: {{ creaturePatternLevel "attack" system.pattern.value }}</li>
        <li>{{ localize 'ADVERSITY.damage' }}: {{ creaturePatternLevel "damage" system.pattern.value }}</li>
        <li>{{ localize 'ADVERSITY.wounds' }}:
          {{ creaturePatternLevel "minorWound" system.pattern.value }}/
          {{ creaturePatternLevel "majorWound" system.pattern.value }}/
          {{ creaturePatternLevel "deadlyWound" system.pattern.value }}
        </li>
      </ul>
    </div>
    <div class="mdb">
      <h4 class="align-center">{{ localize 'ADVERSITY.size' }}: {{ sizeLabel }}</h4>
      <ul class="unstyled">
        <li>{{ localize 'ADVERSITY.attack' }}: {{ sizeCumulative.attack }}</li>
        <li>{{ localize 'ADVERSITY.vigor' }}: {{ sizeCumulative.vigor }}</li>
        <li>{{ localize 'ADVERSITY.wounds' }}:
          {{ sizeCumulative.minorWound }}/
          {{ sizeCumulative.majorWound }}/
          {{ sizeCumulative.deadlyWound }}
        </li>
      </ul>
    </div>
    <div class="mdb">
      <h4 class="align-center">{{ localize 'ADVERSITY.role' }}: {{ roleLabel }}</h4>
      <ul class="unstyled">
        <li>{{ localize 'ADVERSITY.reaction' }}: {{ creatureRoleLevel "reaction" system.role.value }} + {{ creatureRoleLevel "reaction_bonus" system.role.value }}</li>
        <li>{{ localize 'ADVERSITY.pools' }}: {{ creatureRoleLevel "pools" system.role.value }}</li>
        <li>{{ localize 'ADVERSITY.gear' }}: {{ creatureRoleLevel "gear" system.role.value }}</li>
        <li>{{ localize 'ADVERSITY.protection' }}: {{ creatureRoleLevel "protection" system.role.value }}</li>
      </ul>
    </div>
  </section>

  <section class="grid grid-2col gap-md">
    <div class="mdb">
      <h4 class="align-center">{{ localize 'ADVERSITY.pack' }}: {{ packLabel }}</h4>
      <ul class="unstyled">
        <li>{{ localize 'ADVERSITY.attack' }}: {{ creaturePackLevel "attack" system.pack.value }}</li>
        <li>{{ localize 'ADVERSITY.damage' }}: {{ creaturePackLevel "damage" system.pack.value }}</li>
        <li>{{ localize 'ADVERSITY.wounds' }}:
          {{ creaturePackLevel "minorWound" system.pack.value }}/
          {{ creaturePackLevel "majorWound" system.pack.value }}/
          {{ creaturePackLevel "deadlyWound" system.pack.value }}
        </li>
      </ul>
    </div>
    <div class="mdb">
      <h4 class="align-center">{{ localize 'VERMINE.wound_thresholds' }}</h4>
      <ul class="unstyled">
        <li>{{ localize 'VERMINE.wounds.light' }}: {{ system.minorWound.threshold }}D</li>
        <li>{{ localize 'VERMINE.wounds.heavy' }}: {{ system.majorWound.threshold }}D</li>
        <li>{{ localize 'VERMINE.wounds.deadly' }}: {{ system.deadlyWound.threshold }}D</li>
      </ul>
    </div>
  </section>

  {{!-- Ajustements manuels des valeurs calculées (disparités entre créatures
       de même gabarit : base dérivée + modificateur = valeur finale) --}}
  {{#if @root.isEditMode}}
  <section class="mdb">
    <h4 class="align-center">{{ localize 'VERMINE.adjustments' }}</h4>
    <table class="creature-adjustments">
      <thead>
        <tr>
          <th>{{ localize 'VERMINE.stat' }}</th>
          <th>{{ localize 'VERMINE.adjustment' }}</th>
          <th>{{ localize 'VERMINE.total' }}</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>{{ localize 'VERMINE.total_attack' }}</td>
          <td><input type="number" name="system.adjustments.attack" value="{{system.adjustments.attack}}" data-dtype="Number" /></td>
          <td>{{ system.computed.attack }}D</td>
        </tr>
        <tr>
          <td>{{ localize 'ADVERSITY.damage' }}</td>
          <td><input type="number" name="system.adjustments.damage" value="{{system.adjustments.damage}}" data-dtype="Number" /></td>
          <td>{{ system.computed.damage }}</td>
        </tr>
        <tr>
          <td>{{ localize 'ADVERSITY.vigor' }}</td>
          <td><input type="number" name="system.adjustments.vigor" value="{{system.adjustments.vigor}}" data-dtype="Number" /></td>
          <td>{{ system.computed.vigor }}D</td>
        </tr>
        <tr>
          <td>{{ localize 'ADVERSITY.reaction' }}</td>
          <td><input type="number" name="system.adjustments.reaction" value="{{system.adjustments.reaction}}" data-dtype="Number" /></td>
          <td>{{ system.computed.reaction }}D{{#ifgt system.computed.reactionBonus 0}}+{{system.computed.reactionBonus}}{{/ifgt}}</td>
        </tr>
        <tr>
          <td>{{ localize 'ADVERSITY.reaction_bonus' }}</td>
          <td><input type="number" name="system.adjustments.reactionBonus" value="{{system.adjustments.reactionBonus}}" data-dtype="Number" /></td>
          <td>{{ system.computed.reactionBonus }}</td>
        </tr>
        <tr>
          <td>{{ localize 'ADVERSITY.pools' }}</td>
          <td><input type="number" name="system.adjustments.pools" value="{{system.adjustments.pools}}" data-dtype="Number" /></td>
          <td>{{ system.computed.pools }}D</td>
        </tr>
        <tr>
          <td>{{ localize 'ADVERSITY.gear' }}</td>
          <td><input type="number" name="system.adjustments.gear" value="{{system.adjustments.gear}}" data-dtype="Number" /></td>
          <td>{{ system.computed.gear }}</td>
        </tr>
        <tr>
          <td>{{ localize 'ADVERSITY.gear_hindrance' }}</td>
          <td><input type="number" name="system.adjustments.gearHindrance" value="{{system.adjustments.gearHindrance}}" data-dtype="Number" /></td>
          <td>{{ system.computed.gearHindrance }}</td>
        </tr>
        <tr>
          <td>{{ localize 'ADVERSITY.protection' }}</td>
          <td><input type="number" name="system.adjustments.protection" value="{{system.adjustments.protection}}" data-dtype="Number" /></td>
          <td>{{ system.computed.protection }}</td>
        </tr>
      </tbody>
    </table>
  </section>
  {{/if}}
</div>
