mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-09 17:09:26 +02:00
[Balance] Prevent MEs on X1 Waves (#6204)
* [Balance] Prevent MEs on X1 Waves * Fix Bug-Type Superfan Encounter Test * Fix Unit Tests
This commit is contained in:
parent
e8ab79ebed
commit
0bc78cb715
@ -3528,6 +3528,7 @@ export class BattleScene extends SceneBase {
|
|||||||
this.gameMode.hasMysteryEncounters &&
|
this.gameMode.hasMysteryEncounters &&
|
||||||
battleType === BattleType.WILD &&
|
battleType === BattleType.WILD &&
|
||||||
!this.gameMode.isBoss(waveIndex) &&
|
!this.gameMode.isBoss(waveIndex) &&
|
||||||
|
waveIndex % 10 !== 1 &&
|
||||||
waveIndex < highestMysteryEncounterWave &&
|
waveIndex < highestMysteryEncounterWave &&
|
||||||
waveIndex > lowestMysteryEncounterWave
|
waveIndex > lowestMysteryEncounterWave
|
||||||
);
|
);
|
||||||
|
@ -59,7 +59,7 @@ export const TeleportingHijinksEncounter: MysteryEncounter = MysteryEncounterBui
|
|||||||
)
|
)
|
||||||
.withEncounterTier(MysteryEncounterTier.COMMON)
|
.withEncounterTier(MysteryEncounterTier.COMMON)
|
||||||
.withSceneWaveRangeRequirement(...CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES)
|
.withSceneWaveRangeRequirement(...CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES)
|
||||||
.withSceneRequirement(new WaveModulusRequirement([1, 2, 3], 10)) // Must be in first 3 waves after boss wave
|
.withSceneRequirement(new WaveModulusRequirement([2, 3, 4], 10)) // Must be in first 3 waves after boss wave
|
||||||
.withSceneRequirement(new MoneyRequirement(0, MONEY_COST_MULTIPLIER)) // Must be able to pay teleport cost
|
.withSceneRequirement(new MoneyRequirement(0, MONEY_COST_MULTIPLIER)) // Must be able to pay teleport cost
|
||||||
.withAutoHideIntroVisuals(false)
|
.withAutoHideIntroVisuals(false)
|
||||||
.withCatchAllowed(true)
|
.withCatchAllowed(true)
|
||||||
|
@ -174,7 +174,7 @@ describe("Berries Abound - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should start battle if fastest pokemon is slower than boss below wave 50", async () => {
|
it("should start battle if fastest pokemon is slower than boss below wave 50", async () => {
|
||||||
game.override.startingWave(41);
|
game.override.startingWave(42);
|
||||||
const encounterTextSpy = vi.spyOn(EncounterDialogueUtils, "showEncounterText");
|
const encounterTextSpy = vi.spyOn(EncounterDialogueUtils, "showEncounterText");
|
||||||
await game.runToMysteryEncounter(MysteryEncounterType.BERRIES_ABOUND, defaultParty);
|
await game.runToMysteryEncounter(MysteryEncounterType.BERRIES_ABOUND, defaultParty);
|
||||||
|
|
||||||
|
@ -253,7 +253,7 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should start battle against the Bug-Type Superfan with wave 70 party template", async () => {
|
it("should start battle against the Bug-Type Superfan with wave 70 party template", async () => {
|
||||||
game.override.startingWave(61);
|
game.override.startingWave(63);
|
||||||
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
||||||
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
||||||
|
|
||||||
@ -268,7 +268,7 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should start battle against the Bug-Type Superfan with wave 100 party template", async () => {
|
it("should start battle against the Bug-Type Superfan with wave 100 party template", async () => {
|
||||||
game.override.startingWave(81);
|
game.override.startingWave(83);
|
||||||
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
||||||
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should start battle against the Bug-Type Superfan with wave 120 party template", async () => {
|
it("should start battle against the Bug-Type Superfan with wave 120 party template", async () => {
|
||||||
game.override.startingWave(111);
|
game.override.startingWave(113);
|
||||||
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
||||||
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should start battle against the Bug-Type Superfan with wave 140 party template", async () => {
|
it("should start battle against the Bug-Type Superfan with wave 140 party template", async () => {
|
||||||
game.override.startingWave(131);
|
game.override.startingWave(133);
|
||||||
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
||||||
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
||||||
|
|
||||||
@ -320,7 +320,7 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should start battle against the Bug-Type Superfan with wave 160 party template", async () => {
|
it("should start battle against the Bug-Type Superfan with wave 160 party template", async () => {
|
||||||
game.override.startingWave(151);
|
game.override.startingWave(153);
|
||||||
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
||||||
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
||||||
|
|
||||||
@ -338,7 +338,7 @@ describe("Bug-Type Superfan - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should start battle against the Bug-Type Superfan with wave 180 party template", async () => {
|
it("should start battle against the Bug-Type Superfan with wave 180 party template", async () => {
|
||||||
game.override.startingWave(171);
|
game.override.startingWave(173);
|
||||||
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
await game.runToMysteryEncounter(MysteryEncounterType.BUG_TYPE_SUPERFAN, defaultParty);
|
||||||
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
await runMysteryEncounterToEnd(game, 1, undefined, true);
|
||||||
|
|
||||||
|
@ -79,14 +79,6 @@ describe("Teleporting Hijinks - Mystery Encounter", () => {
|
|||||||
expect(TeleportingHijinksEncounter.options.length).toBe(3);
|
expect(TeleportingHijinksEncounter.options.length).toBe(3);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should run in waves that are X1", async () => {
|
|
||||||
game.override.startingWave(11).mysteryEncounterTier(MysteryEncounterTier.COMMON);
|
|
||||||
|
|
||||||
await game.runToMysteryEncounter();
|
|
||||||
|
|
||||||
expect(scene.currentBattle?.mysteryEncounter?.encounterType).toBe(MysteryEncounterType.TELEPORTING_HIJINKS);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should run in waves that are X2", async () => {
|
it("should run in waves that are X2", async () => {
|
||||||
game.override.startingWave(32).mysteryEncounterTier(MysteryEncounterTier.COMMON);
|
game.override.startingWave(32).mysteryEncounterTier(MysteryEncounterTier.COMMON);
|
||||||
|
|
||||||
@ -103,8 +95,16 @@ describe("Teleporting Hijinks - Mystery Encounter", () => {
|
|||||||
expect(scene.currentBattle?.mysteryEncounter?.encounterType).toBe(MysteryEncounterType.TELEPORTING_HIJINKS);
|
expect(scene.currentBattle?.mysteryEncounter?.encounterType).toBe(MysteryEncounterType.TELEPORTING_HIJINKS);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should NOT run in waves that are not X1, X2, or X3", async () => {
|
it("should run in waves that are X4", async () => {
|
||||||
game.override.startingWave(54);
|
game.override.startingWave(54).mysteryEncounterTier(MysteryEncounterTier.COMMON);
|
||||||
|
|
||||||
|
await game.runToMysteryEncounter();
|
||||||
|
|
||||||
|
expect(scene.currentBattle?.mysteryEncounter?.encounterType).toBe(MysteryEncounterType.TELEPORTING_HIJINKS);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should NOT run in waves that are not X2, X3, or X4", async () => {
|
||||||
|
game.override.startingWave(67);
|
||||||
|
|
||||||
await game.runToMysteryEncounter();
|
await game.runToMysteryEncounter();
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ describe("Mystery Encounters", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
scene = game.scene;
|
scene = game.scene;
|
||||||
game.override.startingWave(11).mysteryEncounterChance(100);
|
game.override.startingWave(12).mysteryEncounterChance(100);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Spawns a mystery encounter", async () => {
|
it("Spawns a mystery encounter", async () => {
|
||||||
@ -37,12 +37,20 @@ describe("Mystery Encounters", () => {
|
|||||||
expect(game.scene.phaseManager.getCurrentPhase()!.constructor.name).toBe(MysteryEncounterPhase.name);
|
expect(game.scene.phaseManager.getCurrentPhase()!.constructor.name).toBe(MysteryEncounterPhase.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("Encounters should not run on X1 waves", async () => {
|
||||||
|
game.override.startingWave(11);
|
||||||
|
|
||||||
|
await game.runToMysteryEncounter();
|
||||||
|
|
||||||
|
expect(scene.currentBattle.mysteryEncounter).toBeUndefined();
|
||||||
|
});
|
||||||
|
|
||||||
it("Encounters should not run below wave 10", async () => {
|
it("Encounters should not run below wave 10", async () => {
|
||||||
game.override.startingWave(9);
|
game.override.startingWave(9);
|
||||||
|
|
||||||
await game.runToMysteryEncounter();
|
await game.runToMysteryEncounter();
|
||||||
|
|
||||||
expect(scene.currentBattle?.mysteryEncounter?.encounterType).not.toBe(MysteryEncounterType.MYSTERIOUS_CHALLENGERS);
|
expect(scene.currentBattle.mysteryEncounter).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Encounters should not run above wave 180", async () => {
|
it("Encounters should not run above wave 180", async () => {
|
||||||
|
@ -27,7 +27,7 @@ describe("Mystery Encounter Phases", () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.startingWave(11).mysteryEncounterChance(100).seed("test"); // Seed guarantees wild encounter to be replaced by ME
|
game.override.startingWave(12).mysteryEncounterChance(100).seed("test"); // Seed guarantees wild encounter to be replaced by ME
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("MysteryEncounterPhase", () => {
|
describe("MysteryEncounterPhase", () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user