Compare commits

..

No commits in common. "1c75e18fd318e44e88ced29da82617999241fe00" and "0c122af8fa9e6a97618c8cc8c6fea9209a1f7c1c" have entirely different histories.

5 changed files with 18 additions and 0 deletions

View File

@ -458,6 +458,7 @@ export abstract class PokemonSpeciesForm {
loadAssets(scene: BattleScene, female: boolean, formIndex?: integer, shiny?: boolean, variant?: Variant, startLoad?: boolean): Promise<void> {
return new Promise(resolve => {
console.time("fetching assets " + this.speciesId);
const spriteKey = this.getSpriteKey(female, formIndex, shiny, variant);
scene.loadPokemonAtlas(spriteKey, this.getSpriteAtlasPath(female, formIndex, shiny, variant));
scene.load.audio(`cry/${this.getCryKey(formIndex)}`, `audio/cry/${this.getCryKey(formIndex)}.m4a`);
@ -498,6 +499,7 @@ export abstract class PokemonSpeciesForm {
populateVariantColors(spriteKey).then(() => resolve());
return;
}
console.timeEnd("fetching assets " + this.speciesId);
resolve();
});

View File

@ -13,6 +13,7 @@ import { EggHatchData } from "#app/data/egg-hatch-data.js";
export class EggLapsePhase extends Phase {
private eggHatchData: EggHatchData[] = [];
private loadsWaiting: number;
constructor(scene: BattleScene) {
super(scene);
}
@ -28,6 +29,7 @@ export class EggLapsePhase extends Phase {
this.eggHatchData= [];
const minEggsToPromptSkip = 5;
this.loadsWaiting = eggsToHatch.length;
if (eggsToHatchCount > 0) {
@ -36,6 +38,7 @@ export class EggLapsePhase extends Phase {
// show prompt for skip
this.scene.ui.showText(i18next.t("battle:eggSkipPrompt"), 0);
this.scene.ui.setModeWithoutClear(Mode.CONFIRM, () => {
console.time("hatch eggs");
for (const egg of eggsToHatch) {
this.hatchEggSilently(egg);
}
@ -87,6 +90,11 @@ export class EggLapsePhase extends Phase {
pokemon.clearFusionSpecies();
}
this.loadsWaiting--;
if (this.loadsWaiting === 0) {
console.timeEnd("hatch eggs");
}
if (pokemon.species.subLegendary) {
this.scene.validateAchv(achvs.HATCH_SUB_LEGENDARY);
}

View File

@ -21,9 +21,11 @@ export class EggSummaryPhase extends Phase {
start() {
super.start();
console.time("update egg dex");
const updateNextPokemon = (i: integer) => {
if (i >= this.eggHatchData.length) {
console.timeEnd("update egg dex");
this.scene.ui.setModeForceTransition(Mode.EGG_HATCH_SUMMARY, this.eggHatchData).then(() => {
this.scene.fadeOutBgm(undefined, false);

View File

@ -1628,6 +1628,7 @@ export class GameData {
return;
}
this.scene.playSound("level_up_fanfare");
console.log(`${species.name} has been\nadded as a starter!`);
this.scene.ui.showText(i18next.t("battle:addedAsAStarter", { pokemonName: species.name }), null, () => checkPrevolution(), null, true);
} else {
checkPrevolution();

View File

@ -121,6 +121,8 @@ export default class PokemonHatchInfoContainer extends PokemonInfoContainer {
* @precondition the specific pokemon sprite has already been loaded
*/
displayPokemon(pokemon: PlayerPokemon) {
console.time("display pokemon" + pokemon.name);
console.log("displaying pokemon", pokemon.name);
const species = pokemon.species;
const female = pokemon.gender === Gender.FEMALE;
const formIndex = pokemon.formIndex;
@ -135,6 +137,7 @@ export default class PokemonHatchInfoContainer extends PokemonInfoContainer {
this.currentPokemonSprite.setPipelineData("variant", variant);
this.currentPokemonSprite.setPipelineData("spriteKey", species.getSpriteKey(female, formIndex, shiny, variant));
this.currentPokemonSprite.setVisible(true);
console.timeEnd("display pokemon" + pokemon.name);
});
}
@ -144,6 +147,7 @@ export default class PokemonHatchInfoContainer extends PokemonInfoContainer {
* @param hatchInfo The EggHatchData of the pokemon / new hatch to show
*/
showHatchInfo(hatchInfo: EggHatchData) {
console.time("show hatch info" + hatchInfo.pokemon.name);
this.pokemonEggMovesContainer.setVisible(true);
const pokemon = hatchInfo.pokemon;
@ -184,6 +188,7 @@ export default class PokemonHatchInfoContainer extends PokemonInfoContainer {
} else {
this.pokemonHatchedIcon.setFrame(getEggTierForSpecies(species));
}
console.timeEnd("show hatch info" + hatchInfo.pokemon.name);
}