diff --git a/mm/2s2h/BenGui/BenMenuBar.cpp b/mm/2s2h/BenGui/BenMenuBar.cpp index 37089aa7f3..1be3c7d6d4 100644 --- a/mm/2s2h/BenGui/BenMenuBar.cpp +++ b/mm/2s2h/BenGui/BenMenuBar.cpp @@ -605,6 +605,8 @@ void DrawEnhancementsMenu() { } UIWidgets::CVarCheckbox("Instant Putaway", "gEnhancements.Player.InstantPutaway", { .tooltip = "Allows Link to instantly puts away held item without waiting." }); + UIWidgets::CVarCheckbox("Manual Jump", "gEnhancements.Player.ManualJump", + { .tooltip = "Z + A to Jump and B while midair to Jump Attack" }); ImGui::EndMenu(); } diff --git a/mm/2s2h/Enhancements/Enhancements.cpp b/mm/2s2h/Enhancements/Enhancements.cpp index 663f257c43..f3f6701a79 100644 --- a/mm/2s2h/Enhancements/Enhancements.cpp +++ b/mm/2s2h/Enhancements/Enhancements.cpp @@ -43,6 +43,7 @@ void InitEnhancements() { RegisterClimbSpeed(); RegisterFastFlowerLaunch(); RegisterInstantPutaway(); + RegisterManualJump(); // Songs RegisterEnableSunsSong(); diff --git a/mm/2s2h/Enhancements/Enhancements.h b/mm/2s2h/Enhancements/Enhancements.h index 57c54f4140..535ccd86aa 100644 --- a/mm/2s2h/Enhancements/Enhancements.h +++ b/mm/2s2h/Enhancements/Enhancements.h @@ -25,6 +25,7 @@ #include "Restorations/TatlISG.h" #include "Graphics/PlayAsKafei.h" #include "Player/Player.h" +#include "Player/ManualJump.h" #include "Songs/EnableSunsSong.h" #include "Saving/SavingEnhancements.h" #include "Graphics/DisableBlackBars.h" diff --git a/mm/2s2h/Enhancements/GameInteractor/GameInteractor.h b/mm/2s2h/Enhancements/GameInteractor/GameInteractor.h index 1b2fdb2e9a..780fe9ad0a 100644 --- a/mm/2s2h/Enhancements/GameInteractor/GameInteractor.h +++ b/mm/2s2h/Enhancements/GameInteractor/GameInteractor.h @@ -55,6 +55,7 @@ typedef enum { GI_VB_FLIP_HOP_VARIABLE, GI_VB_DISABLE_LETTERBOX, GI_VB_CLOCK_TOWER_OPENING_CONSIDER_THIS_FIRST_CYCLE, + GI_VB_MANUAL_JUMP, } GIVanillaBehavior; typedef enum { diff --git a/mm/2s2h/Enhancements/Player/ManualJump.cpp b/mm/2s2h/Enhancements/Player/ManualJump.cpp new file mode 100644 index 0000000000..5f8f6f0a36 --- /dev/null +++ b/mm/2s2h/Enhancements/Player/ManualJump.cpp @@ -0,0 +1,10 @@ +#include +#include "Enhancements/GameInteractor/GameInteractor.h" + +void RegisterManualJump() { + REGISTER_VB_SHOULD(GI_VB_MANUAL_JUMP, { + if (CVarGetInteger("gEnhancements.Player.ManualJump", 0)) { + *should = false; + } + }); +} \ No newline at end of file diff --git a/mm/2s2h/Enhancements/Player/ManualJump.h b/mm/2s2h/Enhancements/Player/ManualJump.h new file mode 100644 index 0000000000..b9a160a5c6 --- /dev/null +++ b/mm/2s2h/Enhancements/Player/ManualJump.h @@ -0,0 +1,6 @@ +#ifndef PLAYER_MANUAL_JUMP_H +#define PLAYER_MANUAL_JUMP_H + +void RegisterManualJump(); + +#endif // PLAYER_MANUAL_JUMP_H \ No newline at end of file diff --git a/mm/2s2h/Enhancements/Player/Player.h b/mm/2s2h/Enhancements/Player/Player.h index 0bcc94156d..138cccb659 100644 --- a/mm/2s2h/Enhancements/Player/Player.h +++ b/mm/2s2h/Enhancements/Player/Player.h @@ -4,5 +4,6 @@ void RegisterClimbSpeed(); void RegisterFastFlowerLaunch(); void RegisterInstantPutaway(); +void RegisterManualJump(); #endif // PLAYER_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 f3a173303d..e53fab1e28 100644 --- a/mm/src/overlays/actors/ovl_player_actor/z_player.c +++ b/mm/src/overlays/actors/ovl_player_actor/z_player.c @@ -1631,7 +1631,7 @@ PlayerAnimationHeader* D_8085BE84[PLAYER_ANIMGROUP_MAX][PLAYER_ANIMTYPE_MAX] = { &gPlayerAnim_sude_nwait, } }; - +// Animations while on Z-Target struct_8085C2A4 D_8085C2A4[] = { /* 0 / Forward */ { @@ -7907,7 +7907,7 @@ s32 func_80839800(Player* this, PlayState* play) { } return false; } - +// Side Hops and Backflip void func_80839860(Player* this, PlayState* play, s32 arg2) { s32 pad; f32 speed = (!(arg2 & 1) ? 5.8f : 3.5f); @@ -7969,12 +7969,13 @@ s32 func_80839A84(PlayState* play, Player* this) { return true; } +// Z target but doesn't activate when you're swimming s32 Player_ActionChange_10(Player* this, PlayState* play) { if (CHECK_BTN_ALL(sPlayerControlInput->press.button, BTN_A) && (play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_2) && (sPlayerFloorType != FLOOR_TYPE_7) && (sPlayerFloorEffect != FLOOR_EFFECT_1)) { s32 temp_a2 = this->unk_AE3[this->unk_ADE]; - + // covers when link is staying put and when link is moving forward if (temp_a2 <= 0) { if (func_8082FBE8(this)) { if (this->actor.category != ACTORCAT_PLAYER) { @@ -7983,16 +7984,34 @@ s32 Player_ActionChange_10(Player* this, PlayState* play) { } else { func_80836B3C(play, this, 0.0f); } - } else if (!(this->stateFlags1 & PLAYER_STATE1_8000000) && - (Player_GetMeleeWeaponHeld(this) != PLAYER_MELEEWEAPON_NONE) && - Player_CanUpdateItems(this) && (this->transformation != PLAYER_FORM_GORON)) { - func_808395F0(play, this, PLAYER_MWA_JUMPSLASH_START, 5.0f, 5.0f); + } + // Jump/Leap (Was jump slash) + else if (!(this->stateFlags1 & PLAYER_STATE1_8000000) && + (Player_GetMeleeWeaponHeld(this) != PLAYER_MELEEWEAPON_NONE) && Player_CanUpdateItems(this) && + (this->transformation != PLAYER_FORM_GORON)) { + if (!GameInteractor_Should(GI_VB_MANUAL_JUMP, true, NULL)) { + if (this->transformation == PLAYER_FORM_ZORA) { + func_808395F0(play, this, PLAYER_MWA_JUMPSLASH_START, 5.0f, 5.0f); + } + // Leap + else if (temp_a2 == 0) { + func_80834D50(play, this, D_8085C2A4[0].unk_0, 5.8f, NA_SE_VO_LI_SWORD_N); + } + // Jump + else { + func_80834DB8(this, &gPlayerAnim_link_normal_jump, REG(69) / 100.0f, play); + } + } else { + func_808395F0(play, this, PLAYER_MWA_JUMPSLASH_START, 5.0f, 5.0f); + } + } else if (!func_80839A84(play, this)) { func_80836B3C(play, this, 0.0f); } return true; } + // covers when link is backflipping or sidehopping } else { func_80839860(this, play, temp_a2); return true;