Slight RTC documentation + Evolution times constants

This commit is contained in:
Eduardo Quezada
2023-09-17 13:45:06 -03:00
parent de3493ff0e
commit fb6f45b2c3
3 changed files with 38 additions and 27 deletions

View File

@@ -48,6 +48,12 @@
#include "constants/trainers.h"
#include "constants/union_room.h"
#define DAY_EVO_HOUR_BEGIN 12
#define DAY_EVO_HOUR_END DAY_HOURS
#define NIGHT_EVO_HOUR_BEGIN 0
#define NIGHT_EVO_HOUR_END 12
struct SpeciesItem
{
u16 species;
@@ -5498,12 +5504,12 @@ u16 GetEvolutionTargetSpecies(struct Pokemon *mon, u8 mode, u16 evolutionItem)
break;
case EVO_FRIENDSHIP_DAY:
RtcCalcLocalTime();
if (gLocalTime.hours >= 12 && gLocalTime.hours < 24 && friendship >= 220)
if (gLocalTime.hours >= DAY_EVO_HOUR_BEGIN && gLocalTime.hours < DAY_EVO_HOUR_END && friendship >= 220)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_FRIENDSHIP_NIGHT:
RtcCalcLocalTime();
if (gLocalTime.hours >= 0 && gLocalTime.hours < 12 && friendship >= 220)
if (gLocalTime.hours >= NIGHT_EVO_HOUR_BEGIN && gLocalTime.hours < NIGHT_EVO_HOUR_END && friendship >= 220)
targetSpecies = gEvolutionTable[species][i].targetSpecies;
break;
case EVO_LEVEL: