import OathHammerItemSheet from "./base-item-sheet.mjs"
import { SYSTEM } from "../../config/system.mjs"

export default class OathHammerNpcAttackSheet extends OathHammerItemSheet {
  /** @override */
  static DEFAULT_OPTIONS = {
    classes: ["npcattack"],
    position: { width: 460 },
    window: { contentClasses: ["npcattack-content"] },
  }

  /** @override */
  static PARTS = {
    main: { template: "systems/fvtt-oath-hammer/templates/item/npcattack-sheet.hbs" },
  }

  /** @override */
  async _prepareContext() {
    const context = await super._prepareContext()
    context.dicePoolChoices = Object.fromEntries(
      Array.from({ length: 21 }, (_, i) => [i, String(i)])
    )
    context.colorChoices = Object.fromEntries(
      Object.entries(SYSTEM.DICE_COLOR_TYPES).map(([k, v]) => [k, game.i18n.localize(v)])
    )
    return context
  }
}
