import { SYSTEM } from "../config/system.mjs"
import { booleanField, htmlField, numberField } from "./shared.mjs"

export default class MGNEArmor extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    return {
      description: htmlField(""),
      armorDie: new foundry.data.fields.StringField({
        required: true,
        nullable: false,
        initial: "d4",
        choices: SYSTEM.armorDieChoices,
      }),
      penalty: numberField(0, 0, 6),
      weight: new foundry.data.fields.StringField({
        required: true, nullable: false, initial: "heavy",
        choices: SYSTEM.weightCategories,
      }),
      equipped: booleanField(false),
      broken: booleanField(false),
      durabilityDie: new foundry.data.fields.StringField({
        required: true, nullable: false, initial: "d6",
        choices: SYSTEM.usageDieChoices,
      }),
    }
  }

  /** @override */
  static LOCALIZATION_PREFIXES = ["MGNE.Armor"]
}
