Turn some magic numbers into named constants

This commit is contained in:
Thomas Winwood 2019-11-20 16:37:14 +00:00 committed by huderlem
parent 215bb31d67
commit e3f7f47321
3 changed files with 7 additions and 6 deletions

View File

@ -4555,7 +4555,7 @@ static void Cmd_moveend(void)
case MOVEEND_CHOICE_MOVE: // update choice band move
if (gHitMarker & HITMARKER_OBEYS
&& holdEffectAtk == HOLD_EFFECT_CHOICE_BAND
&& gChosenMove != MOVE_STRUGGLE
&& gChosenMove != MOVE_STRUGGLE
&& (*choicedMoveAtk == 0 || *choicedMoveAtk == 0xFFFF))
{
if (gChosenMove == MOVE_BATON_PASS && !(gMoveResultFlags & MOVE_RESULT_FAILED))
@ -7826,7 +7826,7 @@ static void Cmd_weatherdamage(void)
gBattleMoveDamage = 0;
}
}
if (gBattleWeather & WEATHER_HAIL)
if (gBattleWeather & WEATHER_HAIL_ANY)
{
if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE)
&& !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERGROUND)

View File

@ -30,6 +30,7 @@
#include "wild_encounter.h"
#include "constants/bg_event_constants.h"
#include "constants/event_objects.h"
#include "constants/field_poison.h"
#include "constants/map_types.h"
#include "constants/maps.h"
#include "constants/songs.h"
@ -647,11 +648,11 @@ static bool8 UpdatePoisonStepCounter(void)
{
switch (DoPoisonFieldEffect())
{
case 0:
case FLDPSN_NONE:
return FALSE;
case 1:
case FLDPSN_PSN:
return FALSE;
case 2:
case FLDPSN_FNT:
return TRUE;
}
}

View File

@ -3271,7 +3271,7 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
}
// any weather except sun weakens solar beam
if ((gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_HAIL)) && gCurrentMove == MOVE_SOLAR_BEAM)
if ((gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SANDSTORM_ANY | WEATHER_HAIL_ANY)) && gCurrentMove == MOVE_SOLAR_BEAM)
damage /= 2;
// sunny