You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wanderhome-foundry-system/module/data/base-actor.mjs

23 lines
868 B
JavaScript

3 weeks ago
import WanderhomeDataModel from "./base-model.mjs";
export default class WanderhomeActorBase extends WanderhomeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
const requiredInteger = { required: true, nullable: false, integer: true };
const schema = {};
schema.health = new fields.SchemaField({
value: new fields.NumberField({ ...requiredInteger, initial: 10, min: 0 }),
max: new fields.NumberField({ ...requiredInteger, initial: 10 })
});
schema.power = new fields.SchemaField({
value: new fields.NumberField({ ...requiredInteger, initial: 5, min: 0 }),
max: new fields.NumberField({ ...requiredInteger, initial: 5 })
});
schema.biography = new fields.StringField({ required: true, blank: true }); // equivalent to passing ({initial: ""}) for StringFields
return schema;
}
}