Fixed so that homebrew downtime move actions can have effects (#1615)

This commit is contained in:
WBHarry 2026-01-31 19:34:37 +01:00 committed by GitHub
parent 94efbeada3
commit 22d446f360
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 38 additions and 33 deletions

View file

@ -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) {