Skip to content

Commit

Permalink
Skip ballad of windfish (#180)
Browse files Browse the repository at this point in the history
* skip ballad of windfish

* simplify

* convert to should

* convert to new menu?
  • Loading branch information
balloondude2 authored Jan 29, 2025
1 parent 6ec5a9a commit 4bc13b4
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mm/2s2h/BenGui/BenMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,10 @@ void BenMenu::AddEnhancements() {
AddWidget(path, "Skip Gorman Horse Race", WIDGET_CVAR_CHECKBOX)
.CVar("gEnhancements.Minigames.SkipHorseRace")
.Options(CheckboxOptions().Tooltip("Instantly win the Gorman Horse Race"));
AddWidget(path, "Skip Ballad of Windfish", WIDGET_CVAR_CHECKBOX)
.CVar("gEnhancements.Minigames.SkipBalladOfWindfish")
.Options(CheckboxOptions().Tooltip(
"Play the complete Ballad after playing in one form if you have all three transformation masks."));

path.column = 3;
AddWidget(path, "Saving", WIDGET_SEPARATOR_TEXT);
Expand Down
28 changes: 28 additions & 0 deletions mm/2s2h/Enhancements/Minigames/SkipBalladOfWindfish.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <libultraship/bridge.h>
#include "2s2h/GameInteractor/GameInteractor.h"
#include "2s2h/Enhancements/Enhancements.h"
#include "2s2h/ShipInit.hpp"

extern "C" {
#include "functions.h"
}

#define CVAR_NAME "gEnhancements.Minigames.SkipBalladOfWindfish"
#define CVAR CVarGetInteger(CVAR_NAME, 0)

void RegisterSkipBalladOfWindfish() {

COND_VB_SHOULD(VB_BALLAD_PLAYED_FORM, CVAR, {
if (INV_CONTENT(ITEM_MASK_DEKU) != ITEM_MASK_DEKU || INV_CONTENT(ITEM_MASK_GORON) != ITEM_MASK_GORON ||
INV_CONTENT(ITEM_MASK_ZORA) != ITEM_MASK_ZORA) {
return;
}

SET_WEEKEVENTREG(WEEKEVENTREG_56_10); // Played Ballad as Human
SET_WEEKEVENTREG(WEEKEVENTREG_56_20); // Played Ballad as Deku
SET_WEEKEVENTREG(WEEKEVENTREG_56_40); // Played Ballad as Zora
SET_WEEKEVENTREG(WEEKEVENTREG_56_80); // Played Ballad as Goron
});
}

static RegisterShipInitFunc initFunc(RegisterSkipBalladOfWindfish, { CVAR_NAME });
1 change: 1 addition & 0 deletions mm/2s2h/GameInteractor/GameInteractor.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ typedef enum {
VB_GORON_ROLL_INCREASE_SPIKE_LEVEL,
VB_GORON_ROLL_DISABLE_SPIKE_MODE,
VB_DEKU_LINK_SPIN_ON_LAST_HOP,
VB_BALLAD_PLAYED_FORM,
VB_CONTINUE_BANKER_DIALOGUE,
VB_FISH2_SPAWN_HEART_PIECE,
VB_PLAY_DEFEAT_CAPTAIN_SEQUENCE,
Expand Down
2 changes: 2 additions & 0 deletions mm/src/overlays/actors/ovl_En_Toto/z_en_toto.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "z_en_toto.h"
#include "objects/object_zm/object_zm.h"
#include "2s2h/GameInteractor/GameInteractor.h"

#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY)

Expand Down Expand Up @@ -523,6 +524,7 @@ s32 func_80BA46D8(EnToto* this, PlayState* play) {

s32 func_80BA4740(EnToto* this, PlayState* play) {
if (play->msgCtx.ocarinaMode == OCARINA_MODE_END) {
GameInteractor_Should(VB_BALLAD_PLAYED_FORM, true);
if (GET_PLAYER_FORM == PLAYER_FORM_HUMAN) {
SET_WEEKEVENTREG(WEEKEVENTREG_56_10);
}
Expand Down

0 comments on commit 4bc13b4

Please sign in to comment.