Okay, I tried explaining this on msn to someone, but failed. Possibly because this's difficult to explain, possibly because of my english, but I'm gonna try again here anyway.
Note; I'll be talking about not player-owned pokemon here.
I have a pokemon system. Every pokemon has certain "base-stats". A certain amount of strenght, defense, magic and speed. (Different names, but same deal.) The file looks like this :
Code:
[Pokemon1]
Type=
MAX_HP=0
Attack=0
Defense=0
Special_Attack=0
Special_Defense=0
Speed=0
Attack1=0
Attack2=0
Attack3=0
Attack4=0
It goes on like that till Pokemon6 (MAX_POKEMON = 6)
So that're basicly the stats at level 1.
I also have a file that saves how much stats it gains every level. That one looks something like this :
Code:
[Level2]
MAX_HP=1
Attack=1
Defense=1
Special_Attack=1
Special_Defense=1
Speed=1
Learn_Attack=0
Evolve=0
[Level3]
MAX_HP=2
Attack=2
Defense=6
Special_Attack=2
Special_Defense=4
Speed=1
Learn_Attack=0
Evolve=0
So, if a pokemon levels from level 1 to level 2, all it's stats would increase by 1. And if it levels from level 2 to 3, all it's stats would increase by something too.
Now here's the problem. Since this is about NPC-owned Pokemon, they don't level. Instead, they have a high-level pokemon. Say, a level 3 charmander.
It's stats would be the level 1 basestats + the stats you get at level 2 + the stats you get at level 3.
Now, here's my question. The way I'm doing it now doesn't looks very smart to me. If a trainer used a level 100 pokemon, it'd mean a lot of calculating. Is there a better way to do this? I'd especially like to hear from Matt(?) because he's working on a pokemon-like game what his solution on this problem is. Or maybe I'm just thinking too difficult.
I hope I explained it clearly enough, and if not, ask some questions, I'll glady answer them.
EDIT
Oh, and I know using ini files isn't very smart, I plan on switching to binary, but not until I've got everything done, because Ini's are easier to read/debug, I believe.