Add a long-term goal
parent
9a9f093f5c
commit
5ebc351e4f
|
@ -3030,6 +3030,21 @@ export const speciesStarters = {
|
||||||
[Species.BLOODMOON_URSALUNA]: 7,
|
[Species.BLOODMOON_URSALUNA]: 7,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const noStarterFormKeys: string[] = [
|
||||||
|
SpeciesFormKey.MEGA,
|
||||||
|
SpeciesFormKey.MEGA_X,
|
||||||
|
SpeciesFormKey.MEGA_Y,
|
||||||
|
SpeciesFormKey.PRIMAL,
|
||||||
|
SpeciesFormKey.ORIGIN,
|
||||||
|
SpeciesFormKey.THERIAN,
|
||||||
|
SpeciesFormKey.GIGANTAMAX,
|
||||||
|
SpeciesFormKey.GIGANTAMAX_RAPID,
|
||||||
|
SpeciesFormKey.GIGANTAMAX_SINGLE,
|
||||||
|
SpeciesFormKey.ETERNAMAX
|
||||||
|
].map(k => k.toString());
|
||||||
|
|
||||||
|
console.log(noStarterFormKeys)
|
||||||
|
|
||||||
// TODO: Remove
|
// TODO: Remove
|
||||||
{
|
{
|
||||||
//setTimeout(() => {
|
//setTimeout(() => {
|
||||||
|
|
|
@ -55,7 +55,7 @@ import { OptionSelectConfig, OptionSelectItem } from "./ui/abstact-option-select
|
||||||
import { SaveSlotUiMode } from "./ui/save-slot-select-ui-handler";
|
import { SaveSlotUiMode } from "./ui/save-slot-select-ui-handler";
|
||||||
import { fetchDailyRunSeed, getDailyRunStarters } from "./data/daily-run";
|
import { fetchDailyRunSeed, getDailyRunStarters } from "./data/daily-run";
|
||||||
import { GameModes, gameModes } from "./game-mode";
|
import { GameModes, gameModes } from "./game-mode";
|
||||||
import { getPokemonSpecies } from "./data/pokemon-species";
|
import { getPokemonSpecies, speciesStarters } from "./data/pokemon-species";
|
||||||
|
|
||||||
export class LoginPhase extends Phase {
|
export class LoginPhase extends Phase {
|
||||||
private showText: boolean;
|
private showText: boolean;
|
||||||
|
@ -1512,7 +1512,7 @@ export class CommandPhase extends FieldPhase {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Command.BALL:
|
case Command.BALL:
|
||||||
if (this.scene.arena.biomeType === Biome.END) {
|
if (this.scene.arena.biomeType === Biome.END && (!this.scene.gameMode.isClassic || this.scene.gameData.getStarterCount(d => !!d.caughtAttr) < Object.keys(speciesStarters).length - 1)) {
|
||||||
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
||||||
this.scene.ui.setMode(Mode.MESSAGE);
|
this.scene.ui.setMode(Mode.MESSAGE);
|
||||||
this.scene.ui.showText(`An unseen force\nprevents using Poké Balls.`, null, () => {
|
this.scene.ui.showText(`An unseen force\nprevents using Poké Balls.`, null, () => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import BattleScene, { PokeballCounts, bypassLogin } from "../battle-scene";
|
import BattleScene, { PokeballCounts, bypassLogin } from "../battle-scene";
|
||||||
import Pokemon, { EnemyPokemon, PlayerPokemon } from "../field/pokemon";
|
import Pokemon, { EnemyPokemon, PlayerPokemon } from "../field/pokemon";
|
||||||
import { pokemonPrevolutions } from "../data/pokemon-evolutions";
|
import { pokemonPrevolutions } from "../data/pokemon-evolutions";
|
||||||
import PokemonSpecies, { allSpecies, getPokemonSpecies, speciesStarters } from "../data/pokemon-species";
|
import PokemonSpecies, { SpeciesFormKey, allSpecies, getPokemonSpecies, noStarterFormKeys, speciesStarters } from "../data/pokemon-species";
|
||||||
import { Species } from "../data/enums/species";
|
import { Species } from "../data/enums/species";
|
||||||
import * as Utils from "../utils";
|
import * as Utils from "../utils";
|
||||||
import PokemonData from "./pokemon-data";
|
import PokemonData from "./pokemon-data";
|
||||||
|
@ -936,7 +936,12 @@ export class GameData {
|
||||||
return new Promise<void>(resolve => {
|
return new Promise<void>(resolve => {
|
||||||
const dexEntry = this.dexData[species.speciesId];
|
const dexEntry = this.dexData[species.speciesId];
|
||||||
const caughtAttr = dexEntry.caughtAttr;
|
const caughtAttr = dexEntry.caughtAttr;
|
||||||
dexEntry.caughtAttr |= pokemon.getDexAttr();
|
const formIndex = pokemon.formIndex;
|
||||||
|
if (noStarterFormKeys.includes(pokemon.getFormKey()))
|
||||||
|
pokemon.formIndex = 0;
|
||||||
|
const dexAttr = pokemon.getDexAttr();
|
||||||
|
pokemon.formIndex = formIndex;
|
||||||
|
dexEntry.caughtAttr |= dexAttr;
|
||||||
dexEntry.natureAttr |= Math.pow(2, pokemon.nature + 1);
|
dexEntry.natureAttr |= Math.pow(2, pokemon.nature + 1);
|
||||||
if (incrementCount) {
|
if (incrementCount) {
|
||||||
if (!fromEgg) {
|
if (!fromEgg) {
|
||||||
|
@ -1018,6 +1023,27 @@ export class GameData {
|
||||||
} while (pokemonPrevolutions.hasOwnProperty(speciesId) && (speciesId = pokemonPrevolutions[speciesId]));
|
} while (pokemonPrevolutions.hasOwnProperty(speciesId) && (speciesId = pokemonPrevolutions[speciesId]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getSpeciesCount(dexEntryPredicate: (entry: DexEntry) => boolean): integer {
|
||||||
|
const dexKeys = Object.keys(this.dexData);
|
||||||
|
let speciesCount = 0;
|
||||||
|
for (let s of dexKeys) {
|
||||||
|
if (dexEntryPredicate(this.dexData[s]))
|
||||||
|
speciesCount++;
|
||||||
|
}
|
||||||
|
return speciesCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
getStarterCount(dexEntryPredicate: (entry: DexEntry) => boolean): integer {
|
||||||
|
const starterKeys = Object.keys(speciesStarters);
|
||||||
|
let starterCount = 0;
|
||||||
|
for (let s of starterKeys) {
|
||||||
|
const starterDexEntry = this.dexData[s];
|
||||||
|
if (dexEntryPredicate(starterDexEntry))
|
||||||
|
starterCount++;
|
||||||
|
}
|
||||||
|
return starterCount;
|
||||||
|
}
|
||||||
|
|
||||||
getSpeciesDefaultDexAttr(species: PokemonSpecies, forSeen: boolean = false): bigint {
|
getSpeciesDefaultDexAttr(species: PokemonSpecies, forSeen: boolean = false): bigint {
|
||||||
let ret = 0n;
|
let ret = 0n;
|
||||||
const dexEntry = this.dexData[species.speciesId];
|
const dexEntry = this.dexData[species.speciesId];
|
||||||
|
|
|
@ -25,49 +25,29 @@ const displayStats: DisplayStats = {
|
||||||
startersUnlocked: {
|
startersUnlocked: {
|
||||||
label: 'Starters',
|
label: 'Starters',
|
||||||
sourceFunc: gameData => {
|
sourceFunc: gameData => {
|
||||||
const starterKeys = Object.keys(speciesStarters);
|
const starterCount = gameData.getStarterCount(d => !!d.caughtAttr);
|
||||||
let starterCount = 0;
|
return `${starterCount} (${Math.floor((starterCount / Object.keys(speciesStarters).length) * 1000) / 10}%)`;
|
||||||
for (let s of starterKeys) {
|
|
||||||
if (gameData.dexData[s].caughtAttr)
|
|
||||||
starterCount++;
|
|
||||||
}
|
|
||||||
return `${starterCount} (${Math.floor((starterCount / starterKeys.length) * 1000) / 10}%)`;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
shinyStartersUnlocked: {
|
shinyStartersUnlocked: {
|
||||||
label: 'Shiny Starters',
|
label: 'Shiny Starters',
|
||||||
sourceFunc: gameData => {
|
sourceFunc: gameData => {
|
||||||
const starterKeys = Object.keys(speciesStarters);
|
const starterCount = gameData.getStarterCount(d => !!(d.caughtAttr & DexAttr.SHINY));
|
||||||
let starterCount = 0;
|
return `${starterCount} (${Math.floor((starterCount / Object.keys(speciesStarters).length) * 1000) / 10}%)`;
|
||||||
for (let s of starterKeys) {
|
|
||||||
if (gameData.dexData[s].caughtAttr & DexAttr.SHINY)
|
|
||||||
starterCount++;
|
|
||||||
}
|
|
||||||
return `${starterCount} (${Math.floor((starterCount / starterKeys.length) * 1000) / 10}%)`;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dexSeen: {
|
dexSeen: {
|
||||||
label: 'Species Seen',
|
label: 'Species Seen',
|
||||||
sourceFunc: gameData => {
|
sourceFunc: gameData => {
|
||||||
const dexKeys = Object.keys(gameData.dexData);
|
const seenCount = gameData.getSpeciesCount(d => !!d.seenAttr);
|
||||||
let seenCount = 0;
|
return `${seenCount} (${Math.floor((seenCount / Object.keys(gameData.dexData).length) * 1000) / 10}%)`;
|
||||||
for (let s of dexKeys) {
|
|
||||||
if (gameData.dexData[s].seenAttr)
|
|
||||||
seenCount++;
|
|
||||||
}
|
|
||||||
return `${seenCount} (${Math.floor((seenCount / dexKeys.length) * 1000) / 10}%)`;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dexCaught: {
|
dexCaught: {
|
||||||
label: 'Species Caught',
|
label: 'Species Caught',
|
||||||
sourceFunc: gameData => {
|
sourceFunc: gameData => {
|
||||||
const dexKeys = Object.keys(gameData.dexData);
|
const caughtCount = gameData.getSpeciesCount(d => !!d.caughtAttr);
|
||||||
let caughtCount = 0;
|
return `${caughtCount} (${Math.floor((caughtCount / Object.keys(gameData.dexData).length) * 1000) / 10}%)`;
|
||||||
for (let s of dexKeys) {
|
|
||||||
if (gameData.dexData[s].caughtAttr)
|
|
||||||
caughtCount++;
|
|
||||||
}
|
|
||||||
return `${caughtCount} (${Math.floor((caughtCount / dexKeys.length) * 1000) / 10}%)`;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
classicSessionsPlayed: 'Classic Runs',
|
classicSessionsPlayed: 'Classic Runs',
|
||||||
|
|
Loading…
Reference in New Issue