diff --git a/mm/2s2h/BenGui/BenMenuBar.cpp b/mm/2s2h/BenGui/BenMenuBar.cpp index 2c0a32784..2a83a35fe 100644 --- a/mm/2s2h/BenGui/BenMenuBar.cpp +++ b/mm/2s2h/BenGui/BenMenuBar.cpp @@ -452,6 +452,13 @@ void DrawEnhancementsMenu() { } ImGui::EndMenu(); } + if (UIWidgets::BeginMenu("Player Movement")) { + UIWidgets::CVarSliderInt("Climb speed", "gEnhancements.PlayerMovement.ClimbSpeed", 1, 5, 1, { + .tooltip = "Increases the speed at which Link climbs vines and ladders." + }); + + ImGui::EndMenu(); + } if (UIWidgets::BeginMenu("Restorations")) { UIWidgets::CVarCheckbox("Power Crouch Stab", "gEnhancements.Restorations.PowerCrouchStab", { diff --git a/mm/2s2h/Enhancements/Enhancements.cpp b/mm/2s2h/Enhancements/Enhancements.cpp index aeddce992..740869ae9 100644 --- a/mm/2s2h/Enhancements/Enhancements.cpp +++ b/mm/2s2h/Enhancements/Enhancements.cpp @@ -39,4 +39,7 @@ void InitEnhancements() { // Modes RegisterPlayAsKafei(); + // Player Movement + RegisterClimbSpeed(); + } diff --git a/mm/2s2h/Enhancements/Enhancements.h b/mm/2s2h/Enhancements/Enhancements.h index 0e0b948cc..3675d2070 100644 --- a/mm/2s2h/Enhancements/Enhancements.h +++ b/mm/2s2h/Enhancements/Enhancements.h @@ -18,6 +18,7 @@ #include "Restorations/SideRoll.h" #include "Restorations/TatlISG.h" #include "Graphics/PlayAsKafei.h" +#include "PlayerMovement/ClimbSpeed.h" #include "Songs/EnableSunsSong.h" enum AlwaysWinDoggyRaceOptions { diff --git a/mm/2s2h/Enhancements/GameInteractor/GameInteractor.h b/mm/2s2h/Enhancements/GameInteractor/GameInteractor.h index 4a04b7742..8a6f61a5b 100644 --- a/mm/2s2h/Enhancements/GameInteractor/GameInteractor.h +++ b/mm/2s2h/Enhancements/GameInteractor/GameInteractor.h @@ -40,6 +40,7 @@ typedef enum { GI_VB_PATCH_SIDEROLL, GI_VB_TATL_CONVERSATION_AVAILABLE, GI_VB_PREVENT_MASK_TRANSFORMATION_CS, + GI_VB_SET_CLIMB_SPEED, GI_VB_PREVENT_CLOCK_DISPLAY, GI_VB_SONG_AVAILABLE_TO_PLAY, GI_VB_USE_CUSTOM_CAMERA, diff --git a/mm/2s2h/Enhancements/PlayerMovement/ClimbSpeed.cpp b/mm/2s2h/Enhancements/PlayerMovement/ClimbSpeed.cpp new file mode 100644 index 000000000..f170af77a --- /dev/null +++ b/mm/2s2h/Enhancements/PlayerMovement/ClimbSpeed.cpp @@ -0,0 +1,11 @@ +#include +#include "Enhancements/GameInteractor/GameInteractor.h" + +void RegisterClimbSpeed() { + REGISTER_VB_SHOULD(GI_VB_SET_CLIMB_SPEED, { + if (CVarGetInteger("gEnhancements.PlayerMovement.ClimbSpeed", 1) >1) { + f32* speed = static_cast(opt); + *speed *= CVarGetInteger("gEnhancements.PlayerMovement.ClimbSpeed", 1); + } + }); +} diff --git a/mm/2s2h/Enhancements/PlayerMovement/ClimbSpeed.h b/mm/2s2h/Enhancements/PlayerMovement/ClimbSpeed.h new file mode 100644 index 000000000..b0596a4f9 --- /dev/null +++ b/mm/2s2h/Enhancements/PlayerMovement/ClimbSpeed.h @@ -0,0 +1,6 @@ +#ifndef PLAYER_MOVEMENT_CLIMB_SPEED_H +#define PLAYER_MOVEMENT_CLIMB_SPEED_H + +void RegisterClimbSpeed(); + +#endif // PLAYER_MOVEMENT_CLIMB_SPEED_H diff --git a/mm/src/overlays/actors/ovl_player_actor/z_player.c b/mm/src/overlays/actors/ovl_player_actor/z_player.c index 10a64dc47..0bea7c470 100644 --- a/mm/src/overlays/actors/ovl_player_actor/z_player.c +++ b/mm/src/overlays/actors/ovl_player_actor/z_player.c @@ -16000,7 +16000,9 @@ void Player_Action_50(Player* this, PlayState* play) { var_fv1 = -1.0f; } - this->skelAnime.playSpeed = var_fv1 * var_fv0; + if (GameInteractor_Should(GI_VB_SET_CLIMB_SPEED, true, &var_fv1)) { + this->skelAnime.playSpeed = var_fv1 * var_fv0; + } if (this->av2.actionVar2 >= 0) { if ((this->actor.wallPoly != NULL) && (this->actor.wallBgId != BGCHECK_SCENE)) {