mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
Fixed so that homebrew downtime move actions can have effects (#1615)
This commit is contained in:
parent
94efbeada3
commit
22d446f360
5 changed files with 38 additions and 33 deletions
|
|
@ -114,9 +114,24 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
* Return Item the action is attached too.
|
||||
*/
|
||||
get item() {
|
||||
if (!this.parent.parent && this.systemPath)
|
||||
return foundry.utils.getProperty(this.parent, this.systemPath).get(this.id);
|
||||
|
||||
return this.parent.parent;
|
||||
}
|
||||
|
||||
get applyEffects() {
|
||||
if (this.item.systemPath) {
|
||||
const itemEffectIds = this.item.effects.map(x => x._id);
|
||||
const movePathSplit = this.item.systemPath.split('.');
|
||||
movePathSplit.pop();
|
||||
const move = foundry.utils.getProperty(this.parent, movePathSplit.join('.'));
|
||||
return new Collection(itemEffectIds.map(id => [id, move.effects.find(x => x.id === id)]));
|
||||
}
|
||||
|
||||
return this.item.effects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the first Actor parent found.
|
||||
*/
|
||||
|
|
@ -125,7 +140,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
? this.item
|
||||
: this.item?.parent instanceof DhpActor
|
||||
? this.item.parent
|
||||
: this.item?.actor;
|
||||
: null;
|
||||
}
|
||||
|
||||
static getRollType(parent) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue