Comment fix

This commit is contained in:
Bertie690 2025-06-04 08:33:55 -04:00
parent 4d66324442
commit 023964dbd8

View File

@ -4616,11 +4616,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
/** /**
* Display an immunity message for a failed status application. * Display an immunity message for a failed status application.
* @param quiet - Whether to suppress message and return early * @param quiet - Whether to suppress message and return early
* @param reason - The reason for the terrain blockage - * @param reason - The reason for the status application failure -
* can be "overlap" (already has same status), "other" (generic fail message) * can be "overlap" (already has same status), "other" (generic fail message)
* or a {@linkcode TerrainType} for terrain-based blockages. * or a {@linkcode TerrainType} for terrain-based blockages.
* Defaults to "other".
*/ */
private queueImmuneMessage(quiet: boolean, reason: "overlap" | "other" | TerrainType = "other"): void { private queueStatusImmuneMessage(quiet: boolean, reason: "overlap" | "other" | TerrainType = "other"): void {
if (quiet) { if (quiet) {
return; return;
} }
@ -4661,11 +4662,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
): boolean { ): boolean {
if (effect !== StatusEffect.FAINT) { if (effect !== StatusEffect.FAINT) {
if (overrideStatus ? this.status?.effect === effect : this.status) { if (overrideStatus ? this.status?.effect === effect : this.status) {
this.queueImmuneMessage(quiet, overrideStatus ? "overlap" : "other"); // having different status displays generic fail message this.queueStatusImmuneMessage(quiet, overrideStatus ? "overlap" : "other"); // having different status displays generic fail message
return false; return false;
} }
if (this.isGrounded() && !ignoreField && globalScene.arena.terrain?.terrainType === TerrainType.MISTY) { if (this.isGrounded() && !ignoreField && globalScene.arena.terrain?.terrainType === TerrainType.MISTY) {
this.queueImmuneMessage(quiet, TerrainType.MISTY); this.queueStatusImmuneMessage(quiet, TerrainType.MISTY);
return false; return false;
} }
} }
@ -4696,7 +4697,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
if (this.isOfType(PokemonType.POISON) || this.isOfType(PokemonType.STEEL)) { if (this.isOfType(PokemonType.POISON) || this.isOfType(PokemonType.STEEL)) {
if (poisonImmunity.includes(true)) { if (poisonImmunity.includes(true)) {
this.queueImmuneMessage(quiet); this.queueStatusImmuneMessage(quiet);
return false; return false;
} }
} }
@ -4704,13 +4705,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} }
case StatusEffect.PARALYSIS: case StatusEffect.PARALYSIS:
if (this.isOfType(PokemonType.ELECTRIC)) { if (this.isOfType(PokemonType.ELECTRIC)) {
this.queueImmuneMessage(quiet); this.queueStatusImmuneMessage(quiet);
return false; return false;
} }
break; break;
case StatusEffect.SLEEP: case StatusEffect.SLEEP:
if (this.isGrounded() && globalScene.arena.terrain?.terrainType === TerrainType.ELECTRIC) { if (this.isGrounded() && globalScene.arena.terrain?.terrainType === TerrainType.ELECTRIC) {
this.queueImmuneMessage(quiet, TerrainType.ELECTRIC); this.queueStatusImmuneMessage(quiet, TerrainType.ELECTRIC);
return false; return false;
} }
break; break;
@ -4721,13 +4722,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
globalScene?.arena?.weather?.weatherType && globalScene?.arena?.weather?.weatherType &&
[WeatherType.SUNNY, WeatherType.HARSH_SUN].includes(globalScene.arena.weather.weatherType)) [WeatherType.SUNNY, WeatherType.HARSH_SUN].includes(globalScene.arena.weather.weatherType))
) { ) {
this.queueImmuneMessage(quiet); this.queueStatusImmuneMessage(quiet);
return false; return false;
} }
break; break;
case StatusEffect.BURN: case StatusEffect.BURN:
if (this.isOfType(PokemonType.FIRE)) { if (this.isOfType(PokemonType.FIRE)) {
this.queueImmuneMessage(quiet); this.queueStatusImmuneMessage(quiet);
return false; return false;
} }
break; break;