Adversary Attack

This commit is contained in:
Dapoolp 2025-06-24 21:28:49 +02:00
parent 5a8aed73d2
commit 2981aab917
19 changed files with 269 additions and 499 deletions

View file

@ -8,8 +8,8 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
this.config.experiences = [];
if(config.source?.action) {
this.item = config.actor.parent.items.get(config.source.item);
this.action = this.item.system.actions.find(a => a._id === config.source.action);
this.item = config.data.parent.items.get(config.source.item);
this.action = config.data.attack?._id == config.source.action ? config.data.attack : this.item.system.actions.find(a => a._id === config.source.action);
}
}
@ -47,7 +47,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
async _prepareContext(_options) {
const context = await super._prepareContext(_options);
context.experiences = Object.keys(this.config.actor.experiences).map(id => ({ id, ...this.config.actor.experiences[id] }));
context.experiences = Object.keys(this.config.data.experiences).map(id => ({ id, ...this.config.data.experiences[id] }));
context.selectedExperiences = this.config.experiences;
context.advantage = this.config.advantage;
/* context.diceOptions = this.diceOptions; */