From 22fd34615a5dcc22a2fdc84064d012592e595308 Mon Sep 17 00:00:00 2001 From: geeil-han Date: Wed, 22 Jan 2025 02:38:27 +0100 Subject: [PATCH] selfhit due to confusion does not count for rage fist --- src/data/battler-tags.ts | 1 + src/data/move.ts | 4 ++-- src/field/pokemon.ts | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 4c68de5abc5..d72f909ae6e 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -667,6 +667,7 @@ export class ConfusedTag extends BattlerTag { globalScene.queueMessage(i18next.t("battlerTags:confusedLapseHurtItself")); pokemon.damageAndUpdate(damage); pokemon.battleData.hitCount++; + pokemon.battleData.confHitCount++; (globalScene.getCurrentPhase() as MovePhase).cancel(); } } diff --git a/src/data/move.ts b/src/data/move.ts index 06f3c85e9c4..d9dd4bafbed 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -4010,13 +4010,13 @@ export class RageFistPowerAttr extends VariablePowerAttr { } /** - * Updates the number of hits the Pokemon has taken in battle + * Updates the number of hits the Pokemon has taken in battle not including self inflicted hits due to confusion * @param user Pokemon calling Rage Fist * @param hitCount The number of received hits this battle * @param previousHitCount The number of received hits this battle since last time Rage Fist was used */ protected updateHitReceivedCount(user: Pokemon, hitCount: number, previousHitCount: number): void { - user.customPokemonData.hitsRecCount += (hitCount - previousHitCount); + user.customPokemonData.hitsRecCount += ((hitCount - user.battleData.confHitCount) - previousHitCount); user.battleData.prevHitCount = hitCount; } } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index a4b8603cbb0..8eacb20f9d4 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -5289,6 +5289,8 @@ export class PokemonBattleData { public hitCount: number = 0; /** used for {@linkcode Moves.RAGE_FIST} in order to save hit Counts received before Rage Fist is applied */ public prevHitCount: number = 0; + /** used to count the hitCount of self-hits due to confusion */ + public confHitCount: number = 0; public endured: boolean = false; public berriesEaten: BerryType[] = []; public abilitiesApplied: Abilities[] = [];