mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-10 04:46:48 -04:00
set starting time of day
This commit is contained in:
@@ -971,6 +971,8 @@ public:
|
||||
std::unordered_map<std::string, std::unordered_map<u8, u8>> mTreasureChestOverrides{};
|
||||
std::unordered_map<std::string, std::unordered_map<u8, u8>> mPoeOverrides{};
|
||||
|
||||
u8 mStartHour{0};
|
||||
|
||||
void clear();
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -2980,6 +2980,17 @@ void dComIfGs_setupRandomizerSave() {
|
||||
execItemGet(static_cast<u8>(item->GetID()));
|
||||
}
|
||||
|
||||
// Set starting time of day
|
||||
const auto startTimeSetting = world->Setting("Starting Time of Day");
|
||||
if (startTimeSetting == "Morning")
|
||||
randoData.mStartHour = 6;
|
||||
else if (startTimeSetting == "Noon")
|
||||
randoData.mStartHour = 12;
|
||||
else if (startTimeSetting == "Evening")
|
||||
randoData.mStartHour = 18;
|
||||
else if (startTimeSetting == "Night")
|
||||
randoData.mStartHour = 24;
|
||||
|
||||
DuskLog.debug("Created Rando Save");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2929,6 +2929,12 @@ int dStage_changeScene4Event(int i_exitId, s8 room_no, int i_wipe, bool param_3,
|
||||
}
|
||||
|
||||
if (timeH < 31) {
|
||||
#if TARGET_PC
|
||||
// If randomizer is active and we're loading the first spawn, set our starting time of day
|
||||
if (dComIfG_isRandomizer() && strcmp(scls_info->mStage, "F_SP103") == 0 &&
|
||||
scls_info->mRoom == 1 && scls_info->mStart == 1)
|
||||
timeH = dComIfG_getRandomizer().mStartHour;
|
||||
#endif
|
||||
dKy_set_nexttime(15.0f * timeH);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user