diff --git a/include/overworld.h b/include/overworld.h index 62761ecdb0..5805bb8d6b 100644 --- a/include/overworld.h +++ b/include/overworld.h @@ -25,10 +25,6 @@ #define MOVEMENT_MODE_SCRIPTED 2 #define SKIP_OBJECT_EVENT_LOAD 1 -#define TIME_OF_DAY_NIGHT 0 -#define TIME_OF_DAY_TWILIGHT 1 -#define TIME_OF_DAY_DAY 2 -#define TIME_OF_DAY_MAX TIME_OF_DAY_DAY struct InitialPlayerAvatarState { diff --git a/src/event_object_movement.c b/src/event_object_movement.c index 42f68473a1..122f774ebf 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -29,6 +29,7 @@ #include "pokeball.h" #include "random.h" #include "region_map.h" +#include "rtc.h" #include "script.h" #include "sound.h" #include "sprite.h" @@ -2505,7 +2506,7 @@ void UpdateLightSprite(struct Sprite *sprite) return; } - if (gTimeOfDay != TIME_OF_DAY_NIGHT) + if (gTimeOfDay != TIME_NIGHT) { sprite->invisible = TRUE; return; diff --git a/src/follower_helper.c b/src/follower_helper.c index f1a365532f..26e9f25fab 100644 --- a/src/follower_helper.c +++ b/src/follower_helper.c @@ -3,6 +3,7 @@ #include "event_scripts.h" #include "follower_helper.h" #include "overworld.h" +#include "rtc.h" #include "constants/battle.h" #include "constants/followers.h" #include "constants/metatile_behaviors.h" @@ -362,14 +363,14 @@ const struct FollowerMsgInfoExtended gFollowerConditionalMessages[COND_MSG_COUNT .text = (u8*)sDayTexts, .textSpread = 1, .emotion = FOLLOWER_EMOTION_MUSIC, - .conditions = {MATCH_TIME_OF_DAY(TIME_OF_DAY_DAY)}, + .conditions = {MATCH_TIME_OF_DAY(TIME_DAY)}, }, [COND_MSG_NIGHT] = { .text = (u8*)sNightTexts, .textSpread = 1, .emotion = FOLLOWER_EMOTION_MUSIC, - .conditions = {MATCH_TIME_OF_DAY(TIME_OF_DAY_NIGHT)}, + .conditions = {MATCH_TIME_OF_DAY(TIME_NIGHT)}, }, }; diff --git a/src/overworld.c b/src/overworld.c index c7f3e15d7a..889b35effc 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -1532,9 +1532,10 @@ void CB1_Overworld(void) const struct BlendSettings gTimeOfDayBlend[] = { - [TIME_OF_DAY_NIGHT] = {.coeff = 10, .blendColor = TINT_NIGHT, .isTint = TRUE}, - [TIME_OF_DAY_TWILIGHT] = {.coeff = 4, .blendColor = 0xA8B0E0, .isTint = TRUE}, - [TIME_OF_DAY_DAY] = {.coeff = 0, .blendColor = 0}, + [TIME_MORNING] = {.coeff = 4, .blendColor = 0xA8B0E0, .isTint = TRUE}, // Originally TIME_OF_DAY_TWILIGHT + [TIME_DAY] = {.coeff = 0, .blendColor = 0, .isTint = FALSE}, + [TIME_EVENING] = {.coeff = 4, .blendColor = 0xA8B0E0, .isTint = TRUE}, // Originally TIME_OF_DAY_TWILIGHT + [TIME_NIGHT] = {.coeff = 10, .blendColor = TINT_NIGHT, .isTint = TRUE}, }; u8 UpdateTimeOfDay(void) @@ -1547,50 +1548,50 @@ u8 UpdateTimeOfDay(void) { currentTimeBlend.weight = 256; currentTimeBlend.altWeight = 0; - gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; + gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_NIGHT; } - else if (hours < 7) // night->twilight + else if (hours < 7) // night->morning { - currentTimeBlend.time0 = TIME_OF_DAY_NIGHT; - currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; + currentTimeBlend.time0 = TIME_NIGHT; + currentTimeBlend.time1 = TIME_MORNING; currentTimeBlend.weight = 256 - 256 * ((hours - 4) * 60 + minutes) / ((7-4)*60); currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2; - gTimeOfDay = TIME_OF_DAY_DAY; + gTimeOfDay = TIME_MORNING; } - else if (hours < 10) // twilight->day + else if (hours < 10) // morning->day { - currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; - currentTimeBlend.time1 = TIME_OF_DAY_DAY; + currentTimeBlend.time0 = TIME_MORNING; + currentTimeBlend.time1 = TIME_DAY; currentTimeBlend.weight = 256 - 256 * ((hours - 7) * 60 + minutes) / ((10-7)*60); currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2 + 128; - gTimeOfDay = TIME_OF_DAY_DAY; + gTimeOfDay = TIME_DAY; } else if (hours < 18) // day { currentTimeBlend.weight = currentTimeBlend.altWeight = 256; - gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_DAY; + gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_DAY; } - else if (hours < 20) + else if (hours < 20) // evening { - currentTimeBlend.time0 = TIME_OF_DAY_DAY; - currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; + currentTimeBlend.time0 = TIME_DAY; + currentTimeBlend.time1 = TIME_EVENING; currentTimeBlend.weight = 256 - 256 * ((hours - 18) * 60 + minutes) / ((20-18)*60); currentTimeBlend.altWeight = currentTimeBlend.weight / 2 + 128; - gTimeOfDay = TIME_OF_DAY_TWILIGHT; + gTimeOfDay = TIME_EVENING; } - else if (hours < 22) // twilight->night + else if (hours < 22) // evening->night { - currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; - currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; + currentTimeBlend.time0 = TIME_EVENING; + currentTimeBlend.time1 = TIME_NIGHT; currentTimeBlend.weight = 256 - 256 * ((hours - 20) * 60 + minutes) / ((22-20)*60); currentTimeBlend.altWeight = currentTimeBlend.weight / 2; - gTimeOfDay = TIME_OF_DAY_NIGHT; + gTimeOfDay = TIME_NIGHT; } else // 22-24, night { currentTimeBlend.weight = 256; currentTimeBlend.altWeight = 0; - gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; + gTimeOfDay = currentTimeBlend.time0 = currentTimeBlend.time1 = TIME_NIGHT; } return gTimeOfDay; }