Feature: Displaying all starters based on environment parameters.

This commit is contained in:
Raphaël Pinto 2024-05-06 18:32:51 +02:00
parent bf1233d7ad
commit daaf2ef532
5 changed files with 41 additions and 25 deletions

View File

@ -3,3 +3,6 @@ VITE_ENVIRONMENT="local"
VITE_API_BASE_URL="http://localhost:8001"
VITE_BYPASS_LOGIN=true
VITE_BYPASS_TUTORIAL=false
# Debug
VITE_ACTIVATE_ALL_POKEMON_STARTERS=false

View File

@ -1094,3 +1094,13 @@ export const defaultStarterSpecies: Species[] = [
Species.GROOKEY, Species.SCORBUNNY, Species.SOBBLE,
Species.SPRIGATITO, Species.FUECOCO, Species.QUAXLY
];
if(Boolean(import.meta.env.VITE_ACTIVATE_ALL_POKEMON_STARTERS)){
console.log('je suis passé')
defaultStarterSpecies.length = 0;
for (const value in Species) {
if (isNaN(Number(value))) {
defaultStarterSpecies.push(Species[value as keyof typeof Species]);
}
}
}

View File

@ -1308,7 +1308,9 @@ export class GameData {
}
fixStarterData(systemData: SystemSaveData): void {
for (let starterId of defaultStarterSpecies)
systemData.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1;
}
if(!Boolean(import.meta.env.VITE_ACTIVATE_ALL_POKEMON_STARTERS)){
for (let starterId of defaultStarterSpecies)
systemData.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1;
}
}
}

13
src/vite-env.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
/// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_ENVIRONMENT: string
readonly VITE_API_BASE_URL: string
readonly VITE_BYPASS_LOGIN: boolean
readonly VITE_BYPASS_TUTORIAL: boolean
readonly VITE_ACTIVATE_ALL_POKEMON_STARTERS: boolean
}
interface ImportMeta {
readonly env: ImportMetaEnv
}

12
vite.env.d.ts vendored
View File

@ -1,12 +0,0 @@
/// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_ENVIRONMENT: string;
readonly VITE_API_BASE_URL: string;
readonly VITE_BYPASS_LOGIN: boolean;
readonly VITE_BYPASS_TUTORIAL: boolean;
}
interface ImportMeta {
readonly env: ImportMetaEnv;
}