diff --git a/mm/2s2h/BenGui/BenMenu.cpp b/mm/2s2h/BenGui/BenMenu.cpp index 80027d1fa0..49c484e895 100644 --- a/mm/2s2h/BenGui/BenMenu.cpp +++ b/mm/2s2h/BenGui/BenMenu.cpp @@ -679,7 +679,8 @@ void BenMenu::AddEnhancements() { "launching out of a deku flower")); AddWidget(path, "Infinite Deku Hopping", WIDGET_CVAR_CHECKBOX) .CVar("gEnhancements.Player.InfiniteDekuHopping") - .Options(CheckboxOptions().Tooltip("Allows Deku Link to hop indefinitely in water without drowning.")); + .Options(CheckboxOptions().Tooltip("Allows Deku Link to hop indefinitely in water without drowning. This also " + "prevents the velocity loss while in the air.")); AddWidget(path, "Instant Putaway", WIDGET_CVAR_CHECKBOX) .CVar("gEnhancements.Player.InstantPutaway") .Options(CheckboxOptions().Tooltip("Allows Link to instantly puts away held item without waiting.")); diff --git a/mm/2s2h/Enhancements/Player/InfiniteDekuHopping.cpp b/mm/2s2h/Enhancements/Player/InfiniteDekuHopping.cpp index 2774b0847a..fd32213fbb 100644 --- a/mm/2s2h/Enhancements/Player/InfiniteDekuHopping.cpp +++ b/mm/2s2h/Enhancements/Player/InfiniteDekuHopping.cpp @@ -16,6 +16,16 @@ void RegisterInfiniteDekuHopping() { player->remainingHopsCounter = 5; } }); + + COND_VB_SHOULD(VB_APPLY_AIR_CONTROL, CVAR, { + f32* dekuSpeedTargetMultiplier = va_arg(args, f32*); + Player* player = GET_PLAYER(gPlayState); + + if (player->transformation == PLAYER_FORM_DEKU && player->stateFlags3 & PLAYER_STATE3_200000) { + // Deku Link's air control speedTarget gets halved, so we negate that by doubling it when deku hopping + *dekuSpeedTargetMultiplier *= 2.0f; + } + }); } static RegisterShipInitFunc initFunc(RegisterInfiniteDekuHopping, { CVAR_NAME }); diff --git a/mm/2s2h/Enhancements/Restorations/FlipHopVariable.cpp b/mm/2s2h/Enhancements/Restorations/FlipHopVariable.cpp index 74d4dd5011..aa63b3b372 100644 --- a/mm/2s2h/Enhancements/Restorations/FlipHopVariable.cpp +++ b/mm/2s2h/Enhancements/Restorations/FlipHopVariable.cpp @@ -10,10 +10,12 @@ extern "C" { #define CVAR CVarGetInteger(CVAR_NAME, 0) void RegisterVariableFlipHop() { - COND_VB_SHOULD(VB_FLIP_HOP_VARIABLE, CVAR, { + COND_VB_SHOULD(VB_APPLY_AIR_CONTROL, CVAR, { Player* player = GET_PLAYER(gPlayState); - if (player->stateFlags2 & PLAYER_STATE2_80000) { + if (player->stateFlags2 & PLAYER_STATE2_80000 && + // Deku Hopping last hop is considered a backflip/sidehop so we make sure they aren't deku hopping + !(player->transformation == PLAYER_FORM_DEKU && player->stateFlags3 & PLAYER_STATE3_200000)) { *should = false; } }); diff --git a/mm/2s2h/GameInteractor/GameInteractor.h b/mm/2s2h/GameInteractor/GameInteractor.h index 4dcc07bb89..ae1c74af73 100644 --- a/mm/2s2h/GameInteractor/GameInteractor.h +++ b/mm/2s2h/GameInteractor/GameInteractor.h @@ -59,7 +59,7 @@ typedef enum { VB_TATL_INTERUPT_MSG3, VB_TATL_INTERUPT_MSG6, VB_ITEM_BE_RESTRICTED, - VB_FLIP_HOP_VARIABLE, + VB_APPLY_AIR_CONTROL, VB_DISABLE_LETTERBOX, VB_CLOCK_TOWER_OPENING_CONSIDER_THIS_FIRST_CYCLE, VB_DRAW_SLIME_BODY_ITEM, 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 bed6285f3e..157d34d01d 100644 --- a/mm/src/overlays/actors/ovl_player_actor/z_player.c +++ b/mm/src/overlays/actors/ovl_player_actor/z_player.c @@ -15016,7 +15016,9 @@ void Player_Action_25(Player* this, PlayState* play) { s16 prevYaw = this->currentYaw; func_808378FC(play, this); - func_8083CBC4(this, speedTarget * 0.5f, yawTarget, 2.0f, 0.2f, 0.1f, 0x190); + if (GameInteractor_Should(VB_APPLY_AIR_CONTROL, true, &speedTarget)) { + func_8083CBC4(this, speedTarget * 0.5f, yawTarget, 2.0f, 0.2f, 0.1f, 0x190); + } if (BEN_ANIM_EQUAL(this->skelAnime.animation, gPlayerAnim_pn_attack)) { this->stateFlags2 |= (PLAYER_STATE2_20 | PLAYER_STATE2_40); @@ -15026,7 +15028,7 @@ void Player_Action_25(Player* this, PlayState* play) { Math_StepToF(&this->unk_B10[1], 0.0f, this->unk_B10[0]); } } else { - if (GameInteractor_Should(VB_FLIP_HOP_VARIABLE, true)) { + if (GameInteractor_Should(VB_APPLY_AIR_CONTROL, true, &speedTarget)) { func_8083CBC4(this, speedTarget, yawTarget, 1.0f, 0.05f, 0.1f, 0xC8); } }