From 437cb87df90c86602d1ff369704f2a4397dd3130 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Sun, 5 May 2024 11:05:22 -0400 Subject: [PATCH] Add separate achievements for sub-legendaries and rename pseudoLegendary field --- src/battle-scene.ts | 2 +- src/battle.ts | 2 +- src/data/api.ts | 2 +- src/data/pokemon-species.ts | 10 +++++----- src/data/trainer-config.ts | 4 ++-- src/egg-hatch-phase.ts | 6 ++++-- src/field/arena.ts | 2 +- src/game-mode.ts | 2 +- src/phases.ts | 5 ++++- src/system/achv.ts | 6 ++++-- src/system/game-data.ts | 6 +++--- 11 files changed, 27 insertions(+), 20 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index 504fa1af1..e89874a07 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -1030,7 +1030,7 @@ export default class BattleScene extends SceneBase { return 5; let isBoss: boolean; - if (forceBoss || (species && (species.pseudoLegendary || species.legendary || species.mythical))) + if (forceBoss || (species && (species.subLegendary || species.legendary || species.mythical))) isBoss = true; else { this.executeWithSeedOffset(() => { diff --git a/src/battle.ts b/src/battle.ts index 0f910159f..580bad9a5 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -194,7 +194,7 @@ export default class Battle { return 'battle_final'; return 'battle_final_encounter'; } - if (pokemon.species.legendary || pokemon.species.pseudoLegendary || pokemon.species.mythical) { + if (pokemon.species.legendary || pokemon.species.subLegendary || pokemon.species.mythical) { if (pokemon.species.speciesId === Species.REGIROCK || pokemon.species.speciesId === Species.REGICE || pokemon.species.speciesId === Species.REGISTEEL || pokemon.species.speciesId === Species.REGIGIGAS || pokemon.species.speciesId === Species.REGIELEKI || pokemon.species.speciesId === Species.REGIDRAGO) return 'battle_legendary_regis'; if (pokemon.species.speciesId === Species.COBALION || pokemon.species.speciesId === Species.TERRAKION || pokemon.species.speciesId === Species.VIRIZION || pokemon.species.speciesId === Species.TORNADUS || pokemon.species.speciesId === Species.THUNDURUS || pokemon.species.speciesId === Species.LANDORUS || pokemon.species.speciesId === Species.KELDEO || pokemon.species.speciesId === Species.MELOETTA || pokemon.species.speciesId === Species.GENESECT) diff --git a/src/data/api.ts b/src/data/api.ts index 1f2690c6a..fcfe95671 100644 --- a/src/data/api.ts +++ b/src/data/api.ts @@ -340,7 +340,7 @@ export async function printPokemon() { const speciesKey = (pokemonSpecies as any).key as string; enumStr += ` ${speciesKey}${pokemonSpecies.speciesId >= 2000 ? ` = ${pokemonSpecies.speciesId}` : ''},\n`; - pokemonSpeciesStr += ` new PokemonSpecies(Species.${speciesKey}, "${pokemonSpecies.name}", ${pokemonSpecies.generation}, ${pokemonSpecies.pseudoLegendary}, ${pokemonSpecies.legendary}, ${pokemonSpecies.mythical}, "${pokemonSpecies.species}", Type.${Type[pokemonSpecies.type1]}, ${pokemonSpecies.type2 ? `Type.${Type[pokemonSpecies.type2]}` : 'null'}, ${pokemonSpecies.height}, ${pokemonSpecies.weight}, Abilities.${Abilities[pokemonSpecies.ability1]}, Abilities.${Abilities[pokemonSpecies.ability2]}, Abilities.${Abilities[pokemonSpecies.abilityHidden]}, ${pokemonSpecies.baseTotal}, ${pokemonSpecies.baseStats[0]}, ${pokemonSpecies.baseStats[1]}, ${pokemonSpecies.baseStats[2]}, ${pokemonSpecies.baseStats[3]}, ${pokemonSpecies.baseStats[4]}, ${pokemonSpecies.baseStats[5]}, ${pokemonSpecies.catchRate}, ${pokemonSpecies.baseFriendship}, ${pokemonSpecies.baseExp}, GrowthRate.${GrowthRate[pokemonSpecies.growthRate]}, ${pokemonSpecies.malePercent}, ${pokemonSpecies.genderDiffs}`; + pokemonSpeciesStr += ` new PokemonSpecies(Species.${speciesKey}, "${pokemonSpecies.name}", ${pokemonSpecies.generation}, ${pokemonSpecies.subLegendary}, ${pokemonSpecies.legendary}, ${pokemonSpecies.mythical}, "${pokemonSpecies.species}", Type.${Type[pokemonSpecies.type1]}, ${pokemonSpecies.type2 ? `Type.${Type[pokemonSpecies.type2]}` : 'null'}, ${pokemonSpecies.height}, ${pokemonSpecies.weight}, Abilities.${Abilities[pokemonSpecies.ability1]}, Abilities.${Abilities[pokemonSpecies.ability2]}, Abilities.${Abilities[pokemonSpecies.abilityHidden]}, ${pokemonSpecies.baseTotal}, ${pokemonSpecies.baseStats[0]}, ${pokemonSpecies.baseStats[1]}, ${pokemonSpecies.baseStats[2]}, ${pokemonSpecies.baseStats[3]}, ${pokemonSpecies.baseStats[4]}, ${pokemonSpecies.baseStats[5]}, ${pokemonSpecies.catchRate}, ${pokemonSpecies.baseFriendship}, ${pokemonSpecies.baseExp}, GrowthRate.${GrowthRate[pokemonSpecies.growthRate]}, ${pokemonSpecies.malePercent}, ${pokemonSpecies.genderDiffs}`; if (pokemonSpecies.forms.length > 1) { pokemonSpeciesStr += `, ${pokemonSpecies.canChangeForm},`; for (let form of pokemonSpecies.forms) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index d118adc0f..7f33d9ec7 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -476,7 +476,7 @@ export abstract class PokemonSpeciesForm { export default class PokemonSpecies extends PokemonSpeciesForm implements Localizable { public name: string; - public pseudoLegendary: boolean; + public subLegendary: boolean; public legendary: boolean; public mythical: boolean; public species: string; @@ -486,7 +486,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali public canChangeForm: boolean; public forms: PokemonForm[]; - constructor(id: Species, generation: integer, pseudoLegendary: boolean, legendary: boolean, mythical: boolean, species: string, + constructor(id: Species, generation: integer, subLegendary: boolean, legendary: boolean, mythical: boolean, species: string, type1: Type, type2: Type, height: number, weight: number, ability1: Abilities, ability2: Abilities, abilityHidden: Abilities, baseTotal: integer, baseHp: integer, baseAtk: integer, baseDef: integer, baseSpatk: integer, baseSpdef: integer, baseSpd: integer, catchRate: integer, baseFriendship: integer, baseExp: integer, growthRate: GrowthRate, malePercent: number, @@ -496,7 +496,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali this.speciesId = id; this.formIndex = 0; this.generation = generation; - this.pseudoLegendary = pseudoLegendary; + this.subLegendary = subLegendary; this.legendary = legendary; this.mythical = mythical; this.species = species; @@ -712,14 +712,14 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali getCompatibleFusionSpeciesFilter(): PokemonSpeciesFilter { const hasEvolution = pokemonEvolutions.hasOwnProperty(this.speciesId); const hasPrevolution = pokemonPrevolutions.hasOwnProperty(this.speciesId); - const pseudoLegendary = this.pseudoLegendary; + const pseudoLegendary = this.subLegendary; const legendary = this.legendary; const mythical = this.mythical; return species => { return (pseudoLegendary || legendary || mythical || (pokemonEvolutions.hasOwnProperty(species.speciesId) === hasEvolution && pokemonPrevolutions.hasOwnProperty(species.speciesId) === hasPrevolution)) - && species.pseudoLegendary === pseudoLegendary + && species.subLegendary === pseudoLegendary && species.legendary === legendary && species.mythical === mythical && (this.isTrainerForbidden() || !species.isTrainerForbidden()); diff --git a/src/data/trainer-config.ts b/src/data/trainer-config.ts index 044bd4ec8..36d76edcf 100644 --- a/src/data/trainer-config.ts +++ b/src/data/trainer-config.ts @@ -212,7 +212,7 @@ export class TrainerConfig { this.battleBgm = 'battle_trainer'; this.victoryBgm = 'victory_trainer'; this.partyTemplates = [ trainerPartyTemplates.TWO_AVG ]; - this.speciesFilter = species => (allowLegendaries || (!species.legendary && !species.pseudoLegendary && !species.mythical)) && !species.isTrainerForbidden(); + this.speciesFilter = species => (allowLegendaries || (!species.legendary && !species.subLegendary && !species.mythical)) && !species.isTrainerForbidden(); } getKey(): string { @@ -509,7 +509,7 @@ function getRandomPartyMemberFunc(speciesPool: Species[], trainerSlot: TrainerSl function getSpeciesFilterRandomPartyMemberFunc(speciesFilter: PokemonSpeciesFilter, trainerSlot: TrainerSlot = TrainerSlot.TRAINER, allowLegendaries?: boolean, postProcess?: (EnemyPokemon: EnemyPokemon) => void): PartyMemberFunc { const originalSpeciesFilter = speciesFilter; - speciesFilter = (species: PokemonSpecies) => (allowLegendaries || (!species.legendary && !species.pseudoLegendary && !species.mythical)) && !species.isTrainerForbidden() && originalSpeciesFilter(species); + speciesFilter = (species: PokemonSpecies) => (allowLegendaries || (!species.legendary && !species.subLegendary && !species.mythical)) && !species.isTrainerForbidden() && originalSpeciesFilter(species); return (scene: BattleScene, level: integer, strength: PartyMemberStrength) => { const ret = scene.addEnemyPokemon(getPokemonSpecies(scene.randomSpecies(scene.currentBattle.waveIndex, level, false, speciesFilter).getTrainerSpeciesForLevel(level, true, strength)), level, trainerSlot, undefined, undefined, postProcess); return ret; diff --git a/src/egg-hatch-phase.ts b/src/egg-hatch-phase.ts index 19934ad6e..70f2d5f38 100644 --- a/src/egg-hatch-phase.ts +++ b/src/egg-hatch-phase.ts @@ -241,10 +241,12 @@ export class EggHatchPhase extends Phase { doReveal(): void { const isShiny = this.pokemon.isShiny(); - if (this.pokemon.species.mythical) - this.scene.validateAchv(achvs.HATCH_MYTHICAL); + if (this.pokemon.species.subLegendary) + this.scene.validateAchv(achvs.HATCH_SUB_LEGENDARY); if (this.pokemon.species.legendary) this.scene.validateAchv(achvs.HATCH_LEGENDARY); + if (this.pokemon.species.mythical) + this.scene.validateAchv(achvs.HATCH_MYTHICAL); if (isShiny) this.scene.validateAchv(achvs.HATCH_SHINY); this.eggContainer.setVisible(false); diff --git a/src/field/arena.ts b/src/field/arena.ts index c27e42b89..e8cc98c0a 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -106,7 +106,7 @@ export class Arena { ret = getPokemonSpecies(species); - if (ret.pseudoLegendary || ret.legendary || ret.mythical) { + if (ret.subLegendary || ret.legendary || ret.mythical) { switch (true) { case (ret.baseTotal >= 720): regen = level < 90; diff --git a/src/game-mode.ts b/src/game-mode.ts index 76c97b4c9..81db82425 100644 --- a/src/game-mode.ts +++ b/src/game-mode.ts @@ -121,7 +121,7 @@ export class GameMode implements GameModeConfig { getOverrideSpecies(waveIndex: integer): PokemonSpecies { if (this.isDaily && this.isWaveFinal(waveIndex)) { - const allFinalBossSpecies = allSpecies.filter(s => (s.pseudoLegendary || s.legendary || s.mythical) + const allFinalBossSpecies = allSpecies.filter(s => (s.subLegendary || s.legendary || s.mythical) && s.baseTotal >= 600 && s.speciesId !== Species.ETERNATUS && s.speciesId !== Species.ARCEUS); return Utils.randSeedItem(allFinalBossSpecies); } diff --git a/src/phases.ts b/src/phases.ts index 0f583d9a1..cc493ce98 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -4112,7 +4112,10 @@ export class AttemptCapturePhase extends PokemonPhase { if (speciesForm.abilityHidden && (pokemon.fusionSpecies ? pokemon.fusionAbilityIndex : pokemon.abilityIndex) === speciesForm.getAbilityCount() - 1) this.scene.validateAchv(achvs.HIDDEN_ABILITY); - if (pokemon.species.pseudoLegendary || pokemon.species.legendary) + if (pokemon.species.subLegendary) + this.scene.validateAchv(achvs.CATCH_SUB_LEGENDARY); + + if (pokemon.species.legendary) this.scene.validateAchv(achvs.CATCH_LEGENDARY); if (pokemon.species.mythical) diff --git a/src/system/achv.ts b/src/system/achv.ts index f63dd5b28..bcf857069 100644 --- a/src/system/achv.ts +++ b/src/system/achv.ts @@ -134,11 +134,13 @@ export const achvs = { SPLICE: new Achv('Infinite Fusion', 'Splice two Pokémon together with DNA Splicers', 'dna_splicers', 10), MINI_BLACK_HOLE: new ModifierAchv('A Hole Lot of Items', 'Acquire a Mini Black Hole', 'mini_black_hole', 25, modifier => modifier instanceof TurnHeldItemTransferModifier).setSecret(), CATCH_MYTHICAL: new Achv('Mythical', 'Catch a mythical Pokémon', 'strange_ball', 50).setSecret(), - CATCH_LEGENDARY: new Achv('Legendary', 'Catch a legendary Pokémon', 'mb', 75).setSecret(), + CATCH_SUB_LEGENDARY: new Achv('(Sub-)Legendary', 'Catch a sub-legendary Pokémon', 'rb', 75).setSecret(), + CATCH_LEGENDARY: new Achv('Legendary', 'Catch a legendary Pokémon', 'mb', 100).setSecret(), SEE_SHINY: new Achv('Shiny', 'Find a shiny Pokémon in the wild', 'pb_gold', 75), SHINY_PARTY: new Achv('That\'s Dedication', 'Have a full party of shiny Pokémon', 'shiny_charm', 100).setSecret(true), HATCH_MYTHICAL: new Achv('Mythical Egg', 'Hatch a mythical Pokémon from an egg', 'pair_of_tickets', 75).setSecret(), - HATCH_LEGENDARY: new Achv('Legendary Egg', 'Hatch a legendary Pokémon from an egg', 'mystic_ticket', 100).setSecret(), + HATCH_SUB_LEGENDARY: new Achv('Sub-Legendary Egg', 'Hatch a sub-legendary Pokémon from an egg', 'mystic_ticket', 100).setSecret(), + HATCH_LEGENDARY: new Achv('Legendary Egg', 'Hatch a legendary Pokémon from an egg', 'mystic_ticket', 125).setSecret(), HATCH_SHINY: new Achv('Shiny Egg', 'Hatch a shiny Pokémon from an egg', 'golden_mystic_ticket', 100).setSecret(), HIDDEN_ABILITY: new Achv('Hidden Potential', 'Catch a Pokémon with a hidden ability', 'ability_charm', 75), PERFECT_IVS: new Achv('Certificate of Authenticity', 'Get perfect IVs on a Pokémon', 'blunder_policy', 100), diff --git a/src/system/game-data.ts b/src/system/game-data.ts index 6410c52a2..b828d90f5 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -1005,7 +1005,7 @@ export class GameData { if (incrementCount) { dexEntry.seenCount++; this.gameStats.pokemonSeen++; - if (!trainer && pokemon.species.pseudoLegendary || pokemon.species.legendary) + if (!trainer && pokemon.species.subLegendary || pokemon.species.legendary) this.gameStats.legendaryPokemonSeen++; else if (!trainer && pokemon.species.mythical) this.gameStats.mythicalPokemonSeen++; @@ -1043,7 +1043,7 @@ export class GameData { if (!fromEgg) { dexEntry.caughtCount++; this.gameStats.pokemonCaught++; - if (pokemon.species.pseudoLegendary || pokemon.species.legendary) + if (pokemon.species.subLegendary || pokemon.species.legendary) this.gameStats.legendaryPokemonCaught++; else if (pokemon.species.mythical) this.gameStats.mythicalPokemonCaught++; @@ -1052,7 +1052,7 @@ export class GameData { } else { dexEntry.hatchedCount++; this.gameStats.pokemonHatched++; - if (pokemon.species.pseudoLegendary || pokemon.species.legendary) + if (pokemon.species.subLegendary || pokemon.species.legendary) this.gameStats.legendaryPokemonHatched++; else if (pokemon.species.mythical) this.gameStats.mythicalPokemonHatched++;