mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
* cleanup * test * Step 1 * #2 * Fix Effect Action & Add Hope tumation settings to hook * remove circular dependency * Snuck in some localization fixes I noticed * Remove success condition for duality roll gain * Changed config.roll.type logic --------- Co-authored-by: WBHarry <williambjrklund@gmail.com>
37 lines
1.3 KiB
JavaScript
37 lines
1.3 KiB
JavaScript
import DHBaseAction from "../action/baseAction.mjs";
|
|
|
|
export default class DHApplyEffect extends foundry.abstract.TypeDataModel {
|
|
static defineSchema() {
|
|
const fields = foundry.data.fields;
|
|
|
|
return {
|
|
title: new fields.StringField(),
|
|
targets: new fields.ArrayField(
|
|
new fields.SchemaField({
|
|
id: new fields.StringField({ required: true }),
|
|
name: new fields.StringField(),
|
|
img: new fields.StringField(),
|
|
hit: new fields.BooleanField({ initial: false })
|
|
})
|
|
),
|
|
targetSelection: new fields.BooleanField({ initial: true }),
|
|
source: new fields.SchemaField({
|
|
actor: new fields.StringField(),
|
|
item: new fields.StringField(),
|
|
action: new fields.StringField()
|
|
})
|
|
};
|
|
}
|
|
|
|
prepareDerivedData() {
|
|
this.hasHitTarget = this.targets.filter(t => t.hit === true).length > 0;
|
|
this.currentTargets =
|
|
this.targetSelection !== true
|
|
? Array.from(game.user.targets).map(t => DHBaseAction.formatTarget(t))
|
|
: this.targets;
|
|
}
|
|
|
|
get messageTemplate() {
|
|
return 'systems/daggerheart/templates/ui/chat/apply-effects.hbs';
|
|
}
|
|
}
|