Files
pokemon-battle-engine/Prompts/4-StatSystem
cdemeyer-teachx 16063863d5 clarified prompt
2025-08-15 14:27:02 +09:00

33 lines
1.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This repo is the start of a high performant pokemon battle simulator. It only uses integers.
I want you to implement the stat system of pokemon.
In the pokemon class, only save the values that are relevant to battle.
Make a PokemonInfo class that holds values not relevant to combat, but that can be used to calculate stats relevant to combat.
Combat:
Create fields for the HP, Attack, Defense, Sp. Atk, Sp. Def, Speed (max 20'000).
Create a value for friendship (max 255).
Info:
Each pokemon has its base stats that mirror the combat stats (HP, Attack, Defense, Sp. Atk, Sp. Def, Speed).
Create Effort Values (EV) that are like alternate values between 0-255 that mirror the combat stats .
There can only be 510 EV values max assigned in total.
Create Individual Values (IV) that are values between 0-31.
Implement pokemon natures, which increases the stat by either positive or negative 10%.
Create a stat formula for each generation.
Natures:
- Attack - Defense - Sp. Atk - Sp. Def - Speed
+ Attack Hardy Lonely Adamant Naughty Brave
+ Defense Bold Docile Impish Lax Relaxed
+ Sp. Atk Modest Mild Bashful Rash Quiet
+ Sp. Def Calm Gentle Careful Quirky Sassy
+ Speed Timid Hasty Jolly Naive Serious
formula for stats:
Generations I and II:
HP=⌊((Base+DV)×2+⌊⌈STATEXP⌉4⌋)×Level100⌋+Level+10
OtherStat=⌊((Base+DV)×2+⌊⌈STATEXP⌉4⌋)×Level100⌋+5
Generation III onward:
HP=⌊(2×Base+IV+⌊EV4⌋)×Level100⌋+Level+10
OtherStat=⌊(⌊(2×Base+IV+⌊EV4⌋)×Level100⌋+5)×Nature⌋