Skip to content

Commit

Permalink
add unit tests for Winstrate Challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
ImperialSympathizer committed Aug 19, 2024
1 parent 8826183 commit 6481123
Show file tree
Hide file tree
Showing 8 changed files with 397 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export const ATrainersTestEncounter: MysteryEncounter =
)
.withOutroDialogue([
{
text: `${namespace}:outro`,
text: `${namespace}.outro`,
},
])
.build();
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export const DelibirdyEncounter: MysteryEncounter =
// If pokemon meets primary pokemon reqs, it can be selected
const meetsReqs = encounter.options[1].pokemonMeetsPrimaryRequirements(scene, pokemon);
if (!meetsReqs) {
return getEncounterText(scene, `${namespace}:invalid_selection`);
return getEncounterText(scene, `${namespace}.invalid_selection`);
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const PartTimerEncounter: MysteryEncounter =
// Only Pokemon non-KOd pokemon can be selected
const selectableFilter = (pokemon: Pokemon) => {
if (!pokemon.isAllowedInBattle()) {
return getEncounterText(scene, `${namespace}:invalid_selection`);
return getEncounterText(scene, `${namespace}.invalid_selection`);
}

return null;
Expand Down Expand Up @@ -194,7 +194,7 @@ export const PartTimerEncounter: MysteryEncounter =
// Only Pokemon non-KOd pokemon can be selected
const selectableFilter = (pokemon: Pokemon) => {
if (!pokemon.isAllowedInBattle()) {
return getEncounterText(scene, `${namespace}:invalid_selection`);
return getEncounterText(scene, `${namespace}.invalid_selection`);
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const ShadyVitaminDealerEncounter: MysteryEncounter =
// If pokemon meets primary pokemon reqs, it can be selected
const meetsReqs = encounter.pokemonMeetsPrimaryRequirements(scene, pokemon);
if (!meetsReqs) {
return getEncounterText(scene, `${namespace}:invalid_selection`);
return getEncounterText(scene, `${namespace}.invalid_selection`);
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export const TheWinstrateChallengeEncounter: MysteryEncounter =
buttonTooltip: `${namespace}.option.2.tooltip`,
selected: [
{
speaker: `${namespace}:speaker`,
speaker: `${namespace}.speaker`,
text: `${namespace}.option.2.selected`,
},
],
Expand All @@ -137,7 +137,7 @@ async function spawnNextTrainerOrEndEncounter(scene: BattleScene) {
const nextConfig = encounter.enemyPartyConfigs.pop();
if (!nextConfig) {
await transitionMysteryEncounterIntroVisuals(scene, false, false);
await showEncounterDialogue(scene, `${namespace}:victory`, `${namespace}:speaker`);
await showEncounterDialogue(scene, `${namespace}.victory`, `${namespace}.speaker`);
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.MYSTERY_ENCOUNTER_MACHO_BRACE], fillRemaining: false });
encounter.doContinueEncounter = null;
leaveEncounterWithoutBattle(scene);
Expand Down
5 changes: 4 additions & 1 deletion src/data/mystery-encounters/utils/encounter-phase-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,10 @@ export function handleMysteryEncounterVictory(scene: BattleScene, addHealPhase:
scene.pushPhase(new TrainerVictoryPhase(scene));
}
if (scene.gameMode.isEndless || !scene.gameMode.isWaveFinal(scene.currentBattle.waveIndex)) {
scene.pushPhase(new EggLapsePhase(scene));
if (!encounter.doContinueEncounter) {
// Only lapse eggs once for multi-battle encounters
scene.pushPhase(new EggLapsePhase(scene));
}
scene.pushPhase(new MysteryEncounterRewardsPhase(scene, addHealPhase));
}
}
Expand Down
Loading

0 comments on commit 6481123

Please sign in to comment.