Begin work on the custom editor for dice

This commit is contained in:
Oliver-Akins 2024-02-03 00:12:08 -07:00
parent 36e3a551b8
commit 0deda3235a
6 changed files with 145 additions and 4 deletions

View file

@ -2,10 +2,6 @@ export class MobData extends foundry.abstract.TypeDataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
dice: new fields.StringField({
initial: ``,
blank: true,
}),
bonus: new fields.NumberField({
initial: 0,
nullable: false,
@ -42,6 +38,15 @@ export class MobData extends foundry.abstract.TypeDataModel {
initial: ``,
blank: true,
}),
dice: new fields.ArrayField(
new fields.SchemaField({
// {count}d{sides} x {repeat}
count: new fields.NumberField({ min: 1 }),
sides: new fields.NumberField({ min: 2 }),
repeat: new fields.NumberField({ min: 1 }),
}),
{ initial: [] }
),
};
};
};