Skip to content

Commit

Permalink
fix(KO): KO'd characters only take double damage, not double adjust etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
phBalance committed Dec 20, 2024
1 parent d50ff6a commit cf95e1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
- Inobivous powers no longer show for Actor Description.
- Fixed the chat card name of Adjustment powers that targeted POWERs. Was showing attack item, not target power. [#1608](https://github.com/dmdorman/hero6e-foundryvtt/issues/1608)
- Fixed formatting issues with prosemirror editor caused by us overriding some css that we shouldn't have. [#1629](https://github.com/dmdorman/hero6e-foundryvtt/issues/1629)
- Knocked out targets no longer get double adjustment effect. [#1255](https://github.com/dmdorman/hero6e-foundryvtt/issues/1255)
- Explosions now correctly deal different damage to each token based on distance when using the "Apply Damage to ALL" button. [#1323](https://github.com/dmdorman/hero6e-foundryvtt/issues/1323)

## Version 4.0.12 [Hero System 6e (Unofficial) v2](https://github.com/dmdorman/hero6e-foundryvtt)

Expand Down
13 changes: 7 additions & 6 deletions module/item/item-attack.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2946,6 +2946,13 @@ async function _calcDamage(heroRoller, item, options) {
} else {
bodyForPenetrating = body;
}

// Knocked out targets take double STUN damage from attacks
const targetActor = (game.scenes.current.tokens.get(options.targetTokenId) || options.targetToken)?.actor;
if (targetActor?.statuses.has("knockedOut")) {
effects += "Knocked Out x2 STUN;";
stun *= 2;
}
}

const noHitLocationsPower = !!item.system.noHitLocations;
Expand Down Expand Up @@ -2981,12 +2988,6 @@ async function _calcDamage(heroRoller, item, options) {
effects = item.system.EFFECT + "; ";
}

const targetActor = (game.scenes.current.tokens.get(options.targetTokenId) || options.targetToken)?.actor;
if (targetActor?.statuses.has("knockedOut")) {
effects += "Knocked Out x2 STUN;";
stun *= 2;
}

// VULNERABILITY
if (options.vulnStunMultiplier) {
const vulnStunDamage = Math.floor(stun * (options.vulnStunMultiplier - 1));
Expand Down

0 comments on commit cf95e1a

Please sign in to comment.