mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 07:52:17 +02:00
Added test fixes and removed unwanted edit.
This commit is contained in:
parent
f89bc5856e
commit
516cec232d
@ -1,5 +1,4 @@
|
||||
export enum BattleSpec {
|
||||
DEFAULT,
|
||||
FINAL_BOSS,
|
||||
FINAL_BOSS_MONOTYPE
|
||||
FINAL_BOSS
|
||||
}
|
||||
|
@ -44,8 +44,10 @@ describe("Abilities - Mycelium Might", () => {
|
||||
|
||||
it("If a Pokemon with Mycelium Might uses a status move, it will always move last but the status move will ignore protective abilities", async() => {
|
||||
await game.startBattle([ Species.REGIELEKI ]);
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
const playerPokemonIndex = game.scene.getPlayerPokemon().getBattlerIndex();
|
||||
const enemyPokemonIndex = enemyPokemon.getBattlerIndex();
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.BABY_DOLL_EYES));
|
||||
|
||||
await game.phaseInterceptor.run(EnemyCommandPhase);
|
||||
@ -54,8 +56,8 @@ describe("Abilities - Mycelium Might", () => {
|
||||
const commandOrder = phase.getCommandOrder();
|
||||
// The opponent Pokemon (without Mycelium Might) goes first despite having lower speed than the player Pokemon.
|
||||
// The player Pokemon (with Mycelium Might) goes last despite having higher speed than the opponent.
|
||||
// This means that the commandOrder is equivalent to the speed Order reversed
|
||||
expect(speedOrder.reverse()).toEqual(commandOrder);
|
||||
expect(speedOrder).toEqual([playerPokemonIndex, enemyPokemonIndex]);
|
||||
expect(commandOrder).toEqual([enemyPokemonIndex, playerPokemonIndex]);
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
// Despite the opponent's ability (Clear Body), its attack stat is still reduced.
|
||||
expect(enemyPokemon?.summonData.battleStats[BattleStat.ATK]).toBe(-1);
|
||||
@ -64,8 +66,10 @@ describe("Abilities - Mycelium Might", () => {
|
||||
it("Pokemon with Mycelium Might will go first if a status move that is in a higher priority bracket than the opponent's move is used", async() => {
|
||||
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
||||
await game.startBattle([ Species.REGIELEKI ]);
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
|
||||
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||
const playerPokemonIndex = game.scene.getPlayerPokemon().getBattlerIndex();
|
||||
const enemyPokemonIndex = enemyPokemon.getBattlerIndex();
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.BABY_DOLL_EYES));
|
||||
|
||||
await game.phaseInterceptor.run(EnemyCommandPhase);
|
||||
@ -74,8 +78,8 @@ describe("Abilities - Mycelium Might", () => {
|
||||
const commandOrder = phase.getCommandOrder();
|
||||
// The player Pokemon (with M.M.) goes first because its move is still within a higher priority bracket than its opponent.
|
||||
// The enemy Pokemon goes second because its move is in a lower priority bracket.
|
||||
// This means that the commandOrder should be identical to the speedOrder
|
||||
expect(speedOrder).toEqual(commandOrder);
|
||||
expect(speedOrder).toEqual([playerPokemonIndex, enemyPokemonIndex]);
|
||||
expect(commandOrder).toEqual([playerPokemonIndex, enemyPokemonIndex]);
|
||||
await game.phaseInterceptor.to(TurnEndPhase);
|
||||
// Despite the opponent's ability (Clear Body), its attack stat is still reduced.
|
||||
expect(enemyPokemon?.summonData.battleStats[BattleStat.ATK]).toBe(-1);
|
||||
@ -84,6 +88,8 @@ describe("Abilities - Mycelium Might", () => {
|
||||
it("Order is established normally if the Pokemon uses a non-status move", async() => {
|
||||
await game.startBattle([ Species.REGIELEKI ]);
|
||||
|
||||
const playerPokemonIndex = game.scene.getPlayerPokemon().getBattlerIndex();
|
||||
const enemyPokemonIndex = game.scene.getEnemyPokemon().getBattlerIndex();
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.QUICK_ATTACK));
|
||||
|
||||
await game.phaseInterceptor.run(EnemyCommandPhase);
|
||||
@ -93,6 +99,7 @@ describe("Abilities - Mycelium Might", () => {
|
||||
// The player Pokemon (with M.M.) goes first because it has a higher speed and did not use a status move.
|
||||
// The enemy Pokemon (without M.M.) goes second because its speed is lower.
|
||||
// This means that the commandOrder should be identical to the speedOrder
|
||||
expect(speedOrder).toEqual(commandOrder);
|
||||
expect(speedOrder).toEqual([playerPokemonIndex, enemyPokemonIndex]);
|
||||
expect(commandOrder).toEqual([playerPokemonIndex, enemyPokemonIndex]);
|
||||
}, 20000);
|
||||
});
|
||||
|
@ -41,6 +41,8 @@ describe("Abilities - Stall", () => {
|
||||
it("Pokemon with Stall should move last in its priority bracket regardless of speed", async() => {
|
||||
await game.startBattle([ Species.SHUCKLE ]);
|
||||
|
||||
const playerPokemonIndex = game.scene.getPlayerPokemon().getBattlerIndex();
|
||||
const enemyPokemonIndex = game.scene.getEnemyPokemon().getBattlerIndex();
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.QUICK_ATTACK));
|
||||
|
||||
await game.phaseInterceptor.run(EnemyCommandPhase);
|
||||
@ -49,13 +51,15 @@ describe("Abilities - Stall", () => {
|
||||
const commandOrder = phase.getCommandOrder();
|
||||
// The player Pokemon (without Stall) goes first despite having lower speed than the opponent.
|
||||
// The opponent Pokemon (with Stall) goes last despite having higher speed than the player Pokemon.
|
||||
// This means that the commandOrder is equivalent to the speed Order reversed
|
||||
expect(speedOrder.reverse()).toEqual(commandOrder);
|
||||
expect(speedOrder).toEqual([enemyPokemonIndex, playerPokemonIndex]);
|
||||
expect(commandOrder).toEqual([playerPokemonIndex, enemyPokemonIndex]);
|
||||
}, 20000);
|
||||
|
||||
it("Pokemon with Stall will go first if a move that is in a higher priority bracket than the opponent's move is used", async() => {
|
||||
await game.startBattle([ Species.SHUCKLE ]);
|
||||
|
||||
const playerPokemonIndex = game.scene.getPlayerPokemon().getBattlerIndex();
|
||||
const enemyPokemonIndex = game.scene.getEnemyPokemon().getBattlerIndex();
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.TACKLE));
|
||||
|
||||
await game.phaseInterceptor.run(EnemyCommandPhase);
|
||||
@ -64,14 +68,16 @@ describe("Abilities - Stall", () => {
|
||||
const commandOrder = phase.getCommandOrder();
|
||||
// The opponent Pokemon (with Stall) goes first because its move is still within a higher priority bracket than its opponent.
|
||||
// The player Pokemon goes second because its move is in a lower priority bracket.
|
||||
// This means that the commandOrder should be identical to the speedOrder
|
||||
expect(speedOrder).toEqual(commandOrder);
|
||||
expect(speedOrder).toEqual([enemyPokemonIndex, playerPokemonIndex]);
|
||||
expect(commandOrder).toEqual([enemyPokemonIndex, playerPokemonIndex]);
|
||||
}, 20000);
|
||||
|
||||
it("If both Pokemon have stall and use the same move, speed is used to determine who goes first.", async() => {
|
||||
game.override.ability(Abilities.STALL);
|
||||
await game.startBattle([ Species.SHUCKLE ]);
|
||||
|
||||
const playerPokemonIndex = game.scene.getPlayerPokemon().getBattlerIndex();
|
||||
const enemyPokemonIndex = game.scene.getEnemyPokemon().getBattlerIndex();
|
||||
game.doAttack(getMovePosition(game.scene, 0, Moves.TACKLE));
|
||||
|
||||
await game.phaseInterceptor.run(EnemyCommandPhase);
|
||||
@ -81,7 +87,7 @@ describe("Abilities - Stall", () => {
|
||||
|
||||
// The opponent Pokemon (with Stall) goes first because it has a higher speed.
|
||||
// The player Pokemon (with Stall) goes second because its speed is lower.
|
||||
// This means that the commandOrder should be identical to the speedOrder
|
||||
expect(speedOrder).toEqual(commandOrder);
|
||||
expect(speedOrder).toEqual([enemyPokemonIndex, playerPokemonIndex]);
|
||||
expect(commandOrder).toEqual([enemyPokemonIndex, playerPokemonIndex]);
|
||||
}, 20000);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user