<section class="monster-main monster-main-{{ifThen isPlayMode 'play' 'edit'}}">
  {{log "monster-main" this}}

  <fieldset>
    <legend>{{localize "LETHALFANTASY.Label.monster"}}</legend>
    <div class="monster-pc monster-pc-{{ifThen isPlayMode 'play' 'edit'}}">
      <div class="monster-left">
        <div class="monster-left-image">
          <img
            class="monster-img"
            src="{{actor.img}}"
            data-edit="img"
            data-action="editImage"
            data-tooltip="{{actor.name}}"
          />
        </div>

        <fieldset
          class="monster-characteristics monster-characteristics-{{ifThen
              isPlayMode
              'play'
              'edit'
            }}"
        >
          <div class="flexrow monster-hp">
            <span class="name">{{localize "LETHALFANTASY.Label.HP"}}</span>
            {{formInput
              systemFields.hp.fields.value
              value=system.hp.value
              disabled=isPlayMode
              classes="monster-hp-value"
            }}
            &nbsp;/&nbsp;
            {{formInput
              systemFields.hp.fields.max
              value=system.hp.max
              disabled=isPlayMode
              classes="monster-hp-value"
            }}
          </div>
          <div class="flexrow monster-hp">
            <span class="name">{{localize
                "LETHALFANTASY.Label.damageResistance"
              }}</span>
            {{formInput
              systemFields.hp.fields.damageResistance
              value=system.hp.damageResistance
              disabled=isPlayMode
              classes="monster-hp-value"
            }}
            <span class="name">{{localize
                "LETHALFANTASY.Label.shieldDamageReduction"
              }}</span>
            {{formInput
              systemFields.combat.fields.shieldDamageReduction
              value=system.combat.shieldDamageReduction
              disabled=isPlayMode
              classes="monster-hp-value"
            }}
          </div>
          <div class="flexrow monster-hp">
            <span class="name"><a
                class="rollable"
                data-roll-type="shield-defense"
                data-roll-dice={{system.combat.shieldDefenseDice}}
              ><i class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize
                  "LETHALFANTASY.Label.shieldDefenseDice"
                }}</a></span>
            {{formInput
              systemFields.combat.fields.shieldDefenseDice
              value=system.combat.shieldDefenseDice
              disabled=isPlayMode
              classes="monster-hp-value"
            }}
          </div>
        </fieldset>

      </div>
      <div class="monster-right">
        <div class="monster-name">
          {{formInput
            fields.name
            value=source.name
            rootId=partId
            disabled=isPlayMode
          }}
          <a
            class="control"
            data-action="toggleSheet"
            data-tooltip="LETHALFANTASY.ToggleSheet"
            data-tooltip-direction="UP"
          >
            <i class="fa-solid fa-user-{{ifThen isPlayMode 'lock' 'pen'}}"></i>
          </a>
        </div>

        <fieldset
          class="monster-characteristics monster-characteristics-{{ifThen
              isPlayMode
              'play'
              'edit'
            }}"
        >
          <legend>{{localize "LETHALFANTASY.Label.Saves"}}</legend>
          <div class="monster-saves">
            <div class="monster-save">
              <span class="name"><a
                  class="rollable"
                  data-roll-type="save"
                  data-roll-key="will"
                ><i class="lf-roll-small fa-solid fa-dice-d20"></i>
                  {{localize "LETHALFANTASY.Label.saves.will"}}
                </a></span>
              {{formField
                systemFields.saves.fields.will.fields.value
                value=system.saves.will.value
                disabled=isPlayMode
              }}
              <span class="name">
                <a
                  class="rollable"
                  data-roll-type="save"
                  data-roll-key="dodge"
                ><i class="lf-roll-small fa-solid fa-dice-d20"></i>
                  {{localize "LETHALFANTASY.Label.saves.dodge"}}
                </a>
              </span>
              {{formField
                systemFields.saves.fields.dodge.fields.value
                value=system.saves.dodge.value
                disabled=isPlayMode
              }}
              <span class="name">
                <a
                  class="rollable"
                  data-roll-type="save"
                  data-roll-key="toughness"
                ><i class="lf-roll-small fa-solid fa-dice-d20"></i>
                  {{localize "LETHALFANTASY.Label.saves.toughness"}}
                </a>
              </span>
              {{formField
                systemFields.saves.fields.toughness.fields.value
                value=system.saves.toughness.value
                disabled=isPlayMode
              }}
            </div>
            <div class="monster-save">
              <span class="name">
                <a
                  class="rollable"
                  data-roll-type="save"
                  data-roll-key="contagion"
                ><i class="lf-roll-small fa-solid fa-dice-d20"></i>
                  {{localize "LETHALFANTASY.Label.saves.contagion"}}
                </a>
              </span>
              {{formField
                systemFields.saves.fields.contagion.fields.value
                value=system.saves.contagion.value
                disabled=isPlayMode
              }}

              <span class="name">
                <a
                  class="rollable"
                  data-roll-type="save"
                  data-roll-key="poison"
                ><i class="lf-roll-small fa-solid fa-dice-d20"></i>
                  {{localize "LETHALFANTASY.Label.saves.poison"}}
                </a>
              </span>
              {{formField
                systemFields.saves.fields.poison.fields.value
                value=system.saves.poison.value
                disabled=isPlayMode
              }}

              <!-- <span class="name">
                <a class="rollable" data-roll-type="save" data-roll-key="paincourage" data-roll-dice="D20" data-tooltip="Pain/Courage check on wound of..."><i
                    class="lf-roll-small fa-solid fa-dice-d20"></i>
                  {{localize "LETHALFANTASY.Label.saves.paincourage"}}
                </a>
                </span>
              {{formField systemFields.saves.fields.paincourage.fields.value value=system.saves.paincourage.value disabled=isPlayMode}}

              <span data-tooltip="Pain save if wound exceeds">
              {{formField systemFields.hp.fields.painDamage value=system.hp.painDamage disabled=isPlayMode tooltip="Pain Damage"}}
              </span>-->

            </div>

          </div>
        </fieldset>

        <fieldset
          class="monster-characteristics monster-characteristics-{{ifThen
              isPlayMode
              'play'
              'edit'
            }}"
        >
          <legend>{{localize "LETHALFANTASY.Label.skills"}}</legend>
          <div class="monster-skills">
            <div class="monster-skill">
              <span class="name"><a
                  class="rollable"
                  data-roll-type="monster-skill"
                  data-roll-key="resistTorture"
                ><i class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize
                    "LETHALFANTASY.Label.resistTorture"
                  }}</a></span>
              {{formField
                systemFields.resists.fields.resistTorture.fields.value
                value=system.resists.resistTorture.value
                disabled=isPlayMode
              }}
              <span class="name"><a
                  class="rollable"
                  data-roll-type="monster-skill"
                  data-roll-key="resistPerformance"
                ><i class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize
                    "LETHALFANTASY.Label.resistPerformance"
                  }}</a></span>
              {{formField
                systemFields.resists.fields.resistPerformance.fields.value
                value=system.resists.resistPerformance.value
                disabled=isPlayMode
              }}
              <span class="name"><a
                  class="rollable"
                  data-roll-type="monster-skill"
                  data-roll-key="resistIntimidation"
                ><i class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize
                    "LETHALFANTASY.Label.resistIntimidation"
                  }}</a></span>
              {{formField
                systemFields.resists.fields.resistIntimidation.fields.value
                value=system.resists.resistIntimidation.value
                disabled=isPlayMode
              }}
            </div>
            <div class="monster-skill">
              <span class="name"><a
                  class="rollable"
                  data-roll-type="monster-skill"
                  data-roll-key="perception"
                ><i class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize
                    "LETHALFANTASY.Label.perception"
                  }}</a></span>
              {{formField
                systemFields.resists.fields.perception.fields.value
                value=system.resists.perception.value
                disabled=isPlayMode
              }}

              <span class="name"><a
                  class="rollable"
                  data-roll-type="monster-skill"
                  data-roll-key="stealth"
                ><i class="lf-roll-small fa-solid fa-dice-d20"></i>{{localize
                    "LETHALFANTASY.Label.stealth"
                  }}</a></span>
              {{formField
                systemFields.resists.fields.stealth.fields.value
                value=system.resists.stealth.value
                disabled=isPlayMode
              }}
            </div>

          </div>
        </fieldset>

      </div>
    </div>
  </fieldset>

  <fieldset
    class="monster-characteristics monster-characteristics-{{ifThen
        isPlayMode
        'play'
        'edit'
      }}"
  >
    <legend>{{localize "LETHALFANTASY.Label.characteristics"}}</legend>
    <div class="monster-characteristic">
      <span>{{localize "LETHALFANTASY.Label.int"}}</span>
      {{formField
        systemFields.characteristics.fields.int.fields.value
        value=system.characteristics.int.value
        disabled=isPlayMode
        data-char-id="int"
      }}
    </div>
    <div class="monster-characteristic">
      <span>{{localize "LETHALFANTASY.Label.dex"}}</span>
      {{formField
        systemFields.characteristics.fields.dex.fields.value
        value=system.characteristics.dex.value
        disabled=isPlayMode
        data-char-id="wis"
      }}
    </div>

    <legend>{{localize "LETHALFANTASY.Label.Movement"}}</legend>
    <div class="monster-movements">
      <div class="monster-movement">
        <div class="flexrow monster-hp">
          <span class="name">{{localize
              "LETHALFANTASY.Label.movement.walk"
            }}</span>
          {{formField
            systemFields.movement.fields.walk
            value=system.movement.walk
            disabled=isPlayMode
          }}
        </div>
        <div class="flexrow monster-hp">
          <span class="name">{{localize
              "LETHALFANTASY.Label.movement.jog"
            }}</span>
          {{formField
            systemFields.movement.fields.jog
            value=system.movement.jog
            disabled=isPlayMode
          }}
        </div>
        <div class="flexrow monster-hp">
          <span class="name">{{localize
              "LETHALFANTASY.Label.movement.run"
            }}</span>
          {{formField
            systemFields.movement.fields.run
            value=system.movement.run
            disabled=isPlayMode
          }}
        </div>
        <div class="flexrow monster-hp">
          <span class="name">{{localize
              "LETHALFANTASY.Label.movement.sprint"
            }}</span>
          {{formField
            systemFields.movement.fields.sprint
            value=system.movement.sprint
            disabled=isPlayMode
          }}
        </div>
      </div>
    </div>
  </fieldset>

</section>