mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 06:53:27 +02:00
[Balance] [ME] Trash to Treasure Option 1 Adjustment (#6341)
* Update trash-to-treasure-encounter.ts * Update trash-to-treasure-encounter.test.ts tests
This commit is contained in:
parent
72b09eb7d5
commit
5ee547a39a
@ -153,7 +153,7 @@ export const TrashToTreasureEncounter: MysteryEncounter = MysteryEncounterBuilde
|
|||||||
doGarbageDig();
|
doGarbageDig();
|
||||||
})
|
})
|
||||||
.withOptionPhase(async () => {
|
.withOptionPhase(async () => {
|
||||||
// Gain 2 Leftovers and 1 Shell Bell
|
// Gain 1 Leftovers and 1 Shell Bell
|
||||||
await transitionMysteryEncounterIntroVisuals();
|
await transitionMysteryEncounterIntroVisuals();
|
||||||
await tryApplyDigRewardItems();
|
await tryApplyDigRewardItems();
|
||||||
|
|
||||||
@ -231,21 +231,7 @@ async function tryApplyDigRewardItems() {
|
|||||||
const party = globalScene.getPlayerParty();
|
const party = globalScene.getPlayerParty();
|
||||||
|
|
||||||
// Iterate over the party until an item was successfully given
|
// Iterate over the party until an item was successfully given
|
||||||
// First leftovers
|
// Only Leftovers
|
||||||
for (const pokemon of party) {
|
|
||||||
const heldItems = globalScene.findModifiers(
|
|
||||||
m => m instanceof PokemonHeldItemModifier && m.pokemonId === pokemon.id,
|
|
||||||
true,
|
|
||||||
) as PokemonHeldItemModifier[];
|
|
||||||
const existingLeftovers = heldItems.find(m => m instanceof TurnHealModifier) as TurnHealModifier;
|
|
||||||
|
|
||||||
if (!existingLeftovers || existingLeftovers.getStackCount() < existingLeftovers.getMaxStackCount()) {
|
|
||||||
await applyModifierTypeToPlayerPokemon(pokemon, leftovers);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Second leftovers
|
|
||||||
for (const pokemon of party) {
|
for (const pokemon of party) {
|
||||||
const heldItems = globalScene.findModifiers(
|
const heldItems = globalScene.findModifiers(
|
||||||
m => m instanceof PokemonHeldItemModifier && m.pokemonId === pokemon.id,
|
m => m instanceof PokemonHeldItemModifier && m.pokemonId === pokemon.id,
|
||||||
|
@ -169,7 +169,7 @@ describe("Trash to Treasure - Mystery Encounter", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should give 2 Leftovers, 1 Shell Bell, and Black Sludge", async () => {
|
it("should give 1 Leftovers, 1 Shell Bell, and Black Sludge", async () => {
|
||||||
await game.runToMysteryEncounter(MysteryEncounterType.TRASH_TO_TREASURE, defaultParty);
|
await game.runToMysteryEncounter(MysteryEncounterType.TRASH_TO_TREASURE, defaultParty);
|
||||||
await runMysteryEncounterToEnd(game, 1);
|
await runMysteryEncounterToEnd(game, 1);
|
||||||
await game.phaseInterceptor.to("SelectModifierPhase", false);
|
await game.phaseInterceptor.to("SelectModifierPhase", false);
|
||||||
@ -177,7 +177,7 @@ describe("Trash to Treasure - Mystery Encounter", () => {
|
|||||||
|
|
||||||
const leftovers = scene.findModifier(m => m instanceof TurnHealModifier) as TurnHealModifier;
|
const leftovers = scene.findModifier(m => m instanceof TurnHealModifier) as TurnHealModifier;
|
||||||
expect(leftovers).toBeDefined();
|
expect(leftovers).toBeDefined();
|
||||||
expect(leftovers?.stackCount).toBe(2);
|
expect(leftovers?.stackCount).toBe(1);
|
||||||
|
|
||||||
const shellBell = scene.findModifier(m => m instanceof HitHealModifier) as HitHealModifier;
|
const shellBell = scene.findModifier(m => m instanceof HitHealModifier) as HitHealModifier;
|
||||||
expect(shellBell).toBeDefined();
|
expect(shellBell).toBeDefined();
|
||||||
|
Loading…
Reference in New Issue
Block a user