We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
By default, the time between 4 and 7 am will return time of day day when its super dark outside See: https://github.com/aarant/pokeemerald/blob/lighting/src/overworld.c#L1497
I suggest this as an alternative
u8 UpdateTimeOfDay(void) { s32 hours, minutes; RtcCalcLocalTime(); hours = gLocalTime.hours; minutes = gLocalTime.minutes; if (hours < 6) { currentTimeBlend.time0 = TIME_OF_DAY_NIGHT; currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; currentTimeBlend.weight = 256; currentTimeBlend.altWeight = 0; gTimeOfDay = TIME_OF_DAY_NIGHT; return gTimeOfDay; } else if (hours < 7) { currentTimeBlend.time0 = TIME_OF_DAY_NIGHT; currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; currentTimeBlend.weight = 256 - 256 * ((hours - 6) * 60 + minutes) / ((7 - 6) * 60); currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2; gTimeOfDay = TIME_OF_DAY_TWILIGHT; return gTimeOfDay; } else if (hours < 11) { currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; currentTimeBlend.time1 = TIME_OF_DAY_DAY; currentTimeBlend.weight = 256 - 256 * ((hours - 7) * 60 + minutes) / ((11 - 7) * 60); currentTimeBlend.altWeight = (256 - currentTimeBlend.weight) / 2 + 128; gTimeOfDay = TIME_OF_DAY_TWILIGHT; return gTimeOfDay; } else if (hours < 17) { currentTimeBlend.time0 = TIME_OF_DAY_DAY; currentTimeBlend.time1 = TIME_OF_DAY_TWILIGHT; currentTimeBlend.weight = 256 - 256 * ((hours - 11) * 60 + minutes) / ((18 - 11) * 60); currentTimeBlend.altWeight = currentTimeBlend.weight / 2 + 128; gTimeOfDay = TIME_OF_DAY_DAY; return gTimeOfDay; } else if (hours < 21) { currentTimeBlend.time0 = TIME_OF_DAY_TWILIGHT; currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; currentTimeBlend.weight = 256 - 256 * ((hours - 18) * 60 + minutes) / ((22 - 18) * 60); currentTimeBlend.altWeight = currentTimeBlend.weight / 2; gTimeOfDay = TIME_OF_DAY_TWILIGHT; return gTimeOfDay; } else { currentTimeBlend.time0 = TIME_OF_DAY_NIGHT; currentTimeBlend.time1 = TIME_OF_DAY_NIGHT; currentTimeBlend.weight = 256; currentTimeBlend.altWeight = 0; gTimeOfDay = TIME_OF_DAY_NIGHT; return gTimeOfDay; } }
Would work like this: It works like this: 0 - 6 = Night 6 - 7 = Twilight 7 - 11 = Twilight 11 - 17 = Day 17 - 21 = Twilight 12 - 0 = Night
The text was updated successfully, but these errors were encountered:
No branches or pull requests
By default, the time between 4 and 7 am will return time of day day when its super dark outside
See: https://github.com/aarant/pokeemerald/blob/lighting/src/overworld.c#L1497
I suggest this as an alternative
Would work like this:
It works like this:
0 - 6 = Night
6 - 7 = Twilight
7 - 11 = Twilight
11 - 17 = Day
17 - 21 = Twilight
12 - 0 = Night
The text was updated successfully, but these errors were encountered: