[Enhancement] Constant Distance Backflips/Sidehops (#291)

This commit is contained in:
inspectredc
2024-05-23 09:29:43 -04:00
committed by GitHub
parent 6bd469b54b
commit 00d2f95698
7 changed files with 26 additions and 3 deletions
+3
View File
@@ -489,6 +489,9 @@ void DrawEnhancementsMenu() {
}
if (UIWidgets::BeginMenu("Restorations")) {
UIWidgets::CVarCheckbox(
"Constant Distance Backflips and Sidehops", "gEnhancements.Restorations.ConstantFlipsHops",
{ .tooltip = "Backflips and Sidehops travel a constant distance as they did in OOT." });
UIWidgets::CVarCheckbox(
"Power Crouch Stab", "gEnhancements.Restorations.PowerCrouchStab",
{ .tooltip =
+1
View File
@@ -31,6 +31,7 @@ void InitEnhancements() {
RegisterPowerCrouchStab();
RegisterSideRoll();
RegisterTatlISG();
RegisterVariableFlipHop();
// Cutscenes
RegisterCutscenes();
+1
View File
@@ -13,6 +13,7 @@
#include "Masks/FastTransformation.h"
#include "Minigames/AlwaysWinDoggyRace.h"
#include "Cutscenes/Cutscenes.h"
#include "Restorations/FlipHopVariable.h"
#include "Restorations/PowerCrouchStab.h"
#include "Restorations/SideRoll.h"
#include "Restorations/TatlISG.h"
@@ -44,10 +44,10 @@ typedef enum {
GI_VB_PREVENT_CLOCK_DISPLAY,
GI_VB_SONG_AVAILABLE_TO_PLAY,
GI_VB_USE_CUSTOM_CAMERA,
GI_VB_PLAY_TRANSITION_CS,
GI_VB_TATL_INTERUPT_MSG3,
GI_VB_TATL_INTERUPT_MSG6
GI_VB_TATL_INTERUPT_MSG6,
GI_VB_FLIP_HOP_VARIABLE,
} GIVanillaBehavior;
typedef enum {
@@ -0,0 +1,10 @@
#include <libultraship/bridge.h>
#include "Enhancements/GameInteractor/GameInteractor.h"
void RegisterVariableFlipHop() {
REGISTER_VB_SHOULD(GI_VB_FLIP_HOP_VARIABLE, {
if (CVarGetInteger("gEnhancements.Restorations.ConstantFlipsHops", 0)) {
*should = false;
}
});
}
@@ -0,0 +1,6 @@
#ifndef RESTORATIONS_FLIP_HOP_VARIABLE_H
#define RESTORATIONS_FLIP_HOP_VARIABLE_H
void RegisterVariableFlipHop();
#endif // RESTORATIONS_FLIP_HOP_VARIABLE_H
@@ -14873,7 +14873,9 @@ void Player_Action_25(Player* this, PlayState* play) {
Math_StepToF(&this->unk_B10[1], 0.0f, this->unk_B10[0]);
}
} else {
func_8083CBC4(this, speedTarget, yawTarget, 1.0f, 0.05f, 0.1f, 0xC8);
if (GameInteractor_Should(GI_VB_FLIP_HOP_VARIABLE, true, NULL)) {
func_8083CBC4(this, speedTarget, yawTarget, 1.0f, 0.05f, 0.1f, 0xC8);
}
}
Player_UpdateUpperBody(this, play);