fix unit test breaks

This commit is contained in:
ImperialSympathizer 2024-07-18 22:56:01 -04:00
parent 70fc4b67ae
commit a598c1cb05
4 changed files with 8 additions and 6 deletions

View File

@ -1038,8 +1038,6 @@ export default class BattleScene extends SceneBase {
const playerField = this.getPlayerField(); const playerField = this.getPlayerField();
this.newArena(Biome.VOLCANO);
if (this.gameMode.isFixedBattle(newWaveIndex) && trainerData === undefined) { if (this.gameMode.isFixedBattle(newWaveIndex) && trainerData === undefined) {
battleConfig = this.gameMode.getFixedBattle(newWaveIndex); battleConfig = this.gameMode.getFixedBattle(newWaveIndex);
newDouble = battleConfig.double; newDouble = battleConfig.double;

View File

@ -34,7 +34,7 @@ export function doTrainerExclamation(scene: BattleScene) {
const exclamationSprite = scene.addFieldSprite(0, 0, "exclaim"); const exclamationSprite = scene.addFieldSprite(0, 0, "exclaim");
exclamationSprite.setName("exclamation"); exclamationSprite.setName("exclamation");
scene.field.add(exclamationSprite); scene.field.add(exclamationSprite);
scene.field.moveTo(exclamationSprite, scene.field.list.length - 1); scene.field.moveTo(exclamationSprite, scene.field.getAll().length - 1);
exclamationSprite.setVisible(true); exclamationSprite.setVisible(true);
exclamationSprite.setPosition(110, 68); exclamationSprite.setPosition(110, 68);
scene.tweens.add({ scene.tweens.add({
@ -475,7 +475,7 @@ export function setEncounterExp(scene: BattleScene, participantId: integer | int
const nonFaintedPartyMembers = party.filter(p => p.hp); const nonFaintedPartyMembers = party.filter(p => p.hp);
const expPartyMembers = nonFaintedPartyMembers.filter(p => p.level < scene.getMaxExpLevel()); const expPartyMembers = nonFaintedPartyMembers.filter(p => p.level < scene.getMaxExpLevel());
const partyMemberExp = []; const partyMemberExp = [];
let expValue = baseExpValue * (useWaveIndex ? scene.currentBattle.waveIndex : 1) / 5 + 1; let expValue = Math.floor(baseExpValue * (useWaveIndex ? scene.currentBattle.waveIndex : 1) / 5 + 1);
if (participantIds?.length > 0) { if (participantIds?.length > 0) {
if (scene.currentBattle.mysteryEncounter.encounterVariant === MysteryEncounterVariant.TRAINER_BATTLE) { if (scene.currentBattle.mysteryEncounter.encounterVariant === MysteryEncounterVariant.TRAINER_BATTLE) {

View File

@ -122,7 +122,7 @@ describe("Lost at Sea - Mystery Encounter", () => {
await runSelectMysteryEncounterOption(game, 2); await runSelectMysteryEncounterOption(game, 2);
expect(blastoise.exp).toBe(expBefore + laprasSpecies.baseExp * defaultWave); expect(blastoise.exp).toBe(expBefore + Math.floor(laprasSpecies.baseExp * defaultWave / 5 + 1));
}); });
it("should leave encounter without battle", async () => { it("should leave encounter without battle", async () => {
@ -171,7 +171,7 @@ describe("Lost at Sea - Mystery Encounter", () => {
await runSelectMysteryEncounterOption(game, 2); await runSelectMysteryEncounterOption(game, 2);
expect(pidgeot.exp).toBe(expBefore + laprasBaseExp * wave); expect(pidgeot.exp).toBe(expBefore + Math.floor(laprasBaseExp * defaultWave / 5 + 1));
}); });
it("should leave encounter without battle", async () => { it("should leave encounter without battle", async () => {

View File

@ -154,6 +154,10 @@ export default class MockContainer {
// Sends this Game Object to the back of its parent's display list. // Sends this Game Object to the back of its parent's display list.
} }
moveTo(obj) {
// Moves this Game Object to the given index in the list.
}
moveAbove(obj) { moveAbove(obj) {
// Moves this Game Object to be above the given Game Object in the display list. // Moves this Game Object to be above the given Game Object in the display list.
} }