Skip to content

Commit

Permalink
fix pokemon not returning after winstrate battle
Browse files Browse the repository at this point in the history
  • Loading branch information
ImperialSympathizer committed Aug 19, 2024
1 parent 6481123 commit c831baa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { PartyHealPhase, ReturnPhase, ShowTrainerPhase } from "#app/phases";
import { SpeciesFormChangeManualTrigger } from "#app/data/pokemon-forms";
import { applyPostBattleInitAbAttrs, PostBattleInitAbAttr } from "#app/data/ability";
import { showEncounterDialogue } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";

/** the i18n namespace for the encounter */
const namespace = "mysteryEncounter:theWinstrateChallenge";
Expand Down Expand Up @@ -140,7 +141,7 @@ async function spawnNextTrainerOrEndEncounter(scene: BattleScene) {
await showEncounterDialogue(scene, `${namespace}.victory`, `${namespace}.speaker`);
setEncounterRewards(scene, { guaranteedModifierTypeFuncs: [modifierTypes.MYSTERY_ENCOUNTER_MACHO_BRACE], fillRemaining: false });
encounter.doContinueEncounter = null;
leaveEncounterWithoutBattle(scene);
leaveEncounterWithoutBattle(scene, false, MysteryEncounterMode.TRAINER_BATTLE);
} else {
await initBattleWithEnemyConfig(scene, nextConfig);
}
Expand Down
5 changes: 3 additions & 2 deletions src/data/mystery-encounters/utils/encounter-phase-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,9 +634,10 @@ export function initSubsequentOptionSelect(scene: BattleScene, optionSelectSetti
* Will skip any shops and rewards, and queue the next encounter phase as normal
* @param scene
* @param addHealPhase - when true, will add a shop phase to end of encounter with 0 rewards but healing items are available
* @param encounterMode - Can set custom encounter mode if necessary (may be required for forcing Pokemon to return before next phase)
*/
export function leaveEncounterWithoutBattle(scene: BattleScene, addHealPhase: boolean = false) {
scene.currentBattle.mysteryEncounter.encounterMode = MysteryEncounterMode.NO_BATTLE;
export function leaveEncounterWithoutBattle(scene: BattleScene, addHealPhase: boolean = false, encounterMode: MysteryEncounterMode = MysteryEncounterMode.NO_BATTLE) {
scene.currentBattle.mysteryEncounter.encounterMode = encounterMode;
scene.clearPhaseQueue();
scene.clearPhaseQueueSplice();
handleMysteryEncounterVictory(scene, addHealPhase);
Expand Down
2 changes: 1 addition & 1 deletion src/data/trainer-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1969,7 +1969,7 @@ export const trainerConfigs: TrainerConfigs = {
.setPartyTemplates(trainerPartyTemplates.TWO_AVG_ONE_STRONG),
[TrainerType.VICKY]: new TrainerConfig(++t).setName("Vicky").setTitle("The Winstrates")
.setMoneyMultiplier(1)
.setPartyTemplates(trainerPartyTemplates.ONE_STRONG),
.setPartyTemplates(trainerPartyTemplates.ONE_AVG),
[TrainerType.VITO]: new TrainerConfig(++t).setName("Vito").setTitle("The Winstrates")
.setMoneyMultiplier(2)
.setPartyTemplates(new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(3, PartyMemberStrength.AVERAGE), new TrainerPartyTemplate(2, PartyMemberStrength.STRONG)))
Expand Down

0 comments on commit c831baa

Please sign in to comment.