ADD: Enable Glitch-Useful Cutscenes option to rando

This commit is contained in:
aMannus 2022-08-10 21:51:10 +02:00
parent aba8da5257
commit e259e87588
9 changed files with 34 additions and 4 deletions

View File

@ -593,6 +593,13 @@ string_view kingZoraSpeedRandom = "King Zora will move out of the way in 1
string_view completeMaskDesc = "Once the happy mask shop is opened, all masks\n" //
"will be available to be borrowed."; //
/*------------------------------ //
| ENABLE GLITCH CUTSCENES | //
------------------------------*/ //
string_view glitchCutscenesDesc = "The cutscenes of the Poes in Forest Temple and\n" //
"Darunia in Fire Temple will not be skipped.\n" //
"These cutscenes are only useful for glitched\n" //
"gameplay and can be safely skipped otherwise."; //
/*------------------------------ //
| QUICK TEXT | //
------------------------------*/ //
string_view quickTextDesc0 = "Quick text will be unchanged, requiring\n" //

View File

@ -198,6 +198,8 @@ extern string_view kingZoraSpeedRandom;
extern string_view completeMaskDesc;
extern string_view glitchCutscenesDesc;
extern string_view quickTextDesc0;
extern string_view quickTextDesc1;
extern string_view quickTextDesc2;

View File

@ -265,6 +265,7 @@ namespace Settings {
Option NumRequiredCuccos = Option::U8 ("Cuccos to return", {NumOpts(0, 7)}, {numRequiredCuccosDesc});
Option KingZoraSpeed = Option::U8 ("King Zora Speed", {"Fast", "Vanilla", "Random"}, {kingZoraSpeedFast, kingZoraSpeedVanilla, kingZoraSpeedRandom});
Option CompleteMaskQuest = Option::Bool("Complete Mask Quest", {"Off", "On"}, {completeMaskDesc});
Option EnableGlitchCutscenes = Option::Bool("Enable Glitch-Useful Cutscenes", {"Off", "On"}, {glitchCutscenesDesc});
Option QuickText = Option::U8 ("Quick Text", {"0: Vanilla", "1: Skippable", "2: Instant", "3: Turbo"}, {quickTextDesc0, quickTextDesc1, quickTextDesc2, quickTextDesc3}, OptionCategory::Setting, QUICKTEXT_INSTANT);
Option SkipSongReplays = Option::U8 ("Skip Song Replays", {"Don't Skip", "Skip (No SFX)", "Skip (Keep SFX)"}, {skipSongReplaysDesc});
Option KeepFWWarpPoint = Option::Bool("Keep FW Warp Point", {"Off", "On"}, {keepFWWarpPointDesc});
@ -281,6 +282,7 @@ namespace Settings {
&NumRequiredCuccos,
&KingZoraSpeed,
&CompleteMaskQuest,
&EnableGlitchCutscenes,
&QuickText,
&SkipSongReplays,
&KeepFWWarpPoint,
@ -1302,6 +1304,7 @@ namespace Settings {
ctx.numRequiredCuccos = NumRequiredCuccos.Value<uint8_t>();
ctx.kingZoraSpeed = KingZoraSpeed.Value<uint8_t>();
ctx.completeMaskQuest = CompleteMaskQuest ? 1 : 0;
ctx.enableGlitchCutscenes = CompleteMaskQuest ? 1 : 0;
ctx.quickText = QuickText.Value<uint8_t>();
ctx.skipSongReplays = SkipSongReplays.Value<uint8_t>();
ctx.keepFWWarpPoint = KeepFWWarpPoint ? 1 : 0;
@ -2572,6 +2575,8 @@ namespace Settings {
CompleteMaskQuest.SetSelectedIndex(cvarSettings[RSK_COMPLETE_MASK_QUEST]);
EnableGlitchCutscenes.SetSelectedIndex(cvarSettings[RSK_ENABLE_GLITCH_CUTSCENES]);
NightGSExpectSuns.SetSelectedIndex(cvarSettings[RSK_SKULLS_SUNS_SONG]);
// RANDOTODO implement chest shuffle with keysanity

View File

@ -440,6 +440,7 @@ typedef struct {
uint8_t numRequiredCuccos;
uint8_t kingZoraSpeed;
uint8_t completeMaskQuest;
uint8_t enableGlitchCutscenes;
uint8_t quickText;
uint8_t skipSongReplays;
uint8_t keepFWWarpPoint;
@ -942,6 +943,7 @@ void UpdateSettings(std::unordered_map<RandomizerSettingKey, uint8_t> cvarSettin
extern Option NumRequiredCuccos;
extern Option KingZoraSpeed;
extern Option CompleteMaskQuest;
extern Option EnableGlitchCutscenes;
extern Option QuickText;
extern Option SkipSongReplays;
extern Option KeepFWWarpPoint;

View File

@ -348,7 +348,8 @@ static void WriteSettings(const bool printAll = false) {
setting->GetName() == "Skip Epona Race" ||
setting->GetName() == "Skip Tower Escape" ||
setting->GetName() == "Skip Child Stealth" ||
setting->GetName() == "Complete Mask Quest") {
setting->GetName() == "Complete Mask Quest" ||
setting->GetName() == "Enable Glitch-Useful Cutscenes") {
std::string settingName = menu->name + ":" + setting->GetName();
jsonData["settings"][settingName] = setting->GetSelectedOptionText();
}

View File

@ -1463,6 +1463,7 @@ std::unordered_map<std::string, RandomizerSettingKey> SpoilerfileSettingNameToEn
{ "Timesaver Settings:Skip Epona Race", RSK_SKIP_EPONA_RACE },
{ "Timesaver Settings:Skip Tower Escape", RSK_SKIP_TOWER_ESCAPE },
{ "Timesaver Settings:Complete Mask Quest", RSK_COMPLETE_MASK_QUEST },
{ "Timesaver Settings:Enable Glitch-Useful Cutscenes", RSK_ENABLE_GLITCH_CUTSCENES },
};
s32 Randomizer::GetItemIDFromGetItemID(s32 getItemId) {
@ -1683,6 +1684,7 @@ void Randomizer::ParseRandomizerSettingsFile(const char* spoilerFileName) {
case RSK_STARTING_DEKU_SHIELD:
case RSK_STARTING_KOKIRI_SWORD:
case RSK_COMPLETE_MASK_QUEST:
case RSK_ENABLE_GLITCH_CUTSCENES:
if(it.value() == "Off") {
gSaveContext.randoSettings[index].value = 0;
} else if(it.value() == "On") {
@ -3581,6 +3583,7 @@ void GenerateRandomizerImgui() {
cvarSettings[RSK_SKIP_EPONA_RACE] = CVar_GetS32("gRandomizeSkipEponaRace", 0);
cvarSettings[RSK_SKIP_TOWER_ESCAPE] = CVar_GetS32("gRandomizeSkipTowerEscape", 0);
cvarSettings[RSK_COMPLETE_MASK_QUEST] = CVar_GetS32("gRandomizeCompleteMaskQuest", 0);
cvarSettings[RSK_ENABLE_GLITCH_CUTSCENES] = CVar_GetS32("gRandomizeEnableGlitchCutscenes", 0);
cvarSettings[RSK_SKULLS_SUNS_SONG] = CVar_GetS32("gRandomizeGsExpectSunsSong", 0);
@ -4346,6 +4349,14 @@ void DrawRandoEditor(bool& open) {
InsertHelpHoverText(
"Once the happy mask shop is opened, all masks will be available to be borrowed."
);
PaddedSeparator();
// Enable Glitch-Useful Cutscenes
SohImGui::EnhancementCheckbox(Settings::EnableGlitchCutscenes.GetName().c_str(), "gRandomizeEnableGlitchCutscenes");
InsertHelpHoverText(
"The cutscenes of the Poes in Forest Temple and Darunia in Fire Temple will not be skipped. "
"These cutscenes are only useful for glitched gameplay and can be safely skipped otherwise."
);
// COLUMN 2 - HINT SETTINGS
ImGui::TableNextColumn();

View File

@ -1006,6 +1006,7 @@ typedef enum {
RSK_SKIP_EPONA_RACE,
RSK_SKIP_TOWER_ESCAPE,
RSK_COMPLETE_MASK_QUEST,
RSK_ENABLE_GLITCH_CUTSCENES,
RSK_SKULLS_SUNS_SONG,
RSK_SHUFFLE_ADULT_TRADE
} RandomizerSettingKey;

View File

@ -722,8 +722,9 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
gSaveContext.eventChkInf[4] |= 0x20; // master sword pulled
gSaveContext.eventChkInf[4] |= 0x8000; // entered master sword chamber
gSaveContext.infTable[0] |= 1;
// RANDTODO: Don't skip this scene if Don't Skip Glitch Useful Cutscenes is enabled.
gSaveContext.infTable[17] |= 0x400; // Darunia in Fire Temple
if (!Randomizer_GetSettingValue(RSK_ENABLE_GLITCH_CUTSCENES)) {
gSaveContext.infTable[17] |= 0x400; // Darunia in Fire Temple
}
gSaveContext.cutsceneIndex = 0;
Flags_SetEventChkInf(5);

View File

@ -183,7 +183,7 @@ void EnPoSisters_Init(Actor* thisx, GlobalContext* globalCtx) {
this->epoch++;
// Skip Poe Intro Cutscene
if (gSaveContext.n64ddFlag && thisx->params == 4124) {
if (gSaveContext.n64ddFlag && thisx->params == 4124 && !Randomizer_GetSettingValue(RSK_ENABLE_GLITCH_CUTSCENES)) {
Flags_SetSwitch(globalCtx, 0x1B);
Actor_Kill(thisx);
}