From 72439ffff7b003538ede14d306a927c2574b2b5a Mon Sep 17 00:00:00 2001 From: Tempoanon <163687446+Tempo-anon@users.noreply.github.com> Date: Mon, 16 Sep 2024 10:58:28 -0400 Subject: [PATCH] [Move][Beta] Add back grounded condition to ground shaky moves and grassy terrain (#4276) --- src/data/move.ts | 6 +++--- src/test/arena/grassy_terrain.test.ts | 27 +++++++++++++++++++++------ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 10c98e0a7f7..0c2f587d885 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -6952,7 +6952,7 @@ export function initMoves() { .makesContact(false), new AttackMove(Moves.EARTHQUAKE, Type.GROUND, MoveCategory.PHYSICAL, 100, 100, 10, -1, 0, 1) .attr(HitsTagAttr, BattlerTagType.UNDERGROUND, true) - .attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.GRASSY ? 0.5 : 1) + .attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.GRASSY && target.isGrounded() ? 0.5 : 1) .makesContact(false) .target(MoveTarget.ALL_NEAR_OTHERS), new AttackMove(Moves.FISSURE, Type.GROUND, MoveCategory.PHYSICAL, 200, 30, 5, -1, 0, 1) @@ -7346,7 +7346,7 @@ export function initMoves() { new AttackMove(Moves.MAGNITUDE, Type.GROUND, MoveCategory.PHYSICAL, -1, 100, 30, -1, 0, 2) .attr(PreMoveMessageAttr, magnitudeMessageFunc) .attr(MagnitudePowerAttr) - .attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.GRASSY ? 0.5 : 1) + .attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.GRASSY && target.isGrounded() ? 0.5 : 1) .attr(HitsTagAttr, BattlerTagType.UNDERGROUND, true) .makesContact(false) .target(MoveTarget.ALL_NEAR_OTHERS), @@ -8221,7 +8221,7 @@ export function initMoves() { .target(MoveTarget.ALL_NEAR_ENEMIES), new AttackMove(Moves.BULLDOZE, Type.GROUND, MoveCategory.PHYSICAL, 60, 100, 20, 100, 0, 5) .attr(StatStageChangeAttr, [ Stat.SPD ], -1) - .attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.GRASSY ? 0.5 : 1) + .attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.GRASSY && target.isGrounded() ? 0.5 : 1) .makesContact(false) .target(MoveTarget.ALL_NEAR_OTHERS), new AttackMove(Moves.FROST_BREATH, Type.ICE, MoveCategory.SPECIAL, 60, 90, 10, 100, 0, 5) diff --git a/src/test/arena/grassy_terrain.test.ts b/src/test/arena/grassy_terrain.test.ts index e8064676741..efb2539885d 100644 --- a/src/test/arena/grassy_terrain.test.ts +++ b/src/test/arena/grassy_terrain.test.ts @@ -26,16 +26,16 @@ describe("Arena - Grassy Terrain", () => { game.override .battleType("single") .disableCrits() - .enemyLevel(30) - .enemySpecies(Species.SNORLAX) - .enemyAbility(Abilities.BALL_FETCH) - .enemyMoveset(Moves.SPLASH) + .enemyLevel(1) + .enemySpecies(Species.SHUCKLE) + .enemyAbility(Abilities.STURDY) + .enemyMoveset(Moves.FLY) .moveset([Moves.GRASSY_TERRAIN, Moves.EARTHQUAKE]) - .ability(Abilities.BALL_FETCH); + .ability(Abilities.NO_GUARD); }); it("halves the damage of Earthquake", async () => { - await game.classicMode.startBattle([Species.FEEBAS]); + await game.classicMode.startBattle([Species.TAUROS]); const eq = allMoves[Moves.EARTHQUAKE]; vi.spyOn(eq, "calculateBattlePower"); @@ -53,4 +53,19 @@ describe("Arena - Grassy Terrain", () => { expect(eq.calculateBattlePower).toHaveReturnedWith(50); }, TIMEOUT); + + it("Does not halve the damage of Earthquake if opponent is not grounded", async () => { + await game.classicMode.startBattle([Species.NINJASK]); + + const eq = allMoves[Moves.EARTHQUAKE]; + vi.spyOn(eq, "calculateBattlePower"); + + game.move.select(Moves.GRASSY_TERRAIN); + await game.toNextTurn(); + + game.move.select(Moves.EARTHQUAKE); + await game.phaseInterceptor.to("BerryPhase"); + + expect(eq.calculateBattlePower).toHaveReturnedWith(100); + }, TIMEOUT); });