21 lines
969 B
JavaScript
21 lines
969 B
JavaScript
import { SYSTEM } from "../config/system.mjs"
|
|
|
|
export default class OathHammerAmmunition 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 })
|
|
schema.ammoType = new fields.StringField({ required: true, initial: "arrow", choices: SYSTEM.AMMO_TYPE_CHOICES })
|
|
schema.quantity = new fields.NumberField({ ...requiredInteger, initial: 1, min: 0 })
|
|
schema.properties = new fields.StringField({ required: true, nullable: false, initial: "" })
|
|
schema.cost = new fields.NumberField({ ...requiredInteger, initial: 0, min: 0 })
|
|
schema.currency = new fields.StringField({ required: true, initial: "gp", choices: SYSTEM.CURRENCY_CHOICES })
|
|
|
|
return schema
|
|
}
|
|
|
|
static LOCALIZATION_PREFIXES = ["OATHHAMMER.Ammunition"]
|
|
}
|