mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-08-12 12:18:32 -04:00
[Enhancement] Ingo Race Once (#6965)
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
#include "soh/ShipInit.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include "functions.h"
|
||||
}
|
||||
|
||||
#define CVAR_INGO_RACE_ONCE_NAME CVAR_ENHANCEMENT("IngoRaceOnce")
|
||||
#define CVAR_INGO_RACE_ONCE_VALUE CVarGetInteger(CVAR_INGO_RACE_ONCE_NAME, 0)
|
||||
|
||||
static void RegisterIngoRaceOnce() {
|
||||
COND_VB_SHOULD(VB_LINK_WIN_EPONA, CVAR_INGO_RACE_ONCE_NAME, { *should = true; });
|
||||
}
|
||||
|
||||
static RegisterShipInitFunc initFunc(RegisterIngoRaceOnce, { CVAR_INGO_RACE_ONCE_NAME });
|
||||
@@ -1528,6 +1528,14 @@ typedef enum {
|
||||
// - None
|
||||
VB_LINK_SPIN_WITH_GORON_POT,
|
||||
|
||||
// #### `result`
|
||||
// ```c
|
||||
// gSaveContext.eventInf[0] & 0x40
|
||||
// ```
|
||||
// #### `args`
|
||||
// - None
|
||||
VB_LINK_WIN_EPONA,
|
||||
|
||||
// #### `result`
|
||||
// ```c
|
||||
// !Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)
|
||||
|
||||
@@ -1620,6 +1620,11 @@ void SohMenu::AddMenuEnhancements() {
|
||||
.CVar(CVAR_ENHANCEMENT("SkipAmyPuzzle"))
|
||||
.Options(CheckboxOptions().Tooltip("Amy's block pushing puzzle instantly solved."));
|
||||
|
||||
AddWidget(path, "Ingo's Race", WIDGET_SEPARATOR_TEXT);
|
||||
AddWidget(path, "Only Race Once", WIDGET_CVAR_CHECKBOX)
|
||||
.CVar(CVAR_ENHANCEMENT("IngoRaceOnce"))
|
||||
.Options(CheckboxOptions().Tooltip("Link only needs to race Ingo once to win Epona."));
|
||||
|
||||
path.column = SECTION_COLUMN_3;
|
||||
AddWidget(path, "Rupee Diving Game", WIDGET_SEPARATOR_TEXT);
|
||||
AddWidget(path, "Time Limit: %d seconds", WIDGET_CVAR_SLIDER_INT)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "z_en_horse_game_check.h"
|
||||
#include "overlays/actors/ovl_En_Horse/z_en_horse.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
|
||||
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
|
||||
|
||||
@@ -110,7 +111,7 @@ void EnHorseGameCheck_FinishIngoRace(EnHorseGameCheckIngoRace* this, PlayState*
|
||||
gSaveContext.cutsceneIndex = 0;
|
||||
if (this->result == INGORACE_PLAYER_WIN) {
|
||||
play->nextEntranceIndex = ENTR_LON_LON_RANCH_7;
|
||||
if (gSaveContext.eventInf[0] & 0x40) {
|
||||
if (GameInteractor_Should(VB_LINK_WIN_EPONA, gSaveContext.eventInf[0] & 0x40)) {
|
||||
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0xF) | 6;
|
||||
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0x8000) | 0x8000;
|
||||
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
||||
|
||||
Reference in New Issue
Block a user