added turnorder to tests

This commit is contained in:
geeil-han 2025-02-08 22:41:00 +01:00
parent d94934962f
commit 9bb138c519

View File

@ -5,6 +5,7 @@ import { Species } from "#enums/species";
import { Stat } from "#enums/stat"; import { Stat } from "#enums/stat";
import GameManager from "#test/utils/gameManager"; import GameManager from "#test/utils/gameManager";
import Phaser from "phaser"; import Phaser from "phaser";
import { BattlerIndex } from "#app/battle";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Abilities - Protosynthesis", () => { describe("Abilities - Protosynthesis", () => {
@ -48,12 +49,14 @@ describe("Abilities - Protosynthesis", () => {
const atk_before_boost = mew.getEffectiveStat(Stat.ATK, undefined, undefined, false, undefined, false, false, true); const atk_before_boost = mew.getEffectiveStat(Stat.ATK, undefined, undefined, false, undefined, false, false, true);
const initialHp = enemy.hp; const initialHp = enemy.hp;
game.move.select(Moves.TACKLE); game.move.select(Moves.TACKLE);
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]);
await game.toNextTurn(); await game.toNextTurn();
const unboosted_dmg = initialHp - enemy.hp; const unboosted_dmg = initialHp - enemy.hp;
enemy.hp = initialHp; enemy.hp = initialHp;
const def_after_boost = mew.getEffectiveStat(Stat.DEF, undefined, undefined, false, undefined, false, false, true); const def_after_boost = mew.getEffectiveStat(Stat.DEF, undefined, undefined, false, undefined, false, false, true);
const atk_after_boost = mew.getEffectiveStat(Stat.ATK, undefined, undefined, false, undefined, false, false, true); const atk_after_boost = mew.getEffectiveStat(Stat.ATK, undefined, undefined, false, undefined, false, false, true);
game.move.select(Moves.TACKLE); game.move.select(Moves.TACKLE);
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]);
await game.toNextTurn(); await game.toNextTurn();
const boosted_dmg = initialHp - enemy.hp; const boosted_dmg = initialHp - enemy.hp;
expect(boosted_dmg).toBeGreaterThan(unboosted_dmg); expect(boosted_dmg).toBeGreaterThan(unboosted_dmg);