From 973eefee1df3536052cac0f3de15c061f009742c Mon Sep 17 00:00:00 2001 From: LaukkaE Date: Wed, 10 Apr 2024 16:10:34 +0300 Subject: [PATCH] Add electric terrain electric type boost --- src/data/move.ts | 2 +- src/field/pokemon.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 2969486d850..c6d69c5c003 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -4817,7 +4817,7 @@ export function initMoves() { .target(MoveTarget.ALL_NEAR_OTHERS), new AttackMove(Moves.GRASSY_GLIDE, "Grassy Glide (P)", Type.GRASS, MoveCategory.PHYSICAL, 55, 100, 20, "Gliding on the ground, the user attacks the target. This move always goes first on Grassy Terrain.", -1, 0, 8), new AttackMove(Moves.RISING_VOLTAGE, "Rising Voltage", Type.ELECTRIC, MoveCategory.SPECIAL, 70, 100, 20, "The user attacks with electric voltage rising from the ground. This move's power doubles when the target is on Electric Terrain.", -1, 0, 8) - .attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.ELECTRIC && target.isGrounded() ? 2 : 1 ), + .attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.ELECTRIC && target.isGrounded() ? 2 : 1), new AttackMove(Moves.TERRAIN_PULSE, "Terrain Pulse (P)", Type.NORMAL, MoveCategory.SPECIAL, 50, 100, 10, "The user utilizes the power of the terrain to attack. This move's type and power changes depending on the terrain when it's used.", -1, 0, 8) .pulseMove(), new AttackMove(Moves.SKITTER_SMACK, "Skitter Smack", Type.BUG, MoveCategory.PHYSICAL, 70, 90, 10, "The user skitters behind the target to attack. This also lowers the target's Sp. Atk stat.", 100, 0, 8) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 436539c0437..7b0e9e6d509 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1131,8 +1131,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (source.findTag(t => t instanceof TypeBoostTag && (t as TypeBoostTag).boostedType === type)) power.value *= 1.5; const arenaAttackTypeMultiplier = this.scene.arena.getAttackTypeMultiplier(type, this.isGrounded()); - if (this.scene.arena.terrain?.terrainType === TerrainType.GRASSY && this.isGrounded() && type === Type.GROUND && move.moveTarget === MoveTarget.ALL_NEAR_OTHERS) + if (this.scene.arena.getTerrainType() === TerrainType.GRASSY && this.isGrounded() && type === Type.GROUND && move.moveTarget === MoveTarget.ALL_NEAR_OTHERS) power.value /= 2; + else if (this.scene.arena.getTerrainType() === TerrainType.ELECTRIC && source.isGrounded() && type === Type.ELECTRIC) + power.value *= 1.3; applyMoveAttrs(VariablePowerAttr, source, this, move, power); this.scene.applyModifiers(PokemonMultiHitModifier, source.isPlayer(), source, new Utils.IntegerHolder(0), power); if (!typeless) {