mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-24 07:23:24 +02:00
Fixed some bugs
This commit is contained in:
parent
4219379abf
commit
18a650a10e
@ -19,6 +19,7 @@ import { vouchers } from "#system/voucher";
|
||||
import type { OptionSelectConfig, OptionSelectItem } from "#ui/abstract-option-select-ui-handler";
|
||||
import { SaveSlotUiMode } from "#ui/save-slot-select-ui-handler";
|
||||
import { isLocal, isLocalServerConnected, isNullOrUndefined } from "#utils/common";
|
||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||
import i18next from "i18next";
|
||||
|
||||
export class TitlePhase extends Phase {
|
||||
@ -215,22 +216,18 @@ export class TitlePhase extends Phase {
|
||||
const party = globalScene.getPlayerParty();
|
||||
const loadPokemonAssets: Promise<void>[] = [];
|
||||
for (const starter of starters) {
|
||||
const starterProps = globalScene.gameData.getSpeciesDexAttrProps(starter.species, starter.dexAttr);
|
||||
const starterFormIndex = Math.min(starterProps.formIndex, Math.max(starter.species.forms.length - 1, 0));
|
||||
const species = getPokemonSpecies(starter.speciesId);
|
||||
const starterFormIndex = starter.formIndex;
|
||||
const starterGender =
|
||||
starter.species.malePercent !== null
|
||||
? !starterProps.female
|
||||
? Gender.MALE
|
||||
: Gender.FEMALE
|
||||
: Gender.GENDERLESS;
|
||||
species.malePercent !== null ? (!starter.female ? Gender.MALE : Gender.FEMALE) : Gender.GENDERLESS;
|
||||
const starterPokemon = globalScene.addPlayerPokemon(
|
||||
starter.species,
|
||||
species,
|
||||
startingLevel,
|
||||
starter.abilityIndex,
|
||||
starterFormIndex,
|
||||
starterGender,
|
||||
starterProps.shiny,
|
||||
starterProps.variant,
|
||||
starter.shiny,
|
||||
starter.variant,
|
||||
undefined,
|
||||
starter.nature,
|
||||
);
|
||||
|
@ -238,7 +238,7 @@ export class GameManager {
|
||||
* @param species - Optional array of species for party to start with.
|
||||
* @returns A Promise that resolves when the EncounterPhase ends.
|
||||
*/
|
||||
async runToMysteryEncounter(encounterType?: MysteryEncounterType, species?: SpeciesId[]) {
|
||||
async runToMysteryEncounter(encounterType?: MysteryEncounterType, species: SpeciesId[] = []) {
|
||||
if (!isNullOrUndefined(encounterType)) {
|
||||
this.override.disableTrainerWaves();
|
||||
this.override.mysteryEncounter(encounterType);
|
||||
|
@ -34,7 +34,7 @@ export class ChallengeModeHelper extends GameManagerHelper {
|
||||
* @param gameMode - Optional game mode to set.
|
||||
* @returns A promise that resolves when the summon phase is reached.
|
||||
*/
|
||||
async runToSummon(species?: SpeciesId[]) {
|
||||
async runToSummon(species: SpeciesId[] = []) {
|
||||
await this.game.runToTitle();
|
||||
|
||||
if (this.game.override.disableShinies) {
|
||||
|
@ -32,7 +32,7 @@ export class ClassicModeHelper extends GameManagerHelper {
|
||||
*/
|
||||
async runToSummon(): Promise<void>;
|
||||
async runToSummon(species: SpeciesId[] | undefined): Promise<void>;
|
||||
async runToSummon(species?: SpeciesId[]): Promise<void> {
|
||||
async runToSummon(species: SpeciesId[] = []): Promise<void> {
|
||||
await this.game.runToTitle();
|
||||
|
||||
if (this.game.override.disableShinies) {
|
||||
|
Loading…
Reference in New Issue
Block a user