Compare commits

...

23 Commits

Author SHA1 Message Date
thisPieonFire
9db32e2d2e
Merge f7f863070f into 3b36ab17e4 2025-08-05 00:57:37 -05:00
thisPieonFire
f7f863070f
Merge branch 'beta' into Court-Change-Additions 2025-08-04 10:15:33 +02:00
Dean
5085367b68
Merge branch 'beta' into Court-Change-Additions 2025-08-02 20:03:43 -07:00
NightKev
0ee8b43d1e
Merge branch 'beta' into Court-Change-Additions 2025-07-31 00:34:58 -07:00
thisPieonFire
36ec4c3d3c
Merge branch 'beta' into Court-Change-Additions 2025-07-30 10:29:50 +02:00
thisPieonFire
fcaba40c01
Update court-change.test.ts 2025-07-29 16:30:54 +02:00
thisPieonFire
274af155e8
Added missing import (ArenaTagSide) 2025-07-29 11:49:31 +02:00
thisPieonFire
ec37801904
Merge branch 'beta' into Court-Change-Additions 2025-07-29 11:20:11 +02:00
Bertie690
acc5254bcf
Added missing import 2025-07-28 11:53:58 -04:00
thisPieonFire
a96a315ac1
Update test/moves/court-change.test.ts
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-07-08 14:42:52 +02:00
thisPieonFire
d60e8c7178
Update test/moves/court-change.test.ts
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-07-08 14:42:41 +02:00
thisPieonFire
1afb805e9d
Update test/moves/court-change.test.ts
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-07-08 14:42:31 +02:00
thisPieonFire
4ae0d71c83
Update test/moves/court-change.test.ts
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-07-08 14:42:15 +02:00
thisPieonFire
ad1174a705
Update test/moves/court-change.test.ts
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-07-08 14:41:58 +02:00
thisPieonFire
d8ebd27a9b
Update test/moves/court-change.test.ts
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-07-08 14:41:40 +02:00
thisPieonFire
8bc44baa3a
Update test/moves/court-change.test.ts
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-07-08 14:41:26 +02:00
thisPieonFire
e120a43c28
Update test/moves/court-change.test.ts
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-07-08 14:41:03 +02:00
PieonFire
9126849713 Improve formatting in the "Court Change" move unit test 2025-07-08 11:47:53 +02:00
PieonFire
e5cbb55ef0 Merge remote-tracking branch 'origin/Court-Change-Additions' into Court-Change-Additions
# Conflicts:
#	test/moves/court-change.test.ts
2025-07-08 11:45:04 +02:00
PieonFire
9ec543881b Add unit test for the "Court Change" move 2025-07-08 11:39:17 +02:00
thisPieonFire
a5e7239d0e
Update test/moves/court-change.test.ts
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-07-08 11:21:05 +02:00
thisPieonFire
4b29be1221
Update test/moves/court-change.test.ts
Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
2025-07-08 11:20:02 +02:00
PieonFire
753a3fb31f Add unit test for the "Court Change" move 2025-07-07 14:16:08 +02:00
2 changed files with 86 additions and 1 deletions

View File

@ -10888,7 +10888,7 @@ export function initMoves() {
.attr(MovePowerMultiplierAttr, (_user, target) => target.turnData.acted ? 1 : 2)
.bitingMove(),
new StatusMove(MoveId.COURT_CHANGE, PokemonType.NORMAL, 100, 10, -1, 0, 8)
.attr(SwapArenaTagsAttr, [ ArenaTagType.AURORA_VEIL, ArenaTagType.LIGHT_SCREEN, ArenaTagType.MIST, ArenaTagType.REFLECT, ArenaTagType.SPIKES, ArenaTagType.STEALTH_ROCK, ArenaTagType.STICKY_WEB, ArenaTagType.TAILWIND, ArenaTagType.TOXIC_SPIKES ]),
.attr(SwapArenaTagsAttr, [ ArenaTagType.AURORA_VEIL, ArenaTagType.LIGHT_SCREEN, ArenaTagType.MIST, ArenaTagType.REFLECT, ArenaTagType.SPIKES, ArenaTagType.STEALTH_ROCK, ArenaTagType.STICKY_WEB, ArenaTagType.TAILWIND, ArenaTagType.TOXIC_SPIKES, ArenaTagType.SAFEGUARD, ArenaTagType.FIRE_GRASS_PLEDGE, ArenaTagType.WATER_FIRE_PLEDGE, ArenaTagType.GRASS_WATER_PLEDGE ]),
/* Unused */
new AttackMove(MoveId.MAX_FLARE, PokemonType.FIRE, MoveCategory.PHYSICAL, 10, -1, 10, -1, 0, 8)
.target(MoveTarget.NEAR_ENEMY)

View File

@ -0,0 +1,85 @@
import { AbilityId } from "#enums/ability-id";
import { ArenaTagSide } from "#enums/arena-tag-side";
import { ArenaTagType } from "#enums/arena-tag-type";
import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
import { Stat } from "#enums/stat";
import { StatusEffect } from "#enums/status-effect";
import { GameManager } from "#test/test-utils/game-manager";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Move - Court Change", () => {
let phaserGame: Phaser.Game;
let game: GameManager;
beforeAll(() => {
phaserGame = new Phaser.Game({
type: Phaser.HEADLESS,
});
});
afterEach(() => {
game.phaseInterceptor.restoreOg();
});
beforeEach(() => {
game = new GameManager(phaserGame);
game.override
.ability(AbilityId.BALL_FETCH)
.criticalHits(false)
.enemyAbility(AbilityId.STURDY)
.startingLevel(100)
.battleStyle("single")
.enemySpecies(SpeciesId.MAGIKARP)
.enemyMoveset(MoveId.SPLASH);
});
it("should swap combined Pledge effects to the opposite side", async () => {
game.override.battleStyle("double");
await game.classicMode.startBattle([SpeciesId.REGIELEKI, SpeciesId.SHUCKLE]);
const regieleki = game.field.getPlayerPokemon();
const enemyPokemon = game.field.getEnemyPokemon();
game.move.use(MoveId.WATER_PLEDGE);
game.move.use(MoveId.GRASS_PLEDGE, 1);
await game.toNextTurn();
// enemy team will be in the swamp and slowed
expect(game.scene.arena.getTagOnSide(ArenaTagType.GRASS_WATER_PLEDGE, ArenaTagSide.ENEMY)).toBeDefined();
expect(enemyPokemon.getEffectiveStat(Stat.SPD)).toBe(enemyPokemon.getStat(Stat.SPD) / 4);
game.move.use(MoveId.COURT_CHANGE);
game.move.use(MoveId.SPLASH, 1);
await game.toEndOfTurn();
// own team should now be in the swamp and slowed
expect(game.scene.arena.getTagOnSide(ArenaTagType.GRASS_WATER_PLEDGE, ArenaTagSide.ENEMY)).toBeUndefined();
expect(game.scene.arena.getTagOnSide(ArenaTagType.GRASS_WATER_PLEDGE, ArenaTagSide.PLAYER)).toBeDefined();
expect(regieleki.getEffectiveStat(Stat.SPD)).toBe(regieleki.getStat(Stat.SPD) / 4);
});
it("should swap safeguard to the enemy side ", async () => {
game.override.enemyMoveset(MoveId.TOXIC_THREAD);
await game.classicMode.startBattle([SpeciesId.NINJASK]);
const ninjask = game.field.getPlayerPokemon();
game.move.use(MoveId.SAFEGUARD);
await game.move.forceEnemyMove(MoveId.TOXIC_THREAD);
await game.toNextTurn();
// Ninjask will not be poisoned because of Safeguard
expect(game.scene.arena.getTagOnSide(ArenaTagType.SAFEGUARD, ArenaTagSide.PLAYER)).toBeDefined();
expect(ninjask.status?.effect).toBeUndefined();
game.move.use(MoveId.COURT_CHANGE);
await game.toEndOfTurn();
// Ninjask should now be poisoned due to lack of Safeguard
expect(game.scene.arena.getTagOnSide(ArenaTagType.SAFEGUARD, ArenaTagSide.PLAYER)).toBeUndefined();
expect(game.scene.arena.getTagOnSide(ArenaTagType.SAFEGUARD, ArenaTagSide.ENEMY)).toBeDefined();
expect(ninjask.status?.effect).toBe(StatusEffect.POISON);
});
});