Skip to content

Commit

Permalink
just some testing/planning/etc
Browse files Browse the repository at this point in the history
  • Loading branch information
DayKev committed Nov 13, 2024
1 parent 5c70ab2 commit 2a549be
Show file tree
Hide file tree
Showing 6 changed files with 428 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
jobs:
pre-test:
name: Run Pre-test
if: false
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
Expand All @@ -37,6 +38,7 @@ jobs:

run-tests:
name: Run Tests
if: false
needs: [pre-test]
strategy:
matrix:
Expand Down
115 changes: 115 additions & 0 deletions src/data/pokemon-data-structures.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import { GrowthRate } from "#app/data/exp";
import { Gender } from "#app/data/gender";
import { PokemonForm } from "#app/data/pokemon-species";
import { Type } from "#app/data/type";
import { Abilities } from "#enums/abilities";
import { Biome } from "#enums/biome";
import { Moves } from "#enums/moves";
import { Nature } from "#enums/nature";
import { Species } from "#enums/species";
import { TimeOfDay } from "#enums/time-of-day";
import { WeatherType } from "#enums/weather-type";

// #region stuff to create/modify
export enum LegendType {
NONE,
SUBLEGENDARY,
LEGENDARY,
MYTHICAL
}

// formerly PartyMemberStrength, renamed for clarity
export enum EnemyPartyMemberStrength {
WEAKEST,
WEAKER,
WEAK,
AVERAGE,
STRONG,
STRONGER,
}

/**
* change to linear evolution delay chance (ie: Bulbasaur evolves at 16 normally,
* with medium delay it would have a 10% chance to be ivysaur
* starting at lv17, 20% at lv18, ... and 100% chance to be ivysaur at lv26).
*
* higher "EnemyPartyMemberStrength" values would reduce the delay?
* or use a separate delay value for trainers?
*
* increase # of enum members?
*
* rename from `SpeciesWildEvolutionDelay`
*/
export enum EnemyEvolutionDelay {
NONE,
SHORT, // 5
MEDIUM, // 10
LONG, // 15
VERY_LONG, // 20
NEVER,
}
// #endregion

// #region just collecting/connecting information together, exact data structures tbd
interface EvolutionConditions {
level?: number;
item?: any; // gimmighoul goes here...?
move?: Moves | Moves[];
moveOfType?: Type; // onix -> steelix needs steel type move, ...
timeOfDay?: TimeOfDay | TimeOfDay[];
gender?: Gender;
//spaceInParty?: boolean; // for shedinja; could be handled by the evolution function instead since you can't go "nincada -> shedinja" directly
caughtPokemon?: unknown; // "mantyke -> mantine" (needs caught remoraid), ...
typeInParty?: Type | Type[]; // currently only "pancham -> pangoro", kinda awkward
activeWeather?: WeatherType | WeatherType[];
nature?: Nature | Nature[];
// "tandemaus -> maushold (form)" and "dunsparce -> dudunsparce (form)" uses rng... handle with evolution function?
friendship?: number;
biome?: Biome | Biome[];
}

class PokemonEvolution {
preEvolution?: {
id: Species;
formKey?: string | null; // `null` = target pokemon has no forms but current does; `undefined` = use same form key
};
evolution: {
id: Species;
conditions: EvolutionConditions;
formKey?: string | null; // same as above
expectedEnemyEvolveLevel?: number; // used if the pokemon doesn't evolve by level, as a baseline
};
enemyDelay: EnemyEvolutionDelay = EnemyEvolutionDelay.NONE;
}

export class PokemonSpeciesData {
id: Species;
name: string;
generation: number; // if we're separating pokemon by generation (ie: `generation-1.json`, ...), do we need to specify this as part of the pokemon object in the json file itself?
legendType: LegendType = LegendType.NONE;
speciesText: string;
type1: number;
type2?: number;
height: number;
weight: number;
ability1: Abilities;
ability2: Abilities = Abilities.NONE;
abilityHidden: Abilities = Abilities.NONE;
baseHP: number;
baseAtk: number;
baseDef: number;
baseSpatk: number;
baseSpdef: number;
baseSpd: number;
catchRate: number;
baseFriendship: number;
baseExp: number;
growthRate: GrowthRate;
malePercent?: number; // `undefined` = genderless
genderDiffs: boolean = false;
canChangeForm: boolean = false;
forms: PokemonForm[] = [];
evolutions?: PokemonEvolution[];
isStarterSelectable: boolean = false;
}
// #endregion
67 changes: 67 additions & 0 deletions src/data/pokemon/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"pokemon": {
"id": 0,
"name": "Pokemon Name",
"generation": 0,
"legendType": "Mythical",
"speciesText": "Example Pokémon",
"type1": "Normal",
"type2": "Normal",
"height": 12,
"weight": 34,
"ability1": "Some Ability",
"ability2": "Another Ability",
"abilityHidden": "Third Ability",
"baseHP": 10,
"baseAtk": 20,
"baseDef": 30,
"baseSpatk": 40,
"baseSpdef": 50,
"baseSpd": 60,
"catchRate": 255,
"baseFriendship": 50,
"baseExp": 50,
"growthRate": "Medium Fast",
"malePercent": 50,
"genderDiffs": true,
"canChangeForm": true,
"forms": ["one", "two", "three"],
"evolutions": {
"from": {
"name": "unevolvedpokemon",
"form": "form-name"
},
"to": {
"evolvedspecies": {
"conditions": {
"item": "Linking Cord",
"move": "Extreme Speed",
"moveOfType": "Normal",
"timeOfDay": ["Dawn", "Dusk"],
"gender": "Female",
"caughtPokemon": "arceus",
"typeInParty": "Normal",
"activeWeather": ["Snow", "Hail"],
"nature": ["Hardy", "Serious"],
"friendship": 200,
"biome": ["Island", "Lake", "Sea"]
},
"form": "another-form-name",
"expectedEnemyEvolveLevel": 25
},
"alternatespecies": {
"conditions": {
"level": 20
},
"form": null
}
}
},
"isStarterSelectable": true
},
"pokemon_one": {
"formName": "First Form",
"baseAtk": 40,
"baseSpatk": 20
}
}
68 changes: 68 additions & 0 deletions src/data/pokemon/generation-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"bulbasaur": {
"id": 1,
"name": "Bulbasaur",
"generation": 1,
"speciesText": "Seed Pokémon",
"type1": "Grass",
"type2": "Poison",
"height": 0.7,
"weight": 6.9,
"ability1": "Overgrow",
"abilityHidden": "Chlorophyll",
"baseHP": 45,
"baseAtk": 49,
"baseDef": 49,
"baseSpatk": 65,
"baseSpdef": 65,
"baseSpd": 45,
"catchRate": 45,
"baseFriendship": 50,
"baseExp": 64,
"growthRate": "Medium Slow",
"malePercent": 87.5,
"evolutions": {
"to": {
"ivysaur": {
"conditions": {
"level": 16
}
}
}
},
"isStarterSelectable": true
},
"ivysaur": {
"id": 2,
"name": "Ivysaur",
"generation": 1,
"speciesText": "Seed Pokémon",
"type1": "Grass",
"type2": "Poison",
"height": 1,
"weight": 13,
"ability1": "Overgrow",
"abilityHidden": "Chlorophyll",
"baseHP": 60,
"baseAtk": 62,
"baseDef": 63,
"baseSpatk": 80,
"baseSpdef": 80,
"baseSpd": 60,
"catchRate": 45,
"baseFriendship": 50,
"baseExp": 142,
"growthRate": "Medium Slow",
"malePercent": 87.5,
"evolutions": {
"from": "ivysaur",
"to": {
"venasaur": {
"conditions": {
"level": 32
}
}
}
}
}
}
Loading

0 comments on commit 2a549be

Please sign in to comment.