mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-15 20:09:30 +02:00
Remove non-Legend fresh start option, fix starting movesets
This commit is contained in:
parent
93525b5803
commit
b905dff7d9
@ -4,7 +4,6 @@ import { defaultStarterSpecies } from "#app/constants";
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { pokemonEvolutions } from "#balance/pokemon-evolutions";
|
import { pokemonEvolutions } from "#balance/pokemon-evolutions";
|
||||||
import { speciesStarterCosts } from "#balance/starters";
|
import { speciesStarterCosts } from "#balance/starters";
|
||||||
import { getEggTierForSpecies } from "#data/egg";
|
|
||||||
import { pokemonFormChanges } from "#data/pokemon-forms";
|
import { pokemonFormChanges } from "#data/pokemon-forms";
|
||||||
import type { PokemonSpecies } from "#data/pokemon-species";
|
import type { PokemonSpecies } from "#data/pokemon-species";
|
||||||
import { getPokemonSpeciesForm } from "#data/pokemon-species";
|
import { getPokemonSpeciesForm } from "#data/pokemon-species";
|
||||||
@ -12,7 +11,6 @@ import { BattleType } from "#enums/battle-type";
|
|||||||
import { ChallengeType } from "#enums/challenge-type";
|
import { ChallengeType } from "#enums/challenge-type";
|
||||||
import { Challenges } from "#enums/challenges";
|
import { Challenges } from "#enums/challenges";
|
||||||
import { TypeColor, TypeShadow } from "#enums/color";
|
import { TypeColor, TypeShadow } from "#enums/color";
|
||||||
import { EggTier } from "#enums/egg-type";
|
|
||||||
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||||
import { ModifierTier } from "#enums/modifier-tier";
|
import { ModifierTier } from "#enums/modifier-tier";
|
||||||
import type { MoveId } from "#enums/move-id";
|
import type { MoveId } from "#enums/move-id";
|
||||||
@ -685,14 +683,11 @@ export class SingleTypeChallenge extends Challenge {
|
|||||||
*/
|
*/
|
||||||
export class FreshStartChallenge extends Challenge {
|
export class FreshStartChallenge extends Challenge {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(Challenges.FRESH_START, 3);
|
super(Challenges.FRESH_START, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
applyStarterChoice(pokemon: PokemonSpecies, valid: BooleanHolder): boolean {
|
applyStarterChoice(pokemon: PokemonSpecies, valid: BooleanHolder): boolean {
|
||||||
if (
|
if (this.value === 1 && !defaultStarterSpecies.includes(pokemon.speciesId)) {
|
||||||
(this.value === 1 && !defaultStarterSpecies.includes(pokemon.speciesId)) ||
|
|
||||||
(this.value === 2 && getEggTierForSpecies(pokemon) >= EggTier.EPIC)
|
|
||||||
) {
|
|
||||||
valid.value = false;
|
valid.value = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -708,12 +703,16 @@ export class FreshStartChallenge extends Challenge {
|
|||||||
pokemon.abilityIndex = pokemon.abilityIndex % 2; // Always base ability, if you set it to hidden it wraps to first ability
|
pokemon.abilityIndex = pokemon.abilityIndex % 2; // Always base ability, if you set it to hidden it wraps to first ability
|
||||||
pokemon.passive = false; // Passive isn't unlocked
|
pokemon.passive = false; // Passive isn't unlocked
|
||||||
pokemon.nature = Nature.HARDY; // Neutral nature
|
pokemon.nature = Nature.HARDY; // Neutral nature
|
||||||
pokemon.moveset = pokemon.species
|
let validMoves = pokemon.species
|
||||||
.getLevelMoves()
|
.getLevelMoves()
|
||||||
.filter(m => m[0] <= 5)
|
.filter(m => m[0] <= 5)
|
||||||
.map(lm => lm[1])
|
.map(lm => lm[1]);
|
||||||
.slice(0, 4)
|
// filter egg moves out of the moveset,
|
||||||
.map(m => new PokemonMove(m)); // No egg moves
|
pokemon.moveset = pokemon.moveset.filter(pm => validMoves.includes(pm.moveId));
|
||||||
|
if (pokemon.moveset.length < 4) {
|
||||||
|
validMoves = validMoves.filter(m => !pokemon.moveset.map(pm => pm.moveId).includes(m));
|
||||||
|
pokemon.moveset = pokemon.moveset.concat(validMoves.map(m => new PokemonMove(m))).slice(0, 4);
|
||||||
|
}
|
||||||
pokemon.luck = 0; // No luck
|
pokemon.luck = 0; // No luck
|
||||||
pokemon.shiny = false; // Not shiny
|
pokemon.shiny = false; // Not shiny
|
||||||
pokemon.variant = 0; // Not shiny
|
pokemon.variant = 0; // Not shiny
|
||||||
@ -735,6 +734,7 @@ export class FreshStartChallenge extends Challenge {
|
|||||||
}
|
}
|
||||||
pokemon.ivs = [15, 15, 15, 15, 15, 15]; // Default IVs of 15 for all stats (Updated to 15 from 10 in 1.2.0)
|
pokemon.ivs = [15, 15, 15, 15, 15, 15]; // Default IVs of 15 for all stats (Updated to 15 from 10 in 1.2.0)
|
||||||
pokemon.teraType = pokemon.species.type1; // Always primary tera type
|
pokemon.teraType = pokemon.species.type1; // Always primary tera type
|
||||||
|
pokemon.updateInfo();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user