[Dev] Enable biome parsing of pokemon.ts

This commit is contained in:
NightKev 2025-04-26 20:11:51 -07:00
parent 65a90a3a8d
commit 5954a54782
5 changed files with 798 additions and 1869 deletions

View File

@ -32,7 +32,6 @@
// TODO: these files are too big and complex, ignore them until their respective refactors // TODO: these files are too big and complex, ignore them until their respective refactors
"src/data/moves/move.ts", "src/data/moves/move.ts",
"src/data/abilities/ability.ts", "src/data/abilities/ability.ts",
"src/field/pokemon.ts",
// this file is just too big: // this file is just too big:
"src/data/balance/tms.ts" "src/data/balance/tms.ts"

View File

@ -3,7 +3,7 @@ import {
transitionMysteryEncounterIntroVisuals, transitionMysteryEncounterIntroVisuals,
updatePlayerMoney, updatePlayerMoney,
} from "#app/data/mystery-encounters/utils/encounter-phase-utils"; } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
import { isNullOrUndefined, NumberHolder, randSeedInt, randSeedItem } from "#app/utils/common"; import { isNullOrUndefined, randSeedInt, randSeedItem } from "#app/utils/common";
import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { MysteryEncounterType } from "#enums/mystery-encounter-type";
import { globalScene } from "#app/global-scene"; import { globalScene } from "#app/global-scene";
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter"; import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
@ -111,15 +111,15 @@ export const ThePokemonSalesmanEncounter: MysteryEncounter = MysteryEncounterBui
if ( if (
r === 0 || r === 0 ||
((isNullOrUndefined(species.abilityHidden) || species.abilityHidden === Abilities.NONE) && ((isNullOrUndefined(species.abilityHidden) || species.abilityHidden === Abilities.NONE) &&
(validEventEncounters.length === 0)) validEventEncounters.length === 0)
) { ) {
// If you roll 1%, give shiny Magikarp with random variant // If you roll 1%, give shiny Magikarp with random variant
species = getPokemonSpecies(Species.MAGIKARP); species = getPokemonSpecies(Species.MAGIKARP);
pokemon = new PlayerPokemon(species, 5, 2, undefined, undefined, true); pokemon = new PlayerPokemon(species, 5, 2, undefined, undefined, true);
} }
else if ( else if (
(validEventEncounters.length > 0 && (r <= EVENT_THRESHOLD || validEventEncounters.length > 0 &&
(isNullOrUndefined(species.abilityHidden) || species.abilityHidden === Abilities.NONE))) (r <= EVENT_THRESHOLD || isNullOrUndefined(species.abilityHidden) || species.abilityHidden === Abilities.NONE)
) { ) {
tries = 0; tries = 0;
do { do {

View File

@ -251,21 +251,20 @@ export function getGymLeaderPartyTemplate() {
switch (gameMode.modeId) { switch (gameMode.modeId) {
case GameModes.DAILY: case GameModes.DAILY:
if (currentBattle?.waveIndex <= 20) { if (currentBattle?.waveIndex <= 20) {
return trainerPartyTemplates.GYM_LEADER_2 return trainerPartyTemplates.GYM_LEADER_2;
} }
return trainerPartyTemplates.GYM_LEADER_3; return trainerPartyTemplates.GYM_LEADER_3;
case GameModes.CHALLENGE: // In the future, there may be a ChallengeType to call here. For now, use classic's. case GameModes.CHALLENGE: // In the future, there may be a ChallengeType to call here. For now, use classic's.
case GameModes.CLASSIC: case GameModes.CLASSIC:
if (currentBattle?.waveIndex <= 20) { if (currentBattle?.waveIndex <= 20) {
return trainerPartyTemplates.GYM_LEADER_1; // 1 avg 1 strong return trainerPartyTemplates.GYM_LEADER_1; // 1 avg 1 strong
} } else if (currentBattle?.waveIndex <= 30) {
else if (currentBattle?.waveIndex <= 30) {
return trainerPartyTemplates.GYM_LEADER_2; // 1 avg 1 strong 1 stronger return trainerPartyTemplates.GYM_LEADER_2; // 1 avg 1 strong 1 stronger
} } else if (currentBattle?.waveIndex <= 60) {
else if (currentBattle?.waveIndex <= 60) { // 50 and 60 // 50 and 60
return trainerPartyTemplates.GYM_LEADER_3; // 2 avg 1 strong 1 stronger return trainerPartyTemplates.GYM_LEADER_3; // 2 avg 1 strong 1 stronger
} } else if (currentBattle?.waveIndex <= 90) {
else if (currentBattle?.waveIndex <= 90) { // 80 and 90 // 80 and 90
return trainerPartyTemplates.GYM_LEADER_4; // 3 avg 1 strong 1 stronger return trainerPartyTemplates.GYM_LEADER_4; // 3 avg 1 strong 1 stronger
} }
// 110+ // 110+

File diff suppressed because it is too large Load Diff

View File

@ -151,9 +151,9 @@ export default class LoginFormUiHandler extends FormModalUiHandler {
// Prevent overlapping overrides on action modification // Prevent overlapping overrides on action modification
this.submitAction = originalLoginAction; this.submitAction = originalLoginAction;
this.sanitizeInputs(); this.sanitizeInputs();
globalScene.ui.setMode(UiMode.LOADING, { buttonActions: [] }); globalScene.ui.setMode(UiMode.LOADING, { buttonActions: [] });
const onFail = error => { const onFail = error => {
globalScene.ui.setMode(UiMode.LOGIN_FORM, Object.assign(config, { errorMessage: error?.trim() })); globalScene.ui.setMode(UiMode.LOGIN_FORM, Object.assign(config, { errorMessage: error?.trim() }));
globalScene.ui.playError(); globalScene.ui.playError();
}; };
if (!this.inputs[0].text) { if (!this.inputs[0].text) {
@ -243,7 +243,7 @@ export default class LoginFormUiHandler extends FormModalUiHandler {
}, },
}); });
} }
globalScene.ui.setOverlayMode(UiMode.OPTION_SELECT, { globalScene.ui.setOverlayMode(UiMode.OPTION_SELECT, {
options: options, options: options,
delay: 1000, delay: 1000,
}); });