mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-02-26 14:15:31 +01:00
Add MAX_PER_STAT_EVS macro
This commit is contained in:
parent
d7e31f5a85
commit
58786a7ac0
@ -230,6 +230,7 @@
|
|||||||
#define STATUS_PRIMARY_POKERUS 6
|
#define STATUS_PRIMARY_POKERUS 6
|
||||||
#define STATUS_PRIMARY_FAINTED 7
|
#define STATUS_PRIMARY_FAINTED 7
|
||||||
|
|
||||||
|
#define MAX_PER_STAT_EVS 255
|
||||||
#define MAX_TOTAL_EVS 510
|
#define MAX_TOTAL_EVS 510
|
||||||
#define EV_ITEM_RAISE_LIMIT 100
|
#define EV_ITEM_RAISE_LIMIT 100
|
||||||
|
|
||||||
|
@ -5895,9 +5895,9 @@ void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies)
|
|||||||
if (totalEVs + (s16)evIncrease > MAX_TOTAL_EVS)
|
if (totalEVs + (s16)evIncrease > MAX_TOTAL_EVS)
|
||||||
evIncrease = ((s16)evIncrease + MAX_TOTAL_EVS) - (totalEVs + evIncrease);
|
evIncrease = ((s16)evIncrease + MAX_TOTAL_EVS) - (totalEVs + evIncrease);
|
||||||
|
|
||||||
if (evs[i] + (s16)evIncrease > 255)
|
if (evs[i] + (s16)evIncrease > MAX_PER_STAT_EVS)
|
||||||
{
|
{
|
||||||
int val1 = (s16)evIncrease + 255;
|
int val1 = (s16)evIncrease + MAX_PER_STAT_EVS;
|
||||||
int val2 = evs[i] + evIncrease;
|
int val2 = evs[i] + evIncrease;
|
||||||
evIncrease = val1 - val2;
|
evIncrease = val1 - val2;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user