summaryrefslogtreecommitdiff
path: root/src/pokemon.c
diff options
context:
space:
mode:
authorDizzyEggg <jajkodizzy@wp.pl>2018-07-16 20:47:30 +0200
committerDizzyEggg <jajkodizzy@wp.pl>2018-07-16 20:47:30 +0200
commitbf0178238a179b298f465b64a4f23ff43db48fc9 (patch)
tree20ce13adef55b5c6ef06c8ba697b7c187ef4f453 /src/pokemon.c
parentea5ffa3375f58c3d859f48d220a8a67fcb56fa61 (diff)
Battle files - review changes
Diffstat (limited to 'src/pokemon.c')
-rw-r--r--src/pokemon.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/pokemon.c b/src/pokemon.c
index 5406cfee9..bb2959eda 100644
--- a/src/pokemon.c
+++ b/src/pokemon.c
@@ -2265,7 +2265,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
if (attackerHoldEffect == sHoldEffectToType[i][0]
&& type == sHoldEffectToType[i][1])
{
- if (type <= 8)
+ if (IS_MOVE_PHYSICAL(type))
attack = (attack * (attackerHoldEffectParam + 100)) / 100;
else
spAttack = (spAttack * (attackerHoldEffectParam + 100)) / 100;
@@ -2293,9 +2293,9 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
spAttack /= 2;
if (attacker->ability == ABILITY_HUSTLE)
attack = (150 * attack) / 100;
- if (attacker->ability == ABILITY_PLUS && AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, ABILITY_MINUS, 0, 0))
+ if (attacker->ability == ABILITY_PLUS && ABILITY_ON_FIELD2(ABILITY_MINUS))
spAttack = (150 * spAttack) / 100;
- if (attacker->ability == ABILITY_MINUS && AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, ABILITY_PLUS, 0, 0))
+ if (attacker->ability == ABILITY_MINUS && ABILITY_ON_FIELD2(ABILITY_PLUS))
spAttack = (150 * spAttack) / 100;
if (attacker->ability == ABILITY_GUTS && attacker->status1)
attack = (150 * attack) / 100;
@@ -2316,7 +2316,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
if (gBattleMoves[gCurrentMove].effect == EFFECT_EXPLOSION)
defense /= 2;
- if (type < TYPE_MYSTERY) // is physical
+ if (IS_MOVE_PHYSICAL(type) && type != TYPE_MYSTERY)
{
if (gCritMultiplier == 2)
{
@@ -2366,7 +2366,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
if (type == TYPE_MYSTERY)
damage = 0; // is ??? type. does 0 damage.
- if (type > TYPE_MYSTERY) // is special?
+ if (IS_MOVE_SPECIAL(type))
{
if (gCritMultiplier == 2)
{
@@ -2406,8 +2406,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
damage /= 2;
// are effects of weather negated with cloud nine or air lock
- if (!AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, ABILITY_CLOUD_NINE, 0, 0)
- && !AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, ABILITY_AIR_LOCK, 0, 0))
+ if (WEATHER_HAS_EFFECT2)
{
if (gBattleWeather & WEATHER_RAIN_TEMPORARY)
{
@@ -4514,7 +4513,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem)
holdEffect = ItemId_GetHoldEffect(heldItem);
if (holdEffect == HOLD_EFFECT_PREVENT_EVOLVE && type != 3)
- return 0;
+ return SPECIES_NONE;
switch (type)
{
@@ -4522,7 +4521,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem)
level = GetMonData(mon, MON_DATA_LEVEL, 0);
friendship = GetMonData(mon, MON_DATA_FRIENDSHIP, 0);
- for (i = 0; i < 5; i++)
+ for (i = 0; i < EVOS_PER_MON; i++)
{
switch (gEvolutionTable[species][i].method)
{
@@ -4579,7 +4578,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem)
}
break;
case 1:
- for (i = 0; i < 5; i++)
+ for (i = 0; i < EVOS_PER_MON; i++)
{
switch (gEvolutionTable[species][i].method)
{
@@ -4599,7 +4598,7 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 type, u16 evolutionItem)
break;
case 2:
case 3:
- for (i = 0; i < 5; i++)
+ for (i = 0; i < EVOS_PER_MON; i++)
{
if (gEvolutionTable[species][i].method == EVO_ITEM
&& gEvolutionTable[species][i].param == evolutionItem)