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: Removed a redudant if statement in StatusEffectAttr class In pokemon.ts: Renamed the "messageIsImmune" function to "queueImmuneMessage"
This commit is contained in:
parent
ea618a93ee
commit
45e3fe71ad
|
@ -2442,10 +2442,6 @@ export class StatusEffectAttr extends MoveEffectAttr {
|
|||
const statusCheck = moveChance < 0 || moveChance === 100 || user.randSeedInt(100) < moveChance;
|
||||
if (statusCheck) {
|
||||
const pokemon = this.selfTarget ? user : target;
|
||||
if (pokemon.status && !this.overrideStatus) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (user !== target && move.category === MoveCategory.STATUS && !target.canSetStatus(this.effect, false, false, user, true)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -5517,7 +5517,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
);
|
||||
}
|
||||
|
||||
messageIsImmune(quiet: boolean, effect?: StatusEffect): void {
|
||||
queueImmuneMessage(quiet: boolean, effect?: StatusEffect): void {
|
||||
if (!effect || quiet) {
|
||||
return;
|
||||
}
|
||||
|
@ -5547,7 +5547,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
): boolean {
|
||||
if (effect !== StatusEffect.FAINT) {
|
||||
if (overrideStatus ? this.status?.effect === effect : this.status) {
|
||||
this.messageIsImmune(quiet, effect);
|
||||
this.queueImmuneMessage(quiet, effect);
|
||||
return false;
|
||||
}
|
||||
if (
|
||||
|
@ -5555,7 +5555,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
!ignoreField &&
|
||||
globalScene.arena.terrain?.terrainType === TerrainType.MISTY
|
||||
) {
|
||||
this.messageIsImmune(quiet, effect);
|
||||
this.queueImmuneMessage(quiet, effect);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -5593,14 +5593,14 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
|
||||
if (this.isOfType(PokemonType.POISON) || this.isOfType(PokemonType.STEEL)) {
|
||||
if (poisonImmunity.includes(true)) {
|
||||
this.messageIsImmune(quiet, effect);
|
||||
this.queueImmuneMessage(quiet, effect);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case StatusEffect.PARALYSIS:
|
||||
if (this.isOfType(PokemonType.ELECTRIC)) {
|
||||
this.messageIsImmune(quiet, effect);
|
||||
this.queueImmuneMessage(quiet, effect);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
@ -5609,7 +5609,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
this.isGrounded() &&
|
||||
globalScene.arena.terrain?.terrainType === TerrainType.ELECTRIC
|
||||
) {
|
||||
this.messageIsImmune(quiet, effect);
|
||||
this.queueImmuneMessage(quiet, effect);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
@ -5622,13 +5622,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
globalScene.arena.weather.weatherType,
|
||||
))
|
||||
) {
|
||||
this.messageIsImmune(quiet, effect);
|
||||
this.queueImmuneMessage(quiet, effect);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case StatusEffect.BURN:
|
||||
if (this.isOfType(PokemonType.FIRE)) {
|
||||
this.messageIsImmune(quiet, effect);
|
||||
this.queueImmuneMessage(quiet, effect);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
@ -5660,7 +5660,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
}
|
||||
|
||||
if (cancelled.value) {
|
||||
this.messageIsImmune(quiet, effect);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue