Merge pull request #1132 from briaguya-ai/complete-mask-quest

complete mask quest
This commit is contained in:
briaguya 2022-08-10 06:41:11 -04:00 committed by GitHub
commit 35f69f6fd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 16 deletions

View File

@ -2570,6 +2570,8 @@ namespace Settings {
SkipTowerEscape.SetSelectedIndex(cvarSettings[RSK_SKIP_TOWER_ESCAPE]);
CompleteMaskQuest.SetSelectedIndex(cvarSettings[RSK_COMPLETE_MASK_QUEST]);
NightGSExpectSuns.SetSelectedIndex(cvarSettings[RSK_SKULLS_SUNS_SONG]);
// RANDOTODO implement chest shuffle with keysanity

View File

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

View File

@ -1461,7 +1461,8 @@ std::unordered_map<std::string, RandomizerSettingKey> SpoilerfileSettingNameToEn
{ "Timesaver Settings:Big Poe Target Count", RSK_BIG_POE_COUNT },
{ "Timesaver Settings:Skip Child Stealth", RSK_SKIP_CHILD_STEALTH },
{ "Timesaver Settings:Skip Epona Race", RSK_SKIP_EPONA_RACE },
{ "Timesaver Settings:Skip Tower Escape", RSK_SKIP_TOWER_ESCAPE }
{ "Timesaver Settings:Skip Tower Escape", RSK_SKIP_TOWER_ESCAPE },
{ "Timesaver Settings:Complete Mask Quest", RSK_COMPLETE_MASK_QUEST },
};
s32 Randomizer::GetItemIDFromGetItemID(s32 getItemId) {
@ -1679,6 +1680,9 @@ void Randomizer::ParseRandomizerSettingsFile(const char* spoilerFileName) {
case RSK_SHUFFLE_COWS:
case RSK_SHUFFLE_ADULT_TRADE:
case RSK_RANDOM_TRIALS:
case RSK_STARTING_DEKU_SHIELD:
case RSK_STARTING_KOKIRI_SWORD:
case RSK_COMPLETE_MASK_QUEST:
if(it.value() == "Off") {
gSaveContext.randoSettings[index].value = 0;
} else if(it.value() == "On") {
@ -1700,20 +1704,6 @@ void Randomizer::ParseRandomizerSettingsFile(const char* spoilerFileName) {
gSaveContext.randoSettings[index].value = 5;
}
break;
case RSK_STARTING_DEKU_SHIELD:
if(it.value() == "Off") {
gSaveContext.randoSettings[index].value = 0;
} else if(it.value() == "On") {
gSaveContext.randoSettings[index].value = 1;
}
break;
case RSK_STARTING_KOKIRI_SWORD:
if(it.value() == "Off") {
gSaveContext.randoSettings[index].value = 0;
} else if(it.value() == "On") {
gSaveContext.randoSettings[index].value = 1;
}
break;
case RSK_STARTING_OCARINA:
if(it.value() == "Off") {
gSaveContext.randoSettings[index].value = 0;
@ -3590,6 +3580,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_SKULLS_SUNS_SONG] = CVar_GetS32("gRandomizeGsExpectSunsSong", 0);
@ -4348,6 +4339,13 @@ void DrawRandoEditor(bool& open) {
InsertHelpHoverText(
"The tower escape sequence between Ganondorf and Ganon will be skipped."
);
PaddedSeparator();
// Complete mask quest
SohImGui::EnhancementCheckbox(Settings::CompleteMaskQuest.GetName().c_str(), "gRandomizeCompleteMaskQuest");
InsertHelpHoverText(
"Once the happy mask shop is opened, all masks will be available to be borrowed."
);
// COLUMN 2 - HINT SETTINGS
ImGui::TableNextColumn();

View File

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

View File

@ -1004,6 +1004,16 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
if (Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE)) {
gSaveContext.adultTradeItems = 0;
}
// complete mask quest
if (Randomizer_GetSettingValue(RSK_COMPLETE_MASK_QUEST)) {
gSaveContext.itemGetInf[3] |= 0x100; // Sold Keaton Mask
gSaveContext.itemGetInf[3] |= 0x200; // Sold Skull Mask
gSaveContext.itemGetInf[3] |= 0x400; // Sold Spooky Mask
gSaveContext.itemGetInf[3] |= 0x800; // bunny hood related
gSaveContext.itemGetInf[3] |= 0x8000; // Obtained Mask of Truth
gSaveContext.eventChkInf[8] |= 0x8000; // sold all masks
}
}
Save_SaveFile();