import { SYSTEM } from "../config/system.mjs"
export default class LethalFantasyArmor extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    const fields = foundry.data.fields
    const schema = {}
    const requiredInteger = { required: true, nullable: false, integer: true }

    schema.description = new fields.HTMLField({ required: true, textSearch: true })
    schema.armorType = new fields.StringField({ required: true, initial: "light", choices: SYSTEM.ARMOR_TYPE })
    schema.defense = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: -50 })
    schema.maximumMovement = new fields.StringField({ ...requiredInteger, required: true, initial: "" })
    schema.hp = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
    schema.damageReduction = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })

    schema.encLoad = new fields.NumberField({ required: true, initial: 0, min: 0 })
    schema.equipped = new fields.BooleanField({ required: true, initial: false })
    schema.isHelmet = new fields.BooleanField({ required: true, initial: false })

    schema.cost = new fields.NumberField({ required: true, initial: 0, min: 0 })
    schema.money = new fields.StringField({ required: true, initial: "tinbit", choices: SYSTEM.MONEY })
    
    return schema
  }

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

}
