From 83f79fb63b7695a4950a8b0ec5144212265109cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?In=C3=AAs=20Sim=C3=B5es?= Date: Sat, 15 Mar 2025 21:59:37 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20#5085:=20Moves=20dont=20play=20a=20No=20E?= =?UTF-8?q?ffect=20Message=20Against=20Immune=20Type=20When=20using=20non-?= =?UTF-8?q?volatile=20status=20move=20like:=20Will-O-Wisp,=20Thunder=20Wav?= =?UTF-8?q?e,=20Toxic,=20or=20Poison=20Gas=20against=20a=20Pok=C3=A9mon=20?= =?UTF-8?q?whose=20type=20is=20immune=20to=20that=20Status=20condition,=20?= =?UTF-8?q?no=20"It=20doesn't=20affect"=20message=20plays.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit My proposed fixes: In move.ts: Updated isTypeImmune() function to receive another parameter "move: Move" and to include the cases in which the status moves listed in the bug are being used against the corresponding immune type pokemon. In pokemon.ts: Updated the function call of "isTypeImmune()" to correspond with the newly added parameter. --- src/data/moves/move.ts | 22 +++++++++++++++++++++- src/field/pokemon.ts | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index f2157ab65b7..ac0d97f5d85 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -323,7 +323,7 @@ export default class Move implements Localizable { * @param {PokemonType} type the type of the move's target * @returns boolean */ - isTypeImmune(user: Pokemon, target: Pokemon, type: PokemonType): boolean { + isTypeImmune(user: Pokemon, target: Pokemon, type: PokemonType, move: Move): boolean { if (this.moveTarget === MoveTarget.USER) { return false; } @@ -339,6 +339,26 @@ export default class Move implements Localizable { return true; } break; + case PokemonType.FIRE: + if (move.id === Moves.WILL_O_WISP) { + return true; + } + break; + case PokemonType.ELECTRIC: + if (move.id === Moves.THUNDER_WAVE) { + return true; + } + break; + case PokemonType.POISON: + if (move.id === Moves.TOXIC) { + return true; + } + break; + case PokemonType.STEEL: + if (move.id === Moves.POISON_GAS) { + return true; + } + break; } return false; } diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 890c6bab0d6..1f89cb91822 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -2459,7 +2459,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { typeMultiplier, ); if ( - this.getTypes(true, true).find(t => move.isTypeImmune(source, this, t)) + this.getTypes(true, true).find(t => move.isTypeImmune(source, this, t, move)) ) { typeMultiplier.value = 0; }