Merge pull request #1157 from ketsuban/max-evs-per-stat
Add MAX_PER_STAT_EVS macro
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
+14
-14
@@ -1898,22 +1898,22 @@ static const u16 sDeoxysBaseStats[] =
|
|||||||
const u16 gLinkPlayerFacilityClasses[NUM_MALE_LINK_FACILITY_CLASSES + NUM_FEMALE_LINK_FACILITY_CLASSES] =
|
const u16 gLinkPlayerFacilityClasses[NUM_MALE_LINK_FACILITY_CLASSES + NUM_FEMALE_LINK_FACILITY_CLASSES] =
|
||||||
{
|
{
|
||||||
// Male classes
|
// Male classes
|
||||||
FACILITY_CLASS_COOLTRAINER_M,
|
FACILITY_CLASS_COOLTRAINER_M,
|
||||||
FACILITY_CLASS_BLACK_BELT,
|
FACILITY_CLASS_BLACK_BELT,
|
||||||
FACILITY_CLASS_CAMPER,
|
FACILITY_CLASS_CAMPER,
|
||||||
FACILITY_CLASS_YOUNGSTER,
|
FACILITY_CLASS_YOUNGSTER,
|
||||||
FACILITY_CLASS_PSYCHIC_M,
|
FACILITY_CLASS_PSYCHIC_M,
|
||||||
FACILITY_CLASS_BUG_CATCHER,
|
FACILITY_CLASS_BUG_CATCHER,
|
||||||
FACILITY_CLASS_PKMN_BREEDER_M,
|
FACILITY_CLASS_PKMN_BREEDER_M,
|
||||||
FACILITY_CLASS_GUITARIST,
|
FACILITY_CLASS_GUITARIST,
|
||||||
// Female Classes
|
// Female Classes
|
||||||
FACILITY_CLASS_COOLTRAINER_F,
|
FACILITY_CLASS_COOLTRAINER_F,
|
||||||
FACILITY_CLASS_HEX_MANIAC,
|
FACILITY_CLASS_HEX_MANIAC,
|
||||||
FACILITY_CLASS_PICNICKER,
|
FACILITY_CLASS_PICNICKER,
|
||||||
FACILITY_CLASS_LASS,
|
FACILITY_CLASS_LASS,
|
||||||
FACILITY_CLASS_PSYCHIC_F,
|
FACILITY_CLASS_PSYCHIC_F,
|
||||||
FACILITY_CLASS_BATTLE_GIRL,
|
FACILITY_CLASS_BATTLE_GIRL,
|
||||||
FACILITY_CLASS_PKMN_BREEDER_F,
|
FACILITY_CLASS_PKMN_BREEDER_F,
|
||||||
FACILITY_CLASS_BEAUTY
|
FACILITY_CLASS_BEAUTY
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5806,7 +5806,7 @@ void AdjustFriendship(struct Pokemon *mon, u8 event)
|
|||||||
if (friendship > 199)
|
if (friendship > 199)
|
||||||
friendshipLevel++;
|
friendshipLevel++;
|
||||||
|
|
||||||
if ((event != FRIENDSHIP_EVENT_WALKING || !(Random() & 1))
|
if ((event != FRIENDSHIP_EVENT_WALKING || !(Random() & 1))
|
||||||
&& (event != FRIENDSHIP_EVENT_LEAGUE_BATTLE || IS_LEAGUE_BATTLE))
|
&& (event != FRIENDSHIP_EVENT_LEAGUE_BATTLE || IS_LEAGUE_BATTLE))
|
||||||
{
|
{
|
||||||
s8 mod = sFriendshipEventModifiers[event][friendshipLevel];
|
s8 mod = sFriendshipEventModifiers[event][friendshipLevel];
|
||||||
@@ -5848,7 +5848,7 @@ void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies)
|
|||||||
{
|
{
|
||||||
if (totalEVs >= MAX_TOTAL_EVS)
|
if (totalEVs >= MAX_TOTAL_EVS)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (CheckPartyHasHadPokerus(mon, 0))
|
if (CheckPartyHasHadPokerus(mon, 0))
|
||||||
multiplier = 2;
|
multiplier = 2;
|
||||||
else
|
else
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user