mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-06 16:32:16 +02:00
#3772 refactored according to schmidtc1 comments
This commit is contained in:
parent
168a6cdbef
commit
5256d95830
@ -822,11 +822,11 @@ export class DrowsyTag extends BattlerTag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
canAdd(pokemon: Pokemon): boolean {
|
canAdd(pokemon: Pokemon): boolean {
|
||||||
const isNotElectricTerrainProtected = pokemon.scene.arena.terrain?.terrainType !== TerrainType.ELECTRIC || !pokemon.isGrounded();
|
const isElectricTerrainProtected = pokemon.scene.arena.terrain?.terrainType === TerrainType.ELECTRIC && !pokemon.isGrounded();
|
||||||
if (!isNotElectricTerrainProtected) {
|
if (isElectricTerrainProtected) {
|
||||||
pokemon.scene.queueMessage(i18next.t("terrain:defaultBlockMessage", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), terrainName: getTerrainName(TerrainType.ELECTRIC) }));
|
pokemon.scene.queueMessage(i18next.t("terrain:defaultBlockMessage", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), terrainName: getTerrainName(TerrainType.ELECTRIC) }));
|
||||||
}
|
}
|
||||||
return isNotElectricTerrainProtected;
|
return !isElectricTerrainProtected;
|
||||||
}
|
}
|
||||||
|
|
||||||
onAdd(pokemon: Pokemon): void {
|
onAdd(pokemon: Pokemon): void {
|
||||||
|
Loading…
Reference in New Issue
Block a user