Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Draft] Keep Shadow Temple entrance door open through time #4552

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
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
6 changes: 6 additions & 0 deletions soh/soh/Enhancements/enhancementTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ typedef enum {
FORCED_DIALOG_SKIP_ALL
} ForcedDialogMode;

typedef enum {
PERSIST_SHADOW_DOOR_DISABLED,
PERSIST_SHADOW_DOOR_CHILD,
PERSIST_SHADOW_DOOR_BOTH
} PersistShadowDoorMode;

typedef enum {
BUNNY_HOOD_VANILLA,
BUNNY_HOOD_FAST_AND_JUMP,
Expand Down
22 changes: 22 additions & 0 deletions soh/soh/Enhancements/mods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,27 @@ void RegisterRandomizerCompasses() {
});
}

void RegisterPersistShadowDoor() {
//Change both age flags when opening Shadow Temple Door
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnSceneFlagSet>(
[](int16_t sceneNum, int16_t flagType, int16_t flag)
{
int32_t pShdwDoor = CVarGetInteger(CVAR_ENHANCEMENT("PersistShadowDoor"), PERSIST_SHADOW_DOOR_DISABLED);
int16_t childDoor = 0x1F; //child flag
int16_t adultDoor = 0x1E; //adult flag

if (pShdwDoor != PERSIST_SHADOW_DOOR_DISABLED &&
sceneNum == SCENE_GRAVEYARD &&
flagType == FLAG_SCENE_SWITCH)
{
if ((pShdwDoor == PERSIST_SHADOW_DOOR_CHILD || pShdwDoor == PERSIST_SHADOW_DOOR_BOTH) && flag == childDoor)
GameInteractor::RawAction::SetSceneFlag(SCENE_GRAVEYARD, FLAG_SCENE_SWITCH, adultDoor);
else if (pShdwDoor == PERSIST_SHADOW_DOOR_BOTH && flag == adultDoor)
GameInteractor::RawAction::SetSceneFlag(SCENE_GRAVEYARD, FLAG_SCENE_SWITCH, childDoor);
}
});
}

void InitMods() {
BossRush_RegisterHooks();
RandomizerRegisterHooks();
Expand Down Expand Up @@ -1438,4 +1459,5 @@ void InitMods() {
RegisterHurtContainerModeHandler();
RegisterPauseMenuHooks();
RandoKaleido_RegisterHooks();
RegisterPersistShadowDoor();
}
7 changes: 7 additions & 0 deletions soh/soh/SohMenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ static const char* imguiScaleOptions[4] = { "Small", "Normal", "Large", "X-Large
static const char* chestStyleMatchesContentsOptions[4] = { "Disabled", "Both", "Texture Only", "Size Only" };
static const char* skipGetItemAnimationOptions[3] = { "Disabled", "Junk Items", "All Items" };
static const char* skipForcedDialogOptions[4] = { "None", "Navi Only", "NPCs Only", "All" };
static const char* persistShadowDoorOptions[3] = { "Disabled", "Child to Adult", "Both Ways"};
static const char* bunnyHoodOptions[3] = { "Disabled", "Faster Run & Longer Jump", "Faster Run" };
static const char* mirroredWorldModes[9] = {
"Disabled", "Always", "Random", "Random (Seeded)", "Dungeons",
Expand Down Expand Up @@ -794,6 +795,12 @@ void DrawEnhancementsMenu() {
"- Not within range of Ocarina playing spots");
UIWidgets::PaddedEnhancementCheckbox("Pause Warp", CVAR_ENHANCEMENT("PauseWarp"), true, false);
UIWidgets::Tooltip("Selection of warp song in pause menu initiates warp. Disables song playback.");
UIWidgets::PaddedText("Persist Shadow Temple Door through time", true, false);
UIWidgets::EnhancementCombobox(CVAR_ENHANCEMENT("PersistShadowDoor"), persistShadowDoorOptions, PERSIST_SHADOW_DOOR_DISABLED);
UIWidgets::Tooltip(
"The Shadow Temple Door in Graveyard opens for both ages.\n"
" - Child to Adult: If you open the door as Child, it will be open as Adult\n"
" - Both Ways: If you open the door in any age, it will be open as the other too");

ImGui::EndTable();
ImGui::EndMenu();
Expand Down