Add starters for evolved Pokemon

This commit is contained in:
Flashfyre 2023-07-05 14:19:49 -04:00
parent 4e253862fc
commit 4b61e50d72
2 changed files with 16 additions and 8 deletions

View File

@ -2837,8 +2837,7 @@ export function initMoves() {
.attr(StatChangeAttr, BattleStat.SPATK, -1),
new StatusMove(Moves.FEATHER_DANCE, "Feather Dance", Type.FLYING, 100, 15, -1, "Sharply lowers opponent's Attack.", -1, 0, 3)
.attr(StatChangeAttr, BattleStat.ATK, -2),
new StatusMove(Moves.TEETER_DANCE, "Teeter Dance", Type.NORMAL, 100, 20, -1, "Confuses all Pokémon.", -1, 0, 3)
.attr(ConfuseAttr, true)
new StatusMove(Moves.TEETER_DANCE, "Teeter Dance", Type.NORMAL, 100, 20, -1, "Confuses all other nearby Pokémon.", -1, 0, 3)
.attr(ConfuseAttr)
.target(MoveTarget.ALL_NEAR_OTHERS),
new AttackMove(Moves.BLAZE_KICK, "Blaze Kick", Type.FIRE, MoveCategory.PHYSICAL, 85, 90, 10, -1, "High critical hit ratio. May burn opponent.", 10, 0, 3)

View File

@ -302,22 +302,31 @@ export class GameData {
}
setPokemonCaught(pokemon: Pokemon): Promise<void> {
return new Promise(resolve => {
const dexEntry = this.getPokemonDexEntry(pokemon);
return this.setPokemonSpeciesCaught(pokemon, pokemon.species);
}
setPokemonSpeciesCaught(pokemon: Pokemon, species: PokemonSpecies): Promise<void> {
return new Promise<void>((resolve) => {
const dexEntry = this.getDexEntry(species, pokemon.shiny, pokemon.formIndex, pokemon.gender === Gender.FEMALE, pokemon.abilityIndex);
const hasPrevolution = pokemonPrevolutions.hasOwnProperty(species.speciesId);
if (!dexEntry.caught) {
const newCatch = !this.getDefaultDexEntry(pokemon.species);
const newCatch = !this.getDefaultDexEntry(species);
dexEntry.caught = true;
this.saveSystem();
if (newCatch && !pokemonPrevolutions.hasOwnProperty(pokemon.species.speciesId)) {
if (newCatch && !hasPrevolution) {
this.scene.playSoundWithoutBgm('level_up_fanfare', 1500);
this.scene.ui.showText(`${pokemon.name} has been\nadded as a starter!`, null, () => resolve(), null, true);
this.scene.ui.showText(`${species.name} has been\nadded as a starter!`, null, () => resolve(), null, true);
return;
}
}
resolve();
if (hasPrevolution) {
const prevolutionSpecies = pokemonPrevolutions[species.speciesId];
this.setPokemonSpeciesCaught(pokemon, getPokemonSpecies(prevolutionSpecies)).then(() => resolve());
} else
resolve();
});
}