33 lines
1.4 KiB
JavaScript
33 lines
1.4 KiB
JavaScript
import { SYSTEM } from "../config/system.mjs"
|
|
|
|
export default class OathHammerEquipment extends foundry.abstract.TypeDataModel {
|
|
static defineSchema() {
|
|
const fields = foundry.data.fields
|
|
const requiredInteger = { required: true, nullable: false, integer: true }
|
|
const schema = {}
|
|
|
|
schema.description = new fields.HTMLField({ required: true, textSearch: true })
|
|
|
|
// Sub-category matching the rulebook sections (pp.90-96)
|
|
schema.itemType = new fields.StringField({ required: true, initial: "misc", choices: SYSTEM.EQUIPMENT_TYPE_CHOICES })
|
|
|
|
schema.quantity = new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 })
|
|
|
|
// Item slots occupied when carried. 0 = small item (no slots).
|
|
schema.slots = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
|
|
|
// Rarity: DV for Fortune check when purchasing; 0 = always available
|
|
schema.rarity = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0, max: 6 })
|
|
|
|
// Light radius in feet — only relevant for light-source items (Candle/Lamp/Lantern/Torch)
|
|
schema.lightRadius = new fields.NumberField({ required: false, nullable: true, initial: null, min: 0 })
|
|
|
|
schema.cost = new fields.NumberField({ required: true, nullable: false, initial: 0, min: 0 })
|
|
schema.currency = new fields.StringField({ required: true, initial: "gp", choices: SYSTEM.CURRENCY_CHOICES })
|
|
|
|
return schema
|
|
}
|
|
|
|
static LOCALIZATION_PREFIXES = ["OATHHAMMER.Equipment"]
|
|
}
|