mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-12 03:12:18 +02:00
Fix #5085: Moves dont play a No Effect Message Against Immune Type
When using non-volatile status move like: Will-O-Wisp, Thunder Wave, Toxic, or Poison Gas against a Pokémon whose type is immune to that Status condition, no "It doesn't affect" message plays. 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.
This commit is contained in:
parent
7aa5649aa8
commit
83f79fb63b
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user