WorldMgr: Difference between revisions

imported>Leoetlino
imported>Leoetlino
Line 51: Line 51:
=== TimeMgr::calc ===
=== TimeMgr::calc ===
This is called every frame.
This is called every frame.
* If both [[Demo]]103_0 and Demo997_0 have not been played, time of day is reset to 78.75 (05:15).
* If both [[Demo]]103_0 and Demo997_0 have not been played, time of day is reset to 78.75 (05:15).
* If [[AIDef:Action/AdvanceTime]] or anything else that changes time of day was called, the actual time is updated at this moment.
* If [[AIDef:Action/AdvanceTime]] or anything else that changes time of day was called, the actual time is updated at this moment.
* Blood Moon checks.
* Blood Moon schedule checks (see below).
* Update time of day.
 
* If FindDungeon_Activated is false (if the player hasn't received the ''The Isolated Plateau'' quest) and if the current time is >= 165.0 (11:00), the time is forcefully set to 11:00.
* '''Update time of day''': if Demo103_0 or Demo997_0 have been played, and if there is no active event (cutscene):
* Update the [[#Blood Moon]] timer.
** Add (0.0083333 * elapsed frames) to the Time of Day timer. Effectively, this means that 1 in-game minute = 1 real-life second.
** If the timer is >= 360.0, which means that a day has passed, the game subtracts 360 from the timer and then performs blood moon schedule checks. See below.
** If FindDungeon_Activated is false (if the player hasn't received the ''The Isolated Plateau'' quest) and if the current time is >= 165.0 (11:00), the time is forcefully set to 11:00.
** The [[#Blood Moon]] timer is updated too.
 
* Update the [[#Day/night time flag]], the [[#Time division, IsMorning, IsNoon, etc.]]
* Update the [[#Day/night time flag]], the [[#Time division, IsMorning, IsNoon, etc.]]
* Decrement the "Bloody Moon end reserve timer". If the new timer value is zero or negative, the WM_BloodyDay flag is cleared.
* Decrement the "Bloody Moon end reserve timer". If the new timer value is zero or negative, the WM_BloodyDay flag is cleared.
Anonymous user