mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-28 01:36:07 +00:00
update unit tests
This commit is contained in:
parent
ba637e80e2
commit
de928e5d7e
@ -2760,7 +2760,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
const previousEncounter = this.mysteryEncounterData.encounteredEvents?.length > 0 ? this.mysteryEncounterData.encounteredEvents[this.mysteryEncounterData.encounteredEvents.length - 1][0] : null;
|
const previousEncounter = this.mysteryEncounterData.encounteredEvents?.length > 0 ? this.mysteryEncounterData.encounteredEvents[this.mysteryEncounterData.encounteredEvents.length - 1][0] : null;
|
||||||
const biomeMysteryEncounters = mysteryEncountersByBiome.get(this.arena.biomeType) ?? [];
|
const biomeMysteryEncounters = mysteryEncountersByBiome.get(this.arena.biomeType) ?? [];
|
||||||
// If no valid encounters exist at tier, checks next tier down, continuing until there are some encounters available
|
// If no valid encounters exist at tier, checks next tier down, continuing until there are some encounters available
|
||||||
while (availableEncounters.length === 0 && tier >= 0) {
|
while (availableEncounters.length === 0 && tier !== null) {
|
||||||
availableEncounters = biomeMysteryEncounters
|
availableEncounters = biomeMysteryEncounters
|
||||||
.filter((encounterType) => {
|
.filter((encounterType) => {
|
||||||
const encounterCandidate = allMysteryEncounters[encounterType];
|
const encounterCandidate = allMysteryEncounters[encounterType];
|
||||||
@ -2784,7 +2784,16 @@ export default class BattleScene extends SceneBase {
|
|||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.map((m) => (allMysteryEncounters[m]));
|
.map((m) => (allMysteryEncounters[m]));
|
||||||
tier--;
|
// Decrement tier
|
||||||
|
if (tier === MysteryEncounterTier.ROGUE) {
|
||||||
|
tier = MysteryEncounterTier.ULTRA;
|
||||||
|
} else if (tier === MysteryEncounterTier.ULTRA) {
|
||||||
|
tier = MysteryEncounterTier.GREAT;
|
||||||
|
} else if (tier === MysteryEncounterTier.GREAT) {
|
||||||
|
tier = MysteryEncounterTier.COMMON;
|
||||||
|
} else {
|
||||||
|
tier = null; // Ends loop
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If absolutely no encounters are available, spawn 0th encounter
|
// If absolutely no encounters are available, spawn 0th encounter
|
||||||
|
@ -81,6 +81,7 @@ describe("Absolute Avarice - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not spawn outside of proper biomes", async () => {
|
it("should not spawn outside of proper biomes", async () => {
|
||||||
|
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT);
|
||||||
game.override.startingBiome(Biome.VOLCANO);
|
game.override.startingBiome(Biome.VOLCANO);
|
||||||
await game.runToMysteryEncounter();
|
await game.runToMysteryEncounter();
|
||||||
|
|
||||||
@ -96,6 +97,7 @@ describe("Absolute Avarice - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should spawn if player has enough berries", async () => {
|
it("should spawn if player has enough berries", async () => {
|
||||||
|
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT);
|
||||||
game.override.starterHeldItems([{name: "BERRY", count: 2, type: BerryType.SITRUS}, {name: "BERRY", count: 3, type: BerryType.GANLON}]);
|
game.override.starterHeldItems([{name: "BERRY", count: 2, type: BerryType.SITRUS}, {name: "BERRY", count: 3, type: BerryType.GANLON}]);
|
||||||
|
|
||||||
await game.runToMysteryEncounter();
|
await game.runToMysteryEncounter();
|
||||||
|
@ -72,6 +72,7 @@ describe("An Offer You Can't Refuse - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not spawn outside of HUMAN_TRANSITABLE_BIOMES", async () => {
|
it("should not spawn outside of HUMAN_TRANSITABLE_BIOMES", async () => {
|
||||||
|
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT);
|
||||||
game.override.startingBiome(Biome.VOLCANO);
|
game.override.startingBiome(Biome.VOLCANO);
|
||||||
await game.runToMysteryEncounter();
|
await game.runToMysteryEncounter();
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@ describe("Department Store Sale - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not spawn outside of CIVILIZATION_ENCOUNTER_BIOMES", async () => {
|
it("should not spawn outside of CIVILIZATION_ENCOUNTER_BIOMES", async () => {
|
||||||
|
game.override.mysteryEncounterTier(MysteryEncounterTier.COMMON);
|
||||||
game.override.startingBiome(Biome.VOLCANO);
|
game.override.startingBiome(Biome.VOLCANO);
|
||||||
await game.runToMysteryEncounter();
|
await game.runToMysteryEncounter();
|
||||||
|
|
||||||
|
@ -66,6 +66,7 @@ describe("Lost at Sea - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not spawn outside of sea biome", async () => {
|
it("should not spawn outside of sea biome", async () => {
|
||||||
|
game.override.mysteryEncounterTier(MysteryEncounterTier.COMMON);
|
||||||
game.override.startingBiome(Biome.MOUNTAIN);
|
game.override.startingBiome(Biome.MOUNTAIN);
|
||||||
await game.runToMysteryEncounter();
|
await game.runToMysteryEncounter();
|
||||||
|
|
||||||
|
@ -71,6 +71,7 @@ describe("Mysterious Challengers - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not spawn outside of HUMAN_TRANSITABLE_BIOMES", async () => {
|
it("should not spawn outside of HUMAN_TRANSITABLE_BIOMES", async () => {
|
||||||
|
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT);
|
||||||
game.override.startingBiome(Biome.VOLCANO);
|
game.override.startingBiome(Biome.VOLCANO);
|
||||||
await game.runToMysteryEncounter();
|
await game.runToMysteryEncounter();
|
||||||
|
|
||||||
@ -86,7 +87,6 @@ describe("Mysterious Challengers - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not run above wave 179", async () => {
|
it("should not run above wave 179", async () => {
|
||||||
game.override.mysteryEncounterTier(MysteryEncounterTier.GREAT);
|
|
||||||
game.override.startingWave(181);
|
game.override.startingWave(181);
|
||||||
|
|
||||||
await game.runToMysteryEncounter();
|
await game.runToMysteryEncounter();
|
||||||
|
@ -69,6 +69,7 @@ describe("The Pokemon Salesman - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not spawn outside of HUMAN_TRANSITABLE_BIOMES", async () => {
|
it("should not spawn outside of HUMAN_TRANSITABLE_BIOMES", async () => {
|
||||||
|
game.override.mysteryEncounterTier(MysteryEncounterTier.ULTRA);
|
||||||
game.override.startingBiome(Biome.VOLCANO);
|
game.override.startingBiome(Biome.VOLCANO);
|
||||||
await game.runToMysteryEncounter();
|
await game.runToMysteryEncounter();
|
||||||
|
|
||||||
|
@ -75,6 +75,7 @@ describe("The Strong Stuff - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should not spawn outside of CAVE biome", async () => {
|
it("should not spawn outside of CAVE biome", async () => {
|
||||||
|
game.override.mysteryEncounterTier(MysteryEncounterTier.COMMON);
|
||||||
game.override.startingBiome(Biome.MOUNTAIN);
|
game.override.startingBiome(Biome.MOUNTAIN);
|
||||||
await game.runToMysteryEncounter();
|
await game.runToMysteryEncounter();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user