Clean up time of day code
This commit is contained in:
parent
13a65a21ad
commit
f6f305ef1d
3 changed files with 4 additions and 8 deletions
|
@ -14878,8 +14878,7 @@ static void Cmd_handleballthrow(void)
|
||||||
ballMultiplier = 400;
|
ballMultiplier = 400;
|
||||||
break;
|
break;
|
||||||
case ITEM_DUSK_BALL:
|
case ITEM_DUSK_BALL:
|
||||||
RtcCalcLocalTime();
|
if ((GetTimeOfDay() == TIME_DUSK || GetTimeOfDay() == TIME_NIGHT) || gMapHeader.cave || gMapHeader.mapType == MAP_TYPE_UNDERGROUND)
|
||||||
if ((gLocalTime.hours >= 20 && gLocalTime.hours <= 3) || gMapHeader.cave || gMapHeader.mapType == MAP_TYPE_UNDERGROUND)
|
|
||||||
ballMultiplier = (B_DUSK_BALL_MODIFIER >= GEN_7 ? 300 : 350);
|
ballMultiplier = (B_DUSK_BALL_MODIFIER >= GEN_7 ? 300 : 350);
|
||||||
break;
|
break;
|
||||||
case ITEM_QUICK_BALL:
|
case ITEM_QUICK_BALL:
|
||||||
|
|
|
@ -9072,13 +9072,11 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32
|
||||||
switch (formChanges[i].param1)
|
switch (formChanges[i].param1)
|
||||||
{
|
{
|
||||||
case DAY:
|
case DAY:
|
||||||
RtcCalcLocalTime();
|
if (GetTimeOfDay() != TIME_NIGHT)
|
||||||
if (gLocalTime.hours >= DAY_EVO_HOUR_BEGIN && gLocalTime.hours < DAY_EVO_HOUR_END)
|
|
||||||
targetSpecies = formChanges[i].targetSpecies;
|
targetSpecies = formChanges[i].targetSpecies;
|
||||||
break;
|
break;
|
||||||
case NIGHT:
|
case NIGHT:
|
||||||
RtcCalcLocalTime();
|
if (GetTimeOfDay() == TIME_NIGHT)
|
||||||
if (gLocalTime.hours >= NIGHT_EVO_HOUR_BEGIN && gLocalTime.hours < NIGHT_EVO_HOUR_END)
|
|
||||||
targetSpecies = formChanges[i].targetSpecies;
|
targetSpecies = formChanges[i].targetSpecies;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -310,8 +310,7 @@ u8 GetTimeOfDay(void)
|
||||||
return TIME_DUSK;
|
return TIME_DUSK;
|
||||||
else if (IsBetweenHours(gLocalTime.hours, NIGHT_EVO_HOUR_BEGIN, NIGHT_EVO_HOUR_END))
|
else if (IsBetweenHours(gLocalTime.hours, NIGHT_EVO_HOUR_BEGIN, NIGHT_EVO_HOUR_END))
|
||||||
return TIME_NIGHT;
|
return TIME_NIGHT;
|
||||||
else
|
return TIME_DAY;
|
||||||
return TIME_DAY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RtcInitLocalTimeOffset(s32 hour, s32 minute)
|
void RtcInitLocalTimeOffset(s32 hour, s32 minute)
|
||||||
|
|
Loading…
Reference in a new issue