Skip to content

Commit

Permalink
Merge branch 'beta' into keyboard-key-repeat-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
flx-sta authored Sep 16, 2024
2 parents 2114c97 + 72439ff commit 98e95ca
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/data/move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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)
Expand Down
27 changes: 21 additions & 6 deletions src/test/arena/grassy_terrain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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);
});

0 comments on commit 98e95ca

Please sign in to comment.