mystery encounters: resolve review comments:
Lost at Sea: -fix typo in handlePokemonGuidingYouPhase function Mysterious Chest: - remove obsolete commented code mystery-encounter.ts - remove unused `onDone` field from MysteryEncounterBuilder
This commit is contained in:
parent
fd80036dac
commit
fe2888be4b
|
@ -1,4 +1,6 @@
|
||||||
|
import { getPokemonSpecies } from "#app/data/pokemon-species.js";
|
||||||
import { Moves } from "#app/enums/moves";
|
import { Moves } from "#app/enums/moves";
|
||||||
|
import { Species } from "#app/enums/species.js";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import BattleScene from "../../../battle-scene";
|
import BattleScene from "../../../battle-scene";
|
||||||
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
||||||
|
@ -62,7 +64,7 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
.withOptionPhase(async (scene: BattleScene) => handlePokemongGuidingYouPhase(scene))
|
.withOptionPhase(async (scene: BattleScene) => handlePokemonGuidingYouPhase(scene))
|
||||||
.build()
|
.build()
|
||||||
)
|
)
|
||||||
.withOption(
|
.withOption(
|
||||||
|
@ -81,7 +83,7 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
.withOptionPhase(async (scene: BattleScene) => handlePokemongGuidingYouPhase(scene))
|
.withOptionPhase(async (scene: BattleScene) => handlePokemonGuidingYouPhase(scene))
|
||||||
.build()
|
.build()
|
||||||
)
|
)
|
||||||
.withSimpleOption(
|
.withSimpleOption(
|
||||||
|
@ -122,13 +124,12 @@ export const LostAtSeaEncounter: MysteryEncounter = MysteryEncounterBuilder.with
|
||||||
* @param scene Battle scene
|
* @param scene Battle scene
|
||||||
* @param guidePokemon pokemon choosen as a guide
|
* @param guidePokemon pokemon choosen as a guide
|
||||||
*/
|
*/
|
||||||
function handlePokemongGuidingYouPhase(scene: BattleScene) {
|
function handlePokemonGuidingYouPhase(scene: BattleScene) {
|
||||||
/** Base EXP value for guiding pokemon. Currently Lapras base-value */
|
const laprasSpecies = getPokemonSpecies(Species.LAPRAS);
|
||||||
const baseExpValue: number = 187;
|
|
||||||
const { mysteryEncounter } = scene.currentBattle;
|
const { mysteryEncounter } = scene.currentBattle;
|
||||||
|
|
||||||
if (mysteryEncounter.selectedOption) {
|
if (mysteryEncounter.selectedOption) {
|
||||||
setEncounterExp(scene, mysteryEncounter.selectedOption.primaryPokemon.id, baseExpValue, true);
|
setEncounterExp(scene, mysteryEncounter.selectedOption.primaryPokemon.id, laprasSpecies.baseExp, true);
|
||||||
} else {
|
} else {
|
||||||
console.warn("Lost at sea: No guide pokemon found but pokemon guides player. huh!?");
|
console.warn("Lost at sea: No guide pokemon found but pokemon guides player. huh!?");
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,16 +114,9 @@ export const MysteriousChestEncounter: IMysteryEncounter =
|
||||||
scene.currentBattle.mysteryEncounter.setDialogueToken("pokeName", highestLevelPokemon.name);
|
scene.currentBattle.mysteryEncounter.setDialogueToken("pokeName", highestLevelPokemon.name);
|
||||||
// Show which Pokemon was KOed, then leave encounter with no rewards
|
// Show which Pokemon was KOed, then leave encounter with no rewards
|
||||||
// Does this synchronously so that game over doesn't happen over result message
|
// Does this synchronously so that game over doesn't happen over result message
|
||||||
await showEncounterText(scene, "mysteryEncounter:mysterious_chest_option_1_bad_result")
|
await showEncounterText(scene, "mysteryEncounter:mysterious_chest_option_1_bad_result").then(() => {
|
||||||
.then(() => {
|
leaveEncounterWithoutBattle(scene);
|
||||||
// if (scene.getParty().filter((p) => p.isAllowedInBattle()).length === 0) {
|
});
|
||||||
// // All pokemon fainted, game over
|
|
||||||
// scene.clearPhaseQueue();
|
|
||||||
// scene.unshiftPhase(new GameOverPhase(scene));
|
|
||||||
// } else {
|
|
||||||
leaveEncounterWithoutBattle(scene);
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.build()
|
.build()
|
||||||
|
|
|
@ -363,7 +363,6 @@ export class MysteryEncounterBuilder implements Partial<IMysteryEncounter> {
|
||||||
doEncounterExp?: (scene: BattleScene) => boolean;
|
doEncounterExp?: (scene: BattleScene) => boolean;
|
||||||
doEncounterRewards?: (scene: BattleScene) => boolean;
|
doEncounterRewards?: (scene: BattleScene) => boolean;
|
||||||
onInit?: (scene: BattleScene) => boolean;
|
onInit?: (scene: BattleScene) => boolean;
|
||||||
onDone?: (scene: BattleScene) => boolean;
|
|
||||||
hideBattleIntroMessage?: boolean;
|
hideBattleIntroMessage?: boolean;
|
||||||
hideIntroVisuals?: boolean;
|
hideIntroVisuals?: boolean;
|
||||||
enemyPartyConfigs?: EnemyPartyConfig[] = [];
|
enemyPartyConfigs?: EnemyPartyConfig[] = [];
|
||||||
|
|
Loading…
Reference in New Issue