From ff10e98f746fd490a4c2b00b8e5de6b8d93c01c2 Mon Sep 17 00:00:00 2001 From: innerthunder Date: Sun, 25 Aug 2024 21:47:29 -0700 Subject: [PATCH] Status move effectiveness now accounts for substitute --- src/field/pokemon.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index d02809a3d6b..b0625b88d44 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1332,6 +1332,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } } + if (move.category === MoveCategory.STATUS && move.hitsSubstitute(source, this)) { + typeMultiplier.value = 0; + } + return (!cancelledHolder.value ? typeMultiplier.value : 0) as TypeDamageMultiplier; } @@ -2335,14 +2339,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } break; case MoveCategory.STATUS: - if (move.hitsSubstitute(source, this)) { - // TODO: add status move into substitute message - cancelled.value = true; - } if (!cancelled.value && typeMultiplier === 0) { this.scene.queueMessage(i18next.t("battle:hitResultNoEffect", { pokemonName: getPokemonNameWithAffix(this) })); } - result = (typeMultiplier === 0) ? HitResult.NO_EFFECT : HitResult.STATUS; + result = (cancelled.value || typeMultiplier === 0) ? HitResult.NO_EFFECT : HitResult.STATUS; break; }