mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
* Initial rolls working * Fixed reroll * more * More work * Added results section * . * Visual improvements * . * Removed traces of old TagTeamRoll * Added initiator handling * Added updating for other players * Fixed sync start * Completed finish method * Damage reroll * Fixed localization * Fixed crit damage * Fixes * Added visual of advantage and disadvantage dice
47 lines
1.8 KiB
JavaScript
47 lines
1.8 KiB
JavaScript
export default class TagTeamData extends foundry.abstract.DataModel {
|
|
static defineSchema() {
|
|
const fields = foundry.data.fields;
|
|
|
|
return {
|
|
initiator: new fields.SchemaField(
|
|
{
|
|
memberId: new fields.StringField({
|
|
required: true,
|
|
label: 'DAGGERHEART.APPLICATIONS.TagTeamSelect.FIELDS.initiator.memberId.label'
|
|
}),
|
|
cost: new fields.NumberField({
|
|
integer: true,
|
|
initial: 3,
|
|
label: 'DAGGERHEART.APPLICATIONS.TagTeamSelect.FIELDS.initiator.cost.label'
|
|
})
|
|
},
|
|
{ nullable: true, initial: null }
|
|
),
|
|
members: new fields.TypedObjectField(new fields.EmbeddedDataField(MemberData))
|
|
};
|
|
}
|
|
}
|
|
|
|
export class MemberData extends foundry.abstract.DataModel {
|
|
static defineSchema() {
|
|
const fields = foundry.data.fields;
|
|
|
|
return {
|
|
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 }),
|
|
selected: new fields.BooleanField({ initial: false })
|
|
};
|
|
}
|
|
|
|
get roll() {
|
|
return this.rollData ? CONFIG.Dice.daggerheart.DualityRoll.fromData(this.rollData) : null;
|
|
}
|
|
}
|