[Enhancement] Power Crouch Stab (#273)

* power crouch stab

* update gi enum

---------

Co-authored-by: Archez <Archez@users.noreply.github.com>
This commit is contained in:
inspectredc
2024-05-22 09:05:04 -05:00
committed by Garrett Cox
co-authored by Archez
parent 63428cca5f
commit 83be8b1180
7 changed files with 30 additions and 1 deletions
+8
View File
@@ -347,6 +347,14 @@ void DrawEnhancementsMenu() {
ImGui::EndMenu();
}
if (UIWidgets::BeginMenu("Restorations")) {
UIWidgets::CVarCheckbox("Power Crouch Stab", "gEnhancements.Restorations.PowerCrouchStab", {
.tooltip = "Crouch stabs will use the power of Link's previous melee attack, as is in MM JP 1.0 and OOT."
});
ImGui::EndMenu();
}
if (UIWidgets::BeginMenu("Graphics")) {
MotionBlur_RenderMenuOptions();
ImGui::SeparatorText("Other");
+1
View File
@@ -20,6 +20,7 @@ void InitEnhancements() {
RegisterEnableSunsSong();
// Restorations
RegisterPowerCrouchStab();
RegisterSideRoll();
// Cutscenes
+1
View File
@@ -11,6 +11,7 @@
#include "Minigames/AlwaysWinDoggyRace.h"
#include "Cutscenes/SkipEntranceCutscenes.h"
#include "Cutscenes/HideTitleCards.h"
#include "Restorations/PowerCrouchStab.h"
#include "Restorations/SideRoll.h"
#include "Graphics/PlayAsKafei.h"
#include "Songs/EnableSunsSong.h"
@@ -35,6 +35,7 @@ typedef enum {
GI_VB_DOGGY_RACE_SET_MAX_SPEED,
GI_VB_LOWER_RAZOR_SWORD_DURABILITY,
GI_VB_SET_BLAST_MASK_COOLDOWN_TIMER,
GI_VB_PATCH_POWER_CROUCH_STAB,
GI_VB_PATCH_SIDEROLL,
GI_VB_PREVENT_MASK_TRANSFORMATION_CS,
GI_VB_SONG_AVAILABLE_TO_PLAY,
@@ -0,0 +1,10 @@
#include <libultraship/bridge.h>
#include "Enhancements/GameInteractor/GameInteractor.h"
void RegisterPowerCrouchStab() {
REGISTER_VB_SHOULD(GI_VB_PATCH_POWER_CROUCH_STAB, {
if (CVarGetInteger("gEnhancements.Restorations.PowerCrouchStab", 0)) {
*should = false;
}
});
}
@@ -0,0 +1,6 @@
#ifndef RESTORATIONS_POWER_CROUCH_STAB_H
#define RESTORATIONS_POWER_CROUCH_STAB_H
void RegisterPowerCrouchStab();
#endif // RESTORATIONS_POWER_CROUCH_STAB_H
@@ -9988,7 +9988,9 @@ s32 func_8083FD80(Player* this, PlayState* play) {
if (!Player_IsGoronOrDeku(this) && (Player_GetMeleeWeaponHeld(this) != PLAYER_MELEEWEAPON_NONE) &&
(this->transformation != PLAYER_FORM_ZORA) && sPlayerUseHeldItem) {
//! Calling this function sets the meleeWeaponQuads' damage properties correctly, patching "Power Crouch Stab".
func_8083375C(this, PLAYER_MWA_STAB_1H);
if (GameInteractor_Should(GI_VB_PATCH_POWER_CROUCH_STAB, true, NULL)) {
func_8083375C(this, PLAYER_MWA_STAB_1H);
}
Player_AnimationPlayOnce(play, this, &gPlayerAnim_link_normal_defense_kiru);
this->av1.actionVar1 = 1;
this->meleeWeaponAnimation = PLAYER_MWA_STAB_1H;