Toxic Spikes - Properly removed by statused Poison types (#36)

* Toxic Spikes - Properly removed by statused Poison types

Toxic spikes should now be removed by poison types who are statused before they are switched to, instead of ignoring their entry

* Toxic Spikes update

Fixed duplicate code
pull/37/head
Stophles 2024-04-04 21:45:33 -05:00 committed by GitHub
parent 8b84965d7a
commit 636fc22141
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 10 deletions

View File

@ -211,18 +211,20 @@ class ToxicSpikesTag extends ArenaTrapTag {
}
activateTrap(pokemon: Pokemon): boolean {
if (!pokemon.status && pokemon.isGrounded()) {
const toxic = this.layers > 1;
if (pokemon.trySetStatus(!toxic ? StatusEffect.POISON : StatusEffect.TOXIC, true, null, `the ${this.getMoveName()}`))
if (pokemon.isOfType(Type.POISON) && pokemon.isGrounded()) {
this.neutralized = true;
if (pokemon.scene.arena.removeTag(this.tagType)) {
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` absorbed the ${this.getMoveName()}!`));
return true;
else if (pokemon.isOfType(Type.POISON)) {
this.neutralized = true;
if (pokemon.scene.arena.removeTag(this.tagType)) {
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` absorbed the ${this.getMoveName()}!`));
return true;
}
}
}
else if (!pokemon.status && pokemon.isGrounded()) {
const toxic = this.layers > 1;
if (pokemon.trySetStatus(!toxic ? StatusEffect.POISON : StatusEffect.TOXIC, true, null, `the ${this.getMoveName()}`))
return true;
}
return false;
}
return false;
}
@ -378,4 +380,4 @@ export function getArenaTag(tagType: ArenaTagType, turnCount: integer, sourceMov
case ArenaTagType.GRAVITY:
return new GravityTag(turnCount);
}
}
}