WorldMgr/zh: Difference between revisions

From ZeldaMods (Breath of the Wild)
Jump to navigation Jump to search
(Created page with "World Manager (WorldMgr) 是遊戲裡的一個子系統。 它控制時間、血月、氣候、天氣、霧、風、閃電、雲、山林霸主的出現等等。")
(Updating to match new version of source page)
 
(72 intermediate revisions by 3 users not shown)
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.)}}


World Manager (WorldMgr) 是遊戲裡的一個子系統。 它控制時間、血月、氣候、天氣、霧、風、閃電、雲、山林霸主的出現等等。
World Manager (WorldMgr) 是遊戲裡的一個子系統。 它控制時間、血月、氣候、天氣、霧、風、閃電、雲、山林霸主的出現等等。


Because of the massive amount of state to handle, functionality is split across the main WorldMgr and 9 sub-managers.
這個子系統很大/複雜,它的功能被切成九個部分。


== WorldMgr ==
== WorldMgr ==
=== Sub-managers ===
Sub-managers are created in WorldMgr::init (0x71010F43C0) and inserted into a pointer array (@WorldMgr+0x5c0). All names below are unofficial.


=== 小主管 ===
小主管 (Sub-managers) 由 WorldMgr::init (0x71010F43C0) 生成,and inserted into a pointer array (@WorldMgr+0x5c0). 注意以下名稱不是官方名稱。
<!--T:5-->
{|class="wikitable"
{|class="wikitable"
|+ Sub-managers by ID
|+ 小主管及其編號 (ID)
! ID !! Description
! 編號 !! 負責內容
|-
|-
| 0 || TimeMgr: Handles time, blood moons, Lord of the Mountain.
| 0 || TimeMgr: 時間、血月、山林霸主
|-
|-
| 1 || CloudPrMgr: Handles cloud procedural generation.
| 1 || CloudPrMgr: 程序化生成的雲
|-
|-
| 2 || ShootingStarMgr: Manages shooting stars and (in 1.3.3+) special shooting stars for the Xenoblade 2 quest.
| 2 || ShootingStarMgr: 黃色的流星跟紅色的異度神劍2流星(1.3.3版及其後)。
|-
|-
| 3 || WeatherMgr: Handles "rain splash" and climate weathers.
| 3 || WeatherMgr: Handles "rain splash" and 氣候、天氣
|-
|-
| 4 || TempMgr: Handles world temperature{{check}}.
| 4 || TempMgr: 溫度{{check}}.
|-
|-
| 5 || ?
| 5 || ?
|-
|-
| 6 || SkyMgr: Handles sky and fog{{check}}. Holds the configuration for all EnvPalettes, EnvAttributes, WeatherInfluences, Remains palettes, Indoor palettes and dungeon fogs.
| 6 || SkyMgr: 天空、霧{{check}}. Holds the configuration for all EnvPalettes, EnvAttributes, WeatherInfluences, Remains palettes, Indoor palettes and dungeon fogs.
|-
|-
| 7 || DofMgr: Handles depth of field{{check}}. Holds depth of field related parameters.
| 7 || DofMgr: Handles depth of field{{check}}. Holds depth of field related parameters.
Line 33: Line 36:
|}
|}


=== Climate ===
=== 氣候 ===
The main WorldMgr class is responsible for keeping climate related parameters and determining which set of climate settings to use. Strangely enough, WorldMgr uses the position of the Camera actor to figure out which map area the player is in (and thus what climate to use), not the Player actor.
WorldMgr 本身(而不是小主管)負責處理氣候那一類的事情。 氣候顯然是由玩家所在的位置決定的(在火山很熱、在雪山很冷), 有趣的是,它是用攝影機所在的位置而不是林克所在的位置來決定氣候的。


== TimeMgr ==
== TimeMgr ==
TimeMgr handles everything to do with time, including Blood Moons and the Lord of the Mountain's apparition.
TimeMgr 管理所有跟時間有關的事情,例如血月何時出現,山林霸主何時出現。


Internally, time of day is stored as a float in the [0.0, 360.0] range.
遊戲內時間(小時跟分鐘)是一個 [0.0, 360.0] 範圍內的浮點數。 0.0 跟 360 代表子夜,90 大約是早晨,180.0 代表正午,依此類推。


=== TimeMgr::init ===
=== TimeMgr::init ===
* Time is set to 78.75 (05:15).
(init 代表初始化設定)
 
* 遊戲內時間令為 78.75,早上 05:15 的意思。
* Time for TotS environment is set to 78.75 (05:15) as well.
* Time for TotS environment is set to 78.75 (05:15) as well.
* "Bloody Moon end reserve timer" is set to 0.
* "Bloody Moon end reserve timer" is set to 0.(這個計時器不是用來倒數血月何時出現的那個,下面會詳述。)


<div class="mw-translate-fuzzy">
=== TimeMgr::reset ===
=== TimeMgr::reset ===
This is called whenever a stage is unloaded (essentially every time the loading screen is shown).
This is called whenever a stage is unloaded (essentially every time the loading screen is shown). 意思是凡是讀檔就會呼叫這個函數。
* Blood Moon checks are delayed.
* 血月相關檢查會被延後。
* The AnimalMaster_Appearance flag is cleared, meaning the Lord of the Mountain will not appear.
* 山林霸主的 flag 會被設為 false,意思是不要出現。
</div>


=== TimeMgr::calc ===
=== TimeMgr::calc ===
This is called every frame.
這個函數每幀呼叫一次。


* (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).
* 如果某兩個過場動畫 [[Demo]]103_0 and Demo997_0 都還沒播過的話,時間會被固定在 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.
** 那兩個過場動畫,前一個是林克走出復甦神廟後環顧海拉魯,後一個沒有使用。
* [[#Midnight checks]].
* 如果 [[AIDef:Action/AdvanceTime]] 或是其他什麼東西強制把時間定在某個值的話,那時間就會更新。
* [[#子夜檢查]]


* '''Update time of day''': there are several possible update modes. In most cases, the update mode is 0.
* '''更新時間''':有幾種更新的模式,大部分的時候是用模式 0。
{|class="wikitable"
{|class="wikitable"
! Mode !! Description
! 模式 !! 更新方式
|-
|-
| 0 || If Demo103_0 or Demo997_0 have been played, and if there is no active event (cutscene):
| 0 || 如果 Demo103_0 Demo997_0 播過,而且不是在過場動畫裡的話:
* Add (0.0083333 * elapsed frames) to the Time of Day timer. Effectively, this means that 1 in-game minute = 1 real-life second.
* 遊戲內時間(那個符點數)會增加「0.0083333 * 幀數」,本遊戲一秒三十幀,所以遊戲裡的一分鐘是現實生活中的一小時。
* If the timer is >= 360.0, which means that a day has passed, the game subtracts 360 from the timer and then performs midnight checks.
* 如果遊戲內時間 ≥ 360.0,也就是完整的一天已經過完了,那就減掉 360,然後執行子夜檢查(下面詳述)。
* 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. Effectively, this means that time will not get past 11:00 until the Great Plateau Tower is activated and the Old Man cutscene is triggered.
* 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. Effectively, this means that time will not get past 11:00 until the Great Plateau Tower is activated and the Old Man cutscene is triggered. 整句的意思是,遊戲從 5:15 開始跑,如果到 11:00 時玩家還沒啟動初始之塔而且爬下來的話,遊戲時間會固定在早上 11:00。
* The Blood Moon timer is updated too.
* 血月計時器也會增加(增加跟遊戲內時間相同的量)。
|-
|-
| 1, 13, 35 || Freeze time to 04:00
| 1, 13, 35 || Freeze time to 04:00 把時間固定在 04:00
|-
|-
| 2, 14 || Freeze time to 05:00
| 2, 14 || Freeze time to 05:00
Line 118: Line 126:
|-
|-
| 34 ||
| 34 ||
* Add (0.0083333 * elapsed frames) to the Time of Day timer.
* 遊戲內時間增加「0.0083333 * 幀數」。
* If the timer is >= 360.0, which means that a day has passed, the game subtracts 360 from the timer.
* 如果遊戲內時間 >= 360.0, 也就是完整的一天已經過完了,那就減掉 360。


'''Note''': In this state, the blood moon timer is never updated and its value is never checked either.
'''附註''': 這個模式跟模式 0 不一樣的地方在於血月計時器既不更新也不檢查。
|}
|}
* 更新 [[#日夜標籤]],更新 [[#晨午暮夜標籤]]
* If the "Bloody Moon end reserve timer" is non zero, decrement it. If the new value is zero, the WM_BloodyDay flag is cleared.(這個計時器不是用來倒數血月何時出現的那個,下面詳述。)
* 更新 [[#山林霸主]] flags.
=== 子夜檢查 ===
下面這些是子夜檢查的內容(就是每次時間從 360.0 變成 0.0 的時候做的事情)。


* Update the [[#Day/night time flag]], the [[#Time division, IsMorning, IsNoon, etc.]]
增加 WM_NumberOfDays(總共過了幾個遊戲天)。
* If the "Bloody Moon end reserve timer" is non zero, decrement it. If the new value is zero, the WM_BloodyDay flag is cleared.
* Update [[#Lord of the Mountain]] flags.


=== Midnight checks ===
'''如果「血月該出現了」''':
The following actions happen every time the timer reaches 360.0 (midnight).
(如果 WM_BloodyDay 是 true)(可以看到東方有紅色滿月就是這個狀態,雙子驛站的西納巴岡會告訴你內心有股騷動。)


WM_NumberOfDays is incremented.
* 如果沒辦法出現血月(下面有列原因),血月計時器會被設在 2880.0。
* 如果血月可以出現,播放 [https://eventviewer.zeldamods.org/viewer.html?data=/d/Demo011_0.json&params=1 Demo011_0](又到了紅月出現的時刻,林克你要小心), 然後血月計時器歸零。


'''If a Blood Moon is scheduled''' (WM_BloodyDay is true):
'''「好久沒有血月了」'''
*If Blood Moons are prohibited (see conditions below), set the Blood Moon timer to 2880.0.
*If they are allowed to happen, call [https://eventviewer.zeldamods.org/viewer.html?data=/d/Demo011_0.json&params=1 Demo011_0] and set the Blood Moon timer to 0.0.


'''Scheduling new Blood Moons''':
* 如果 FirstTouchdown flag is set(出台地了)而且血月計時器 > 2520.0 (遊戲內過了整整七天,營火快轉不算):
*If the FirstTouchdown flag is set (i.e. if the player has left the Great Plateau), and if the Blood Moon timer is > 2520.0 (7 in-game days):
** WM_BloodyDay 設為 true,代表下個子夜檢查時就會執行上面的「血月該出現了」。
**WM_BloodyDay is set to true, which means that a Blood Moon is scheduled for the next night.
** 血月計時器歸零。
**The Blood Moon timer is reset to 0.0.
* Otherwise, the "Bloody end reserve timer" is set to 150. This ensures that the WM_BloodyDay flag is cleared 5 in-game minutes (= 5 seconds in real life) after a Blood Moon occurs.
* Otherwise, the "Bloody end reserve timer" is set to 150. This ensures that the WM_BloodyDay flag is cleared 5 in-game minutes (= 5 seconds in real life) after a Blood Moon occurs.


==== Blood Moon inhibitors ====
==== 阻止血月的理由 ====
If any of the following conditions are true, the Blood Moon cutscene will not be triggered.
下面任何一件事情都會阻止血月。


* Not on MainField (main overworld)
* 不在MainField (main overworld) (在神廟裡之類的地方)
* IsInHyruleCastleArea is set
* IsInHyruleCastleArea is set(在城堡裡之類的地方)
* LastBossGanonBeastGenerateFlag is set (fighting Dark Beast Ganon)
* LastBossGanonBeastGenerateFlag is set(在打魔獸加儂)
* BloodyMoonProhibition is set
* BloodyMoonProhibition is set
* Wind_Relic_BattleStart is set (Vah Medoh battle)
* Wind_Relic_BattleStart is set (在打瓦‧梅德)
* Electric_Relic_Battle is set (Vah Naboris battle)
* Electric_Relic_Battle is set (在打瓦‧娜波力斯)
* Water_Relic_BattleTime is set (Vah Ruta battle)
* Water_Relic_BattleTime is set (在打瓦‧露塔)
* SkyMgr's field_2B4 is set to 15 and field_2B8 >= 1.0
* SkyMgr's field_2B4 is set to 15 and field_2B8 >= 1.0


However, these do not prevent the Blood Moon timer from advancing, or the WM_BloodyDay flag from being set.
請注意:即使血月被阻止,血月計時器也不會歸零,還是會繼續增加。這些理由也不能阻止 WM_BloodyDay 被設成 true。
 
注意二:瓦‧魯達尼亞看似沒有在這個表裡,但是瓦‧魯達尼亞會去設 BloodyMoonProhibition,所以血月還是不會出現。
 
=== 日夜標籤 ===


Note: Vah Rudania is missing from the list. This is normal and blood moons still cannot happen during the Vah Rudania battle sequence because the BloodyMoonProhibition flag is set during it.
這些標籤讓程式的其他部分可以用有語義的方式檢查現在是早上還是晚上等等。


=== Day/night time flag ===
From 00:00 to 06:00 (closed interval) and from 18:00 to 00:00 (closed interval), WM_DaytimeFlag is set to false and WM_NighttimeFlag is true.
From 00:00 to 06:00 (closed interval) and from 18:00 to 00:00 (closed interval), WM_DaytimeFlag is set to false and WM_NighttimeFlag is true.


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. ===
In any other case, WM_DaytimeFlag is set to true and WM_NighttimeFlag to false.
 
=== Time division, IsMorning, IsNoon, etc. === <!--T:26-->
{|class="wikitable"
{|class="wikitable"
! Start !! End !! Division !! Time type (1) !! Time type (2)
! !! !! Division !! Time type (1) !! Time type (2)
|-
|-
| 04:00 || 05:00 || 0 || MorningA || Morning_A1
| 04:00 || 05:00 || 0 || MorningA || Morning_A1
Line 186: Line 201:
| 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.


=== Moon type ===
筆記:上述的時間區間左閉右開。
The moon type is calculated based on the number of in-game days (WM_NumberOfDays). The exact formula is <code>(numberOfDays + x + 1) % 8</code><ref>0x71010E8200</ref>, where x is equal to 1 if the current time is > 180.0 (noon) and % is the modulo operator.
 
=== 月相 ===
月相取決於你在遊戲裡活了幾天 (WM_NumberOfDays)。精確的式子是 <code>(numberOfDays + x + 1) % 8</code><ref>0x71010E8200</ref>,這裡的 x 在下午的時候是 1,上午的時候是 0。 百分號是模運算(除以八的餘數)。 也就是說,每過一次正午月相就前進一格。 從 0 開始,滿月、十六夜、下弦月、殘月、新月、眉月、上弦月、十三夜。


If a moon type was set manually (for instance using [[AIDef:Action/EventSetMoonType]]), that value will be used as the moon type.
如果有什麼東西直接設定月相的話 (例如 [[AIDef:Action/EventSetMoonType]]),那月相就會是設定過的值。


The moon type is returned by [[AIDef:Query/WhatMoonName]], which some NPC event flows use to check the current moon phase. However, the moon schedule has nothing to do with the blood moon schedule.
這個函數 [[AIDef:Query/WhatMoonName]] 會回傳月相。 雙子驛站的西納巴岡在內心沒有騷動的時候會告訴你今晚的月相。 請注意:月相跟血月沒有任何關係。 血月不只會在本來應該是滿月的晚上出現,血月後也不會接到下弦月。


=== Lord of the Mountain ===
=== 山林霸主 ===
The Lord of the Mountain appears whenever the AnimalMaster_Appearance flag is set. Its value is managed by a simple state machine.
山林霸主會在 AnimalMaster_Appearance flag 是 true 的時候出現。 山林霸主出不出現是由一個有限狀態自動機控制的。


Note that whenever a stage is unloaded, the AnimalMaster_Appearance flag is reset to false.
再次強調:只要讀檔,山林霸主就會消失。


====State 0 - Wait for conditions====
====State 0 沈默狀態====
If the following three conditions are true:
如果以下全真
* The [[#Moon type]] is 5 (waxing crescent)
* [[#月相]] 是 5(眉月)
* The AnimalMaster_Existence flag is false (the LotM must not already be spawned)
* The AnimalMaster_Existence flag 是 false(山林霸主還沒出現)
* The current [[map area]] number is not 64 ("HyruleHill", presumably the Satori Mountain area)
* The current [[map area]] number is not 64 ("HyruleHill",就是林克處在薩托利山這個區域)


then the game generates a random "appearance hour" in the [0 .. 22] interval and goes into state 1.
那麼遊戲會從 [0 .. 22] 這個區間生成一個隨機的數值(這個數值代表山林霸主幾點出現), 然後進到 State 1。


====State 1 - Wait for the appearance time====
====State 1 蓄勢待發狀態====
If the player is in map area 64, the state is reset back to 0.
如果你進到 map area 64 (薩托利山這個區域)那就回到 State 0(隨機數值也作廢)。


Otherwise, the game does nothing until the current hour matches the previously generated appearance hour, at which point it sets AnimalMaster_Appearance to true (which allows the LotM to spawn) and goes into state 2.
如果你不在 map area 64,那遊戲會一直等等到現在的時間(小時)是上面生成的出現的小時。 (請注意這個檢查是每幀都做。) 這時 AnimalMaster_Appearance 設成 true,山林霸主會出現/薩托利山會發光。 然後進到 State 2。


====State 2====
====State 2 發光狀態====
After one hour has elapsed, the current day of the week is stored and the state is set to 3.
一個遊戲內小時後,遊戲會紀錄星期幾,然後進到 State 3.


====State 3====
====State 3 準備消失狀態====
After two week day changes, ''or'' [after the in-game day of the week changes and the current hour is >= the generated appearance hour], the LotM will disappear and the state will be set to 4.
「兩天之後」 or 「『過了一天』且『現在的小時 ≥ 出現的小時』」,山林霸主消失。 (意思是山林霸主只會維持整整 24 遊戲內小時/現時分鐘。)


====State 4====
====State 4 熄滅狀態====
The game waits for the moon type to be 5, before going back to state 0.
等月相是 5(眉月)的時候再進到 State 0.


== WeatherMgr ==
== WeatherMgr ==
Line 226: Line 242:
=== Weather types ===
=== Weather types ===
{|class="wikitable"
{|class="wikitable"
! Value !! Name
! !!
|-
|-
| 0 || Bluesky
| 0 || Bluesky
Line 247: Line 263:
|}
|}


[[Category:Internals]]
<!--T:40-->
[[Category:Subsystems (BotW)]]
[[Category:Internals{{#translation:}}]]
[[Category:Subsystems (BotW){{#translation:}}]]

Latest revision as of 20:04, 16 May 2020

Other languages:
WorldMgr
Subsystem
Official name Yes
Description Manages world state (time, blood moons, climates, weather, etc.)
Init function Switch 1.5.0: 00000071010F2920
Wii U 1.5.0: ???
Debug only No

World Manager (WorldMgr) 是遊戲裏的一個子系統。 它控制時間、血月、氣候、天氣、霧、風、閃電、雲、山林霸主的出現等等。

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

WorldMgr

小主管

小主管 (Sub-managers) 由 WorldMgr::init (0x71010F43C0) 生成,and inserted into a pointer array (@WorldMgr+0x5c0). 注意以下名稱不是官方名稱。

小主管及其編號 (ID)
編號 負責內容
0 TimeMgr: 時間、血月、山林霸主
1 CloudPrMgr: 程序化生成的雲
2 ShootingStarMgr: 黃色的流星跟紅色的異度神劍2流星(1.3.3版及其後)。
3 WeatherMgr: Handles "rain splash" and 氣候、天氣
4 TempMgr: 溫度[check].
5 ?
6 SkyMgr: 天空、霧[check]. Holds the configuration for all EnvPalettes, EnvAttributes, WeatherInfluences, Remains palettes, Indoor palettes and dungeon fogs.
7 DofMgr: Handles depth of field[check]. Holds depth of field related parameters.
8 ?

氣候

WorldMgr 本身(而不是小主管)負責處理氣候那一類的事情。 氣候顯然是由玩家所在的位置決定的(在火山很熱、在雪山很冷), 有趣的是,它是用攝影機所在的位置而不是林克所在的位置來決定氣候的。

TimeMgr

TimeMgr 管理所有跟時間有關的事情,例如血月何時出現,山林霸主何時出現。

遊戲內時間(小時跟分鐘)是一個 [0.0, 360.0] 範圍內的浮點數。 0.0 跟 360 代表子夜,90 大約是早晨,180.0 代表正午,依此類推。

TimeMgr::init

(init 代表初始化設定)

  • 遊戲內時間令為 78.75,早上 05:15 的意思。
  • Time for TotS environment is set to 78.75 (05:15) as well.
  • "Bloody Moon end reserve timer" is set to 0.(這個計時器不是用來倒數血月何時出現的那個,下面會詳述。)

TimeMgr::reset

This is called whenever a stage is unloaded (essentially every time the loading screen is shown). 意思是凡是讀檔就會呼叫這個函數。

  • 血月相關檢查會被延後。
  • 山林霸主的 flag 會被設為 false,意思是不要出現。

TimeMgr::calc

這個函數每幀呼叫一次。

  • (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.)(好像是沒用到的功能。)
  • 如果某兩個過場動畫 Demo103_0 and Demo997_0 都還沒播過的話,時間會被固定在 78.75(早上 05:15)。
    • 那兩個過場動畫,前一個是林克走出復甦神廟後環顧海拉魯,後一個沒有使用。
  • 如果 AIDef:Action/AdvanceTime 或是其他什麼東西強制把時間定在某個值的話,那時間就會更新。
  • #子夜檢查
  • 更新時間:有幾種更新的模式,大部分的時候是用模式 0。
模式 更新方式
0 如果 Demo103_0 或 Demo997_0 播過,而且不是在過場動畫裏的話:
  • 遊戲內時間(那個符點數)會增加「0.0083333 * 幀數」,本遊戲一秒三十幀,所以遊戲裏的一分鐘是現實生活中的一小時。
  • 如果遊戲內時間 ≥ 360.0,也就是完整的一天已經過完了,那就減掉 360,然後執行子夜檢查(下面詳述)。
  • 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. Effectively, this means that time will not get past 11:00 until the Great Plateau Tower is activated and the Old Man cutscene is triggered. 整句的意思是,遊戲從 5:15 開始跑,如果到 11:00 時玩家還沒啟動初始之塔而且爬下來的話,遊戲時間會固定在早上 11:00。
  • 血月計時器也會增加(增加跟遊戲內時間相同的量)。
1, 13, 35 Freeze time to 04:00 把時間固定在 04:00
2, 14 Freeze time to 05:00
3, 16, 36 Freeze time to 07:00
4, 19, 37 Freeze time to 10:00
5, 26, 39 Freeze time to 17:00
6, 28, 40 Freeze time to 19:00
7, 30, 41 Freeze time to 21:00
8, 11 Freeze time to 02:00
9, 42 Freeze time to 00:00
10 Freeze time to 01:00
12 Freeze time to 03:00
15 Freeze time to 06:00
17 Freeze time to 08:00
18 Freeze time to 09:00
20 Freeze time to 11:00
21 Freeze time to 12:00
22, 38 Freeze time to 13:00
23 Freeze time to 14:00
24 Freeze time to 15:00
25 Freeze time to 16:00
27 Freeze time to 18:00
29 Freeze time to 20:00
31 Freeze time to 22:00
32 Freeze time to 23:00
34
  • 遊戲內時間增加「0.0083333 * 幀數」。
  • 如果遊戲內時間 >= 360.0, 也就是完整的一天已經過完了,那就減掉 360。

附註: 這個模式跟模式 0 不一樣的地方在於血月計時器既不更新也不檢查。

  • 更新 #日夜標籤,更新 #晨午暮夜標籤
  • If the "Bloody Moon end reserve timer" is non zero, decrement it. If the new value is zero, the WM_BloodyDay flag is cleared.(這個計時器不是用來倒數血月何時出現的那個,下面詳述。)
  • 更新 #山林霸主 flags.

子夜檢查

下面這些是子夜檢查的內容(就是每次時間從 360.0 變成 0.0 的時候做的事情)。

增加 WM_NumberOfDays(總共過了幾個遊戲天)。

如果「血月該出現了」

(如果 WM_BloodyDay 是 true)(可以看到東方有紅色滿月就是這個狀態,雙子驛站的西納巴岡會告訴你內心有股騷動。)
  • 如果沒辦法出現血月(下面有列原因),血月計時器會被設在 2880.0。
  • 如果血月可以出現,播放 Demo011_0(又到了紅月出現的時刻,林克你要小心), 然後血月計時器歸零。

「好久沒有血月了」

  • 如果 FirstTouchdown flag is set(出台地了)而且血月計時器 > 2520.0 (遊戲內過了整整七天,營火快轉不算):
    • WM_BloodyDay 設為 true,代表下個子夜檢查時就會執行上面的「血月該出現了」。
    • 血月計時器歸零。
  • Otherwise, the "Bloody end reserve timer" is set to 150. This ensures that the WM_BloodyDay flag is cleared 5 in-game minutes (= 5 seconds in real life) after a Blood Moon occurs.

阻止血月的理由

下面任何一件事情都會阻止血月。

  • 不在MainField (main overworld) (在神廟裏之類的地方)
  • IsInHyruleCastleArea is set(在城堡裏之類的地方)
  • LastBossGanonBeastGenerateFlag is set(在打魔獸加儂)
  • BloodyMoonProhibition is set
  • Wind_Relic_BattleStart is set (在打瓦‧梅德)
  • Electric_Relic_Battle is set (在打瓦‧娜波力斯)
  • Water_Relic_BattleTime is set (在打瓦‧露塔)
  • SkyMgr's field_2B4 is set to 15 and field_2B8 >= 1.0

請注意:即使血月被阻止,血月計時器也不會歸零,還是會繼續增加。這些理由也不能阻止 WM_BloodyDay 被設成 true。

注意二:瓦‧魯達尼亞看似沒有在這個表裏,但是瓦‧魯達尼亞會去設 BloodyMoonProhibition,所以血月還是不會出現。

日夜標籤

這些標籤讓程式的其他部分可以用有語義的方式檢查現在是早上還是晚上等等。

From 00:00 to 06:00 (closed interval) and from 18:00 to 00:00 (closed interval), WM_DaytimeFlag is set to false and WM_NighttimeFlag is true.

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.

Division Time type (1) Time type (2)
04:00 05:00 0 MorningA Morning_A1
05:00 07:00 0 MorningA Morning_A2
07:00 10:00 1 MorningB Morning_B
10:00 13:00 2 NoonA Noon_A
13:00 17:00 3 NoonB Noon_B
17:00 19:00 4 EveningA Evening_A
19:00 21:00 5 EveningB Evening_B
21:00 00:00 6 NightA Night_A
00:00 04:00 7 NightB Night_B

筆記:上述的時間區間左閉右開。

月相

月相取決於你在遊戲裏活了幾天 (WM_NumberOfDays)。精確的式子是 (numberOfDays + x + 1) % 8[1],這裏的 x 在下午的時候是 1,上午的時候是 0。 百分號是模運算(除以八的餘數)。 也就是說,每過一次正午月相就前進一格。 從 0 開始,滿月、十六夜、下弦月、殘月、新月、眉月、上弦月、十三夜。

如果有什麼東西直接設定月相的話 (例如 AIDef:Action/EventSetMoonType),那月相就會是設定過的值。

這個函數 AIDef:Query/WhatMoonName 會回傳月相。 雙子驛站的西納巴岡在內心沒有騷動的時候會告訴你今晚的月相。 請注意:月相跟血月沒有任何關係。 血月不只會在本來應該是滿月的晚上出現,血月後也不會接到下弦月。

山林霸主

山林霸主會在 AnimalMaster_Appearance flag 是 true 的時候出現。 山林霸主出不出現是由一個有限狀態自動機控制的。

再次強調:只要讀檔,山林霸主就會消失。

State 0 沈默狀態

如果以下全真

  • #月相 是 5(眉月)
  • The AnimalMaster_Existence flag 是 false(山林霸主還沒出現)
  • The current map area number is not 64 ("HyruleHill",就是林克處在薩托利山這個區域)

那麼遊戲會從 [0 .. 22] 這個區間生成一個隨機的數值(這個數值代表山林霸主幾點出現), 然後進到 State 1。

State 1 蓄勢待發狀態

如果你進到 map area 64 (薩托利山這個區域)那就回到 State 0(隨機數值也作廢)。

如果你不在 map area 64,那遊戲會一直等等到現在的時間(小時)是上面生成的出現的小時。 (請注意這個檢查是每幀都做。) 這時 AnimalMaster_Appearance 設成 true,山林霸主會出現/薩托利山會發光。 然後進到 State 2。

State 2 發光狀態

一個遊戲內小時後,遊戲會紀錄星期幾,然後進到 State 3.

State 3 準備消失狀態

「兩天之後」 or 「『過了一天』且『現在的小時 ≥ 出現的小時』」,山林霸主消失。 (意思是山林霸主只會維持整整 24 遊戲內小時/現時分鐘。)

State 4 熄滅狀態

等月相是 5(眉月)的時候再進到 State 0.

WeatherMgr

Weather types

0 Bluesky
1 Cloudy
2 Rain
3 HeavyRain
4 Snow
5 HeavySnow
6 ThunderStorm
7 ThunderRain
8 BlueskyRain
  1. 0x71010E8200