mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-06 00:12: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 {
|
||||
const isNotElectricTerrainProtected = pokemon.scene.arena.terrain?.terrainType !== TerrainType.ELECTRIC || !pokemon.isGrounded();
|
||||
if (!isNotElectricTerrainProtected) {
|
||||
const isElectricTerrainProtected = pokemon.scene.arena.terrain?.terrainType === TerrainType.ELECTRIC && !pokemon.isGrounded();
|
||||
if (isElectricTerrainProtected) {
|
||||
pokemon.scene.queueMessage(i18next.t("terrain:defaultBlockMessage", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), terrainName: getTerrainName(TerrainType.ELECTRIC) }));
|
||||
}
|
||||
return isNotElectricTerrainProtected;
|
||||
return !isElectricTerrainProtected;
|
||||
}
|
||||
|
||||
onAdd(pokemon: Pokemon): void {
|
||||
|
Loading…
Reference in New Issue
Block a user