From 21add68ed745347c4fe0a15d36957a0e2118be3f Mon Sep 17 00:00:00 2001 From: Christopher Schmidt Date: Sat, 25 Jan 2025 19:54:20 -0500 Subject: [PATCH] Adds HitResult.SELF for confusion to distinguish from indirect damage --- src/data/battler-tags.ts | 2 +- src/field/pokemon.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 4c68de5abc5..3e9a86b4640 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -665,7 +665,7 @@ export class ConfusedTag extends BattlerTag { const def = pokemon.getEffectiveStat(Stat.DEF); const damage = toDmgValue(((((2 * pokemon.level / 5 + 2) * 40 * atk / def) / 50) + 2) * (pokemon.randSeedIntRange(85, 100) / 100)); globalScene.queueMessage(i18next.t("battlerTags:confusedLapseHurtItself")); - pokemon.damageAndUpdate(damage); + pokemon.damageAndUpdate(damage, HitResult.SELF); pokemon.battleData.hitCount++; (globalScene.getCurrentPhase() as MovePhase).cancel(); } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index d778944ce06..d211ffbe04e 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -5400,10 +5400,11 @@ export enum HitResult { FAIL, MISS, OTHER, - IMMUNE + IMMUNE, + SELF } -export type DamageResult = HitResult.EFFECTIVE | HitResult.SUPER_EFFECTIVE | HitResult.NOT_VERY_EFFECTIVE | HitResult.ONE_HIT_KO | HitResult.OTHER; +export type DamageResult = HitResult.EFFECTIVE | HitResult.SUPER_EFFECTIVE | HitResult.NOT_VERY_EFFECTIVE | HitResult.ONE_HIT_KO | HitResult.SELF | HitResult.OTHER; /** Interface containing the results of a damage calculation for a given move */ export interface DamageCalculationResult {