20 lines
825 B
JavaScript
20 lines
825 B
JavaScript
export default class Shadowrun6ActorBase extends foundry.abstract.TypeDataModel {
|
|
|
|
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;
|
|
}
|
|
} |