import MournbladeActorSheet from "./base-actor-sheet.mjs"

export default class MournbladeCreatureSheet extends MournbladeActorSheet {
  /** @override */
  static DEFAULT_OPTIONS = {
    ...super.DEFAULT_OPTIONS,
    classes: [...super.DEFAULT_OPTIONS.classes],
    window: {
      ...super.DEFAULT_OPTIONS.window,
      title: "SHEETS.Actor.creature",
    },
  }

  /** @override */
  static PARTS = {
    sheet: {
      template: "systems/fvtt-mournblade/templates/creature-sheet.hbs",
      scrollable: [".tab.competences", ".tab.equipement", ".tab.biodata"],
    },
  }

  /** @override */
  tabGroups = {
    primary: "stats",
  }

  /** @override */
  async _prepareContext() {
    const context = await super._prepareContext()
    const actor = this.document

    // Add creature-specific data
    context.skills = actor.getSkills()
    context.armes = foundry.utils.duplicate(actor.getWeapons())
    context.protections = foundry.utils.duplicate(actor.getArmors())
    context.capacites = foundry.utils.duplicate(actor.getCapacites())
    context.runes = foundry.utils.duplicate(actor.getRunes())
    context.combat = actor.getCombatValues()
    context.equipements = foundry.utils.duplicate(actor.getEquipments())
    context.protectionTotal = actor.getProtectionTotal()
    context.santeMalus = actor.getStatusMalus()
    context.ameMalus = actor.getAmeMalus()
    return context
  }
}