164 - Add Hope/Fear formula

This commit is contained in:
Dapoolp 2025-06-25 16:16:47 +02:00
parent aacaf516b2
commit 8423ab6776
9 changed files with 125 additions and 57 deletions

View file

@ -67,6 +67,8 @@ export default class DHActionConfig extends DaggerheartSheet(ApplicationV2) {
context.getRealIndex = this.getRealIndex.bind(this);
context.disableOption = this.disableOption.bind(this);
context.isNPC = this.action.actor && this.action.actor.type !== 'character';
context.hasRoll = this.action.hasRoll();
console.log(context)
return context;
}

View file

@ -42,13 +42,12 @@ export default class CostSelectionDialog extends HandlebarsApplicationMixin(Appl
}
async _prepareContext(_options) {
console.log(this.costs);
const updatedCosts = this.action.calcCosts(this.costs),
updatedUses = this.action.calcUses(this.uses);
return {
costs: updatedCosts,
uses: updatedUses,
canUse: this.action.getRealCosts(updatedCosts)?.hasCost && this.action.hasUses(updatedUses)
canUse: this.action.hasCost(updatedCosts) && this.action.hasUses(updatedUses)
};
}

View file

@ -28,10 +28,6 @@ export class DHRoll extends Roll {
this.applyKeybindings(config);
// let roll;
// if(config.dialog?.configure === false) {
// roll = new this('', config.actor, config);
// } else {
if (config.dialog.configure !== false) {
// Open Roll Dialog
const DialogClass = config.dialog?.class ?? this.DefaultDialog;