mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-08-12 12:18:32 -04:00
32 lines
1.2 KiB
C++
32 lines
1.2 KiB
C++
#include "soh/Enhancements/enhancementTypes.h"
|
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
|
#include "soh/ShipInit.hpp"
|
|
|
|
extern "C" {
|
|
#include "functions.h"
|
|
extern SaveContext gSaveContext;
|
|
extern PlayState* gPlayState;
|
|
}
|
|
|
|
#define CVAR_INGO_RACE_ONCE_NAME CVAR_ENHANCEMENT("IngoRaceOnce")
|
|
#define CVAR_INGO_RACE_ONCE_VALUE CVarGetInteger(CVAR_INGO_RACE_ONCE_NAME, INGO_RACE_TWICE)
|
|
|
|
static void RegisterIngoRaceOnce() {
|
|
COND_VB_SHOULD(VB_RACE_INGO, CVAR_INGO_RACE_ONCE_VALUE == INGO_RACE_NONE, {
|
|
s32 entranceIndex = va_arg(args, s32);
|
|
if (entranceIndex == 2 && (gSaveContext.eventInf[0] & 0x10) == 0) {
|
|
gPlayState->nextEntranceIndex = ENTR_LON_LON_RANCH_7;
|
|
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & ~0xF) | 0x8006;
|
|
gPlayState->transitionType = TRANS_TYPE_FADE_WHITE;
|
|
gPlayState->transitionTrigger = TRANS_TRIGGER_START;
|
|
gSaveContext.timerState = TIMER_STATE_OFF;
|
|
Environment_ForcePlaySequence(NA_BGM_INGO);
|
|
*should = false;
|
|
}
|
|
})
|
|
|
|
COND_VB_SHOULD(VB_LINK_WIN_EPONA, CVAR_INGO_RACE_ONCE_VALUE != INGO_RACE_TWICE, { *should = true; });
|
|
}
|
|
|
|
static RegisterShipInitFunc initFunc(RegisterIngoRaceOnce, { CVAR_INGO_RACE_ONCE_NAME });
|