From 86ad99f3c8b429862ca58a0ced20e9a5b2981782 Mon Sep 17 00:00:00 2001 From: Yomitht <168052978+Yomitht@users.noreply.github.com> Date: Mon, 14 Oct 2024 17:01:18 -0600 Subject: [PATCH] More Mweep (#4192) * More Mweep Adjusted the "King Zora Speed" timesaver enhancement to allow for slowing the animation down. * [Fixed] Crashing when applying preset settings Adjusted presets.h to expect a float instead of an integer for the "MweepSpeed" timesaver enhancement setting. * Cleaning some things up Deleted an unnecessary line, and switched the "King Zora Speed" option back to multiplier display instead of a percentage. * Update SohMenuBar.cpp Switched back to multiplier display --------- Co-authored-by: Malkierian --- soh/soh/Enhancements/presets.h | 10 +++++----- soh/soh/SohMenuBar.cpp | 2 +- soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h index 834432605..63871813d 100644 --- a/soh/soh/Enhancements/presets.h +++ b/soh/soh/Enhancements/presets.h @@ -562,7 +562,7 @@ const std::vector vanillaPlusPresetEntries = { // Skip Text PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1), // King Zora Speed (1 to 5) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MweepSpeed"), 2), + PRESET_ENTRY_FLOAT(CVAR_ENHANCEMENT("MweepSpeed"), 2.0f), // Faster Block Push (+0 to +5) PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), // Better Owl @@ -633,7 +633,7 @@ const std::vector enhancedPresetEntries = { // Skip Text PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1), // King Zora Speed (1 to 5) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MweepSpeed"), 5), + PRESET_ENTRY_FLOAT(CVAR_ENHANCEMENT("MweepSpeed"), 5.0f), // Faster Block Push (+0 to +5) PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), // Better Owl @@ -765,7 +765,7 @@ const std::vector randomizerPresetEntries = { // Skip Text PRESET_ENTRY_S32(CVAR_ENHANCEMENT("SkipText"), 1), // King Zora Speed (1 to 5) - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MweepSpeed"), 5), + PRESET_ENTRY_FLOAT(CVAR_ENHANCEMENT("MweepSpeed"), 5.0f), // Faster Block Push (+0 to +5) PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), // Better Owl @@ -914,7 +914,7 @@ const std::vector randomizerPresetEntries = { const std::vector spockRacePresetEntries = { PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("LogicRules"), 0), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("TextSpeed"), 5), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MweepSpeed"), 5), + PRESET_ENTRY_FLOAT(CVAR_ENHANCEMENT("MweepSpeed"), 5.0f), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("ClimbSpeed"), 4), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterBlockPush"), 5), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("FasterHeavyBlockLift"), 1), @@ -1034,7 +1034,7 @@ const std::vector spockRaceNoLogicPresetEntries = { PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MMBunnyHood"), BUNNY_HOOD_FAST), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MarketSneak"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MaskSelect"), 1), - PRESET_ENTRY_S32(CVAR_ENHANCEMENT("MweepSpeed"), 5), + PRESET_ENTRY_FLOAT(CVAR_ENHANCEMENT("MweepSpeed"), 5.0f), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoForcedNavi"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("NoInputForCredits"), 1), PRESET_ENTRY_S32(CVAR_ENHANCEMENT("PauseAnyCursor"), 1), diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index d30626fae..b57648ba3 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -667,7 +667,7 @@ void DrawEnhancementsMenu() { UIWidgets::PaddedEnhancementSliderInt("Text Speed: %dx", "##TEXTSPEED", CVAR_ENHANCEMENT("TextSpeed"), 1, 5, "", 1, true, false, true); UIWidgets::PaddedEnhancementCheckbox("Skip Text", CVAR_ENHANCEMENT("SkipText"), false, true); UIWidgets::Tooltip("Holding down B skips text"); - UIWidgets::PaddedEnhancementSliderInt("King Zora Speed: %dx", "##MWEEPSPEED", CVAR_ENHANCEMENT("MweepSpeed"), 1, 5, "", 1, true, false, true); + UIWidgets::PaddedEnhancementSliderFloat("King Zora Speed: %.2fx", "##MWEEPSPEED", CVAR_ENHANCEMENT("MweepSpeed"), 0.1f, 5.0f, "", 1.0f, false, false, true); UIWidgets::PaddedEnhancementSliderInt("Vine/Ladder Climb speed +%d", "##CLIMBSPEED", CVAR_ENHANCEMENT("ClimbSpeed"), 0, 12, "", 0, true, false, true); UIWidgets::PaddedEnhancementSliderInt("Block pushing speed +%d", "##BLOCKSPEED", CVAR_ENHANCEMENT("FasterBlockPush"), 0, 5, "", 0, true, false, true); UIWidgets::PaddedEnhancementSliderInt("Crawl speed %dx", "##CRAWLSPEED", CVAR_ENHANCEMENT("CrawlSpeed"), 1, 4, "", 1, true, false, true); diff --git a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c index 2bef0d30f..69b2d5a11 100644 --- a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -350,7 +350,7 @@ s32 EnKz_FollowPath(EnKz* this, PlayState* play) { pathDiffZ = pointPos->z - this->actor.world.pos.z; Math_SmoothStepToS(&this->actor.world.rot.y, (Math_FAtan2F(pathDiffX, pathDiffZ) * (0x8000 / M_PI)), 0xA, 0x3E8, 1); - if ((SQ(pathDiffX) + SQ(pathDiffZ)) < 10.0f * CVarGetInteger(CVAR_ENHANCEMENT("MweepSpeed"), 1)) { + if ((SQ(pathDiffX) + SQ(pathDiffZ)) < 10.0f * CVarGetFloat(CVAR_ENHANCEMENT("MweepSpeed"), 1.0f)) { this->waypoint++; if (this->waypoint >= path->count) { this->waypoint = 0; @@ -445,7 +445,7 @@ void EnKz_SetupMweep(EnKz* this, PlayState* play) { initPos.z += 260.0f; Play_CameraSetAtEye(play, this->cutsceneCamera, &pos, &initPos); Player_SetCsActionWithHaltedActors(play, &this->actor, 8); - this->actor.speedXZ = 0.1f * CVarGetInteger(CVAR_ENHANCEMENT("MweepSpeed"), 1); + this->actor.speedXZ = 0.1f * CVarGetFloat(CVAR_ENHANCEMENT("MweepSpeed"), 1.0f); this->actionFunc = EnKz_Mweep; }