WorldMgr/zh: Difference between revisions

Updating to match new version of source page
(Created page with "=== TimeMgr::calc === 這個函數每幀呼叫一次。")
(Updating to match new version of source page)
Line 1: Line 1:
<languages/>
<languages/>
<!--T:1-->
{{Subsystem infobox|name=WorldMgr|init_addr_switch150=00000071010F2920|is_name_official=1|description=Manages world state (time, blood moons, climates, weather, etc.)}}
{{Subsystem infobox|name=WorldMgr|init_addr_switch150=00000071010F2920|is_name_official=1|description=Manages world state (time, blood moons, climates, weather, etc.)}}


Line 6: Line 7:
這個子系統很大/複雜,它的功能被切成九個部分。
這個子系統很大/複雜,它的功能被切成九個部分。


<div class="mw-translate-fuzzy">
== WorldMgr ==
== WorldMgr ==
=== 小主管 ===
=== 小主管 ===
小主管 (Sub-managers) 由 WorldMgr::init (0x71010F43C0) 生成, and inserted into a pointer array (@WorldMgr+0x5c0). (注意以下名稱不是官方名稱。)
小主管 (Sub-managers) 由 WorldMgr::init (0x71010F43C0) 生成, and inserted into a pointer array (@WorldMgr+0x5c0). (注意以下名稱不是官方名稱。)
</div>


=== Sub-managers ===
Sub-managers are created in WorldMgr::init (0x71010F43C0) and inserted into a pointer array (@WorldMgr+0x5c0). All names below are unofficial.
<!--T:5-->
{|class="wikitable"
{|class="wikitable"
|+ Sub-managers by ID
|+ Sub-managers by ID
Line 56: Line 63:
* (If field 0x14A is set to 99, WM_BloodyDay is set to true. [[AIDef:Action/SetBloodyMoonEnv]] uses this to force a Blood Moon to be scheduled. This feature appears to be unused.)
* (If field 0x14A is set to 99, WM_BloodyDay is set to true. [[AIDef:Action/SetBloodyMoonEnv]] uses this to force a Blood Moon to be scheduled. This feature appears to be unused.)
* 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).
** Demo103_0 is the "leaving Shrine of Resurrection" cutscene, and Demo997_0 is a cutscene that doesn't exist anymore.
* 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.
* [[#Midnight checks]].
* The game then performs [[#Midnight checks]].


* '''Update time of day''': there are several possible update modes. In most cases, the update mode is 0.
* '''Update time of day''': there are several possible update modes. In most cases, the update mode is 0.
Line 117: Line 125:
| 32 || Freeze time to 23:00
| 32 || Freeze time to 23:00
|-
|-
| 34 ||
| 34 ||* Add (0.0083333 * elapsed frames) to the Time of Day timer.
* Add (0.0083333 * elapsed frames) to the Time of Day timer.
* If the timer is >= 360.0, which means that a day has passed, the game subtracts 360 from the timer.
* If the timer is >= 360.0, which means that a day has passed, the game subtracts 360 from the timer.


'''Note''': In this state, the blood moon timer is never updated and its value is never checked either.  
'''Note''': In this state, the blood moon timer is never updated and its value is never checked either.  
|}
|}
* Update the [[#Day/night time flag]], the [[#Time division, IsMorning, IsNoon, etc.]]
* Update the [[#Day/night time flag]], the [[#Time division, IsMorning, IsNoon, etc.]]
* If the "Bloody Moon end reserve timer" is non zero, decrement it. If the new value is zero, the WM_BloodyDay flag is cleared.
* If the "Bloody Moon end reserve timer" is non zero, decrement it. If the new value is zero, the WM_BloodyDay flag is cleared.
Line 164: Line 170:
In any other case, WM_DaytimeFlag is set to true and WM_NighttimeFlag to false.
In any other case, WM_DaytimeFlag is set to true and WM_NighttimeFlag to false.


=== Time division, IsMorning, IsNoon, etc. ===
=== Time division, IsMorning, IsNoon, etc. === <!--T:26-->
{|class="wikitable"
{|class="wikitable"
! Start !! End !! Division !! Time type (1) !! Time type (2)
! Start !! End !! Division !! Time type (1) !! Time type (2)
Line 186: Line 192:
| 00:00 || 04:00 || 7 || NightB || Night_B
| 00:00 || 04:00 || 7 || NightB || Night_B
|}
|}
Note: all intervals include the start time and exclude the end time.
Note: all intervals include the start time and exclude the end time.


Line 247: Line 254:
|}
|}


<!--T:40-->
[[Category:Internals]]
[[Category:Internals]]
[[Category:Subsystems (BotW)]]
[[Category:Subsystems (BotW)]]
826

edits