set starting time of day

This commit is contained in:
gymnast86
2026-04-15 19:20:44 -07:00
parent c0e83af35e
commit 1ff9421cea
3 changed files with 19 additions and 0 deletions
+2
View File
@@ -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
+11
View File
@@ -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
+6
View File
@@ -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);
}