From cf95e1acf0e7282243a23bcf0d8182c110af67e7 Mon Sep 17 00:00:00 2001 From: phBalance <29824554+phBalance@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:41:41 -0700 Subject: [PATCH] fix(KO): KO'd characters only take double damage, not double adjust etc. --- CHANGELOG.md | 2 ++ module/item/item-attack.mjs | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 782becf8..95db4d08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/module/item/item-attack.mjs b/module/item/item-attack.mjs index 0ed53013..18ac9cd0 100644 --- a/module/item/item-attack.mjs +++ b/module/item/item-attack.mjs @@ -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; @@ -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));