[Enhancement] Fierce Deity Anchored Backwalk Animation (#670)

* Add Fierce Deity anchored backwalk enhancement

* adjust ztarget hook to clamp speed instead of modifying animation frame logic

---------

Co-authored-by: Archez <archez39@me.com>
This commit is contained in:
Eblo
2024-09-03 23:00:11 -04:00
committed by GitHub
co-authored by Archez
parent ea8809ddd0
commit 185e761f78
7 changed files with 39 additions and 0 deletions
+4
View File
@@ -529,6 +529,10 @@ void DrawEnhancementsMenu() {
{ .tooltip = "Fixes a missing gDPSetEnvColor, which causes the ammo count to be "
"the wrong color prior to obtaining magic or other conditions." });
UIWidgets::CVarCheckbox("Fix Fierce Deity Z-Target movement",
"gEnhancements.Fixes.FierceDeityZTargetMovement",
{ .tooltip = "Fixes Fierce Deity movement being choppy when Z-targeting" });
UIWidgets::CVarCheckbox("Fix Hess and Weirdshot Crash", "gEnhancements.Fixes.HessCrash",
{ .tooltip = "Fixes a crash that can occur when performing a HESS or Weirdshot.",
.defaultValue = true });
+3
View File
@@ -30,6 +30,9 @@ void InitEnhancements() {
RegisterSkipMagicArrowEquip();
RegisterInstantRecall();
// Fixes
RegisterFierceDeityZTargetMovement();
// Graphics
RegisterDisableBlackBars();
Register3DItemDrops();
+1
View File
@@ -15,6 +15,7 @@
#include "Cheats/TimeStop.h"
#include "Cycle/EndOfCycle.h"
#include "Equipment/SkipMagicArrowEquip.h"
#include "Fixes/Fixes.h"
#include "Masks/BlastMaskKeg.h"
#include "Masks/FierceDeityAnywhere.h"
#include "Masks/NoBlastMaskCooldown.h"
@@ -0,0 +1,21 @@
#include <libultraship/bridge.h>
#include "Enhancements/GameInteractor/GameInteractor.h"
extern "C" {
#include "variables.h"
}
void RegisterFierceDeityZTargetMovement() {
REGISTER_VB_SHOULD(GI_VB_ZTARGET_SPEED_CHECK, {
Player* player = GET_PLAYER(gPlayState);
float* speedArg = (float*)opt;
// If the player is Fierce Deity and targeting,
if (player->lockOnActor != NULL && player->transformation == PLAYER_FORM_FIERCE_DEITY &&
CVarGetInteger("gEnhancements.Fixes.FierceDeityZTargetMovement", 0)) {
// 6.0f is the maximum speed of Zora/Goron/Deku link, whereas FD can be up to 10
// Clamping to 6.0 keeps z target movement similar to other transformations
*speedArg = CLAMP_MAX(*speedArg, 6.0f);
}
});
}
+6
View File
@@ -0,0 +1,6 @@
#ifndef ENHANCEMENTS_FIXES_H
#define ENHANCEMENTS_FIXES_H
void RegisterFierceDeityZTargetMovement();
#endif // ENHANCEMENTS_FIXES_H
@@ -59,6 +59,7 @@ typedef enum {
GI_VB_DISABLE_LETTERBOX,
GI_VB_CLOCK_TOWER_OPENING_CONSIDER_THIS_FIRST_CYCLE,
GI_VB_DRAW_SLIME_BODY_ITEM,
GI_VB_ZTARGET_SPEED_CHECK,
} GIVanillaBehavior;
typedef enum {
@@ -9595,6 +9595,9 @@ s32 func_8083E404(Player* this, f32 arg1, s16 arg2) {
func_8083C62C(this, func_800B7128(this) || func_8082EF20(this));
}
// Using Should hook, but ignoring return value, to be able to modify the speed argument
GameInteractor_Should(GI_VB_ZTARGET_SPEED_CHECK, false, &arg1);
temp_fv1 = fabsf(sp1C) / 0x8000;
if (((SQ(temp_fv1) * 50.0f) + 6.0f) < arg1) {
return 1;