Skip to content

Commit

Permalink
Merge pull request dmdorman#1636 from phBalance/phBalance/ko-is-doubl…
Browse files Browse the repository at this point in the history
…e-damage-only

fix(KO): KO'd characters only take double damage, not double adjust etc.
  • Loading branch information
phBalance authored Dec 20, 2024
2 parents d50ff6a + 9b72d38 commit 1767634
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 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
1 change: 0 additions & 1 deletion module/actor/actor.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { RoundFavorPlayerDown, RoundFavorPlayerUp } from "../utility/round.mjs";
* @extends {Actor}
*/
export class HeroSystem6eActor extends Actor {

/** @inheritdoc */
async _preCreate(data, options, user) {
await super._preCreate(data, options, user);
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 1767634

Please sign in to comment.