Skip to content

Commit

Permalink
Restore range penalties to strike attack rolls (#14192)
Browse files Browse the repository at this point in the history
  • Loading branch information
stwlam committed Mar 12, 2024
1 parent cc54843 commit f3a77a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/module/actor/character/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1549,7 +1549,8 @@ class CharacterPF2e<TParent extends TokenDocumentPF2e | null = TokenDocumentPF2e
const statistic = context.origin.statistic ?? action;
const maps = calculateMAPs(context.origin.item, { domains: context.domains, options: context.options });
const maPenalty = createMAPenalty(maps, mapIncreases, context.options);
const check = checkModifiers[mapIncreases](statistic, R.compact([maPenalty]));
const allModifiers = R.compact([maPenalty, params.modifiers, context.origin.modifiers].flat());
const check = checkModifiers[mapIncreases](statistic, allModifiers);

// Check whether target is out of maximum range; abort early if so
if (context.origin.item.isRanged && typeof context.target?.distance === "number") {
Expand Down
4 changes: 2 additions & 2 deletions src/module/actor/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,6 @@ function strikeFromMeleeItem(item: MeleePF2e<ActorPF2e>): NPCStrike {
}
}

const otherModifiers = R.compact([map]);
const title = game.i18n.format(
item.isMelee ? "PF2E.Action.Strike.MeleeLabel" : "PF2E.Action.Strike.RangedLabel",
{ weapon: item.name },
Expand All @@ -538,7 +537,8 @@ function strikeFromMeleeItem(item: MeleePF2e<ActorPF2e>): NPCStrike {
);
const dosAdjustments = extractDegreeOfSuccessAdjustments(context.origin.actor.synthetics, domains);

const check = new CheckModifier("strike", context.origin.statistic ?? strike, otherModifiers);
const allModifiers = R.compact([map, params.modifiers, context.origin.modifiers].flat());
const check = new CheckModifier("strike", context.origin.statistic ?? strike, allModifiers);
const checkContext: CheckCheckContext = {
type: "attack-roll",
identifier: `${item.id}.${attackSlug}.${meleeOrRanged}`,
Expand Down
4 changes: 2 additions & 2 deletions static/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -902,8 +902,8 @@
"AdjustedTarget": "<opposer>Target: {opposer}</opposer> <dc>({dcType} <preadjusted>{preadjusted}</preadjusted> <adjusted>{adjusted}</adjusted>)</dc>",
"NoChangeTarget": "<opposer>Target: {opposer}</opposer> <dc>({dcType} <adjusted>{adjusted}</adjusted>)</dc>",
"NoTarget": "<dc>{dcType} {dc}</dc>",
"WithTarget": "<opposer>Target: {opposer}</target> <dc>({dcType} {dc})</dc>",
"WithOrigin": "<opposer>Origin: {opposer}</target> <dc>({dcType} {dc})</dc>"
"WithTarget": "<opposer>Target: {opposer}</opposer> <dc>({dcType} {dc})</dc>",
"WithOrigin": "<opposer>Origin: {opposer}</opposer> <dc>({dcType} {dc})</dc>"
},
"Specific": {
"armor": "AC",
Expand Down

0 comments on commit f3a77a1

Please sign in to comment.