Update action actionType & roll type

This commit is contained in:
Dapoolp 2025-08-23 12:35:38 +02:00
parent 5045d481e5
commit b5ba7e7fba
7 changed files with 14 additions and 12 deletions

View file

@ -7,7 +7,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
this.roll = roll;
this.config = config;
this.config.experiences = [];
this.reactionOverride = config.roll?.type === 'reaction';
this.reactionOverride = config.actionType === 'reaction';
if (config.source?.action) {
this.item = config.data.parent.items.get(config.source.item) ?? config.data.parent;
@ -114,7 +114,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
context.extraFormula = this.config.extraFormula;
context.formula = this.roll.constructFormula(this.config);
context.showReaction = !context.rollConfig.type && context.rollType === 'DualityRoll';
context.showReaction = !context.config.roll?.type && context.rollType === 'DualityRoll';
context.reactionOverride = this.reactionOverride;
}
return context;
@ -171,11 +171,11 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
static toggleReaction() {
if (this.config.roll) {
this.reactionOverride = !this.reactionOverride;
this.config.roll.type = this.reactionOverride
this.config.actionType = this.reactionOverride
? CONFIG.DH.ITEM.actionTypes.reaction.id
: this.config.roll.type === CONFIG.DH.ITEM.actionTypes.reaction.id
: this.config.actionType === CONFIG.DH.ITEM.actionTypes.reaction.id
? null
: this.config.roll.type;
: this.config.actionType;
this.render();
}
}

View file

@ -661,7 +661,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
})
});
game.system.api.fields.ActionFields.CostField.execute.call(this, result);
if(result) game.system.api.fields.ActionFields.CostField.execute.call(this, result);
}
//TODO: redo toggleEquipItem method