mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-08 16:39:26 +02:00
Add unit test for the "Court Change" move
This commit is contained in:
parent
753a3fb31f
commit
9ec543881b
@ -26,51 +26,48 @@ describe("Move - Court Change", () => {
|
|||||||
game.override
|
game.override
|
||||||
.ability(AbilityId.BALL_FETCH)
|
.ability(AbilityId.BALL_FETCH)
|
||||||
.criticalHits(false)
|
.criticalHits(false)
|
||||||
.enemyAbility(AbilityId.BALL_FETCH)
|
.enemyAbility(AbilityId.STURDY)
|
||||||
.startingLevel(100)
|
.startingLevel(100)
|
||||||
.battleStyle("double")
|
.battleStyle("single")
|
||||||
.enemyLevel(100);
|
.enemySpecies(SpeciesId.MAGIKARP)
|
||||||
|
.enemyMoveset(MoveId.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Court Change should swap the swamp from the enemy to the own teams side ", async () => {
|
it("should swap the pledge effect to the opposite side ", async () => {
|
||||||
|
game.override.battleStyle("double");
|
||||||
await game.classicMode.startBattle([SpeciesId.REGIELEKI, SpeciesId.SHUCKLE]);
|
await game.classicMode.startBattle([SpeciesId.REGIELEKI, SpeciesId.SHUCKLE]);
|
||||||
const [regieleki, shuckle] = game.scene.getPlayerParty();
|
const regieleki = game.field.getPlayerPokemon();
|
||||||
game.move.changeMoveset(regieleki, [MoveId.WATER_PLEDGE, MoveId.COURT_CHANGE, MoveId.SPLASH]);
|
const enemyPokemon = game.field.getEnemyPokemon();
|
||||||
game.move.changeMoveset(shuckle, [MoveId.GRASS_PLEDGE, MoveId.COURT_CHANGE, MoveId.SPLASH]);
|
|
||||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
|
||||||
|
|
||||||
game.move.use(MoveId.WATER_PLEDGE, 0);
|
game.move.use(MoveId.WATER_PLEDGE);
|
||||||
game.move.use(MoveId.GRASS_PLEDGE, 1);
|
game.move.use(MoveId.GRASS_PLEDGE, 1);
|
||||||
await game.toEndOfTurn();
|
await game.toNextTurn();
|
||||||
|
|
||||||
//enemy team will be in the swamp and slowed
|
// enemy team will be in the swamp and slowed
|
||||||
expect(enemyPokemon.getEffectiveStat(Stat.SPD)).toBe(enemyPokemon.getStat(Stat.SPD) >> 2);
|
expect(enemyPokemon.getEffectiveStat(Stat.SPD)).toBe(enemyPokemon.getStat(Stat.SPD) / 4);
|
||||||
|
|
||||||
game.move.use(MoveId.COURT_CHANGE, 0);
|
game.move.use(MoveId.COURT_CHANGE);
|
||||||
game.move.use(MoveId.SPLASH, 1);
|
game.move.use(MoveId.SPLASH, 1);
|
||||||
await game.toEndOfTurn();
|
await game.toEndOfTurn();
|
||||||
|
// own team should now be in the swamp and slowed
|
||||||
//own team should now be in the swamp and slowed
|
expect(regieleki.getEffectiveStat(Stat.SPD)).toBe(regieleki.getStat(Stat.SPD) / 4);
|
||||||
|
|
||||||
expect(regieleki.getEffectiveStat(Stat.SPD)).toBe(regieleki.getStat(Stat.SPD) >> 2);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Court Change should swap safeguard to the enemy side ", async () => {
|
it("should swap safeguard to the enemy side ", async () => {
|
||||||
game.override.battleStyle("single").enemySpecies(SpeciesId.GRIMER).enemyMoveset(MoveId.TOXIC_THREAD);
|
game.override.enemyMoveset(MoveId.TOXIC_THREAD);
|
||||||
await game.classicMode.startBattle([SpeciesId.NINJASK]);
|
await game.classicMode.startBattle([SpeciesId.NINJASK]);
|
||||||
const [ninjask] = game.scene.getPlayerParty();
|
const ninjask = game.field.getPlayerPokemon();
|
||||||
game.move.changeMoveset(ninjask, [MoveId.SAFEGUARD, MoveId.COURT_CHANGE, MoveId.NUZZLE, MoveId.SPLASH]);
|
|
||||||
|
|
||||||
game.move.use(MoveId.SAFEGUARD, 0);
|
game.move.use(MoveId.SAFEGUARD);
|
||||||
await game.toEndOfTurn();
|
await game.toNextTurn();
|
||||||
|
|
||||||
//Ninjask will not be poisoned because of Safeguard
|
// Ninjask will not be poisoned because of Safeguard
|
||||||
expect(ninjask.status?.effect).not.toBe(StatusEffect.POISON);
|
expect(ninjask.status?.effect).not.toBe(StatusEffect.POISON);
|
||||||
|
|
||||||
game.move.use(MoveId.COURT_CHANGE);
|
game.move.use(MoveId.COURT_CHANGE);
|
||||||
await game.toEndOfTurn();
|
await game.toEndOfTurn();
|
||||||
|
|
||||||
//Ninjask should now be poisoned
|
// Ninjask should now be poisoned due to lack of Safeguard
|
||||||
expect(ninjask.status?.effect).toBe(StatusEffect.POISON);
|
expect(ninjask.status?.effect).toBe(StatusEffect.POISON);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user