42 lines
2.2 KiB
JavaScript
42 lines
2.2 KiB
JavaScript
import { SYSTEM } from "../config/system.mjs"
|
|
export default class PrismRPGArmor 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 })
|
|
|
|
// MRR - Movement Rating Reduction (reduced by Vigor sub-attribute)
|
|
schema.mrr = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0, label: "Movement Rating Reduction" })
|
|
|
|
// Armor Passive - the passive ability of this armor piece
|
|
schema.passive = new fields.StringField({ required: false, initial: "", label: "Armor Passive" })
|
|
schema.passiveDescription = new fields.HTMLField({ required: false, textSearch: true, label: "Passive Description" })
|
|
|
|
// Armor Augment - the Withstand action effect (requires augment from class feature)
|
|
schema.augment = new fields.StringField({ required: false, initial: "", label: "Armor Augment" })
|
|
schema.augmentDescription = new fields.HTMLField({ required: false, textSearch: true, label: "Augment Description" })
|
|
|
|
// Legacy fields for compatibility
|
|
schema.defense = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: -50 })
|
|
schema.maximumMovement = new fields.StringField({ required: false, 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 = ["PRISMRPG.Armor"]
|
|
|
|
}
|