From c484ea227b8bb2e8343485dbe041c47b1f2f4a2e Mon Sep 17 00:00:00 2001 From: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> Date: Thu, 15 Feb 2024 23:12:09 -0500 Subject: [PATCH] [Difficulty Options] Leever Spawn Rate (#3460) * Spawn Rate * Update z_en_reeba.c Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * gEnhancements * Merging issues * Added preset entry and changed timer value math * Update soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c * this should do it * Update soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c * move out of loop --------- Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> Co-authored-by: Garrett Cox --- soh/soh/Enhancements/presets.h | 1 + soh/soh/SohMenuBar.cpp | 2 ++ soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h index 025581b0d..3fede1e9b 100644 --- a/soh/soh/Enhancements/presets.h +++ b/soh/soh/Enhancements/presets.h @@ -269,6 +269,7 @@ const std::vector enhancementsCvars = { "gEnhancements.OpenAllHours", "gEnhancements.ResetNaviTimer", "gEnhancements.ScaleAdultEquimentAsChild", + "gEnhancements.LeeverSpawnRate", "gEnhancements.SwordToggle", "gEnhancements.FixFloorSwitches", "gFixZoraHintDialogue", diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index a3f91b145..3ba5030f3 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -977,6 +977,8 @@ void DrawEnhancementsMenu() { UIWidgets::Tooltip("All dogs can be traded in and will count as Richard."); UIWidgets::PaddedEnhancementSliderInt("Cuccos Stay Put Multiplier: %dx", "##CuccoStayDurationMultiplier", "gCuccoStayDurationMultiplier", 1, 5, "", 1, true, true, false); UIWidgets::Tooltip("Cuccos will stay in place longer after putting them down, by a multiple of the value of the slider."); + UIWidgets::PaddedEnhancementSliderInt("Leever Spawn Rate: %d seconds", "##LeeverSpawnRate", "gEnhancements.LeeverSpawnRate", 0, 10, "", 0, true, true, false); + UIWidgets::Tooltip("The time between leever groups spawning."); ImGui::EndMenu(); } diff --git a/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index a43dd8679..146f0deaa 100644 --- a/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -169,6 +169,10 @@ void EnEncount1_SpawnLeevers(EnEncount1* this, PlayState* play) { break; } } + int32_t modifiedSpawnRate = CVarGetInteger("gEnhancements.LeeverSpawnRate", 0); + if (modifiedSpawnRate) { + this->timer = 20 * modifiedSpawnRate; + } } } }