Toxic Spikes update

Fixed duplicate code
This commit is contained in:
Stophles 2024-04-04 20:06:55 -05:00 committed by GitHub
parent fab415c156
commit bc8c283e89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,21 +17,7 @@ export enum ArenaTagSide {
ENEMY
}
export abstract class ArenaTag {activateTrap(pokemon: Pokemon): boolean {
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.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;
}
export abstract class ArenaTag {
public tagType: ArenaTagType;
public turnCount: integer;
public sourceMove: Moves;