Skip to content

Commit

Permalink
Fix modifier adjustments for single-check actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaj-a committed Sep 22, 2024
1 parent 0d47e74 commit dbb4ba3
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/module/system/action-macros/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,18 @@ class ActionMacroHelpers {
target: options.target,
});

// add relevant modifier adjustments
const modifiers = (data.modifiers ?? [])
.map((modifier) => modifier.clone())
.map((modifier) => {
const adjustments = extractModifierAdjustments(options.actor.synthetics.modifierAdjustments, [type, slug], modifier.slug);

Check failure on line 90 in src/module/system/action-macros/helpers.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Replace `options.actor.synthetics.modifierAdjustments,·[type,·slug],·modifier.slug` with `⏎····················options.actor.synthetics.modifierAdjustments,⏎····················[type,·slug],⏎····················modifier.slug,⏎················`
modifier.adjustments = (modifier.adjustments ?? []).concat(adjustments);
return modifier;
});

return {
item,
modifiers: data.modifiers ?? [],
modifiers,
rollOptions: contextualRollOptions,
slug,
statistic,
Expand Down Expand Up @@ -172,15 +181,16 @@ class ActionMacroHelpers {

if (statistic instanceof Statistic) {
const dc = this.#resolveCheckDC({ unresolvedDC: options.difficultyClass });
await statistic.roll({
await statistic.extend({

Check failure on line 184 in src/module/system/action-macros/helpers.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Insert `⏎························`
modifiers,

Check failure on line 185 in src/module/system/action-macros/helpers.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Insert `····`
}).roll({

Check failure on line 186 in src/module/system/action-macros/helpers.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Replace `})` with `····})⏎························`
...eventToRollParams(options.event, { type: "check" }),

Check failure on line 187 in src/module/system/action-macros/helpers.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Insert `····`
token: selfToken,

Check failure on line 188 in src/module/system/action-macros/helpers.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Insert `····`
label,

Check failure on line 189 in src/module/system/action-macros/helpers.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Insert `····`
title: label,

Check failure on line 190 in src/module/system/action-macros/helpers.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Replace `························` with `····························`
dc,

Check failure on line 191 in src/module/system/action-macros/helpers.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Insert `····`
extraRollNotes: notes,

Check failure on line 192 in src/module/system/action-macros/helpers.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

Insert `····`
extraRollOptions: combinedOptions,
modifiers,
target: targetData.actor,
traits: actionTraits,
createMessage: options.createMessage,
Expand Down

0 comments on commit dbb4ba3

Please sign in to comment.