<div class="malefices-chat-card">

  <header class="chat-card-header">
    {{#if actorImg}}
      <img class="chat-actor-img" src="{{actorImg}}" alt="{{alias}}" />
    {{/if}}
    <div class="chat-actor-name">{{alias}}</div>
    {{#if img}}
      <div class="chat-header-roll">
        <img class="chat-roll-icon" src="{{img}}" alt="{{name}}" />
        <span class="chat-roll-name">{{name}}</span>
      </div>
    {{/if}}
  </header>

  <div class="chat-card-separator"></div>

  <dl class="chat-roll-details">
    {{#if attr}}
      <div class="chat-detail-row">
        <dt>{{attr.label}}</dt>
        <dd>{{attr.value}}</dd>
      </div>
    {{/if}}
    {{#if bonusMalusPerso}}
      <div class="chat-detail-row">
        <dt>Bonus/Malus biographique</dt>
        <dd>{{bonusMalusPerso}}</dd>
      </div>
    {{/if}}
    {{#if bonusMalusSituation}}
      <div class="chat-detail-row">
        <dt>Bonus/Malus de situation</dt>
        <dd>{{bonusMalusSituation}}</dd>
      </div>
    {{/if}}
    <div class="chat-detail-row chat-detail-target">
      <dt>Seuil final</dt>
      <dd>{{target}}</dd>
    </div>
    <div class="chat-detail-row chat-detail-roll">
      <dt>Résultat du dé</dt>
      <dd>{{roll.total}}</dd>
    </div>
  </dl>

  <div class="chat-card-result {{#if isSuccess}}result-success{{else}}result-failure{{/if}}">
    {{#if isSuccess}}
      {{#if isCritical}}
        <i class="fa-solid fa-star"></i> Réussite Critique !
        {{#if arme}}
          {{#if arme.system.dommagecritiquemort}}
            <div class="chat-result-damage">La victime est morte !</div>
          {{else}}
            {{#if arme.system.dommagecritiqueko}}
              <div class="chat-result-damage">La victime est KO !</div>
            {{/if}}
            <div class="chat-result-damage">{{arme.system.dommagecritique}} dommages</div>
          {{/if}}
        {{/if}}
      {{else if isPart}}
        <i class="fa-solid fa-circle-check"></i> Réussite Particulière !
        {{#if arme}}
          <div class="chat-result-damage">{{arme.system.dommagepart}} dommages</div>
        {{/if}}
      {{else}}
        <i class="fa-solid fa-check"></i> Succès !
        {{#if arme}}
          <div class="chat-result-damage">{{arme.system.dommagenormale}} dommages</div>
        {{/if}}
      {{/if}}
    {{else}}
      {{#if isFumble}}
        <i class="fa-solid fa-skull"></i> Échec Critique !
      {{else}}
        <i class="fa-solid fa-xmark"></i> Échec !
      {{/if}}
    {{/if}}
  </div>

  {{#unless isReroll}}
    {{#if (gt destin 0)}}
      <div class="chat-card-actions">
        <button class="chat-card-button roll-destin">
          <i class="fa-solid fa-rotate-right"></i> Relancer (1 Destin)
        </button>
      </div>
    {{/if}}
  {{/unless}}

</div>
