diff options
author | DizzyEggg <jajkodizzy@wp.pl> | 2019-07-29 21:44:03 +0200 |
---|---|---|
committer | DizzyEggg <jajkodizzy@wp.pl> | 2019-07-29 21:44:03 +0200 |
commit | af5502984370322737e6e5128c73214b66612c9b (patch) | |
tree | 3a53e8641720a9bc3b17ca0de889c5b71aa1e2c4 /src | |
parent | ff2dcf541317ffd7267e4d283b79cf3f758a18e1 (diff) |
Prettier GetDeoxysStat
Diffstat (limited to 'src')
-rw-r--r-- | src/pokemon.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/pokemon.c b/src/pokemon.c index 2485caa50..6c0a51f41 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -2649,25 +2649,20 @@ bool8 sub_80688F8(u8 caseId, u8 battlerId) return TRUE; } -static s32 GetDeoxysStat(struct Pokemon *mon, s32 statId) +static u16 GetDeoxysStat(struct Pokemon *mon, s32 statId) { s32 ivVal, evVal; - s32 statValue; - u8 nature, statId_; + u16 statValue = 0; + u8 nature; - if (gBattleTypeFlags & BATTLE_TYPE_20) - return 0; - if (GetMonData(mon, MON_DATA_SPECIES, NULL) != SPECIES_DEOXYS) + if (gBattleTypeFlags & BATTLE_TYPE_20 || GetMonData(mon, MON_DATA_SPECIES, NULL) != SPECIES_DEOXYS) return 0; ivVal = GetMonData(mon, MON_DATA_HP_IV + statId, NULL); evVal = GetMonData(mon, MON_DATA_HP_EV + statId, NULL); - statValue = (u16)(((sDeoxysBaseStats[statId] * 2 + ivVal + evVal / 4) * mon->level) / 100 + 5); - + statValue = ((sDeoxysBaseStats[statId] * 2 + ivVal + evVal / 4) * mon->level) / 100 + 5; nature = GetNature(mon); - statId_ = statId; // needed to match - statValue = ModifyStatByNature(nature, statValue, statId_); - + statValue = ModifyStatByNature(nature, statValue, (u8)statId); return statValue; } |