/**
 * Application de feuille de PNJ pour Mournblade
 */
import MournbladeActorSheet from "./base-actor-sheet.mjs"

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

  /** @override */
  static PARTS = {
    sheet: {
      template: "systems/fvtt-mournblade/templates/actor-sheet.hbs",
    },
  }

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

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

    // Add pnj-specific data
    context.skills = actor.getSkills()
    context.armes = foundry.utils.duplicate(actor.getWeapons())
    context.protections = foundry.utils.duplicate(actor.getArmors())
    context.dons = foundry.utils.duplicate(actor.getDons())
    context.pactes = foundry.utils.duplicate(actor.getPactes())
    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
  }
}