diff --git a/include/d/actor/d_a_obj_wind_stone.h b/include/d/actor/d_a_obj_wind_stone.h index f5e52dfc94..7e44cb7108 100644 --- a/include/d/actor/d_a_obj_wind_stone.h +++ b/include/d/actor/d_a_obj_wind_stone.h @@ -27,6 +27,9 @@ public: bool chkEveOccur(); void exeModeHowl(); void exeModeMapDisp(); + #if TARGET_PC + void exeModeSetTime(); + #endif bool chkMapDispMode(); u8 getGoldWolfIdx(); diff --git a/include/dusk/settings.h b/include/dusk/settings.h index 68ea49c752..168c5ca31b 100644 --- a/include/dusk/settings.h +++ b/include/dusk/settings.h @@ -47,6 +47,7 @@ struct UserSettings { ConfigVar noMissClimbing; ConfigVar fastTears; ConfigVar instantSaves; + ConfigVar timeStones; // Preferences ConfigVar enableMirrorMode; diff --git a/src/d/actor/d_a_alink_wolf.inc b/src/d/actor/d_a_alink_wolf.inc index 2e38298090..7f4bef7e42 100644 --- a/src/d/actor/d_a_alink_wolf.inc +++ b/src/d/actor/d_a_alink_wolf.inc @@ -3868,12 +3868,7 @@ void daAlink_c::setWolfHowlNotHappen(int param_0) { } int daAlink_c::procWolfHowlDemoInit() { - if (!dComIfGp_event_compulsory(this, NULL, 0xFFFF)) { - return 0; - } - - mDemo.setSpecialDemoType(); - + #if TARGET_PC s16 name; if (field_0x27f4 != NULL) { name = fopAcM_GetName(field_0x27f4); @@ -3881,6 +3876,28 @@ int daAlink_c::procWolfHowlDemoInit() { name = fpcNm_ALINK_e; } + if (name == fpcNm_Obj_WindStone_e && !static_cast(field_0x27f4)->chkEveOccur() && dusk::getSettings().game.timeStones) { + Z2GetSeMgr()->seStart(Z2SE_READ_RIDDLE_B, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + dKy_instant_timechg(0.0f); + return 0; + } + #endif + + if (!dComIfGp_event_compulsory(this, NULL, 0xFFFF)) { + return 0; + } + + mDemo.setSpecialDemoType(); + + #if !TARGET_PC + s16 name; + if (field_0x27f4 != NULL) { + name = fopAcM_GetName(field_0x27f4); + } else { + name = fpcNm_ALINK_e; + } + #endif + if (name == fpcNm_Tag_WaraHowl_e) { shape_angle.y = field_0x27f4->shape_angle.y; current.angle.y = shape_angle.y; diff --git a/src/d/actor/d_a_obj_wind_stone.cpp b/src/d/actor/d_a_obj_wind_stone.cpp index 3158b93848..861b402d06 100644 --- a/src/d/actor/d_a_obj_wind_stone.cpp +++ b/src/d/actor/d_a_obj_wind_stone.cpp @@ -87,6 +87,9 @@ int daWindStone_c::execute() { exeModeMapDisp(); break; case 2: + #if TARGET_PC + exeModeSetTime(); + #endif break; } setModelMtx(); @@ -180,6 +183,16 @@ void daWindStone_c::exeModeMapDisp() { } } +#if TARGET_PC +void daWindStone_c::exeModeSetTime() { + attention_info.flags = 0; + if (!chkEveOccur() && chkWlfInRange() && dusk::getSettings().game.timeStones) { + attention_info.flags |= fopAc_AttnFlag_ETC_e; + attention_info.distances[fopAc_attn_ETC_e] = 65; + } +} +#endif + bool daWindStone_c::chkMapDispMode() { if (fopAcM_isSwitch(this, getSwBit2())) { return false; diff --git a/src/dusk/imgui/ImGuiFirstRunPreset.cpp b/src/dusk/imgui/ImGuiFirstRunPreset.cpp index b73eaff6e6..f42b444ec7 100644 --- a/src/dusk/imgui/ImGuiFirstRunPreset.cpp +++ b/src/dusk/imgui/ImGuiFirstRunPreset.cpp @@ -37,6 +37,7 @@ static void ApplyPresetDusk() { s.game.instantSaves.setValue(true); s.game.midnasLamentNonStop.setValue(true); s.game.enableFrameInterpolation.setValue(true); + s.game.timeStones.setValue(true); } // ========================================================================= diff --git a/src/dusk/imgui/ImGuiMenuEnhancements.cpp b/src/dusk/imgui/ImGuiMenuEnhancements.cpp index a50ec1ee4c..7827781400 100644 --- a/src/dusk/imgui/ImGuiMenuEnhancements.cpp +++ b/src/dusk/imgui/ImGuiMenuEnhancements.cpp @@ -63,6 +63,11 @@ namespace dusk { ImGui::SetTooltip("Skip the delay when writing to the Memory Card."); } + config::ImGuiCheckbox("Time Stones", getSettings().game.timeStones); + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("Allows Wolf Link to use Howling Stones to set the time to midnight."); + } + ImGui::EndMenu(); } diff --git a/src/dusk/settings.cpp b/src/dusk/settings.cpp index 9d3d873acc..a1773b1346 100644 --- a/src/dusk/settings.cpp +++ b/src/dusk/settings.cpp @@ -35,6 +35,7 @@ UserSettings g_userSettings = { .noMissClimbing {"game.noMissClimbing", false}, .fastTears {"game.fastTears", false}, .instantSaves {"game.instantSaves", false}, + .timeStones {"game.timeStones", false}, // Preferences .enableMirrorMode {"game.enableMirrorMode", false}, @@ -111,6 +112,7 @@ void registerSettings() { Register(g_userSettings.game.fastClimbing); Register(g_userSettings.game.fastTears); Register(g_userSettings.game.instantSaves); + Register(g_userSettings.game.timeStones); Register(g_userSettings.game.enableMirrorMode); Register(g_userSettings.game.invertCameraXAxis); Register(g_userSettings.game.enableBloom);