Skip to content

Commit

Permalink
Restore "str-damage" selector to NPC damage rolls when appropriate (f…
Browse files Browse the repository at this point in the history
  • Loading branch information
stwlam authored Aug 31, 2022
1 parent dcdb047 commit c1bd39e
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/module/system/damage/weapon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -700,18 +700,26 @@ class WeaponDamagePF2e {
"strike-damage",
"damage",
];
if (weapon.isOfType("melee")) return selectors;

if (weapon.isOfType("melee")) {
if (this.strengthBasedDamage(weapon)) {
selectors.push("str-damage");
}
return selectors;
}

if (weapon.group) {
selectors.push(`${weapon.group}-weapon-group-damage`);
}

if (weapon.category === "unarmed") {
selectors.push("unarmed-damage");
}

if (ability) {
selectors.push(`${ability}-damage`);
}

if (proficiencyRank >= 0) {
const proficiencies = ["untrained", "trained", "expert", "master", "legendary"];
selectors.push(`${proficiencies[proficiencyRank]}-damage`);
Expand Down Expand Up @@ -756,9 +764,14 @@ class WeaponDamagePF2e {
};
}

/** Determine whether the damage source is a strength-based statistic */
static strengthBasedDamage(weapon: WeaponPF2e | MeleePF2e): boolean {
return weapon.isMelee || (weapon.isThrown && !weapon.traits.has("splash"));
}

/** Determine whether a strike's damage includes the actor's strength modifier */
static strengthModToDamage(weapon: WeaponPF2e | MeleePF2e): boolean {
return weapon.isOfType("weapon") && (weapon.isMelee || (weapon.isThrown && !weapon.traits.has("splash")));
return weapon.isOfType("weapon") && this.strengthBasedDamage(weapon);
}
}

Expand Down

0 comments on commit c1bd39e

Please sign in to comment.