mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
Completed
This commit is contained in:
parent
58b855389d
commit
774141a8da
8 changed files with 94 additions and 66 deletions
|
|
@ -7,26 +7,31 @@ export default class DHAbilityUse extends foundry.abstract.TypeDataModel {
|
|||
img: new fields.StringField({}),
|
||||
name: new fields.StringField({}),
|
||||
description: new fields.StringField({}),
|
||||
actions: new fields.ArrayField(
|
||||
new fields.ObjectField({
|
||||
name: new fields.StringField({}),
|
||||
damage: new fields.SchemaField({
|
||||
type: new fields.StringField({}),
|
||||
value: new fields.StringField({})
|
||||
}),
|
||||
healing: new fields.SchemaField({
|
||||
type: new fields.StringField({}),
|
||||
value: new fields.StringField({})
|
||||
}),
|
||||
cost: new fields.SchemaField({
|
||||
type: new fields.StringField({}),
|
||||
value: new fields.NumberField({})
|
||||
}),
|
||||
target: new fields.SchemaField({
|
||||
type: new fields.StringField({ nullable: true })
|
||||
})
|
||||
})
|
||||
)
|
||||
source: new fields.SchemaField({
|
||||
actor: new fields.StringField(),
|
||||
item: new fields.StringField(),
|
||||
action: new fields.StringField()
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
get actionActor() {
|
||||
if (!this.source.actor) return null;
|
||||
return fromUuidSync(this.source.actor);
|
||||
}
|
||||
|
||||
get actionItem() {
|
||||
const actionActor = this.actionActor;
|
||||
if (!actionActor || !this.source.item) return null;
|
||||
|
||||
const item = actionActor.items.get(this.source.item);
|
||||
return item ? item.system.actionsList?.find(a => a.id === this.source.action) : null;
|
||||
}
|
||||
|
||||
get action() {
|
||||
const { actionItem: itemAction } = this;
|
||||
if (!this.source.action) return null;
|
||||
if (itemAction) return itemAction;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,11 @@ export default class AreaField extends fields.ArrayField {
|
|||
/** @inheritDoc */
|
||||
constructor(options = {}, context = {}) {
|
||||
const element = new fields.SchemaField({
|
||||
name: new fields.StringField({
|
||||
nullable: false,
|
||||
initial: 'Area',
|
||||
label: 'DAGGERHEART.GENERAL.name'
|
||||
}),
|
||||
type: new fields.StringField({
|
||||
nullable: false,
|
||||
choices: CONFIG.DH.ACTIONS.areaTypes,
|
||||
|
|
|
|||
|
|
@ -281,8 +281,14 @@ export function ActionMixin(Base) {
|
|||
name: this.name,
|
||||
img: this.baseAction ? this.parent.parent.img : this.img,
|
||||
tags: this.tags ? this.tags : ['Spell', 'Arcana', 'Lv 10'],
|
||||
area: this.area,
|
||||
summon: this.summon
|
||||
},
|
||||
source: {
|
||||
actor: this.actor.uuid,
|
||||
item: this.item.id,
|
||||
action: this.id,
|
||||
},
|
||||
itemOrigin: this.item,
|
||||
description: this.description || (this.item instanceof Item ? this.item.system.description : '')
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue