mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 19:51:08 +01:00
Begin damage
This commit is contained in:
parent
7cc92d153b
commit
1c90024a5d
11 changed files with 159 additions and 104 deletions
|
|
@ -140,6 +140,10 @@ export class DHBaseAction extends foundry.abstract.DataModel {
|
|||
return foundry.utils.getProperty(this.parent, this.systemPath).indexOf(this);
|
||||
}
|
||||
|
||||
get id() {
|
||||
return this._id;
|
||||
}
|
||||
|
||||
get item() {
|
||||
return this.parent.parent;
|
||||
}
|
||||
|
|
@ -190,8 +194,8 @@ export class DHBaseAction extends foundry.abstract.DataModel {
|
|||
event,
|
||||
title: this.item.name,
|
||||
source: {
|
||||
itemId: this.item._id,
|
||||
actionId: this._id
|
||||
item: this.item._id,
|
||||
action: this._id
|
||||
},
|
||||
type: this.type,
|
||||
hasDamage: !!this.damage?.parts?.length,
|
||||
|
|
@ -238,7 +242,7 @@ export class DHBaseAction extends foundry.abstract.DataModel {
|
|||
...config,
|
||||
roll: {
|
||||
// modifier: modifierValue,
|
||||
modifier: [],
|
||||
modifiers: [],
|
||||
trait: this.roll?.trait,
|
||||
label: game.i18n.localize(abilities[this.roll.trait].label),
|
||||
type: this.actionType,
|
||||
|
|
|
|||
|
|
@ -17,18 +17,18 @@ export default class DHDualityRoll extends foundry.abstract.TypeDataModel {
|
|||
static defineSchema() {
|
||||
return {
|
||||
title: new fields.StringField(),
|
||||
origin: new fields.StringField({ required: true }),
|
||||
/* origin: new fields.StringField({ required: true }), */
|
||||
roll: new fields.DataField({}),
|
||||
modifiers: new fields.ArrayField(
|
||||
/* modifiers: new fields.ArrayField(
|
||||
new fields.SchemaField({
|
||||
value: new fields.NumberField({ integer: true }),
|
||||
label: new fields.StringField({})
|
||||
})
|
||||
),
|
||||
hope: diceField(),
|
||||
), */
|
||||
/* hope: diceField(),
|
||||
fear: diceField(),
|
||||
advantageState: new fields.BooleanField({ nullable: true, initial: null }),
|
||||
advantage: diceField(),
|
||||
advantageState: new fields.BooleanField({ nullable: true, initial: null }), */
|
||||
/* advantage: diceField(), */
|
||||
targets: new fields.ArrayField(
|
||||
new fields.SchemaField({
|
||||
id: new fields.StringField({}),
|
||||
|
|
@ -41,14 +41,15 @@ export default class DHDualityRoll extends foundry.abstract.TypeDataModel {
|
|||
),
|
||||
hasDamage: new fields.BooleanField({ initial: false }),
|
||||
hasEffect: new fields.BooleanField({ initial: false }),
|
||||
action: new fields.SchemaField({
|
||||
itemId: new fields.StringField(),
|
||||
actionId: new fields.StringField()
|
||||
source: new fields.SchemaField({
|
||||
actor: new fields.StringField(),
|
||||
item: new fields.StringField(),
|
||||
action: new fields.StringField()
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
get diceTotal() {
|
||||
/* get diceTotal() {
|
||||
return this.hope.value + this.fear.value;
|
||||
}
|
||||
|
||||
|
|
@ -89,5 +90,5 @@ export default class DHDualityRoll extends foundry.abstract.TypeDataModel {
|
|||
prepareDerivedData() {
|
||||
this.hope.discarded = this.hope.value < this.fear.value;
|
||||
this.fear.discarded = this.fear.value < this.hope.value;
|
||||
}
|
||||
} */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue