Initial rolls working

This commit is contained in:
WBHarry 2026-03-03 00:17:49 +01:00
parent c48842dd2d
commit a0fa743b8e
20 changed files with 483 additions and 577 deletions

View file

@ -0,0 +1,28 @@
export default class TagTeamData extends foundry.abstract.DataModel {
static defineSchema() {
const fields = foundry.data.fields;
return {
members: new fields.TypedObjectField(
new fields.SchemaField({
name: new fields.StringField({ required: true }),
img: new fields.StringField({ required: true }),
rollType: new fields.StringField({
required: true,
choices: CONFIG.DH.GENERAL.tagTeamRollTypes,
initial: CONFIG.DH.GENERAL.tagTeamRollTypes.trait.id,
label: 'Roll Type'
}),
rollChoice: new fields.StringField({ nullable: true, initial: null }),
rollData: new fields.JSONField({ nullable: true, initial: null })
})
)
};
}
get roll() {
const roll = CONFIG.Dice.daggerheart.DualityRoll(JSON.parse(this.rollData));
return this.rollData ? CONFIG.Dice.daggerheart.DualityRoll(JSON.parse(this.rollData)) : null;
}
}