mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-26 03:12:18 -05:00
Add Randomizer setting for keeping Sleeping Waterfall open
This commit is contained in:
parent
24530bfbd6
commit
c9e0e32386
@ -551,6 +551,7 @@ const std::vector<const char*> randomizerCvars = {
|
||||
CVAR_RANDOMIZER_SETTING("SkipChildZelda"),
|
||||
CVAR_RANDOMIZER_SETTING("SkipEponaRace"),
|
||||
CVAR_RANDOMIZER_SETTING("SkipScarecrowsSong"),
|
||||
CVAR_RANDOMIZER_SETTING("SleepingWaterfall"),
|
||||
CVAR_RANDOMIZER_SETTING("StartingAge"),
|
||||
CVAR_RANDOMIZER_SETTING("StartingBoleroOfFire"),
|
||||
CVAR_RANDOMIZER_SETTING("StartingConsumables"),
|
||||
@ -1177,12 +1178,13 @@ const std::vector<PresetEntry> s6PresetEntries = {
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipChildZelda"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipEponaRace"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipTowerEscape"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SleepingWaterfall"), RO_WATERFALL_CLOSED),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingAge"), RO_AGE_RANDOM),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingConsumables"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingDekuShield"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMapsCompasses"), RO_DUNGEON_ITEM_LOC_STARTWITH),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingOcarina"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ZorasFountain"), 0),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ZorasFountain"), RO_ZF_CLOSED),
|
||||
};
|
||||
|
||||
const std::vector<PresetEntry> hellModePresetEntries = {
|
||||
@ -1237,16 +1239,18 @@ const std::vector<PresetEntry> hellModePresetEntries = {
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipEponaRace"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipScarecrowsSong"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SkipTowerEscape"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SleepingWaterfall"), RO_WATERFALL_OPEN),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingAge"), RO_AGE_RANDOM),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("StartingMapsCompasses"), RO_DUNGEON_ITEM_LOC_ANYWHERE),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SunlightArrows"), 1),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ZorasFountain"), 2),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ZorasFountain"), RO_ZF_OPEN),
|
||||
};
|
||||
|
||||
const std::vector<PresetEntry> BenchmarkPresetEntries = {
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("Forest"), RO_FOREST_CLOSED_DEKU),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("KakarikoGate"), RO_KAK_GATE_OPEN),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("DoorOfTime"), RO_DOOROFTIME_SONGONLY),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("SleepingWaterfall"), RO_WATERFALL_CLOSED),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("ZorasFountain"), RO_ZF_CLOSED),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("GerudoFortress"), RO_GF_NORMAL),
|
||||
PRESET_ENTRY_S32(CVAR_RANDOMIZER_SETTING("RainbowBridge"), RO_BRIDGE_DUNGEON_REWARDS),
|
||||
|
@ -43,7 +43,7 @@ void RegionTable_Init_ZorasDomain() {
|
||||
Entrance(RR_ZR_FAIRY_GROTTO, {[]{return Here(RR_ZORAS_RIVER, []{return logic->BlastOrSmash();});}}),
|
||||
Entrance(RR_THE_LOST_WOODS, {[]{return logic->HasItem(RG_SILVER_SCALE) || logic->CanUse(RG_IRON_BOOTS);}}),
|
||||
Entrance(RR_ZR_STORMS_GROTTO, {[]{return logic->CanOpenStormsGrotto();}}),
|
||||
Entrance(RR_ZR_BEHIND_WATERFALL, {[]{return logic->CanUse(RG_ZELDAS_LULLABY) || (logic->IsChild && ctx->GetTrickOption(RT_ZR_CUCCO)) || (logic->IsAdult && logic->CanUse(RG_HOVER_BOOTS) && ctx->GetTrickOption(RT_ZR_HOVERS));}}),
|
||||
Entrance(RR_ZR_BEHIND_WATERFALL, {[]{return ctx->GetOption(RSK_SLEEPING_WATERFALL).Is(RO_WATERFALL_OPEN) || logic->CanUse(RG_ZELDAS_LULLABY) || (logic->IsChild && ctx->GetTrickOption(RT_ZR_CUCCO)) || (logic->IsAdult && (ctx->GetOption(RSK_SLEEPING_WATERFALL).Is(RO_WATERFALL_CLOSED_CHILD) || (logic->CanUse(RG_HOVER_BOOTS) && ctx->GetTrickOption(RT_ZR_HOVERS))));}}),
|
||||
});
|
||||
|
||||
areaTable[RR_ZR_BEHIND_WATERFALL] = Region("ZR Behind Waterfall", "Zora River", {RA_ZORAS_RIVER}, DAY_NIGHT_CYCLE, {}, {}, {
|
||||
|
@ -18,6 +18,7 @@ extern "C" {
|
||||
#include "soh/Enhancements/randomizer/adult_trade_shuffle.h"
|
||||
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
|
||||
#include "soh/Enhancements/randomizer/randomizer_grotto.h"
|
||||
#include "src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.h"
|
||||
#include "src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h"
|
||||
#include "src/overlays/actors/ovl_En_Si/z_en_si.h"
|
||||
#include "src/overlays/actors/ovl_En_Cow/z_en_cow.h"
|
||||
@ -1612,6 +1613,8 @@ void ObjComb_RandomizerWait(ObjComb* objComb, PlayState* play) {
|
||||
}
|
||||
}
|
||||
|
||||
void BgSpot03Taki_KeepOpen(BgSpot03Taki* bgSpot03Taki, PlayState* play) { }
|
||||
|
||||
void RandomizerOnActorInitHandler(void* actorRef) {
|
||||
Actor* actor = static_cast<Actor*>(actorRef);
|
||||
|
||||
@ -1757,6 +1760,46 @@ void RandomizerOnActorInitHandler(void* actorRef) {
|
||||
bgTreemouth->unk_168 = 1.0f;
|
||||
}
|
||||
|
||||
if (actor->id == ACTOR_BG_SPOT03_TAKI) {
|
||||
Rando::Option& waterfallOption = Rando::Context::GetInstance()->GetOption(RSK_SLEEPING_WATERFALL);
|
||||
if (waterfallOption.Is(RO_WATERFALL_OPEN) || (waterfallOption.Is(RO_WATERFALL_CLOSED_CHILD) && LINK_IS_ADULT)) {
|
||||
static uint32_t bgSpot03UpdateHook = 0;
|
||||
static uint32_t bgSpot03KillHook = 0;
|
||||
|
||||
bgSpot03UpdateHook = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnActorUpdate>(
|
||||
[](void* innerActorRef) mutable {
|
||||
Actor* innerActor = static_cast<Actor*>(innerActorRef);
|
||||
Rando::Option& waterfallOption = Rando::Context::GetInstance()->GetOption(RSK_SLEEPING_WATERFALL);
|
||||
if (innerActor->id == ACTOR_BG_SPOT03_TAKI && waterfallOption.IsNot(RO_WATERFALL_CLOSED) && (waterfallOption.Is(RO_WATERFALL_OPEN) || LINK_IS_ADULT)) {
|
||||
BgSpot03Taki* bgSpot03 = static_cast<BgSpot03Taki*>(innerActorRef);
|
||||
if (bgSpot03->actionFunc == func_808ADEF0) {
|
||||
bgSpot03->actionFunc = BgSpot03Taki_KeepOpen;
|
||||
bgSpot03->state = WATERFALL_OPENED;
|
||||
bgSpot03->openingAlpha = 0.0f;
|
||||
Flags_SetSwitch(gPlayState, bgSpot03->switchFlag);
|
||||
func_8003EBF8(gPlayState, &gPlayState->colCtx.dyna, bgSpot03->dyna.bgId);
|
||||
BgSpot03Taki_ApplyOpeningAlpha(bgSpot03, 0);
|
||||
BgSpot03Taki_ApplyOpeningAlpha(bgSpot03, 1);
|
||||
|
||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnActorUpdate>(bgSpot03UpdateHook);
|
||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnSceneInit>(bgSpot03KillHook);
|
||||
bgSpot03UpdateHook = 0;
|
||||
bgSpot03KillHook = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
bgSpot03KillHook = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnSceneInit>(
|
||||
[](int16_t sceneNum) mutable {
|
||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnActorUpdate>(bgSpot03UpdateHook);
|
||||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnSceneInit>(bgSpot03KillHook);
|
||||
bgSpot03UpdateHook = 0;
|
||||
bgSpot03KillHook = 0;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//consumable bags
|
||||
if (
|
||||
actor->id == ACTOR_EN_ITEM00 &&
|
||||
|
@ -33,6 +33,15 @@ void Settings::CreateOptionDescriptions() {
|
||||
"\n"
|
||||
"Open - King Zora has already mweeped out of the way in both "
|
||||
"time periods. Ruto's Letter is removed from the item pool.";
|
||||
mOptionDescriptions[RSK_SLEEPING_WATERFALL] = "Closed - Sleeping Waterfall obstructs the entrance to Zora's "
|
||||
"Domain. Zelda's Lullaby must be played in order to open it in "
|
||||
"both time periods.\n"
|
||||
"\n"
|
||||
"Closed as child - Zelda's Lullaby is only required to open "
|
||||
"Sleeping Waterfall as child Link. It starts open as adult.\n"
|
||||
"\n"
|
||||
"Open - Sleeping Waterfall is always open in both time periods. "
|
||||
"Link may always enter Zora's Domain.";
|
||||
mOptionDescriptions[RSK_STARTING_AGE] =
|
||||
"Choose which age Link will start as.\n\n"
|
||||
"Starting as adult means you start with the Master Sword in your inventory.\n"
|
||||
|
@ -3849,6 +3849,7 @@ typedef enum {
|
||||
RSK_KAK_GATE,
|
||||
RSK_DOOR_OF_TIME,
|
||||
RSK_ZORAS_FOUNTAIN,
|
||||
RSK_SLEEPING_WATERFALL,
|
||||
RSK_STARTING_AGE,
|
||||
RSK_GERUDO_FORTRESS,
|
||||
RSK_RAINBOW_BRIDGE,
|
||||
@ -4086,6 +4087,13 @@ typedef enum {
|
||||
RO_ZF_OPEN,
|
||||
} RandoOptionZorasFountain;
|
||||
|
||||
//Sleeping Waterfall settings (closed, closed as child, open)
|
||||
typedef enum {
|
||||
RO_WATERFALL_CLOSED,
|
||||
RO_WATERFALL_CLOSED_CHILD,
|
||||
RO_WATERFALL_OPEN,
|
||||
} RandoOptionSleepingWaterfall;
|
||||
|
||||
//Starting Age settings (child, adult, random)
|
||||
typedef enum {
|
||||
RO_AGE_CHILD,
|
||||
|
@ -109,6 +109,7 @@ void Settings::CreateOptions() {
|
||||
mOptions[RSK_KAK_GATE] = Option::U8("Kakariko Gate", {"Closed", "Open"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("KakarikoGate"), mOptionDescriptions[RSK_KAK_GATE]);
|
||||
mOptions[RSK_DOOR_OF_TIME] = Option::U8("Door of Time", {"Closed", "Song only", "Open"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("DoorOfTime"), mOptionDescriptions[RSK_DOOR_OF_TIME], WidgetType::Combobox);
|
||||
mOptions[RSK_ZORAS_FOUNTAIN] = Option::U8("Zora's Fountain", {"Closed", "Closed as child", "Open"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("ZorasFountain"), mOptionDescriptions[RSK_ZORAS_FOUNTAIN]);
|
||||
mOptions[RSK_SLEEPING_WATERFALL] = Option::U8("Sleeping Waterfall", {"Closed", "Closed as child", "Open"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("SleepingWaterfall"), mOptionDescriptions[RSK_SLEEPING_WATERFALL]);
|
||||
mOptions[RSK_GERUDO_FORTRESS] = Option::U8("Gerudo Fortress", {"Normal", "Fast", "Open"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("GerudoFortress"), mOptionDescriptions[RSK_GERUDO_FORTRESS]);
|
||||
mOptions[RSK_RAINBOW_BRIDGE] = Option::U8("Rainbow Bridge", {"Vanilla", "Always open", "Stones", "Medallions", "Dungeon rewards", "Dungeons", "Tokens", "Greg"}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("RainbowBridge"), mOptionDescriptions[RSK_RAINBOW_BRIDGE], WidgetType::Combobox, RO_BRIDGE_VANILLA, false, IMFLAG_NONE);
|
||||
mOptions[RSK_RAINBOW_BRIDGE_STONE_COUNT] = Option::U8("Stone Count", {NumOpts(0, 4)}, OptionCategory::Setting, CVAR_RANDOMIZER_SETTING("StoneCount"), "", WidgetType::Slider, 3, true);
|
||||
@ -695,6 +696,7 @@ void Settings::CreateOptions() {
|
||||
&mOptions[RSK_KAK_GATE],
|
||||
&mOptions[RSK_DOOR_OF_TIME],
|
||||
&mOptions[RSK_ZORAS_FOUNTAIN],
|
||||
&mOptions[RSK_SLEEPING_WATERFALL],
|
||||
}, false, WidgetContainerType::COLUMN);
|
||||
mOptionGroups[RSG_WORLD_IMGUI] = OptionGroup::SubGroup("World Settings", {
|
||||
&mOptions[RSK_STARTING_AGE],
|
||||
@ -944,6 +946,7 @@ void Settings::CreateOptions() {
|
||||
&mOptions[RSK_KAK_GATE],
|
||||
&mOptions[RSK_DOOR_OF_TIME],
|
||||
&mOptions[RSK_ZORAS_FOUNTAIN],
|
||||
&mOptions[RSK_SLEEPING_WATERFALL],
|
||||
&mOptions[RSK_GERUDO_FORTRESS],
|
||||
&mOptions[RSK_RAINBOW_BRIDGE],
|
||||
&mOptions[RSK_RAINBOW_BRIDGE_STONE_COUNT],
|
||||
@ -1261,6 +1264,7 @@ void Settings::CreateOptions() {
|
||||
{ "Open Settings:Kakariko Gate", RSK_KAK_GATE },
|
||||
{ "Open Settings:Door of Time", RSK_DOOR_OF_TIME },
|
||||
{ "Open Settings:Zora's Fountain", RSK_ZORAS_FOUNTAIN },
|
||||
{ "Open Settings:Sleeping Waterfall", RSK_SLEEPING_WATERFALL },
|
||||
{ "World Settings:Starting Age", RSK_STARTING_AGE },
|
||||
{ "Open Settings:Gerudo Fortress", RSK_GERUDO_FORTRESS },
|
||||
{ "Open Settings:Rainbow Bridge", RSK_RAINBOW_BRIDGE },
|
||||
@ -2576,6 +2580,15 @@ void Settings::ParseJson(nlohmann::json spoilerFileJson) {
|
||||
mOptions[index].SetSelectedIndex(RO_ZF_OPEN);
|
||||
}
|
||||
break;
|
||||
case RSK_SLEEPING_WATERFALL:
|
||||
if (it.value() == "Closed") {
|
||||
mOptions[index].SetSelectedIndex(RO_WATERFALL_CLOSED);
|
||||
} else if (it.value() == "Closed as child") {
|
||||
mOptions[index].SetSelectedIndex(RO_WATERFALL_CLOSED_CHILD);
|
||||
} else if (it.value() == "Open") {
|
||||
mOptions[index].SetSelectedIndex(RO_WATERFALL_OPEN);
|
||||
}
|
||||
break;
|
||||
case RSK_STARTING_AGE:
|
||||
if (it.value() == "Child") {
|
||||
mOptions[index].SetSelectedIndex(RO_AGE_CHILD);
|
||||
|
@ -93,9 +93,6 @@ void EnDntDemo_JudgeSkipToReward(EnDntDemo* enDntDemo, PlayState* play) {
|
||||
}
|
||||
}
|
||||
|
||||
void BgSpot03Taki_KeepOpen(BgSpot03Taki* bgSpot03Taki, PlayState* play) {
|
||||
}
|
||||
|
||||
static int successChimeCooldown = 0;
|
||||
void RateLimitedSuccessChime() {
|
||||
if (successChimeCooldown == 0) {
|
||||
|
@ -30,4 +30,7 @@ void func_808ADEF0(BgSpot03Taki* bgSpot03Taki, PlayState* play);
|
||||
|
||||
void BgSpot03Taki_ApplyOpeningAlpha(BgSpot03Taki* bgSpot03Taki, s32 bufferIndex);
|
||||
|
||||
// USED IN HOOK HANDLERS ONLY -- DO NOT REFERENCE FROM z_bg_spot03_taki.c
|
||||
void BgSpot03Taki_KeepOpen(BgSpot03Taki* bgSpot03Taki, PlayState* play);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user