Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libultraship
5 changes: 5 additions & 0 deletions mm/2s2h/BenGui/BenMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,11 @@ void BenMenu::AddEnhancements() {
.Options(CheckboxOptions().Tooltip(
"Fixes a bug that results in the wrong audio playing upon receiving a 4th piece of heart to "
"fill a new heart container."));
AddWidget(path, "Fix Deku Butler Shock Animation", WIDGET_CVAR_CHECKBOX)
.CVar("gEnhancements.Fixes.DekuButlerFixShockLoopAnimation")
.Options(CheckboxOptions().Tooltip(
"Fixes a bug where the Deku Butler loops the incorrect animation in the cutscene that plays after "
"freeing the Deku Princess."));

// Restorations
path = { "Enhancements", "Restorations", SECTION_COLUMN_1 };
Expand Down
24 changes: 24 additions & 0 deletions mm/2s2h/Enhancements/Fixes/FixDekuButlerShockLoopAnimation.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <libultraship/bridge/consolevariablebridge.h>
#include "2s2h/GameInteractor/GameInteractor.h"
#include "2s2h/ShipInit.hpp"

extern "C" {
#include "src/overlays/actors/ovl_En_Dno/z_en_dno.h"
}

#define CVAR_NAME "gEnhancements.Fixes.DekuButlerFixShockLoopAnimation"
#define CVAR CVarGetInteger(CVAR_NAME, 0)

#define EN_DNO_ANIM_SHOCK_LOOP 18

void RegisterDekuButlerFixShockLoopAnimation() {
COND_VB_SHOULD(VB_DEKU_BUTLER_FIX_SHOCK_ANIM, CVAR, {
EnDno* dno = va_arg(args, EnDno*);
u8* changeAnim = va_arg(args, u8*);
if (dno->animIndex == EN_DNO_ANIM_SHOCK_LOOP) {
*changeAnim = false;
}
});
}

static RegisterShipInitFunc initFunc(RegisterDekuButlerFixShockLoopAnimation, { CVAR_NAME });
8 changes: 8 additions & 0 deletions mm/2s2h/GameInteractor/GameInteractor_VanillaBehavior.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@ typedef enum {
// - `*f32` (speed)
VB_CLAMP_ANIMATION_SPEED,

// #### `result`
// ```c
// this->animIndex == EN_DNO_ANIM_SHOCK_LOOP
// ```
// #### `args`
// - `this->animIndex == EN_DNO_ANIM_SHOCK_LOOP` (bool)
VB_DEKU_BUTLER_FIX_SHOCK_ANIM,
Comment on lines +253 to +254
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking the name should be a bit more descriptive of what the vanilla behavior is. It also might be a good idea to make the comments regarding args more specific. This also needs to be moved since its not in alphabetical order.

Suggested change
// - `this->animIndex == EN_DNO_ANIM_SHOCK_LOOP` (bool)
VB_DEKU_BUTLER_FIX_SHOCK_ANIM,
// - `*EnDno` (this)
// - `*u8` (changeAnim)
VB_DEKU_BUTLER_CHANGE_SHOCK_ANIMATION,


// #### `result`
// ```c
// gSaveContext.save.saveInfo.inventory.items[SLOT_BOW] == ITEM_NONE
Expand Down
2 changes: 2 additions & 0 deletions mm/src/overlays/actors/ovl_En_Dno/z_en_dno.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "z_en_dno.h"
#include "overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "2s2h/GameInteractor/GameInteractor.h"

#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED | \
Expand Down Expand Up @@ -961,6 +962,7 @@ void func_80A73408(EnDno* this, PlayState* play) {
break;

case 2:
GameInteractor_Should(VB_DEKU_BUTLER_FIX_SHOCK_ANIM, true, this, &changeAnim);
nextAnimIndex = EN_DNO_ANIM_SHOCK_START;
break;

Expand Down
Loading