diff --git a/soh/include/z64save.h b/soh/include/z64save.h index 3f03c9c76..8d3acf22f 100644 --- a/soh/include/z64save.h +++ b/soh/include/z64save.h @@ -284,8 +284,7 @@ typedef struct { /* 0x1428 */ u16 pendingSaleMod; // #region SOH [General] // Upstream TODO: Move these to their own struct or name to more obviously specific to SoH - /* */ uint32_t isMasterQuest; - /* */ uint32_t isBossRush; + /* */ uint8_t questId; /* */ uint32_t isBossRushPaused; /* */ uint8_t bossRushOptions[BOSSRUSH_OPTIONS_AMOUNT]; /* */ u8 mqDungeonCount; @@ -328,6 +327,18 @@ typedef struct { // #endregion } SaveContext; // size = 0x1428 +typedef enum { + /* 00 */ QUEST_NORMAL, + /* 01 */ QUEST_MASTER, + /* 02 */ QUEST_RANDOMIZER, + /* 03 */ QUEST_BOSSRUSH, +} Quest; + +#define IS_VANILLA (gSaveContext.questId == QUEST_NORMAL) +#define IS_MASTER_QUEST (gSaveContext.questId == QUEST_MASTER) +#define IS_RANDO (gSaveContext.questId == QUEST_RANDOMIZER) +#define IS_BOSS_RUSH (gSaveContext.questId == QUEST_BOSSRUSH) + typedef enum { /* 0x00 */ BTN_ENABLED, /* 0xFF */ BTN_DISABLED = 0xFF diff --git a/soh/soh/Enhancements/boss-rush/BossRush.cpp b/soh/soh/Enhancements/boss-rush/BossRush.cpp index a4952148f..d35b8825e 100644 --- a/soh/soh/Enhancements/boss-rush/BossRush.cpp +++ b/soh/soh/Enhancements/boss-rush/BossRush.cpp @@ -235,7 +235,7 @@ void BossRush_HandleBlueWarpHeal(PlayState* play) { } void BossRush_HandleCompleteBoss(PlayState* play) { - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { return; } diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index cf60e61da..6636f5407 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -708,7 +708,7 @@ void DrawInventoryTab() { ImVec2(0, 0), ImVec2(1, 1), 0)) { gSaveContext.inventory.items[selectedIndex] = slotEntry.id; // Set adult trade item flag if you're playing adult trade shuffle in rando - if (gSaveContext.n64ddFlag && + if (IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_ADULT_TRADE) && selectedIndex == SLOT_TRADE_ADULT && slotEntry.id >= ITEM_POCKET_EGG && slotEntry.id <= ITEM_CLAIM_CHECK) { @@ -753,7 +753,7 @@ void DrawInventoryTab() { // Trade quest flags are only used when shuffling the trade sequence, so // don't show this if it isn't needed. - if (gSaveContext.n64ddFlag && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_ADULT_TRADE) + if (IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_ADULT_TRADE) && ImGui::TreeNode("Adult trade quest items")) { for (int i = ITEM_POCKET_EGG; i <= ITEM_CLAIM_CHECK; i++) { DrawBGSItemFlag(i); @@ -1080,7 +1080,7 @@ void DrawFlagsTab() { // If playing a Randomizer Save with Shuffle Skull Tokens on anything other than "Off" we don't want to keep // GS Token Count updated, since Gold Skulltulas killed will not correlate to GS Tokens Collected. - if (!(gSaveContext.n64ddFlag && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_TOKENS) != RO_TOKENSANITY_OFF)) { + if (!(IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_TOKENS) != RO_TOKENSANITY_OFF)) { static bool keepGsCountUpdated = true; ImGui::Checkbox("Keep GS Count Updated", &keepGsCountUpdated); UIWidgets::InsertHelpHoverText("Automatically adjust the number of gold skulltula tokens acquired based on set flags."); @@ -1096,7 +1096,7 @@ void DrawFlagsTab() { for (int i = 0; i < flagTables.size(); i++) { const FlagTable& flagTable = flagTables[i]; - if (flagTable.flagTableType == RANDOMIZER_INF && !gSaveContext.n64ddFlag && !gSaveContext.isBossRush) { + if (flagTable.flagTableType == RANDOMIZER_INF && !IS_RANDO && !IS_BOSS_RUSH) { continue; } @@ -1290,7 +1290,7 @@ void DrawEquipmentTab() { "Giant (500)", }; // only display Tycoon wallet if you're in a save file that would allow it. - if (gSaveContext.n64ddFlag && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHOPSANITY) > RO_SHOPSANITY_ZERO_ITEMS) { + if (IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHOPSANITY) > RO_SHOPSANITY_ZERO_ITEMS) { const std::string walletName = "Tycoon (999)"; walletNamesImpl.push_back(walletName); } diff --git a/soh/soh/Enhancements/enemyrandomizer.cpp b/soh/soh/Enhancements/enemyrandomizer.cpp index 454fe43c1..a89400844 100644 --- a/soh/soh/Enhancements/enemyrandomizer.cpp +++ b/soh/soh/Enhancements/enemyrandomizer.cpp @@ -234,7 +234,7 @@ extern "C" uint8_t GetRandomizedEnemy(PlayState* play, int16_t *actorId, f32 *po EnemyEntry GetRandomizedEnemyEntry(uint32_t seed) { if (CVarGetInteger("gRandomizedEnemies", ENEMY_RANDOMIZER_OFF) == ENEMY_RANDOMIZER_RANDOM_SEEDED) { - uint32_t finalSeed = seed + (gSaveContext.n64ddFlag ? gSaveContext.finalSeed : gSaveContext.sohStats.fileCreatedAt); + uint32_t finalSeed = seed + (IS_RANDO ? gSaveContext.finalSeed : gSaveContext.sohStats.fileCreatedAt); Random_Init(finalSeed); } diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index 927ae1870..634460672 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -231,9 +231,9 @@ void RegisterOcarinaTimeTravel() { gPlayState->msgCtx.lastPlayedSong == OCARINA_SONG_TIME && !nearbyTimeBlockEmpty && !nearbyTimeBlock && !nearbyOcarinaSpot && !nearbyFrogs) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { CVarSetInteger("gSwitchTimeline", 1); - } else if (!gSaveContext.n64ddFlag && !nearbyDoorOfTime) { + } else if (!IS_RANDO && !nearbyDoorOfTime) { // This check is made for when Link is learning the Song Of Time in a vanilla save file that load a // Temple of Time scene where the only object present is the Door of Time CVarSetInteger("gSwitchTimeline", 1); @@ -469,7 +469,7 @@ void RegisterHyperBosses() { uint8_t hyperBossesActive = CVarGetInteger("gHyperBosses", 0) || - (gSaveContext.isBossRush && + (IS_BOSS_RUSH && gSaveContext.bossRushOptions[BR_OPTIONS_HYPERBOSSES] == BR_CHOICE_HYPERBOSSES_YES); // Don't apply during cutscenes because it causes weird behaviour and/or crashes on some bosses. @@ -581,7 +581,7 @@ void UpdateMirrorModeState(int32_t sceneNum) { (sceneNum == SCENE_GANON_BOSS); if (mirroredMode == MIRRORED_WORLD_RANDOM_SEEDED || mirroredMode == MIRRORED_WORLD_DUNGEONS_RANDOM_SEEDED) { - uint32_t seed = sceneNum + (gSaveContext.n64ddFlag ? gSaveContext.finalSeed : gSaveContext.sohStats.fileCreatedAt); + uint32_t seed = sceneNum + (IS_RANDO ? gSaveContext.finalSeed : gSaveContext.sohStats.fileCreatedAt); Random_Init(seed); } diff --git a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp index 1c880c21d..6a7f2dc6c 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp @@ -380,63 +380,63 @@ bool fortressFast; bool fortressNormal; void LoadSettings() { - //If in randomzer (n64ddFlag), then get the setting and check if in general we should be showing the settings + //If in randomzer, then get the setting and check if in general we should be showing the settings //If in vanilla, _try_ to show items that at least are needed for 100% - showShops = gSaveContext.n64ddFlag ? ( + showShops = IS_RANDO ? ( OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHOPSANITY) != RO_SHOPSANITY_OFF && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHOPSANITY) != RO_SHOPSANITY_ZERO_ITEMS) : false; - showBeans = gSaveContext.n64ddFlag ? + showBeans = IS_RANDO ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_MAGIC_BEANS) == RO_GENERIC_YES : true; - showScrubs = gSaveContext.n64ddFlag ? + showScrubs = IS_RANDO ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_SCRUBS) != RO_SCRUBS_OFF : false; - showMerchants = gSaveContext.n64ddFlag ? + showMerchants = IS_RANDO ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_MERCHANTS) != RO_SHUFFLE_MERCHANTS_OFF : true; - showCows = gSaveContext.n64ddFlag ? + showCows = IS_RANDO ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_COWS) == RO_GENERIC_YES : false; - showAdultTrade = gSaveContext.n64ddFlag ? + showAdultTrade = IS_RANDO ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_ADULT_TRADE) == RO_GENERIC_YES : true; - showKokiriSword = gSaveContext.n64ddFlag ? + showKokiriSword = IS_RANDO ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_KOKIRI_SWORD) == RO_GENERIC_YES : true; - showWeirdEgg = gSaveContext.n64ddFlag ? + showWeirdEgg = IS_RANDO ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_WEIRD_EGG) == RO_GENERIC_YES : true; - showGerudoCard = gSaveContext.n64ddFlag ? + showGerudoCard = IS_RANDO ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_GERUDO_MEMBERSHIP_CARD) == RO_GENERIC_YES : true; - showFrogSongRupees = gSaveContext.n64ddFlag ? + showFrogSongRupees = IS_RANDO ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_FROG_SONG_RUPEES) == RO_GENERIC_YES : false; - showStartingMapsCompasses = gSaveContext.n64ddFlag ? + showStartingMapsCompasses = IS_RANDO ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_STARTING_MAPS_COMPASSES) != RO_DUNGEON_ITEM_LOC_VANILLA : false; - showKeysanity = gSaveContext.n64ddFlag ? + showKeysanity = IS_RANDO ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_KEYSANITY) != RO_DUNGEON_ITEM_LOC_VANILLA : false; - showBossKeysanity = gSaveContext.n64ddFlag ? + showBossKeysanity = IS_RANDO ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_BOSS_KEYSANITY) != RO_DUNGEON_ITEM_LOC_VANILLA : false; - showGerudoFortressKeys = gSaveContext.n64ddFlag ? + showGerudoFortressKeys = IS_RANDO ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_GERUDO_KEYS) != RO_GERUDO_KEYS_VANILLA : false; - showGanonBossKey = gSaveContext.n64ddFlag ? + showGanonBossKey = IS_RANDO ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_GANONS_BOSS_KEY) != RO_GANON_BOSS_KEY_VANILLA : false; - showOcarinas = gSaveContext.n64ddFlag ? + showOcarinas = IS_RANDO ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_OCARINA) == RO_GENERIC_YES : false; - show100SkullReward = gSaveContext.n64ddFlag ? + show100SkullReward = IS_RANDO ? OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_100_GS_REWARD) == RO_GENERIC_YES : false; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { switch (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHUFFLE_TOKENS)) { case RO_TOKENSANITY_ALL: showOverworldTokens = true; @@ -747,7 +747,7 @@ bool HasItemBeenCollected(RandomizerCheckObject obj) { case SpoilerCollectionCheckType::SPOILER_CHK_GRAVEDIGGER: // Gravedigger has a fix in place that means one of two save locations. Check both. return (gSaveContext.itemGetInf[1] & 0x1000) || // vanilla flag - ((gSaveContext.n64ddFlag || CVarGetInteger("gGravediggingTourFix", 0)) && + ((IS_RANDO || CVarGetInteger("gGravediggingTourFix", 0)) && gSaveContext.sceneFlags[scene].collect & (1 << flag)); // rando/fix flag default: return false; @@ -831,7 +831,7 @@ void DrawLocation(RandomizerCheckObject rcObj, RandomizerCheckShow* thisCheckSta case RCSHOW_SAVED: case RCSHOW_CHECKED: case RCSHOW_SCUMMED: - if (gSaveContext.n64ddFlag) + if (IS_RANDO) txt = OTRGlobals::Instance->gRandomizer ->EnumToSpoilerfileGetName[gSaveContext.itemLocations[rcObj.rc].get.rgID][gSaveContext.language]; else if (gSaveContext.language == LANGUAGE_ENG) @@ -843,7 +843,7 @@ void DrawLocation(RandomizerCheckObject rcObj, RandomizerCheckShow* thisCheckSta txt = "Skipped"; //TODO language break; case RCSHOW_SEEN: - if (gSaveContext.n64ddFlag) + if (IS_RANDO) txt = OTRGlobals::Instance->gRandomizer ->EnumToSpoilerfileGetName[gSaveContext.itemLocations[rcObj.rc].get.fakeRgID][gSaveContext.language]; else if (gSaveContext.language == LANGUAGE_ENG) diff --git a/soh/soh/Enhancements/tts/tts.cpp b/soh/soh/Enhancements/tts/tts.cpp index 3387bfd21..0fde40656 100644 --- a/soh/soh/Enhancements/tts/tts.cpp +++ b/soh/soh/Enhancements/tts/tts.cpp @@ -722,22 +722,22 @@ void RegisterOnUpdateMainMenuSelection() { if (!CVarGetInteger("gA11yTTS", 0)) return; switch (questIndex) { - case FS_QUEST_NORMAL: { + case QUEST_NORMAL: { auto translation = GetParameritizedText("quest_sel_vanilla", TEXT_BANK_FILECHOOSE, nullptr); SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); break; } - case FS_QUEST_MASTER: { + case QUEST_MASTER: { auto translation = GetParameritizedText("quest_sel_mq", TEXT_BANK_FILECHOOSE, nullptr); SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); break; } - case FS_QUEST_RANDOMIZER: { + case QUEST_RANDOMIZER: { auto translation = GetParameritizedText("quest_sel_randomizer", TEXT_BANK_FILECHOOSE, nullptr); SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); break; } - case FS_QUEST_BOSSRUSH: { + case QUEST_BOSSRUSH: { auto translation = GetParameritizedText("quest_sel_boss_rush", TEXT_BANK_FILECHOOSE, nullptr); SpeechSynthesizer::Instance->Speak(translation.c_str(), GetLanguageCode()); break; diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index a9cf62515..74ca8dc07 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1110,11 +1110,11 @@ uint32_t IsSceneMasterQuest(s16 sceneNum) { if (OTRGlobals::Instance->HasMasterQuest()) { if (!OTRGlobals::Instance->HasOriginal()) { value = 1; - } else if (gSaveContext.isMasterQuest) { + } else if (IS_MASTER_QUEST) { value = 1; } else { value = 0; - if (gSaveContext.n64ddFlag && + if (IS_RANDO && !OTRGlobals::Instance->gRandomizer->masterQuestDungeons.empty() && OTRGlobals::Instance->gRandomizer->masterQuestDungeons.contains(sceneNum)) { value = 1; @@ -1966,7 +1966,7 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) { const int maxBufferSize = sizeof(font->msgBuf); CustomMessage messageEntry; s16 actorParams = 0; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { Player* player = GET_PLAYER(play); if (textId == TEXT_RANDOMIZER_CUSTOM_ITEM) { if (player->getItemEntry.getItemId == RG_ICE_TRAP) { @@ -2131,14 +2131,14 @@ extern "C" int CustomMessage_RetrieveIfExists(PlayState* play) { // RANDOTODO: Implement a way to determine if an item came from a skulltula and // inject the auto-dismiss control code if it did. if (CVarGetInteger("gSkulltulaFreeze", 0) != 0 && - !(gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_TOKENS) != RO_TOKENSANITY_OFF)) { + !(IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_TOKENS) != RO_TOKENSANITY_OFF)) { textId = TEXT_GS_NO_FREEZE; } else { textId = TEXT_GS_FREEZE; } // In vanilla, GS token count is incremented prior to the text box displaying // In rando we need to bump the token count by one to show the correct count - s16 gsCount = gSaveContext.inventory.gsTokens + (gSaveContext.n64ddFlag ? 1 : 0); + s16 gsCount = gSaveContext.inventory.gsTokens + (IS_RANDO ? 1 : 0); messageEntry = CustomMessageManager::Instance->RetrieveMessage(customMessageTableID, textId); messageEntry.Replace("{{gsCount}}", std::to_string(gsCount)); } diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index 9736a3e22..4e84bfab5 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -286,7 +286,7 @@ void SaveManager::LoadRandomizerVersion2() { void SaveManager::SaveRandomizer(SaveContext* saveContext, int sectionID, bool fullSave) { - if(!saveContext->n64ddFlag) return; + if(saveContext->questId != QUEST_RANDOMIZER) return; SaveManager::Instance->SaveArray("itemLocations", RC_MAX, [&](size_t i) { SaveManager::Instance->SaveStruct("", [&]() { @@ -456,12 +456,12 @@ void SaveManager::InitMeta(int fileNum) { fileMetaInfo[fileNum].seedHash[i] = gSaveContext.seedIcons[i]; } - fileMetaInfo[fileNum].randoSave = gSaveContext.n64ddFlag; + fileMetaInfo[fileNum].randoSave = IS_RANDO; // If the file is marked as a Master Quest file or if we're randomized and have at least one master quest dungeon, we need the mq otr. - fileMetaInfo[fileNum].requiresMasterQuest = gSaveContext.isMasterQuest > 0 || (gSaveContext.n64ddFlag && gSaveContext.mqDungeonCount > 0); + fileMetaInfo[fileNum].requiresMasterQuest = IS_MASTER_QUEST || (IS_RANDO && gSaveContext.mqDungeonCount > 0); // If the file is not marked as Master Quest, it could still theoretically be a rando save with all 12 MQ dungeons, in which case // we don't actually require a vanilla OTR. - fileMetaInfo[fileNum].requiresOriginal = !gSaveContext.isMasterQuest && (!gSaveContext.n64ddFlag || gSaveContext.mqDungeonCount < 12); + fileMetaInfo[fileNum].requiresOriginal = !IS_MASTER_QUEST && (!IS_RANDO || gSaveContext.mqDungeonCount < 12); fileMetaInfo[fileNum].buildVersionMajor = gSaveContext.sohStats.buildVersionMajor; fileMetaInfo[fileNum].buildVersionMinor = gSaveContext.sohStats.buildVersionMinor; @@ -617,7 +617,7 @@ void SaveManager::InitFileNormal() { gSaveContext.pendingSale = ITEM_NONE; gSaveContext.pendingSaleMod = MOD_NONE; - if (gSaveContext.isBossRush) { + if (IS_BOSS_RUSH) { BossRush_InitSave(); } @@ -897,8 +897,8 @@ void SaveManager::SaveFileThreaded(int fileNum, SaveContext* saveContext, int se nlohmann::json& sectionBlock = saveBlock["sections"][saveFuncInfo.name]; sectionBlock["version"] = sectionHandlerPair.second.version; // If any save file is loaded for medatata, or a spoiler log is loaded (not sure which at this point), there is still data in the "randomizer" section - // This clears the randomizer data block if and only if the section being called is "randomizer" and n64ddFlag is false. - if (sectionHandlerPair.second.name == "randomizer" && !gSaveContext.n64ddFlag) { + // This clears the randomizer data block if and only if the section being called is "randomizer" and the current save file is not a randomizer save file. + if (sectionHandlerPair.second.name == "randomizer" && !IS_RANDO) { sectionBlock["data"] = nlohmann::json::object(); continue; } @@ -1119,7 +1119,11 @@ void SaveManager::LoadBaseVersion1() { SaveManager::Instance->LoadArray("playerName", ARRAY_COUNT(gSaveContext.playerName), [](size_t i) { SaveManager::Instance->LoadData("", gSaveContext.playerName[i]); }); - SaveManager::Instance->LoadData("n64ddFlag", gSaveContext.n64ddFlag); + int isRando = 0; + SaveManager::Instance->LoadData("n64ddFlag", isRando); + if (isRando) { + gSaveContext.questId = QUEST_RANDOMIZER; + } SaveManager::Instance->LoadData("healthCapacity", gSaveContext.healthCapacity); SaveManager::Instance->LoadData("health", gSaveContext.health); SaveManager::Instance->LoadData("magicLevel", gSaveContext.magicLevel); @@ -1260,7 +1264,11 @@ void SaveManager::LoadBaseVersion2() { SaveManager::Instance->LoadArray("playerName", ARRAY_COUNT(gSaveContext.playerName), [](size_t i) { SaveManager::Instance->LoadData("", gSaveContext.playerName[i]); }); - SaveManager::Instance->LoadData("n64ddFlag", gSaveContext.n64ddFlag); + int isRando = 0; + SaveManager::Instance->LoadData("n64ddFlag", isRando); + if (isRando) { + gSaveContext.questId = QUEST_RANDOMIZER; + } SaveManager::Instance->LoadData("healthCapacity", gSaveContext.healthCapacity); SaveManager::Instance->LoadData("health", gSaveContext.health); SaveManager::Instance->LoadData("magicLevel", gSaveContext.magicLevel); @@ -1426,7 +1434,11 @@ void SaveManager::LoadBaseVersion2() { SaveManager::Instance->LoadArray("randomizerInf", ARRAY_COUNT(gSaveContext.randomizerInf), [](size_t i) { SaveManager::Instance->LoadData("", gSaveContext.randomizerInf[i]); }); - SaveManager::Instance->LoadData("isMasterQuest", gSaveContext.isMasterQuest); + int isMQ = 0; + SaveManager::Instance->LoadData("isMasterQuest", isMQ); + if (isMQ) { + gSaveContext.questId = QUEST_MASTER; + } // Workaround for breaking save compatibility from 5.0.2 -> 5.1.0 in commit d7c35221421bf712b5ead56a360f81f624aca4bc if (!gSaveContext.isMagicAcquired) { @@ -1468,7 +1480,11 @@ void SaveManager::LoadBaseVersion3() { SaveManager::Instance->LoadArray("playerName", ARRAY_COUNT(gSaveContext.playerName), [](size_t i) { SaveManager::Instance->LoadData("", gSaveContext.playerName[i]); }); - SaveManager::Instance->LoadData("n64ddFlag", gSaveContext.n64ddFlag); + int isRando = 0; + SaveManager::Instance->LoadData("n64ddFlag", isRando); + if (isRando) { + gSaveContext.questId = QUEST_RANDOMIZER; + } SaveManager::Instance->LoadData("healthCapacity", gSaveContext.healthCapacity); SaveManager::Instance->LoadData("health", gSaveContext.health); SaveManager::Instance->LoadData("magicLevel", gSaveContext.magicLevel); @@ -1656,7 +1672,11 @@ void SaveManager::LoadBaseVersion3() { SaveManager::Instance->LoadArray("randomizerInf", ARRAY_COUNT(gSaveContext.randomizerInf), [](size_t i) { SaveManager::Instance->LoadData("", gSaveContext.randomizerInf[i]); }); - SaveManager::Instance->LoadData("isMasterQuest", gSaveContext.isMasterQuest); + int isMQ = 0; + SaveManager::Instance->LoadData("isMasterQuest", isMQ); + if (isMQ) { + gSaveContext.questId = QUEST_MASTER; + } SaveManager::Instance->LoadStruct("backupFW", []() { SaveManager::Instance->LoadStruct("pos", []() { SaveManager::Instance->LoadData("x", gSaveContext.backupFW.pos.x); @@ -1686,7 +1706,11 @@ void SaveManager::LoadBaseVersion4() { SaveManager::Instance->LoadArray("playerName", ARRAY_COUNT(gSaveContext.playerName), [](size_t i) { SaveManager::Instance->LoadData("", gSaveContext.playerName[i]); }); - SaveManager::Instance->LoadData("n64ddFlag", gSaveContext.n64ddFlag); + int isRando = 0; + SaveManager::Instance->LoadData("n64ddFlag", isRando); + if (isRando) { + gSaveContext.questId = QUEST_RANDOMIZER; + } SaveManager::Instance->LoadData("healthCapacity", gSaveContext.healthCapacity); SaveManager::Instance->LoadData("health", gSaveContext.health); SaveManager::Instance->LoadData("magicLevel", gSaveContext.magicLevel); @@ -1829,7 +1853,11 @@ void SaveManager::LoadBaseVersion4() { SaveManager::Instance->LoadArray("randomizerInf", ARRAY_COUNT(gSaveContext.randomizerInf), [](size_t i) { SaveManager::Instance->LoadData("", gSaveContext.randomizerInf[i]); }); - SaveManager::Instance->LoadData("isMasterQuest", gSaveContext.isMasterQuest); + int isMQ = 0; + SaveManager::Instance->LoadData("isMasterQuest", isMQ); + if (isMQ) { + gSaveContext.questId = QUEST_MASTER; + } SaveManager::Instance->LoadStruct("backupFW", []() { SaveManager::Instance->LoadStruct("pos", []() { SaveManager::Instance->LoadData("x", gSaveContext.backupFW.pos.x); @@ -1859,7 +1887,7 @@ void SaveManager::SaveBase(SaveContext* saveContext, int sectionID, bool fullSav SaveManager::Instance->SaveArray("playerName", ARRAY_COUNT(saveContext->playerName), [&](size_t i) { SaveManager::Instance->SaveData("", saveContext->playerName[i]); }); - SaveManager::Instance->SaveData("n64ddFlag", saveContext->n64ddFlag); + SaveManager::Instance->SaveData("n64ddFlag", saveContext->questId == QUEST_RANDOMIZER); SaveManager::Instance->SaveData("healthCapacity", saveContext->healthCapacity); SaveManager::Instance->SaveData("health", saveContext->health); SaveManager::Instance->SaveData("magicLevel", saveContext->magicLevel); @@ -1998,7 +2026,7 @@ void SaveManager::SaveBase(SaveContext* saveContext, int sectionID, bool fullSav SaveManager::Instance->SaveArray("randomizerInf", ARRAY_COUNT(saveContext->randomizerInf), [&](size_t i) { SaveManager::Instance->SaveData("", saveContext->randomizerInf[i]); }); - SaveManager::Instance->SaveData("isMasterQuest", saveContext->isMasterQuest); + SaveManager::Instance->SaveData("isMasterQuest", saveContext->questId == QUEST_MASTER); SaveManager::Instance->SaveStruct("backupFW", [&]() { SaveManager::Instance->SaveStruct("pos", [&]() { SaveManager::Instance->SaveData("x", saveContext->backupFW.pos.x); @@ -2155,7 +2183,7 @@ void SaveManager::DeleteZeldaFile(int fileNum) { } bool SaveManager::IsRandoFile() { - return gSaveContext.n64ddFlag != 0 ? true : false; + return IS_RANDO; } // Functionality required to convert old saves into versioned saves diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index ce2777fcd..bf14317bf 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -527,7 +527,7 @@ void DrawEnhancementsMenu() { UIWidgets::PaddedEnhancementCheckbox("Better Owl", "gBetterOwl", true, false); UIWidgets::Tooltip("The default response to Kaepora Gaebora is always that you understood what he said"); UIWidgets::PaddedEnhancementCheckbox("Fast Ocarina Playback", "gFastOcarinaPlayback", true, false); - bool forceSkipScarecrow = gSaveContext.n64ddFlag && + bool forceSkipScarecrow = IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SKIP_SCARECROWS_SONG); static const char* forceSkipScarecrowText = "This setting is forcefully enabled because a savefile\nwith \"Skip Scarecrow Song\" is loaded"; @@ -645,7 +645,7 @@ void DrawEnhancementsMenu() { UIWidgets::Tooltip("Respawn with full health instead of 3 Hearts"); UIWidgets::PaddedEnhancementCheckbox("No Random Drops", "gNoRandomDrops", true, false); UIWidgets::Tooltip("Disables random drops, except from the Goron Pot, Dampe, and bosses"); - bool forceEnableBombchuDrops = gSaveContext.n64ddFlag && + bool forceEnableBombchuDrops = IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_ENABLE_BOMBCHU_DROPS) == 1; static const char* forceEnableBombchuDropsText = "This setting is forcefully enabled because a savefile\nwith \"Enable Bombchu Drops\" is loaded."; @@ -849,7 +849,7 @@ void DrawEnhancementsMenu() { UIWidgets::Tooltip("Removes the input requirement on textboxes after defeating Ganon, allowing Credits sequence to continue to progress"); // Blue Fire Arrows - bool forceEnableBlueFireArrows = gSaveContext.n64ddFlag && + bool forceEnableBlueFireArrows = IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_BLUE_FIRE_ARROWS); static const char* forceEnableBlueFireArrowsText = "This setting is forcefully enabled because a savefile\nwith \"Blue Fire Arrows\" is loaded."; @@ -858,7 +858,7 @@ void DrawEnhancementsMenu() { UIWidgets::Tooltip("Allows Ice Arrows to melt red ice.\nMay require a room reload if toggled during gameplay."); // Sunlight Arrows - bool forceEnableSunLightArrows = gSaveContext.n64ddFlag && + bool forceEnableSunLightArrows = IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SUNLIGHT_ARROWS); static const char* forceEnableSunLightArrowsText = "This setting is forcefully enabled because a savefile\nwith \"Sunlight Arrows\" is loaded."; @@ -1518,7 +1518,7 @@ void DrawRandomizerMenu() { (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_GANONS_BOSS_KEY) != RO_GANON_BOSS_KEY_VANILLA && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_GANONS_BOSS_KEY) != RO_GANON_BOSS_KEY_OWN_DUNGEON && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_GANONS_BOSS_KEY) != RO_GANON_BOSS_KEY_STARTWITH) || - !gSaveContext.n64ddFlag) { + !IS_RANDO) { disableKeyColors = false; } diff --git a/soh/soh/z_play_otr.cpp b/soh/soh/z_play_otr.cpp index 1f5e21c94..5e54da8ed 100644 --- a/soh/soh/z_play_otr.cpp +++ b/soh/soh/z_play_otr.cpp @@ -76,7 +76,7 @@ void OTRPlay_InitScene(PlayState* play, s32 spawn) { OTRScene_ExecuteCommands(play, (LUS::Scene*)play->sceneSegment); Play_InitEnvironment(play, play->skyboxId); // Unpause the timer for Boss Rush when the scene loaded isn't the Chamber of Sages. - if (gSaveContext.isBossRush && play->sceneNum != SCENE_CHAMBER_OF_THE_SAGES) { + if (IS_BOSS_RUSH && play->sceneNum != SCENE_CHAMBER_OF_THE_SAGES) { gSaveContext.isBossRushPaused = 0; } /* auto data = static_cast(LUS::Context::GetInstance() diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 85b9748df..1a122cc9b 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -1988,7 +1988,7 @@ s32 GiveItemEntryWithoutActor(PlayState* play, GetItemEntry getItemEntry) { if (!(player->stateFlags1 & 0x3C7080) && Player_GetExplosiveHeld(player) < 0) { if (((player->heldActor != NULL) && ((getItemEntry.getItemId > GI_NONE) && (getItemEntry.getItemId < GI_MAX)) || - (gSaveContext.n64ddFlag && (getItemEntry.getItemId > RG_NONE) && (getItemEntry.getItemId < RG_MAX))) || + (IS_RANDO && (getItemEntry.getItemId > RG_NONE) && (getItemEntry.getItemId < RG_MAX))) || (!(player->stateFlags1 & 0x20000800))) { if ((getItemEntry.getItemId != GI_NONE)) { player->getItemEntry = getItemEntry; @@ -2024,8 +2024,8 @@ s32 GiveItemEntryFromActor(Actor* actor, PlayState* play, GetItemEntry getItemEn if (!(player->stateFlags1 & 0x3C7080) && Player_GetExplosiveHeld(player) < 0) { if ((((player->heldActor != NULL) || (actor == player->targetActor)) && - ((!gSaveContext.n64ddFlag && ((getItemEntry.getItemId > GI_NONE) && (getItemEntry.getItemId < GI_MAX))) || - (gSaveContext.n64ddFlag && ((getItemEntry.getItemId > RG_NONE) && (getItemEntry.getItemId < RG_MAX))))) || + ((!IS_RANDO && ((getItemEntry.getItemId > GI_NONE) && (getItemEntry.getItemId < GI_MAX))) || + (IS_RANDO && ((getItemEntry.getItemId > RG_NONE) && (getItemEntry.getItemId < RG_MAX))))) || (!(player->stateFlags1 & 0x20000800))) { if ((actor->xzDistToPlayer < xzRange) && (fabsf(actor->yDistToPlayer) < yRange)) { s16 yawDiff = actor->yawTowardsPlayer - player->actor.shape.rot.y; @@ -2066,7 +2066,7 @@ s32 func_8002F434(Actor* actor, PlayState* play, s32 getItemId, f32 xzRange, f32 if (!(player->stateFlags1 & 0x3C7080) && Player_GetExplosiveHeld(player) < 0) { if ((((player->heldActor != NULL) || (actor == player->targetActor)) && - ((!gSaveContext.n64ddFlag && ((getItemId > GI_NONE) && (getItemId < GI_MAX))) || (gSaveContext.n64ddFlag && ((getItemId > RG_NONE) && (getItemId < RG_MAX))))) || + ((!IS_RANDO && ((getItemId > GI_NONE) && (getItemId < GI_MAX))) || (IS_RANDO && ((getItemId > RG_NONE) && (getItemId < RG_MAX))))) || (!(player->stateFlags1 & 0x20000800))) { if ((actor->xzDistToPlayer < xzRange) && (fabsf(actor->yDistToPlayer) < yRange)) { s16 yawDiff = actor->yawTowardsPlayer - player->actor.shape.rot.y; diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c index bba12161f..e0b17fe72 100644 --- a/soh/src/code/z_demo.c +++ b/soh/src/code/z_demo.c @@ -246,7 +246,7 @@ void func_80064824(PlayState* play, CutsceneContext* csCtx, CsCmdBase* cmd) { case 3: if (sp3F != 0) { Flags_SetEnv(play, 0); - if (gSaveContext.entranceIndex == 0x0053 || (gSaveContext.n64ddFlag && gSaveContext.entranceIndex == 0x05F4)) { + if (gSaveContext.entranceIndex == 0x0053 || (IS_RANDO && gSaveContext.entranceIndex == 0x05F4)) { Flags_SetEnv(play, 2); } } @@ -497,7 +497,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB // cmd->base == 8: Traveling back/forward in time cutscene // cmd->base == 24: Dropping a fish for Jabu Jabu // cmd->base == 33: Zelda escaping with impa cutscene - bool randoCsSkip = (gSaveContext.n64ddFlag && (cmd->base == 8 || cmd->base == 24 || cmd->base == 33)); + bool randoCsSkip = (IS_RANDO && (cmd->base == 8 || cmd->base == 24 || cmd->base == 33)); bool debugCsSkip = (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_START) && (gSaveContext.fileNum != 0xFEDC) && CVarGetInteger("gDebugEnabled", 0)); @@ -2113,7 +2113,7 @@ void Cutscene_HandleEntranceTriggers(PlayState* play) { u8 requiredAge; s16 i; - if (gSaveContext.n64ddFlag && + if (IS_RANDO && // don't skip epona escape cutscenes gSaveContext.entranceIndex != 650 && gSaveContext.entranceIndex != 654 && @@ -2151,9 +2151,9 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) { if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) { const bool bShouldTowerRandoSkip = - (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_TOWER_ESCAPE)); + (IS_RANDO && Randomizer_GetSettingValue(RSK_SKIP_TOWER_ESCAPE)); if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT)) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { Flags_SetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT); gSaveContext.entranceIndex = 0x0123; gSaveContext.cutsceneIndex = 0xFFF0; @@ -2161,12 +2161,12 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) { } else if ((gSaveContext.entranceIndex == 0x00DB) && LINK_IS_ADULT && (Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) && (Flags_GetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP)) && (Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP)) && !Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL)) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { Flags_SetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL); gSaveContext.cutsceneIndex = 0xFFF0; } } else if ((gSaveContext.entranceIndex == 0x05E0) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE)) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_SARIA_ON_BRIDGE); Item_Give(play, ITEM_OCARINA_FAIRY); gSaveContext.entranceIndex = 0x011E; @@ -2175,7 +2175,7 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) { } else if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) && LINK_IS_ADULT && !Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS) && (gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_TEMPLE_OF_TIME)) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { Flags_SetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS); gSaveContext.entranceIndex = 0x0053; gSaveContext.cutsceneIndex = 0xFFF8; @@ -2187,7 +2187,7 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) { Flags_SetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO); gSaveContext.entranceIndex = 0x0517; // In rando, skip the cutscene for the tower falling down after the escape. - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { return; } gSaveContext.cutsceneIndex = 0xFFF0; diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c index fc8bbd669..42ea78f90 100644 --- a/soh/src/code/z_en_item00.c +++ b/soh/src/code/z_en_item00.c @@ -381,7 +381,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.03f); this->scale = 0.03f; // Offset keys in randomizer slightly higher for their GID replacement - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { yOffset = 350.0f; } else { yOffset = 430.0f; @@ -488,7 +488,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) { RandomizerCheck randoCheck = Randomizer_GetCheckFromActor(this->actor.id, play->sceneNum, this->ogParams); - if (gSaveContext.n64ddFlag && randoCheck != RC_UNKNOWN_CHECK) { + if (IS_RANDO && randoCheck != RC_UNKNOWN_CHECK) { this->randoGiEntry = Randomizer_GetItemFromKnownCheck(randoCheck, getItemId); this->randoGiEntry.getItemFrom = ITEM_FROM_FREESTANDING; @@ -578,7 +578,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) { if (!Actor_HasParent(&this->actor, play)) { if (getItemId != GI_NONE) { - if (!gSaveContext.n64ddFlag || this->randoGiEntry.getItemId == GI_NONE) { + if (!IS_RANDO || this->randoGiEntry.getItemId == GI_NONE) { func_8002F554(&this->actor, play, getItemId); } else { GiveItemEntryFromActorWithFixedRange(&this->actor, play, this->randoGiEntry); @@ -731,7 +731,7 @@ void func_8001E5C8(EnItem00* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->getItemId != GI_NONE) { if (!Actor_HasParent(&this->actor, play)) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, this->getItemId, 50.0f, 80.0f); } else { GiveItemEntryFromActor(&this->actor, play, this->randoGiEntry, 50.0f, 80.0f); @@ -783,7 +783,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { this->actor.params == ITEM00_BOMBS_SPECIAL || this->actor.params == ITEM00_BOMBCHU) { if (CVarGetInteger("gNewDrops", 0) || // Keys in randomizer need to always rotate for their GID replacement - (gSaveContext.n64ddFlag && this->actor.params == ITEM00_SMALL_KEY)) { + (IS_RANDO && this->actor.params == ITEM00_SMALL_KEY)) { this->actor.shape.rot.y += 960; } else { this->actor.shape.rot.y = 0; @@ -951,7 +951,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { params = &this->actor.params; if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, play)) { - if (!gSaveContext.n64ddFlag || this->randoGiEntry.getItemId == GI_NONE) { + if (!IS_RANDO || this->randoGiEntry.getItemId == GI_NONE) { func_8002F554(&this->actor, play, getItemId); } else { getItemId = this->randoGiEntry.getItemId; @@ -1046,7 +1046,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { } break; case ITEM00_HEART_PIECE: - if (CVarGetInteger("gNewDrops", 0) && !gSaveContext.n64ddFlag) { + if (CVarGetInteger("gNewDrops", 0) && !IS_RANDO) { mtxScale = 21.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_HEART_PIECE); @@ -1156,7 +1156,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { break; } case ITEM00_SMALL_KEY: - if (CVarGetInteger("gNewDrops", 0) && !gSaveContext.n64ddFlag) { + if (CVarGetInteger("gNewDrops", 0) && !IS_RANDO) { mtxScale = 8.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); GetItem_Draw(play, GID_KEY_SMALL); @@ -1362,7 +1362,7 @@ static const Vtx customDropVtx[] = { * Draw Function used for most collectible types of En_Item00 (ammo, bombs, sticks, nuts, magic...). */ void EnItem00_DrawCollectible(EnItem00* this, PlayState* play) { - if (gSaveContext.n64ddFlag && (this->getItemId != GI_NONE || this->actor.params == ITEM00_SMALL_KEY)) { + if (IS_RANDO && (this->getItemId != GI_NONE || this->actor.params == ITEM00_SMALL_KEY)) { RandomizerCheck randoCheck = Randomizer_GetCheckFromActor(this->actor.id, play->sceneNum, this->ogParams); @@ -1456,7 +1456,7 @@ void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play) { * Draw Function used for the Piece of Heart type of En_Item00. */ void EnItem00_DrawHeartPiece(EnItem00* this, PlayState* play) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { RandomizerCheck randoCheck = Randomizer_GetCheckFromActor(this->actor.id, play->sceneNum, this->ogParams); @@ -1533,7 +1533,7 @@ s16 func_8001F404(s16 dropId) { } if ((CVarGetInteger("gBombchuDrops", 0) || - (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_ENABLE_BOMBCHU_DROPS) == 1)) && + (IS_RANDO && Randomizer_GetSettingValue(RSK_ENABLE_BOMBCHU_DROPS) == 1)) && (dropId == ITEM00_BOMBS_A || dropId == ITEM00_BOMBS_B || dropId == ITEM00_BOMBS_SPECIAL)) { dropId = EnItem00_ConvertBombDropToBombchu(dropId); } diff --git a/soh/src/code/z_game_over.c b/soh/src/code/z_game_over.c index 315199000..4b10cb5e2 100644 --- a/soh/src/code/z_game_over.c +++ b/soh/src/code/z_game_over.c @@ -33,7 +33,7 @@ void GameOver_Update(PlayState* play) { gSaveContext.eventInf[1] &= ~1; // search inventory for spoiling items and revert if necessary - if (!(gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE))) { + if (!(IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE))) { for (i = 0; i < ARRAY_COUNT(gSpoilingItems); i++) { if (INV_CONTENT(ITEM_POCKET_EGG) == gSpoilingItems[i]) { INV_CONTENT(gSpoilingItemReverts[i]) = gSpoilingItemReverts[i]; diff --git a/soh/src/code/z_horse.c b/soh/src/code/z_horse.c index 3d63a467a..c36e6095e 100644 --- a/soh/src/code/z_horse.c +++ b/soh/src/code/z_horse.c @@ -73,8 +73,8 @@ void func_8006D0EC(PlayState* play, Player* player) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1, true); assert(horseActor != NULL); } else if ((play->sceneNum == gSaveContext.horseData.scene) && - (((Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) != 0) && (!gSaveContext.n64ddFlag || - (gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && + (((Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) != 0) && (!IS_RANDO || + (IS_RANDO && CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && (INV_CONTENT(ITEM_OCARINA_FAIRY) != ITEM_NONE)))) || DREG(1) != 0)) { // "Set by existence of horse %d %d %d" osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.scene, Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED), diff --git a/soh/src/code/z_kaleido_scope_call.c b/soh/src/code/z_kaleido_scope_call.c index 6f0648e08..dd7e3fdd9 100644 --- a/soh/src/code/z_kaleido_scope_call.c +++ b/soh/src/code/z_kaleido_scope_call.c @@ -57,7 +57,7 @@ void KaleidoScopeCall_Update(PlayState* play) { PauseContext* pauseCtx = &play->pauseCtx; if (!gSaveContext.sohStats.gameComplete && - (!gSaveContext.isBossRush || !gSaveContext.isBossRushPaused)) { + (!IS_BOSS_RUSH || !gSaveContext.isBossRushPaused)) { gSaveContext.sohStats.pauseTimer++; } diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c index caeef6887..c4db0098b 100644 --- a/soh/src/code/z_map_exp.c +++ b/soh/src/code/z_map_exp.c @@ -394,8 +394,8 @@ void Map_InitData(PlayState* play, s16 room) { } } else if (play->sceneNum == SCENE_LAKE_HYLIA) { if ((LINK_AGE_IN_YEARS == YEARS_ADULT) && - ((!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER)) || - (gSaveContext.n64ddFlag && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_WATER_TEMPLE)))) { + ((!IS_RANDO && !CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER)) || + (IS_RANDO && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_WATER_TEMPLE)))) { extendedMapIndex = 0x15; } } else if (play->sceneNum == SCENE_GERUDO_VALLEY) { @@ -403,8 +403,8 @@ void Map_InitData(PlayState* play, s16 room) { extendedMapIndex = 0x16; } } else if (play->sceneNum == SCENE_GERUDOS_FORTRESS) { - if ((!gSaveContext.n64ddFlag && GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) || - (gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_GERUDO_CARD))) { + if ((!IS_RANDO && GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) || + (IS_RANDO && CHECK_QUEST_ITEM(QUEST_GERUDO_CARD))) { extendedMapIndex = 0x17; } } diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 91f9003a2..c88c698c7 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -1617,9 +1617,9 @@ void Message_OpenText(PlayState* play, u16 textId) { // Increments text id based on piece of heart count, assumes the piece of heart text is all // in order and that you don't have more than the intended amount of heart pieces. textId += (gSaveContext.inventory.questItems & 0xF0000000 & 0xF0000000) >> 0x1C; - } else if (!gSaveContext.n64ddFlag && (msgCtx->textId == 0xC && CHECK_OWNED_EQUIP(EQUIP_SWORD, 2))) { + } else if (!IS_RANDO && (msgCtx->textId == 0xC && CHECK_OWNED_EQUIP(EQUIP_SWORD, 2))) { textId = 0xB; // Traded Giant's Knife for Biggoron Sword - } else if (!gSaveContext.n64ddFlag && (msgCtx->textId == 0xB4 && (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_CURSED_MAN_IN_SKULL_HOUSE)))) { + } else if (!IS_RANDO && (msgCtx->textId == 0xB4 && (Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_CURSED_MAN_IN_SKULL_HOUSE)))) { textId = 0xB5; // Destroyed Gold Skulltula } // Ocarina Staff + Dialog @@ -2517,7 +2517,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { if (msgCtx->lastPlayedSong < OCARINA_SONG_SARIAS && (msgCtx->ocarinaAction < OCARINA_ACTION_PLAYBACK_MINUET || msgCtx->ocarinaAction >= OCARINA_ACTION_PLAYBACK_SARIA)) { - if (msgCtx->disableWarpSongs || (interfaceCtx->restrictions.warpSongs == 3 && !gSaveContext.n64ddFlag)) { + if (msgCtx->disableWarpSongs || (interfaceCtx->restrictions.warpSongs == 3 && !IS_RANDO)) { Message_StartTextbox(play, 0x88C, NULL); // "You can't warp here!" play->msgCtx.ocarinaMode = OCARINA_MODE_04; } else if ((gSaveContext.eventInf[0] & 0xF) != 1) { @@ -2603,7 +2603,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->lastPlayedSong = msgCtx->ocarinaStaff->state; msgCtx->msgMode = MSGMODE_SONG_PLAYBACK_SUCCESS; - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { Item_Give(play, ITEM_SONG_MINUET + gOcarinaSongItemMap[msgCtx->ocarinaStaff->state]); } diff --git a/soh/src/code/z_onepointdemo.c b/soh/src/code/z_onepointdemo.c index 704c28585..ab62692cc 100644 --- a/soh/src/code/z_onepointdemo.c +++ b/soh/src/code/z_onepointdemo.c @@ -792,7 +792,7 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 camIdx, s16 csId, Actor* actor case 4100: csInfo->keyFrames = D_801225D4; // RANDO: Waterfall opening cutscene skips to the end of the cutscene data earlier by doing this - if (!(gSaveContext.n64ddFlag)) { + if (!(IS_RANDO)) { csInfo->keyFrameCnt = 5; } else { csInfo->keyFrameCnt = 2; diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 93bf8fbfd..75c85e3e4 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -884,7 +884,7 @@ void func_80083108(PlayState* play) { } } // Don't hide the HUD in the Chamber of Sages when in Boss Rush. - } else if (play->sceneNum == SCENE_CHAMBER_OF_THE_SAGES && !gSaveContext.isBossRush) { + } else if (play->sceneNum == SCENE_CHAMBER_OF_THE_SAGES && !IS_BOSS_RUSH) { Interface_ChangeAlpha(1); } else if (play->sceneNum == SCENE_FISHING_POND) { gSaveContext.unk_13E7 = 2; @@ -1413,7 +1413,7 @@ void Inventory_SwapAgeEquipment(void) { // When becoming adult, remove swordless flag since we'll get master sword // Only in rando to keep swordless link bugs in vanilla - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { Flags_UnsetInfTable(INFTABLE_SWORDLESS); } @@ -1467,7 +1467,7 @@ void Inventory_SwapAgeEquipment(void) { } else { // When becoming child, set swordless flag if player doesn't have kokiri sword // Only in rando to keep swordless link bugs in vanilla - if (gSaveContext.n64ddFlag && (1 << 0 & gSaveContext.inventory.equipment) == 0) { + if (IS_RANDO && (1 << 0 & gSaveContext.inventory.equipment) == 0) { Flags_SetInfTable(INFTABLE_SWORDLESS); } @@ -1533,7 +1533,7 @@ void Inventory_SwapAgeEquipment(void) { gSaveContext.equips.equipment = gSaveContext.childEquips.equipment; gSaveContext.equips.equipment &= 0xFFF0; gSaveContext.equips.equipment |= 0x0001; - } else if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_STARTING_AGE) == RO_AGE_ADULT) { + } else if (IS_RANDO && Randomizer_GetSettingValue(RSK_STARTING_AGE) == RO_AGE_ADULT) { /*If in rando and starting age is adult, childEquips is not initialized and buttonItems[0] will be ITEM_NONE. When changing age from adult -> child, reset equips to "default" (only kokiri tunic/boots equipped, no sword, no C-button items, no D-Pad items). @@ -1837,7 +1837,7 @@ u8 Item_Give(PlayState* play, u8 item) { // In rando, when buying Giant's Knife, also check // for 0xE in case we don't have Kokiri Sword - if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF || (gSaveContext.n64ddFlag && ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xE)) { + if (ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xF || (IS_RANDO && ALL_EQUIP_VALUE(EQUIP_SWORD) == 0xE)) { gSaveContext.inventory.equipment ^= 8 << gEquipShifts[EQUIP_SWORD]; @@ -1944,13 +1944,13 @@ u8 Item_Give(PlayState* play, u8 item) { return Return_Item(item, MOD_NONE, ITEM_NONE); } else if (item == ITEM_WALLET_ADULT) { Inventory_ChangeUpgrade(UPG_WALLET, 1); - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_FULL_WALLETS)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_FULL_WALLETS)) { Rupees_ChangeBy(200); } return Return_Item(item, MOD_NONE, ITEM_NONE); } else if (item == ITEM_WALLET_GIANT) { Inventory_ChangeUpgrade(UPG_WALLET, 2); - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_FULL_WALLETS)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_FULL_WALLETS)) { Rupees_ChangeBy(500); } return Return_Item(item, MOD_NONE, ITEM_NONE); @@ -1994,7 +1994,7 @@ u8 Item_Give(PlayState* play, u8 item) { } } // update the adult/child equips when rando'd (accounting for equp swapped hookshot as child) - if (gSaveContext.n64ddFlag && LINK_IS_CHILD) { + if (IS_RANDO && LINK_IS_CHILD) { for (i = 1; i < ARRAY_COUNT(gSaveContext.adultEquips.buttonItems); i++) { if (gSaveContext.adultEquips.buttonItems[i] == ITEM_HOOKSHOT) { gSaveContext.adultEquips.buttonItems[i] = ITEM_LONGSHOT; @@ -2004,7 +2004,7 @@ u8 Item_Give(PlayState* play, u8 item) { } } } - if (gSaveContext.n64ddFlag && LINK_IS_ADULT) { + if (IS_RANDO && LINK_IS_ADULT) { for (i = 1; i < ARRAY_COUNT(gSaveContext.childEquips.buttonItems); i++) { if (gSaveContext.childEquips.buttonItems[i] == ITEM_HOOKSHOT) { gSaveContext.childEquips.buttonItems[i] = ITEM_LONGSHOT; @@ -2149,7 +2149,7 @@ u8 Item_Give(PlayState* play, u8 item) { } // update the adult/child equips when rando'd - if (gSaveContext.n64ddFlag && LINK_IS_CHILD) { + if (IS_RANDO && LINK_IS_CHILD) { for (i = 1; i < ARRAY_COUNT(gSaveContext.adultEquips.buttonItems); i++) { if (gSaveContext.adultEquips.buttonItems[i] == ITEM_OCARINA_FAIRY) { gSaveContext.adultEquips.buttonItems[i] = ITEM_OCARINA_TIME; @@ -2159,7 +2159,7 @@ u8 Item_Give(PlayState* play, u8 item) { } } } - if (gSaveContext.n64ddFlag && LINK_IS_ADULT) { + if (IS_RANDO && LINK_IS_ADULT) { for (i = 1; i < ARRAY_COUNT(gSaveContext.childEquips.buttonItems); i++) { if (gSaveContext.childEquips.buttonItems[i] == ITEM_OCARINA_FAIRY) { gSaveContext.childEquips.buttonItems[i] = ITEM_OCARINA_TIME; @@ -2515,7 +2515,7 @@ u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) { if (item == RG_TYCOON_WALLET) { Inventory_ChangeUpgrade(UPG_WALLET, 3); - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_FULL_WALLETS)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_FULL_WALLETS)) { Rupees_ChangeBy(999); } return Return_Item_Entry(giEntry, RG_NONE); @@ -2576,7 +2576,7 @@ u8 Item_CheckObtainability(u8 item) { osSyncPrintf("item_get_non_setting=%d pt=%d z=%x\n", item, slot, gSaveContext.inventory.items[slot]); osSyncPrintf(VT_RST); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { if (item == ITEM_SINGLE_MAGIC || item == ITEM_DOUBLE_MAGIC || item == ITEM_DOUBLE_DEFENSE) { return ITEM_NONE; } @@ -2593,25 +2593,25 @@ u8 Item_CheckObtainability(u8 item) { return ITEM_NONE; } else if ((gBitFlags[item - ITEM_SWORD_KOKIRI] << gEquipShifts[EQUIP_SWORD]) & gSaveContext.inventory.equipment) { - return gSaveContext.n64ddFlag ? ITEM_NONE : item; + return IS_RANDO ? ITEM_NONE : item; } else { return ITEM_NONE; } } else if ((item >= ITEM_SHIELD_DEKU) && (item <= ITEM_SHIELD_MIRROR)) { if ((gBitFlags[item - ITEM_SHIELD_DEKU] << gEquipShifts[EQUIP_SHIELD]) & gSaveContext.inventory.equipment) { - return gSaveContext.n64ddFlag ? ITEM_NONE : item; + return IS_RANDO ? ITEM_NONE : item; } else { return ITEM_NONE; } } else if ((item >= ITEM_TUNIC_KOKIRI) && (item <= ITEM_TUNIC_ZORA)) { if ((gBitFlags[item - ITEM_TUNIC_KOKIRI] << gEquipShifts[EQUIP_TUNIC]) & gSaveContext.inventory.equipment) { - return gSaveContext.n64ddFlag ? ITEM_NONE : item; + return IS_RANDO ? ITEM_NONE : item; } else { return ITEM_NONE; } } else if ((item >= ITEM_BOOTS_KOKIRI) && (item <= ITEM_BOOTS_HOVER)) { if ((gBitFlags[item - ITEM_BOOTS_KOKIRI] << gEquipShifts[EQUIP_BOOTS]) & gSaveContext.inventory.equipment) { - return gSaveContext.n64ddFlag ? ITEM_NONE : item; + return IS_RANDO ? ITEM_NONE : item; } else { return ITEM_NONE; } @@ -2828,7 +2828,7 @@ s32 Inventory_ConsumeFairy(PlayState* play) { } bool Inventory_HatchPocketCucco(PlayState* play) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { return Inventory_ReplaceItem(play, ITEM_POCKET_EGG, ITEM_POCKET_CUCCO); } @@ -5096,7 +5096,7 @@ void Interface_Draw(PlayState* play) { } gDPSetPrimColor(OVERLAY_DISP++, 0, 0, rColor.r, rColor.g, rColor.b, interfaceCtx->magicAlpha); // Draw Rupee icon. Hide in Boss Rush. - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gRupeeCounterIconTex, 16, 16, PosX_RC, PosY_RC, 16, 16, 1 << 10, 1 << 10); } @@ -5214,7 +5214,7 @@ void Interface_Draw(PlayState* play) { svar5 = rupeeDigitsCount[CUR_UPG_VALUE(UPG_WALLET)]; // Draw Rupee Counter. Hide in Boss Rush. - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { for (svar1 = 0, svar3 = 16; svar1 < svar5; svar1++, svar2++, svar3 += 8) { OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, ((u8*)digitTextures[interfaceCtx->counterDigits[svar2]]), 8, 16, PosX_RC + svar3, PosY_RC, 8, 16, 1 << 10, 1 << 10); @@ -6152,7 +6152,7 @@ void Interface_Draw(PlayState* play) { void Interface_DrawTotalGameplayTimer(PlayState* play) { // Draw timer based on the Gameplay Stats total time. - if ((gSaveContext.isBossRush && gSaveContext.bossRushOptions[BR_OPTIONS_TIMER] == BR_CHOICE_TIMER_YES) || + if ((IS_BOSS_RUSH && gSaveContext.bossRushOptions[BR_OPTIONS_TIMER] == BR_CHOICE_TIMER_YES) || (CVarGetInteger("gGameplayStats.ShowIngameTimer", 0) && gSaveContext.fileNum >= 0 && gSaveContext.fileNum <= 2)) { s32 X_Margins_Timer = 0; @@ -6639,7 +6639,7 @@ void Interface_Update(PlayState* play) { play->nextEntranceIndex = gSaveContext.entranceIndex; // In ER, handle sun song respawn from last entrance from grottos - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { Grotto_ForceGrottoReturn(); } diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index 7e480ad27..45977b6e7 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -179,7 +179,7 @@ void Play_Destroy(GameState* thisx) { } // In ER, remove link from epona when entering somewhere that doesn't support epona - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_ENTRANCES)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_ENTRANCES)) { Entrance_HandleEponaState(); } @@ -469,7 +469,7 @@ void Play_Init(GameState* thisx) { // eventChkInf[5] & 0x200 = Got Impa's reward // entranceIndex 0x7A, Castle Courtyard - Day from crawlspace // entranceIndex 0x400, Zelda's Courtyard - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_CHILD_STEALTH) && + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SKIP_CHILD_STEALTH) && !Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_ZELDAS_LULLABY)) { if (gSaveContext.entranceIndex == 0x7A) { gSaveContext.entranceIndex = 0x400; @@ -1181,7 +1181,7 @@ void Play_Update(PlayState* play) { play->gameplayFrames++; // Gameplay stat tracking if (!gSaveContext.sohStats.gameComplete && - (!gSaveContext.isBossRush || (gSaveContext.isBossRush && !gSaveContext.isBossRushPaused))) { + (!IS_BOSS_RUSH || (IS_BOSS_RUSH && !gSaveContext.isBossRushPaused))) { gSaveContext.sohStats.playTimer++; gSaveContext.sohStats.sceneTimer++; gSaveContext.sohStats.roomTimer++; @@ -1419,7 +1419,7 @@ skip: Environment_Update(play, &play->envCtx, &play->lightCtx, &play->pauseCtx, &play->msgCtx, &play->gameOverCtx, play->state.gfxCtx); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GivePlayerRandoRewardSariaGift(play, RC_LW_GIFT_FROM_SARIA); GivePlayerRandoRewardSongOfTime(play, RC_SONG_FROM_OCARINA_OF_TIME); GivePlayerRandoRewardZeldaLightArrowsGift(play, RC_TOT_LIGHT_ARROWS_CUTSCENE); @@ -1918,7 +1918,7 @@ void* Play_LoadFile(PlayState* play, RomFile* file) { void Play_InitEnvironment(PlayState* play, s16 skyboxId) { // For entrance rando, ensure the correct weather state and sky mode is applied - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { Entrance_OverrideWeatherState(); } Skybox_Init(&play->state, &play->skyboxCtx, skyboxId); @@ -1955,7 +1955,7 @@ void Play_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn) { OTRPlay_SpawnScene(play, sceneNum, spawn); - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { Entrance_OverrideSpawnScene(sceneNum, spawn); } } diff --git a/soh/src/code/z_room.c b/soh/src/code/z_room.c index 81fe2714b..ccbc93d0d 100644 --- a/soh/src/code/z_room.c +++ b/soh/src/code/z_room.c @@ -579,7 +579,7 @@ s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum) { size_t size; // In ER, override roomNum to load based on scene and spawn - if (gSaveContext.n64ddFlag && gSaveContext.respawnFlag <= 0 && + if (IS_RANDO && gSaveContext.respawnFlag <= 0 && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { roomNum = Entrance_OverrideSpawnSceneRoom(play->sceneNum, play->curSpawn, roomNum); } diff --git a/soh/src/code/z_scene_table.c b/soh/src/code/z_scene_table.c index 00593d0dd..d1065533c 100644 --- a/soh/src/code/z_scene_table.c +++ b/soh/src/code/z_scene_table.c @@ -2091,7 +2091,7 @@ void func_8009EE44(PlayState* play) { gDPSetEnvColor(POLY_OPA_DISP++, 128, 128, 128, 128); bool playerHasCojiro = INV_CONTENT(ITEM_COJIRO) == ITEM_COJIRO; - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE)) { playerHasCojiro = PLAYER_HAS_SHUFFLED_ADULT_TRADE_ITEM(ITEM_COJIRO); } if ((play->roomCtx.unk_74[0] == 0) && playerHasCojiro) { diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index 8dbb96087..fd2b5ebd9 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -155,7 +155,7 @@ void Sram_OpenSave() { } // if zelda cutscene has been watched but lullaby was not obtained, restore cutscene and take away letter - if ((Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) && !CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) && !gSaveContext.n64ddFlag) { + if ((Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)) && !CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) && !IS_RANDO) { i = gSaveContext.eventChkInf[4] & ~1; gSaveContext.eventChkInf[4] = i; @@ -176,7 +176,7 @@ void Sram_OpenSave() { gSaveContext.equips.equipment |= 2; } - if (!(gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE))) { + if (!(IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE))) { for (i = 0; i < ARRAY_COUNT(gSpoilingItems); i++) { if (INV_CONTENT(ITEM_TRADE_ADULT) == gSpoilingItems[i]) { INV_CONTENT(gSpoilingItemReverts[i]) = gSpoilingItemReverts[i]; @@ -218,11 +218,10 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { gSaveContext.playerName[offset] = Save_GetSaveMetaInfo(fileChooseCtx->buttonIndex)->playerName[offset]; } + gSaveContext.n64ddFlag = fileChooseCtx->n64ddFlag; + if (fileChooseCtx->questType[fileChooseCtx->buttonIndex] == 2 && strnlen(CVarGetString("gSpoilerLog", ""), 1) != 0) { - // Set N64DD Flags for save file - fileChooseCtx->n64ddFlags[fileChooseCtx->buttonIndex] = 1; - fileChooseCtx->n64ddFlag = 1; - gSaveContext.n64ddFlag = 1; + gSaveContext.questId = 2; Randomizer_InitSaveFile(); } diff --git a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index 925a66ba2..58f11a7f3 100644 --- a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -106,7 +106,7 @@ void BgBreakwall_Init(Actor* thisx, PlayState* play) { s32 wallType = ((this->dyna.actor.params >> 13) & 3) & 0xFF; // Initialize this with the mud wall, so it can't be affected by toggling while the actor is loaded - blueFireArrowsEnabledOnMudwallLoad = CVarGetInteger("gBlueFireArrows", 0) || (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_BLUE_FIRE_ARROWS)); + blueFireArrowsEnabledOnMudwallLoad = CVarGetInteger("gBlueFireArrows", 0) || (IS_RANDO && Randomizer_GetSettingValue(RSK_BLUE_FIRE_ARROWS)); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_UNK); @@ -275,7 +275,7 @@ void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) { } // Break the floor immediately in Boss Rush so the player can jump in the hole immediately. - if (this->collider.base.acFlags & 2 || blueFireArrowHit || gSaveContext.isBossRush) { + if (this->collider.base.acFlags & 2 || blueFireArrowHit || IS_BOSS_RUSH) { Vec3f effectPos; s32 wallType = ((this->dyna.actor.params >> 13) & 3) & 0xFF; diff --git a/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index cbd47fee1..7223e936f 100644 --- a/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -199,7 +199,7 @@ void BgDyYoseizo_CheckMagicAcquired(BgDyYoseizo* this, PlayState* play) { if (Flags_GetSwitch(play, 0x38)) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; - if(gSaveContext.n64ddFlag) { + if(IS_RANDO) { gSaveContext.healthAccumulator = 0x140; Magic_Fill(play); if(Flags_GetTreasure(play, this->fountainType + 1)) { diff --git a/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index 847f8da43..3307b6148 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/soh/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -45,8 +45,8 @@ void BgGateShutter_Init(Actor* thisx, PlayState* play) { this->somePos.y = thisx->world.pos.y; this->somePos.z = thisx->world.pos.z; if (((Flags_GetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD)) || - (!gSaveContext.n64ddFlag && (Flags_GetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL))) || - (gSaveContext.n64ddFlag && (Randomizer_GetSettingValue(RSK_KAK_GATE) == RO_KAK_GATE_OPEN))) && + (!IS_RANDO && (Flags_GetEventChkInf(EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL))) || + (IS_RANDO && (Randomizer_GetSettingValue(RSK_KAK_GATE) == RO_KAK_GATE_OPEN))) && (play->sceneNum == SCENE_KAKARIKO_VILLAGE)) { thisx->world.pos.x = -89.0f; thisx->world.pos.z = -1375.0f; diff --git a/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c b/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c index b79020309..b592edcd5 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c +++ b/soh/src/overlays/actors/ovl_Bg_Gjyo_Bridge/z_bg_gjyo_bridge.c @@ -51,7 +51,7 @@ void BgGjyoBridge_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); int bridge = Randomizer_GetSettingValue(RSK_RAINBOW_BRIDGE); - if (Flags_GetEventChkInf(EVENTCHKINF_RAINBOW_BRIDGE_BUILT) || (gSaveContext.n64ddFlag && bridge == RO_BRIDGE_ALWAYS_OPEN)) { + if (Flags_GetEventChkInf(EVENTCHKINF_RAINBOW_BRIDGE_BUILT) || (IS_RANDO && bridge == RO_BRIDGE_ALWAYS_OPEN)) { this->actionFunc = func_808787A4; } else { this->dyna.actor.draw = NULL; @@ -84,7 +84,7 @@ u8 CheckPlayerPosition(Player* player, PlayState* play) { void BgGjyoBridge_TriggerCutscene(BgGjyoBridge* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) && (INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) && CheckPlayerPosition(player, play)) { LaunchBridgeCutscene(this, play); @@ -146,7 +146,7 @@ void BgGjyoBridge_TriggerCutscene(BgGjyoBridge* this, PlayState* play) { } void BgGjyoBridge_SpawnBridge(BgGjyoBridge* this, PlayState* play) { - if (gSaveContext.n64ddFlag || (play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.npcActions[2] != NULL) && + if (IS_RANDO || (play->csCtx.state != CS_STATE_IDLE) && (play->csCtx.npcActions[2] != NULL) && (play->csCtx.npcActions[2]->action == 2)) { this->dyna.actor.draw = BgGjyoBridge_Draw; func_8003EC50(play, &play->colCtx.dyna, this->dyna.bgId); diff --git a/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index 04018c9a8..36666ed15 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/soh/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -105,7 +105,7 @@ void func_80890740(BgIceShelter* this, PlayState* play) { s32 type = (this->dyna.actor.params >> 8) & 7; // Initialize this with the red ice, so it can't be affected by toggling while the actor is loaded - blueFireArrowsEnabledOnRedIceLoad = CVarGetInteger("gBlueFireArrows", 0) || (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_BLUE_FIRE_ARROWS)); + blueFireArrowsEnabledOnRedIceLoad = CVarGetInteger("gBlueFireArrows", 0) || (IS_RANDO && Randomizer_GetSettingValue(RSK_BLUE_FIRE_ARROWS)); Collider_InitCylinder(play, &this->cylinder1); // If "Blue Fire Arrows" is enabled, set up a collider on the red ice that responds to them diff --git a/soh/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c b/soh/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c index 0ab03c081..8019d414e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c @@ -82,7 +82,7 @@ void BgSpot00Hanebasi_Init(Actor* thisx, PlayState* play) { if (gSaveContext.sceneSetupIndex != 6) { // Don't close the bridge in rando to accomodate hyrule castle exit if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) && - CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE) && !(gSaveContext.n64ddFlag)) { + CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE) && !(IS_RANDO)) { this->dyna.actor.shape.rot.x = -0x4000; } } diff --git a/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c b/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c index f08878ec2..905106dce 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c @@ -49,7 +49,7 @@ void BgSpot01Idosoko_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); // If dungeon entrance randomizer is on, remove the well stone as adult Link when // child Link has drained the water to the well - if (!LINK_IS_ADULT || (gSaveContext.n64ddFlag && + if (!LINK_IS_ADULT || (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF && Flags_GetEventChkInf(EVENTCHKINF_DRAINED_WELL_IN_KAKARIKO))) { Actor_Kill(&this->dyna.actor); diff --git a/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c b/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c index f63f427db..2eb3faeda 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c @@ -131,7 +131,7 @@ void func_808AC908(BgSpot02Objects* this, PlayState* play) { // We want to do most of the same things in rando, but we're not in a cutscene and the flag for // destroying the royal tombstone is already set. - if (gSaveContext.n64ddFlag && Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB)) { + if (IS_RANDO && Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB)) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_GRAVE_EXPLOSION); this->timer = 25; pos.x = (Math_SinS(this->dyna.actor.shape.rot.y) * 50.0f) + this->dyna.actor.world.pos.x; @@ -174,7 +174,7 @@ void func_808ACA08(BgSpot02Objects* this, PlayState* play) { // This shouldn't execute in rando even without the check since we never // enter the cutscene context. - if (play->csCtx.frames == 402 && !(gSaveContext.n64ddFlag)) { + if (play->csCtx.frames == 402 && !(IS_RANDO)) { if (!LINK_IS_ADULT) { Player_PlaySfx(&player->actor, NA_SE_VO_LI_DEMO_DAMAGE_KID); } else { @@ -220,7 +220,7 @@ void func_808ACC34(BgSpot02Objects* this, PlayState* play) { // This is the actionFunc that the game settles on when you load the Graveyard // When we're in rando and the flag for the gravestone being destroyed gets set, // set the actionFunc to the function where the gravestone explodes. - if (gSaveContext.n64ddFlag && Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB)) { + if (IS_RANDO && Flags_GetEventChkInf(EVENTCHKINF_DESTROYED_ROYAL_FAMILY_TOMB)) { this->actionFunc = func_808AC908; } diff --git a/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index 42f946b53..816f96aa4 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -217,7 +217,7 @@ void BgSpot06Objects_Destroy(Actor* thisx, PlayState* play) { // Due to Ships resource caching, the water box collisions for the river have to be manually reset play->colCtx.colHeader->waterBoxes[LHWB_GERUDO_VALLEY_RIVER_LOWER].zMin = WATER_LEVEL_RIVER_LOWER_Z; - if (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_WATER_TEMPLE)) { + if (IS_RANDO && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_WATER_TEMPLE)) { // For randomizer when leaving lake hylia while the water level is lowered, // reset the "raise lake hylia water" flag back to on if the water temple is cleared Flags_SetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER); @@ -451,7 +451,7 @@ void BgSpot06Objects_Update(Actor* thisx, PlayState* play) { } // Bail early for water control system for child or non-rando - if (LINK_IS_CHILD || !gSaveContext.n64ddFlag) { + if (LINK_IS_CHILD || !IS_RANDO) { return; } @@ -596,7 +596,7 @@ void BgSpot06Objects_WaterPlaneCutsceneRise(BgSpot06Objects* this, PlayState* pl this->actionFunc = BgSpot06Objects_DoNothing; // On rando, this is used with the water control system switch to finalize raising the water - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { this->lakeHyliaWaterLevel = 0; play->colCtx.colHeader->waterBoxes[LHWB_GERUDO_VALLEY_RIVER_LOWER].ySurface = WATER_LEVEL_RIVER_RAISED; play->colCtx.colHeader->waterBoxes[LHWB_GERUDO_VALLEY_RIVER_LOWER].zMin = WATER_LEVEL_RIVER_LOWER_Z; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index 790e06dd3..519767534 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -60,7 +60,7 @@ void BgSpot12Saku_Init(Actor* thisx, PlayState* play) { // If ER is on, force the gate to always use its permanent flag // (which it only uses in Child Gerudo Fortress in the vanilla game) - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF) { thisx->params = 0x0002; } @@ -132,7 +132,7 @@ void BgSpot12Saku_Update(Actor* thisx, PlayState* play) { BgSpot12Saku* this = (BgSpot12Saku*)thisx; // If ER is on, when the guard opens the GtG gate its permanent flag will be set. - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF && + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF && Flags_GetSwitch(play, 0x3A)) { Flags_SetSwitch(play, 0x2); } diff --git a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 6c8db2fdf..4fe2c817c 100644 --- a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -74,7 +74,7 @@ void BgTokiSwd_Init(Actor* thisx, PlayState* play) { BgTokiSwd_SetupAction(this, func_808BAF40); if (LINK_IS_ADULT) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { if (!CUR_UPG_VALUE(UPG_BOMB_BAG)) { for (size_t i = 0; i < 8; i++) { if (gSaveContext.equips.buttonItems[i] == ITEM_BOMB) { @@ -84,7 +84,7 @@ void BgTokiSwd_Init(Actor* thisx, PlayState* play) { } } this->actor.draw = NULL; - } else if (gSaveContext.n64ddFlag) { + } else if (IS_RANDO) { // don't give child link a kokiri sword if we don't have one uint32_t kokiriSwordBitMask = 1 << 0; if (!(gSaveContext.inventory.equipment & kokiriSwordBitMask)) { @@ -119,7 +119,7 @@ void func_808BAF40(BgTokiSwd* this, PlayState* play) { gSaveContext.cutsceneTrigger = 1; } - if (!LINK_IS_ADULT || (Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) && !gSaveContext.n64ddFlag) || gSaveContext.n64ddFlag) { + if (!LINK_IS_ADULT || (Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) && !IS_RANDO) || IS_RANDO) { if (Actor_HasParent(&this->actor, play)) { if (!LINK_IS_ADULT) { Item_Give(play, ITEM_SWORD_MASTER); @@ -135,7 +135,7 @@ void func_808BAF40(BgTokiSwd* this, PlayState* play) { } else { Player* player = GET_PLAYER(play); if (Actor_IsFacingPlayer(&this->actor, 0x2000) && - (!gSaveContext.n64ddFlag || (gSaveContext.n64ddFlag && player->getItemId == GI_NONE))) { + (!IS_RANDO || (IS_RANDO && player->getItemId == GI_NONE))) { func_8002F580(&this->actor, play); } } diff --git a/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c index a7f4905e7..75e920b29 100644 --- a/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/soh/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -75,7 +75,7 @@ void BgTreemouth_Init(Actor* thisx, PlayState* play) { BgTreemouth_SetupAction(this, func_808BC8B8); // If dungeon entrance randomizer is on, keep the tree mouth open // when Link is adult and sword & shield have been shown to Mido - } else if ((LINK_IS_ADULT && (!gSaveContext.n64ddFlag || + } else if ((LINK_IS_ADULT && (!IS_RANDO || Randomizer_GetSettingValue(RSK_SHUFFLE_DUNGEON_ENTRANCES) == RO_DUNGEON_ENTRANCE_SHUFFLE_OFF) || !Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) || (gSaveContext.sceneSetupIndex == 7)) { this->unk_168 = 0.0f; diff --git a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index f35c2094e..e90e36e80 100644 --- a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -1631,7 +1631,7 @@ void BossDodongo_DeathCutscene(BossDodongo* this, PlayState* play) { if (this->unk_1DA == 820) { Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS_CLEAR); - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { Actor_Spawn( &play->actorCtx, play, ACTOR_ITEM_B_HEART, Math_SinS(this->actor.shape.rot.y) * -50.0f + this->actor.world.pos.x, this->actor.world.pos.y, @@ -1650,7 +1650,7 @@ void BossDodongo_DeathCutscene(BossDodongo* this, PlayState* play) { Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_ACTIVE); func_80064534(play, &play->csCtx); func_8002DF54(play, &this->actor, 7); - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, -890.0f, -1523.76f, -3304.0f, 0, 0, 0, WARP_DUNGEON_CHILD); } else { Actor_Spawn(&play->actorCtx, play, ACTOR_DOOR_WARP1, -890.0f, -1523.76f, -3304.0f, 0, 0, 0, WARP_DUNGEON_ADULT, false); diff --git a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index 962190885..e74f3c0e4 100644 --- a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -913,7 +913,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) { this->actionFunc = BossFd_Wait; this->actor.world.pos.y -= 1000.0f; } - if (this->timers[0] == 7 && !gSaveContext.isBossRush) { + if (this->timers[0] == 7 && !IS_BOSS_RUSH) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0, true); } diff --git a/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c b/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c index a523c875e..fb14c5ebe 100644 --- a/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c +++ b/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c @@ -789,7 +789,7 @@ void BossFd2_Death(BossFd2* this, PlayState* play) { this->deathCamera = 0; func_80064534(play, &play->csCtx); func_8002DF54(play, &this->actor, 7); - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, 0.0f, 100.0f, 0.0f, 0, 0, 0, WARP_DUNGEON_ADULT); } else { diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 6cfa93860..6b8d2df5c 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -570,7 +570,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { Play_ChangeCameraStatus(play, this->csCamIndex, CAM_STAT_ACTIVE); this->csCamFov = 60.0f; - if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_GANONDORF_BATTLE) || gSaveContext.n64ddFlag || gSaveContext.isBossRush) { + if (Flags_GetEventChkInf(EVENTCHKINF_BEGAN_GANONDORF_BATTLE) || IS_RANDO || IS_BOSS_RUSH) { // watched cutscene already, skip most of it this->csState = 17; this->csTimer = 0; @@ -581,7 +581,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { BossGanon_SetIntroCsCamera(this, 11); this->unk_198 = 2; this->timers[2] = 110; - if (!(gSaveContext.isBossRush && gSaveContext.bossRushOptions[BR_OPTIONS_HEAL] == BR_CHOICE_HEAL_NEVER)) { + if (!(IS_BOSS_RUSH && gSaveContext.bossRushOptions[BR_OPTIONS_HEAL] == BR_CHOICE_HEAL_NEVER)) { gSaveContext.healthAccumulator = 0x140; } Audio_QueueSeqCmd(NA_BGM_STOP); @@ -904,7 +904,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { this->csTimer = 0; this->csCamFov = 60.0f; BossGanon_SetIntroCsCamera(this, 12); - if (!gSaveContext.n64ddFlag && !gSaveContext.isBossRush) { + if (!IS_RANDO && !IS_BOSS_RUSH) { Message_StartTextbox(play, 0x70CB, NULL); } } @@ -928,7 +928,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { this->csState = 19; this->csTimer = 0; - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { Message_StartTextbox(play, 0x70CC, NULL); } Animation_MorphToPlayOnce(&this->skelAnime, &gGanondorfRaiseHandStartAnim, -5.0f); @@ -972,7 +972,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) { if ((this->csTimer > 80) && (Message_GetState(&play->msgCtx) == TEXT_STATE_NONE)) { // In rando, skip past dark waves section straight to title card phase of the cutscene. - if (gSaveContext.n64ddFlag || gSaveContext.isBossRush) { + if (IS_RANDO || IS_BOSS_RUSH) { this->timers[2] = 30; this->csCamAt.x = this->unk_1FC.x - 10.0f; this->csCamAt.y = this->unk_1FC.y + 30.0f; @@ -1282,7 +1282,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { // Skip Ganondorf dying and go straight to next scene. // The cutscene skip met a mixed reaction, so until we figure out a better way of doing it, // it will stay not-skipped outside of Boss Rush (originally implemented for randomizer). - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { this->csState = 1; this->csTimer = 0; } else { @@ -1539,7 +1539,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { if (this->csTimer == 180) { play->sceneLoadFlag = 0x14; - if ((gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_TOWER_ESCAPE) || gSaveContext.isBossRush)) { + if ((IS_RANDO && Randomizer_GetSettingValue(RSK_SKIP_TOWER_ESCAPE) || IS_BOSS_RUSH)) { Flags_SetEventChkInf(EVENTCHKINF_WATCHED_GANONS_CASTLE_COLLAPSE_CAUGHT_BY_GERUDO); play->nextEntranceIndex = 0x517; } @@ -1562,7 +1562,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { sBossGanonZelda = (EnZl3*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_ZL3, 0.0f, 6000.0f, 0.0f, 0, 0, 0, 0x2000); - if (!gSaveContext.n64ddFlag && !gSaveContext.isBossRush) { + if (!IS_RANDO && !IS_BOSS_RUSH) { this->csState = 101; } else { this->skelAnime.playSpeed = 1.0f; @@ -1690,7 +1690,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { // fallthrough case 104: // In rando, fade out the white here as the earlier part is skipped. - if (gSaveContext.n64ddFlag || gSaveContext.isBossRush) { + if (IS_RANDO || IS_BOSS_RUSH) { Math_ApproachZeroF(&this->whiteFillAlpha, 1.0f, 10.0f); } @@ -1712,7 +1712,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, PlayState* play) { if (this->csTimer == 50) { // In rando, skip the rest of the cutscene after the crystal around Zelda dissapears. - if (!gSaveContext.n64ddFlag && !gSaveContext.isBossRush) { + if (!IS_RANDO && !IS_BOSS_RUSH) { sBossGanonZelda->unk_3C8 = 4; } else { this->csState = 108; diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 811ebbd2c..13cc46e38 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -234,7 +234,7 @@ void func_808FD5F4(BossGanon2* this, PlayState* play) { sBossGanon2Zelda->actor.shape.rot.y = -0x7000; // In rando, skip past the cutscene to the part where the player takes control again. - if (!gSaveContext.n64ddFlag && !gSaveContext.isBossRush) { + if (!IS_RANDO && !IS_BOSS_RUSH) { this->csState = 1; this->csTimer = 0; } else { diff --git a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 244053915..111380f0b 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -959,12 +959,12 @@ void BossGanondrof_Death(BossGanondrof* this, PlayState* play) { case DEATH_THROES: switch (this->work[GND_ACTION_STATE]) { case DEATH_SPASM: - if (Animation_OnFrame(&this->skelAnime, this->fwork[GND_END_FRAME]) && !gSaveContext.n64ddFlag && !gSaveContext.isBossRush) { + if (Animation_OnFrame(&this->skelAnime, this->fwork[GND_END_FRAME]) && !IS_RANDO && !IS_BOSS_RUSH) { this->fwork[GND_END_FRAME] = Animation_GetLastFrame(&gPhantomGanonAirDamageAnim); Animation_Change(&this->skelAnime, &gPhantomGanonAirDamageAnim, 0.5f, 0.0f, this->fwork[GND_END_FRAME], ANIMMODE_ONCE_INTERP, 0.0f); this->work[GND_ACTION_STATE] = DEATH_LIMP; - } else if (gSaveContext.n64ddFlag || gSaveContext.isBossRush) { + } else if (IS_RANDO || IS_BOSS_RUSH) { // Skip to death scream animation and move ganondrof to middle this->deathState = DEATH_SCREAM; this->timers[0] = 50; @@ -991,7 +991,7 @@ void BossGanondrof_Death(BossGanondrof* this, PlayState* play) { bodyDecayLevel = 1; break; } - if (gSaveContext.n64ddFlag || gSaveContext.isBossRush) { + if (IS_RANDO || IS_BOSS_RUSH) { break; } Math_ApproachS(&this->actor.shape.rot.y, this->work[GND_VARIANCE_TIMER] * -100, 5, 0xBB8); @@ -1105,7 +1105,7 @@ void BossGanondrof_Death(BossGanondrof* this, PlayState* play) { this->deathCamera = 0; func_80064534(play, &play->csCtx); func_8002DF54(play, &this->actor, 7); - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, GND_BOSSROOM_CENTER_X, GND_BOSSROOM_CENTER_Y, GND_BOSSROOM_CENTER_Z + 200.0f, 0, 0, 0, 0, true); } diff --git a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index c75c65ffc..6de72fd2d 100644 --- a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -1118,7 +1118,7 @@ void BossGoma_Defeated(BossGoma* this, PlayState* play) { this->timer = 70; this->decayingProgress = 0; this->subCameraFollowSpeed = 0.0f; - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0, true); } @@ -1152,7 +1152,7 @@ void BossGoma_Defeated(BossGoma* this, PlayState* play) { } } - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, childPos.x, this->actor.world.pos.y, childPos.z, 0, 0, 0, WARP_DUNGEON_CHILD); } else { diff --git a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index a6bb6e8ae..a8d992ca9 100644 --- a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -1116,7 +1116,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) { BossMo_SpawnDroplet(MO_FX_DROPLET, (BossMoEffect*)play->specialEffects, &spD4, &spE0, ((300 - indS1) * .0015f) + 0.13f); } - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, this->actor.world.pos.x, -280.0f, this->actor.world.pos.z, 0, 0, 0, WARP_DUNGEON_ADULT); diff --git a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index dbd531ba9..f7a48f873 100644 --- a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -1204,7 +1204,7 @@ void BossSst_HeadFinish(BossSst* this, PlayState* play) { } else if (this->effects[0].alpha == 0) { Actor_Spawn(&play->actorCtx, play, ACTOR_DOOR_WARP1, ROOM_CENTER_X, ROOM_CENTER_Y, ROOM_CENTER_Z, 0, 0, 0, WARP_DUNGEON_ADULT, true); - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, (Math_SinS(this->actor.shape.rot.y) * 200.0f) + ROOM_CENTER_X, ROOM_CENTER_Y, Math_CosS(this->actor.shape.rot.y) * 200.0f + ROOM_CENTER_Z, 0, 0, 0, 0, true); diff --git a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 9cc955797..5360eef02 100644 --- a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -2365,7 +2365,7 @@ void BossTw_DeathCSMsgSfx(BossTw* this, PlayState* play) { sp35 = 0; // Skip ahead to last part of the cutscene in rando - if (this->work[CS_TIMER_2] == 10 && (gSaveContext.n64ddFlag || gSaveContext.isBossRush)) { + if (this->work[CS_TIMER_2] == 10 && (IS_RANDO || IS_BOSS_RUSH)) { this->work[CS_TIMER_2] = 860; } @@ -2550,7 +2550,7 @@ void BossTw_DeathCSMsgSfx(BossTw* this, PlayState* play) { // Add separate timings for the "beam" that opens and closes around the sisters // Needed because we skip ahead in cutscene timer value so it never gets called otherwise - if (gSaveContext.n64ddFlag || gSaveContext.isBossRush) { + if (IS_RANDO || IS_BOSS_RUSH) { if (this->work[CS_TIMER_2] < 900) { Math_ApproachF(&this->workf[UNK_F18], 255.0f, 0.1f, 5.0f); } else if (this->work[CS_TIMER_2] > 910) { @@ -2795,7 +2795,7 @@ void BossTw_TwinrovaDeathCS(BossTw* this, PlayState* play) { func_80064534(play, &play->csCtx); func_8002DF54(play, &this->actor, 7); Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS_CLEAR); - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_DOOR_WARP1, 600.0f, 230.0f, 0.0f, 0, 0, 0, WARP_DUNGEON_ADULT); Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, -600.0f, 230.f, 0.0f, 0, 0, 0, 0, true); diff --git a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index e59e8085d..ee62b141e 100644 --- a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -1653,7 +1653,7 @@ void BossVa_BodyDeath(BossVa* this, PlayState* play) { func_8002DF54(play, &this->actor, 7); sCsState++; - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_B_HEART, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0, true); } @@ -1665,7 +1665,7 @@ void BossVa_BodyDeath(BossVa* this, PlayState* play) { } } - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_RU1, sWarpPos[sp7C].x, sWarpPos[sp7C].y, sWarpPos[sp7C].z, 0, 0, 0, 0, true); } else { diff --git a/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index 28224864c..7125984e2 100644 --- a/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/soh/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -142,7 +142,7 @@ f32 DemoEffect_InterpolateCsFrames(PlayState* play, s32 csActionId) { */ void DemoEffect_InitJewel(PlayState* play, DemoEffect* this) { this->initDrawFunc = DemoEffect_DrawJewel; - if (gSaveContext.n64ddFlag && play->sceneNum == SCENE_JABU_JABU) { + if (IS_RANDO && play->sceneNum == SCENE_JABU_JABU) { this->initDrawFunc = DemoEffect_DrawGetItem; } if (!LINK_IS_ADULT) { @@ -156,7 +156,7 @@ void DemoEffect_InitJewel(PlayState* play, DemoEffect* this) { Actor_SetScale(&this->actor, 0.10f); } this->csActionId = 1; - this->actor.shape.rot.x = (gSaveContext.n64ddFlag && play->sceneNum == SCENE_JABU_JABU) ? 0 : 16384; + this->actor.shape.rot.x = (IS_RANDO && play->sceneNum == SCENE_JABU_JABU) ? 0 : 16384; DemoEffect_InitJewelColor(this); this->jewel.alpha = 0; this->jewelCsRotation.x = this->jewelCsRotation.y = this->jewelCsRotation.z = 0; @@ -635,7 +635,7 @@ void DemoEffect_UpdateGetItem(DemoEffect* this, PlayState* play) { Actor_SetScale(thisx, 0.20f); - if (gSaveContext.entranceIndex == 0x0053 || (gSaveContext.n64ddFlag && gSaveContext.entranceIndex == 0x05F4)) { + if (gSaveContext.entranceIndex == 0x0053 || (IS_RANDO && gSaveContext.entranceIndex == 0x05F4)) { switch (play->csCtx.npcActions[this->csActionId]->action) { case 2: DemoEffect_MedalSparkle(this, play, 0); @@ -648,7 +648,7 @@ void DemoEffect_UpdateGetItem(DemoEffect* this, PlayState* play) { switch (play->csCtx.npcActions[this->csActionId]->action) { case 2: if (gSaveContext.entranceIndex == 0x0053 || - (gSaveContext.n64ddFlag && gSaveContext.entranceIndex == 0x05F4)) { + (IS_RANDO && gSaveContext.entranceIndex == 0x05F4)) { Audio_PlayActorSound2(thisx, NA_SE_EV_MEDAL_APPEAR_L - SFX_FLAG); } else { func_800788CC(NA_SE_EV_MEDAL_APPEAR_S - SFX_FLAG); @@ -664,7 +664,7 @@ void DemoEffect_UpdateGetItem(DemoEffect* this, PlayState* play) { this->actor.shape.rot.y += this->getItem.rotation; } if (gSaveContext.entranceIndex == 0x0053 || - (gSaveContext.n64ddFlag && gSaveContext.entranceIndex == 0x05F4)) { + (IS_RANDO && gSaveContext.entranceIndex == 0x05F4)) { Audio_PlayActorSound2(thisx, NA_SE_EV_MEDAL_APPEAR_L - SFX_FLAG); } else { func_800788CC(NA_SE_EV_MEDAL_APPEAR_S - SFX_FLAG); @@ -1545,7 +1545,7 @@ void DemoEffect_UpdateJewelAdult(DemoEffect* this, PlayState* play) { this->actor.shape.rot.y += 0x0400; DemoEffect_PlayJewelSfx(this, play); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { switch (this->jewel.type) { case DEMO_EFFECT_JEWEL_KOKIRI: if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { @@ -1615,14 +1615,14 @@ void DemoEffect_UpdateJewelChild(DemoEffect* this, PlayState* play) { default: DemoEffect_MoveToCsEndpoint(this, play, this->csActionId, 0); if (gSaveContext.entranceIndex == 0x0053 || - (gSaveContext.n64ddFlag && gSaveContext.entranceIndex == 0x05F4)) { + (IS_RANDO && gSaveContext.entranceIndex == 0x05F4)) { DemoEffect_MoveJewelSplit(&thisx->world, this); } break; } } - if (gSaveContext.entranceIndex == 0x0053 || (gSaveContext.n64ddFlag && gSaveContext.entranceIndex == 0x05F4)) { + if (gSaveContext.entranceIndex == 0x0053 || (IS_RANDO && gSaveContext.entranceIndex == 0x05F4)) { if (!Flags_GetEventChkInf(EVENTCHKINF_OPENED_THE_DOOR_OF_TIME)) { hasCmdAction = play->csCtx.state && play->csCtx.npcActions[this->csActionId]; if (!hasCmdAction) { @@ -1636,7 +1636,7 @@ void DemoEffect_UpdateJewelChild(DemoEffect* this, PlayState* play) { DemoEffect_PlayJewelSfx(this, play); this->effectFlags &= ~1; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { switch (this->jewel.type) { case DEMO_EFFECT_JEWEL_KOKIRI: if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { @@ -2087,7 +2087,7 @@ void DemoEffect_DrawGetItem(Actor* thisx, PlayState* play) { this->getItem.isLoaded = 1; return; } - if (gSaveContext.n64ddFlag && play->sceneNum == SCENE_JABU_JABU) { + if (IS_RANDO && play->sceneNum == SCENE_JABU_JABU) { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_BARINADE, RG_ZORA_SAPPHIRE); this->getItem.drawId = getItemEntry.gid; func_8002EBCC(thisx, play, 0); diff --git a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index 6643423e0..c72fdc4fd 100644 --- a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -868,7 +868,7 @@ void func_80986B2C(PlayState* play) { Player* player = GET_PLAYER(play); // In entrance rando have impa bring link back to the front of castle grounds - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_ENTRANCES)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_ENTRANCES)) { play->nextEntranceIndex = 0x0138; } else { play->nextEntranceIndex = 0xCD; @@ -928,7 +928,7 @@ void GivePlayerRandoRewardImpa(Actor* impa, PlayState* play, RandomizerCheck che void func_80986C30(DemoIm* this, PlayState* play) { if (func_80986A5C(this, play)) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GivePlayerRandoRewardImpa(this, play, RC_SONG_FROM_IMPA); } else { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gZeldasCourtyardLullabyCs); @@ -960,7 +960,7 @@ void func_80986D40(DemoIm* this, PlayState* play) { if (gSaveContext.sceneSetupIndex == 6) { this->action = 19; this->drawConfig = 1; - } else if ((Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) && !gSaveContext.n64ddFlag) { + } else if ((Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) && !IS_RANDO) { Actor_Kill(&this->actor); } else if (!Flags_GetEventChkInf(EVENTCHKINF_LEARNED_ZELDAS_LULLABY)) { this->action = 23; diff --git a/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index f34482503..daa843d16 100644 --- a/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/soh/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -428,7 +428,7 @@ void DemoKankyo_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); // In ER, override the warp song locations. Also removes the warp song cutscene - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES) && + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES) && thisx->params == 0x000F) { // Warp Song particles Entrance_SetWarpSongEntrance(); } @@ -808,7 +808,7 @@ void DemoKankyo_DrawWarpSparkles(Actor* thisx, PlayState* play) { this->unk_150[i].unk_23 = 0; // Skip the first part of warp song cutscenes in rando - if (gSaveContext.n64ddFlag && this->actor.params == DEMOKANKYO_WARP_OUT) { + if (IS_RANDO && this->actor.params == DEMOKANKYO_WARP_OUT) { this->unk_150[i].unk_22 = 2; } else { this->unk_150[i].unk_22++; diff --git a/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c b/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c index 9e6c3acb7..01a2ab047 100644 --- a/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c +++ b/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c @@ -88,7 +88,7 @@ s32 DemoKekkai_CheckEventFlag(s32 params) { if ((params < KEKKAI_TOWER) || (params > KEKKAI_FOREST)) { return true; } - if (gSaveContext.n64ddFlag && params > KEKKAI_TOWER) { + if (IS_RANDO && params > KEKKAI_TOWER) { return Flags_GetRandomizerInf(trialParamToRandInf(params)); } return Flags_GetEventChkInf(eventFlags[params]); @@ -148,7 +148,7 @@ void DemoKekkai_Init(Actor* thisx, PlayState* play) { this->collider2.dim.height = thisx->scale.y * 5000.0f; this->collider2.dim.yShift = 300; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { if (TrialsDoneCount() == NUM_TRIALS) { Actor_Kill(thisx); return; @@ -161,7 +161,7 @@ void DemoKekkai_Init(Actor* thisx, PlayState* play) { case KEKKAI_SHADOW: case KEKKAI_SPIRIT: case KEKKAI_FOREST: - if (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(trialParamToRandInf(thisx->params))) { + if (IS_RANDO && Flags_GetRandomizerInf(trialParamToRandInf(thisx->params))) { Actor_Kill(thisx); return; } @@ -270,7 +270,7 @@ void DemoKekkai_TrialBarrierDispel(Actor* thisx, PlayState* play) { s32 pad; DemoKekkai* this = (DemoKekkai*)thisx; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { Flags_SetRandomizerInf(trialParamToRandInf(thisx->params)); // May or may not be needed. Not sure if needed for anything // that randoInf isn't already covering. Leaving it for safety. diff --git a/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c b/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c index 8e7a3c8a1..6da87ab3c 100644 --- a/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c +++ b/soh/src/overlays/actors/ovl_Demo_Sa/z_demo_sa.c @@ -254,7 +254,7 @@ void func_8098E960(DemoSa* this, PlayState* play) { if ((gSaveContext.chamberCutsceneNum == 0) && (gSaveContext.sceneSetupIndex < 4)) { player = GET_PLAYER(play); - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { this->action = 1; play->csCtx.segment = D_8099010C; gSaveContext.cutsceneTrigger = 2; diff --git a/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 917959e2f..d5d5f7ea1 100644 --- a/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/soh/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -146,7 +146,7 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) { play->nextEntranceIndex = entrances[destinationIdx]; // In ER, load the correct entrance based on the grotto link is falling into - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { Grotto_OverrideActorEntrance(&this->actor); } diff --git a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 9b1ce5a59..5940f8c03 100644 --- a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -252,7 +252,7 @@ void DoorWarp1_SetupBlueCrystal(DoorWarp1* this, PlayState* play) { -255; } - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { play->envCtx.adjFogNear = -500; this->warpTimer = 30; } else { @@ -299,7 +299,7 @@ void DoorWarp1_SetPlayerPos(DoorWarp1* this, PlayState* play) { player->actor.velocity.y = 0.0f; player->actor.world.pos.x = this->actor.world.pos.x; - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { player->actor.world.pos.y = this->actor.world.pos.y + 55.0f; } else { player->actor.world.pos.y = this->actor.world.pos.y; @@ -323,7 +323,7 @@ void func_80999214(DoorWarp1* this, PlayState* play) { Math_SmoothStepToF(&this->crystalAlpha, 255.0f, 0.2f, 5.0f, 0.1f); - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { darkness = (f32)(40 - this->warpTimer) / 40.0f; darkness = CLAMP_MIN(darkness, 0); } else { @@ -366,7 +366,7 @@ void func_80999348(DoorWarp1* this, PlayState* play) { void DoorWarp1_FloatPlayer(DoorWarp1* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { player->actor.gravity = -0.1f; } } @@ -533,7 +533,7 @@ void DoorWarp1_ChildWarpIdle(DoorWarp1* this, PlayState* play) { if (DoorWarp1_PlayerInRange(this, play)) { player = GET_PLAYER(play); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GivePlayerRandoReward(this, player, play, 0, 0); return; } @@ -573,7 +573,7 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, PlayState* play) { if (!Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) { Flags_SetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP); Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { play->nextEntranceIndex = 0x47A; gSaveContext.nextCutsceneIndex = 0; } else { @@ -586,11 +586,11 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, PlayState* play) { gSaveContext.nextCutsceneIndex = 0; } } else if (play->sceneNum == SCENE_DEKU_TREE_BOSS) { - if (!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD) || gSaveContext.n64ddFlag) { + if (!Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD) || IS_RANDO) { Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD); Flags_SetEventChkInf(EVENTCHKINF_USED_DEKU_TREE_BLUE_WARP); Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { play->nextEntranceIndex = 0x0457; gSaveContext.nextCutsceneIndex = 0; // Skip Mido complaining about dead Deku tree @@ -609,7 +609,7 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, PlayState* play) { gSaveContext.nextCutsceneIndex = 0; } - if (gSaveContext.n64ddFlag && (Randomizer_GetSettingValue(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF || + if (IS_RANDO && (Randomizer_GetSettingValue(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF || Randomizer_GetSettingValue(RSK_SHUFFLE_BOSS_ENTRANCES) != RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF)) { Entrance_OverrideBlueWarp(); } @@ -636,7 +636,7 @@ void DoorWarp1_RutoWarpIdle(DoorWarp1* this, PlayState* play) { if (this->rutoWarpState != WARP_BLUE_RUTO_STATE_INITIAL && DoorWarp1_PlayerInRange(this, play)) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GivePlayerRandoReward(this, GET_PLAYER(play), play, 1, 0); return; } @@ -670,7 +670,7 @@ void func_80999EE0(DoorWarp1* this, PlayState* play) { Play_CameraSetAtEye(play, sRutoWarpSubCamId, &at, &eye); Play_CameraSetFov(play, sRutoWarpSubCamId, 90.0f); this->rutoWarpState = WARP_BLUE_RUTO_STATE_TALKING; - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { Message_StartTextbox(play, 0x4022, NULL); } DoorWarp1_SetupAction(this, func_80999FE4); @@ -707,7 +707,7 @@ void DoorWarp1_RutoWarpOut(DoorWarp1* this, PlayState* play) { Flags_SetEventChkInf(EVENTCHKINF_USED_JABU_JABUS_BELLY_BLUE_WARP); Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_JABU_JABUS_BELLY); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { play->nextEntranceIndex = 0x10E; gSaveContext.nextCutsceneIndex = 0; } else { @@ -716,7 +716,7 @@ void DoorWarp1_RutoWarpOut(DoorWarp1* this, PlayState* play) { gSaveContext.nextCutsceneIndex = 0xFFF0; } - if (gSaveContext.n64ddFlag && (Randomizer_GetSettingValue(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF || + if (IS_RANDO && (Randomizer_GetSettingValue(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF || Randomizer_GetSettingValue(RSK_SHUFFLE_BOSS_ENTRANCES) != RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF)) { Entrance_OverrideBlueWarp(); } @@ -761,13 +761,13 @@ void DoorWarp1_AdultWarpIdle(DoorWarp1* this, PlayState* play) { if (DoorWarp1_PlayerInRange(this, play)) { // Heal player in Boss Rush - if (gSaveContext.isBossRush) { + if (IS_BOSS_RUSH) { BossRush_HandleBlueWarpHeal(play); } player = GET_PLAYER(play); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GivePlayerRandoReward(this, player, play, 0, 1); return; } @@ -826,14 +826,14 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) { this->warpTimer++; if (this->warpTimer > sWarpTimerTarget && gSaveContext.nextCutsceneIndex == 0xFFEF) { - if (gSaveContext.isBossRush) { + if (IS_BOSS_RUSH) { BossRush_HandleBlueWarp(play, this->actor.world.pos.x, this->actor.world.pos.z); } else if (play->sceneNum == SCENE_FOREST_TEMPLE_BOSS) { if (!Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) { Flags_SetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP); Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_FOREST_TEMPLE); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { play->nextEntranceIndex = 0x608; gSaveContext.nextCutsceneIndex = 0; } else { @@ -855,7 +855,7 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) { Flags_SetEventChkInf(EVENTCHKINF_USED_FIRE_TEMPLE_BLUE_WARP); Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { play->nextEntranceIndex = 0x564; gSaveContext.nextCutsceneIndex = 0; // Change Death Mountain cloud since we aren't warping to the cutscene @@ -878,7 +878,7 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) { Flags_SetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP); Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_WATER_TEMPLE); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { play->nextEntranceIndex = 0x60C; gSaveContext.nextCutsceneIndex = 0; // Fill Lake Hylia since we aren't warping to the cutscene @@ -898,10 +898,10 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) { gSaveContext.nextCutsceneIndex = 0; } } else if (play->sceneNum == SCENE_SPIRIT_TEMPLE_BOSS) { - if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) || gSaveContext.n64ddFlag) { + if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) || IS_RANDO) { Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_SPIRIT_TEMPLE); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { play->nextEntranceIndex = 0x610; gSaveContext.nextCutsceneIndex = 0; } else { @@ -919,10 +919,10 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) { gSaveContext.nextCutsceneIndex = 0; } } else if (play->sceneNum == SCENE_SHADOW_TEMPLE_BOSS) { - if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) || gSaveContext.n64ddFlag) { + if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) || IS_RANDO) { Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { play->nextEntranceIndex = 0x580; gSaveContext.nextCutsceneIndex = 0; } else { @@ -941,7 +941,7 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) { } } - if (gSaveContext.n64ddFlag && (Randomizer_GetSettingValue(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF || + if (IS_RANDO && (Randomizer_GetSettingValue(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF || Randomizer_GetSettingValue(RSK_SHUFFLE_BOSS_ENTRANCES) != RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF)) { Entrance_OverrideBlueWarp(); } diff --git a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 2993ef18c..15ebd759c 100644 --- a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -128,7 +128,7 @@ void func_809B0558(EnAni* this, PlayState* play) { } Flags_SetItemGetInf(ITEMGETINF_15); } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_HEART_PIECE, 10000.0f, 200.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE); @@ -142,7 +142,7 @@ void func_809B05F0(EnAni* this, PlayState* play) { EnAni_SetupAction(this, func_809B0558); } - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_HEART_PIECE, 10000.0f, 200.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE); diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 31f362763..76c0feac3 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -83,7 +83,7 @@ void EnBomBowlMan_Init(Actor* thisx, PlayState* play2) { } } - this->prizeSelect = gSaveContext.n64ddFlag ? 0 : (s16)Rand_ZeroFloat(4.99f); + this->prizeSelect = IS_RANDO ? 0 : (s16)Rand_ZeroFloat(4.99f); this->actor.targetMode = 1; this->actionFunc = EnBomBowMan_SetupWaitAsleep; } @@ -142,7 +142,7 @@ void EnBomBowMan_BlinkAwake(EnBomBowlMan* this, PlayState* play) { this->dialogState = TEXT_STATE_EVENT; // Check for beaten Dodongo's Cavern if Rando is disabled - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { if ((Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) || BREG(2)) { this->actor.textId = 0xBF; } else { @@ -152,7 +152,7 @@ void EnBomBowMan_BlinkAwake(EnBomBowlMan* this, PlayState* play) { // In randomizer, only check for bomb bag when bombchus aren't in logic // and only check for bombchus when bombchus are in logic - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { u8 bombchusInLogic = Randomizer_GetSettingValue(RSK_BOMBCHUS_IN_LOGIC); if ((!bombchusInLogic && INV_CONTENT(ITEM_BOMB) == ITEM_NONE) || (bombchusInLogic && INV_CONTENT(ITEM_BOMBCHU) == ITEM_NONE)) { @@ -187,7 +187,7 @@ void EnBomBowMan_CheckBeatenDC(EnBomBowlMan* this, PlayState* play) { this->blinkTimer = (s16)Rand_ZeroFloat(60.0f) + 20; bool bombchuBowlingClosed; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { // when rando'd, check if we have bombchus if chus are in logic // and check if we have a bomb bag if chus aren't in logic u8 explosive = Randomizer_GetSettingValue(RSK_BOMBCHUS_IN_LOGIC) ? ITEM_BOMBCHU : ITEM_BOMB; @@ -431,7 +431,7 @@ void EnBomBowMan_ChooseShowPrize(EnBomBowlMan* this, PlayState* play) { } break; case 1: - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { prizeTemp = EXITEM_PURPLE_RUPEE_BOWLING; } else { prizeTemp = EXITEM_HEART_PIECE_BOWLING; @@ -444,7 +444,7 @@ void EnBomBowMan_ChooseShowPrize(EnBomBowlMan* this, PlayState* play) { prizeTemp = EXITEM_BOMBCHUS_BOWLING; break; case 3: - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { prizeTemp = EXITEM_HEART_PIECE_BOWLING; if (Flags_GetItemGetInf(ITEMGETINF_12)) { prizeTemp = EXITEM_PURPLE_RUPEE_BOWLING; diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c index b92b22d3f..a6d3afda5 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.c @@ -183,7 +183,7 @@ void EnBomBowlPit_GivePrize(EnBomBowlPit* this, PlayState* play) { this->getItemId = GI_BOMB_BAG_40; } - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { switch (this->prizeIndex) { case EXITEM_BOMB_BAG_BOWLING: this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_FIRST_PRIZE, GI_BOMB_BAG_20); @@ -202,7 +202,7 @@ void EnBomBowlPit_GivePrize(EnBomBowlPit* this, PlayState* play) { player->stateFlags1 &= ~0x20000000; this->actor.parent = NULL; - if (!gSaveContext.n64ddFlag || this->getItemEntry.getItemId == GI_NONE) { + if (!IS_RANDO || this->getItemEntry.getItemId == GI_NONE) { func_8002F434(&this->actor, play, this->getItemId, 2000.0f, 1000.0f); } else { GiveItemEntryFromActor(&this->actor, play, this->getItemEntry, 2000.0f, 1000.0f); @@ -215,7 +215,7 @@ void EnBomBowlPit_WaitTillPrizeGiven(EnBomBowlPit* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actionFunc = EnBomBowlPit_Reset; } else { - if (!gSaveContext.n64ddFlag || this->getItemEntry.getItemId == GI_NONE) { + if (!IS_RANDO || this->getItemEntry.getItemId == GI_NONE) { func_8002F434(&this->actor, play, this->getItemId, 2000.0f, 1000.0f); } else { GiveItemEntryFromActor(&this->actor, play, this->getItemEntry, 2000.0f, 1000.0f); @@ -226,7 +226,7 @@ void EnBomBowlPit_WaitTillPrizeGiven(EnBomBowlPit* this, PlayState* play) { void EnBomBowlPit_Reset(EnBomBowlPit* this, PlayState* play) { if (((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) || - (gSaveContext.n64ddFlag && this->getItemId == GI_ICE_TRAP)) { + (IS_RANDO && this->getItemId == GI_ICE_TRAP)) { // "Normal termination"/"completion" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST); if (this->getItemId == GI_HEART_PIECE) { diff --git a/soh/src/overlays/actors/ovl_En_Box/z_en_box.c b/soh/src/overlays/actors/ovl_En_Box/z_en_box.c index 6d5131732..1e2c4d6cd 100644 --- a/soh/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/soh/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -192,7 +192,7 @@ void EnBox_Init(Actor* thisx, PlayState* play2) { SkelAnime_Init(play, &this->skelanime, &gTreasureChestSkel, anim, this->jointTable, this->morphTable, 5); Animation_Change(&this->skelanime, anim, 1.5f, animFrameStart, endFrame, ANIMMODE_ONCE, 0.0f); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { this->getItemEntry = Randomizer_GetItemFromActor(this->dyna.actor.id, play->sceneNum, this->dyna.actor.params, this->dyna.actor.params >> 5 & 0x7F); } else { this->getItemEntry = ItemTable_RetrieveEntry(MOD_NONE, this->dyna.actor.params >> 5 & 0x7F); @@ -206,7 +206,7 @@ void EnBox_Init(Actor* thisx, PlayState* play2) { } // Delete chests in Boss Rush. Mainly for the chest in King Dodongo's boss room. - if (gSaveContext.isBossRush) { + if (IS_BOSS_RUSH) { EnBox_SetupAction(this, EnBox_Destroy); } } @@ -448,7 +448,7 @@ void EnBox_WaitOpen(EnBox* this, PlayState* play) { // treasure chest game rando if (Randomizer_GetSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) { - if (gSaveContext.n64ddFlag && play->sceneNum == 16 && (this->dyna.actor.params & 0x60) != 0x20) { + if (IS_RANDO && play->sceneNum == 16 && (this->dyna.actor.params & 0x60) != 0x20) { if((this->dyna.actor.params & 0xF) < 2) { Flags_SetCollectible(play, 0x1B); } @@ -476,7 +476,7 @@ void EnBox_WaitOpen(EnBox* this, PlayState* play) { // RANDOTODO treasure chest game rando if (Randomizer_GetSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) { - if (gSaveContext.n64ddFlag && play->sceneNum == 16 && (this->dyna.actor.params & 0x60) != 0x20) { + if (IS_RANDO && play->sceneNum == 16 && (this->dyna.actor.params & 0x60) != 0x20) { if((this->dyna.actor.params & 0xF) < 2) { if(Flags_GetCollectible(play, 0x1B)) { sItem = blueRupee; @@ -506,7 +506,7 @@ void EnBox_WaitOpen(EnBox* this, PlayState* play) { } // Chests need to have a negative getItemId in order to not immediately give their item // when approaching. - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { sItem.getItemId = 0 - sItem.getItemId; sItem.getItemFrom = ITEM_FROM_CHEST; GiveItemEntryFromActorWithFixedRange(&this->dyna.actor, play, sItem); @@ -626,8 +626,8 @@ void EnBox_Update(Actor* thisx, PlayState* play) { Actor_SetFocus(&this->dyna.actor, 40.0f); } - if (((!gSaveContext.n64ddFlag && ((this->dyna.actor.params >> 5 & 0x7F) == 0x7C)) || - (gSaveContext.n64ddFlag && ABS(sItem.getItemId) == RG_ICE_TRAP)) && + if (((!IS_RANDO && ((this->dyna.actor.params >> 5 & 0x7F) == 0x7C)) || + (IS_RANDO && ABS(sItem.getItemId) == RG_ICE_TRAP)) && this->actionFunc == EnBox_Open && this->skelanime.curFrame > 45 && this->iceSmokeTimer < 100) { if (!CVarGetInteger("gAddTraps.enabled", 0)) { EnBox_SpawnIceSmoke(this, play); diff --git a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c index dec4b6063..04123c7b3 100644 --- a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -107,7 +107,7 @@ void EnCow_Init(Actor* thisx, PlayState* play) { EnCow* this = (EnCow*)thisx; s32 pad; - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_COWS)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_COWS)) { EnCow_MoveForRandomizer(thisx, play); } @@ -311,7 +311,7 @@ void func_809DF96C(EnCow* this, PlayState* play) { // when randomized with cowsanity, if we haven't gotten the // reward from this cow yet, give that, otherwise use the // vanilla cow behavior - if (gSaveContext.n64ddFlag && + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_COWS) && !EnCow_HasBeenMilked(this, play)) { EnCow_SetCowMilked(this, play); diff --git a/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index d12e34c1a..df00c3cf5 100644 --- a/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/soh/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -455,7 +455,7 @@ void func_809EEA00(EnDivingGame* this, PlayState* play) { if ((this->unk_292 == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play))) { Message_CloseTextbox(play); this->actor.parent = NULL; - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_SCALE_SILVER, 90.0f, 10.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_ZD_DIVING_MINIGAME, GI_SCALE_SILVER); @@ -470,7 +470,7 @@ void func_809EEA90(EnDivingGame* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actionFunc = func_809EEAF8; } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_SCALE_SILVER, 90.0f, 10.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_ZD_DIVING_MINIGAME, GI_SCALE_SILVER); diff --git a/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c index a50a69cbe..85d47753a 100644 --- a/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -168,7 +168,7 @@ void EnDns_Init(Actor* thisx, PlayState* play) { this->actor.gravity = -1.0f; this->actor.textId = D_809F040C[this->actor.params]; this->dnsItemEntry = sItemEntries[this->actor.params]; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { // Ugly, but the best way we can identify which grotto we are in, same method 3DRando uses, but we'll need to account for entrance rando s16 respawnData = gSaveContext.respawn[RESPAWN_MODE_RETURN].data & ((1 << 8) - 1); this->scrubIdentity = Randomizer_IdentifyScrub(play->sceneNum, this->actor.params, respawnData); @@ -412,7 +412,7 @@ void EnDns_Talk(EnDns* this, PlayState* play) { void func_809EFDD0(EnDns* this, PlayState* play) { u16 pendingGetItemId; - if (!gSaveContext.n64ddFlag || !this->scrubIdentity.isShuffled) { + if (!IS_RANDO || !this->scrubIdentity.isShuffled) { if (this->actor.params == 0x9) { if (CUR_UPG_VALUE(UPG_STICKS) < 2) { pendingGetItemId = GI_STICK_UPGRADE_20; @@ -533,7 +533,7 @@ void EnDns_Update(Actor* thisx, PlayState* play) { this->dustTimer++; this->actor.textId = D_809F040C[this->actor.params]; - if (gSaveContext.n64ddFlag && this->scrubIdentity.isShuffled) { + if (IS_RANDO && this->scrubIdentity.isShuffled) { this->actor.textId = 0x9000 + (this->scrubIdentity.randomizerInf - RAND_INF_SCRUBS_PURCHASED_DODONGOS_CAVERN_DEKU_SCRUB_NEAR_BOMB_BAG_LEFT); } Actor_SetFocus(&this->actor, 60.0f); diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index 4f2ecf93d..eb9942fba 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -135,7 +135,7 @@ void EnDntDemo_Judge(EnDntDemo* this, PlayState* play) { this->judgeTimer = 0; } } else { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { Player* player = GET_PLAYER(play); switch (Player_GetMask(play)) { case PLAYER_MASK_SKULL: diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index dac77a90f..f3dff79fe 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -252,7 +252,7 @@ void EnDntNomal_TargetWait(EnDntNomal* this, PlayState* play) { if (!LINK_IS_ADULT && !Flags_GetItemGetInf(ITEMGETINF_1D)) { this->hitCounter++; if (this->hitCounter >= 3) { - if(gSaveContext.n64ddFlag) { + if(IS_RANDO) { this->actionFunc = EnDntNomal_TargetGivePrize; } else { OnePointCutscene_Init(play, 4140, -99, &this->actor, MAIN_CAM); diff --git a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 784ed5f78..6da75b1e7 100644 --- a/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/soh/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -96,7 +96,7 @@ void EnDs_GiveOddPotion(EnDs* this, PlayState* play) { gSaveContext.timer2State = 0; } else { u32 itemId = GI_ODD_POTION; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_TRADE_ODD_MUSHROOM, GI_ODD_POTION); GiveItemEntryFromActor(&this->actor, play, itemEntry, 10000.0f, 50.0f); Randomizer_ConsumeAdultTradeItem(play, ITEM_ODD_MUSHROOM); @@ -111,7 +111,7 @@ void EnDs_TalkAfterBrewOddPotion(EnDs* this, PlayState* play) { Message_CloseTextbox(play); this->actionFunc = EnDs_GiveOddPotion; u32 itemId = GI_ODD_POTION; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_TRADE_ODD_MUSHROOM, GI_ODD_POTION); GiveItemEntryFromActor(&this->actor, play, itemEntry, 10000.0f, 50.0f); Randomizer_ConsumeAdultTradeItem(play, ITEM_ODD_MUSHROOM); @@ -138,7 +138,7 @@ void EnDs_BrewOddPotion2(EnDs* this, PlayState* play) { this->brewTimer -= 1; } else { this->actionFunc = EnDs_BrewOddPotion3; - this->brewTimer = gSaveContext.n64ddFlag ? 0 : 60; + this->brewTimer = IS_RANDO ? 0 : 60; Flags_UnsetSwitch(play, 0x3F); } } @@ -148,7 +148,7 @@ void EnDs_BrewOddPotion1(EnDs* this, PlayState* play) { this->brewTimer -= 1; } else { this->actionFunc = EnDs_BrewOddPotion2; - this->brewTimer = gSaveContext.n64ddFlag ? 0 : 20; + this->brewTimer = IS_RANDO ? 0 : 20; } Math_StepToF(&this->unk_1E4, 1.0f, 0.01f); @@ -162,7 +162,7 @@ void EnDs_OfferOddPotion(EnDs* this, PlayState* play) { switch (play->msgCtx.choiceIndex) { case 0: // yes this->actionFunc = EnDs_BrewOddPotion1; - this->brewTimer = gSaveContext.n64ddFlag ? 0 : 60; + this->brewTimer = IS_RANDO ? 0 : 60; Flags_SetSwitch(play, 0x3F); play->msgCtx.msgMode = MSGMODE_PAUSED; player->exchangeItemId = EXCH_ITEM_NONE; @@ -175,7 +175,7 @@ void EnDs_OfferOddPotion(EnDs* this, PlayState* play) { } u8 EnDs_RandoCanGetGrannyItem() { - return gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_MERCHANTS) != RO_SHUFFLE_MERCHANTS_OFF && + return IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MERCHANTS) != RO_SHUFFLE_MERCHANTS_OFF && !Flags_GetRandomizerInf(RAND_INF_MERCHANTS_GRANNYS_SHOP) && // Traded odd mushroom when adult trade is on ((Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE) && Flags_GetItemGetInf(ITEMGETINF_30)) || @@ -263,7 +263,7 @@ void EnDs_Wait(EnDs* this, PlayState* play) { this->actionFunc = EnDs_OfferOddPotion; } else if ( // Always offer blue potion when adult trade is off - (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE) == RO_GENERIC_OFF) || + (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE) == RO_GENERIC_OFF) || Flags_GetItemGetInf(ITEMGETINF_30)) { // Traded odd mushroom player->actor.textId = 0x500C; this->actionFunc = EnDs_OfferBluePotion; diff --git a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c index 21f34dc9f..acd64e308 100644 --- a/soh/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/soh/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -344,7 +344,7 @@ void func_809FE4A4(EnDu* this, PlayState* play) { play->msgCtx.ocarinaMode = OCARINA_MODE_00; EnDu_SetupAction(this, func_809FE3C0); } else if (play->msgCtx.ocarinaMode >= OCARINA_MODE_06) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gGoronCityDaruniaWrongCs); gSaveContext.cutsceneTrigger = 1; } @@ -353,7 +353,7 @@ void func_809FE4A4(EnDu* this, PlayState* play) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gGoronCityDaruniaCorrectCs); gSaveContext.cutsceneTrigger = 1; } @@ -442,8 +442,8 @@ void func_809FE890(EnDu* this, PlayState* play) { Vec3f velocity = { 0.0f, 0.0f, 0.0f }; CsCmdActorAction* csAction; - if (play->csCtx.state == CS_STATE_IDLE || gSaveContext.n64ddFlag) { - if (gSaveContext.n64ddFlag) { + if (play->csCtx.state == CS_STATE_IDLE || IS_RANDO) { + if (IS_RANDO) { play->csCtx.state = CS_STATE_IDLE; } func_8002DF54(play, &this->actor, 1); @@ -518,9 +518,9 @@ void func_809FEB08(EnDu* this, PlayState* play) { EnDu_SetupAction(this, func_809FE3C0); return; } - if ((!gSaveContext.n64ddFlag && CUR_UPG_VALUE(UPG_STRENGTH) <= 0) || - (gSaveContext.n64ddFlag && !Flags_GetTreasure(play, 0x1E))) { - if (gSaveContext.n64ddFlag) { + if ((!IS_RANDO && CUR_UPG_VALUE(UPG_STRENGTH) <= 0) || + (IS_RANDO && !Flags_GetTreasure(play, 0x1E))) { + if (IS_RANDO) { Flags_SetTreasure(play, 0x1E); } this->actor.textId = 0x301C; @@ -548,7 +548,7 @@ void func_809FEC70(EnDu* this, PlayState* play) { EnDu_SetupAction(this, func_809FECE4); } else { f32 xzRange = this->actor.xzDistToPlayer + 1.0f; - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_BRACELET, xzRange, fabsf(this->actor.yDistToPlayer) + 1.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GC_DARUNIAS_JOY, GI_BRACELET); diff --git a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index d5941d348..8d8c2c543 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -137,7 +137,7 @@ void EnExItem_WaitForObject(EnExItem* this, PlayState* play) { onCounter = true; case EXITEM_BOMB_BAG_BOWLING: this->unk_17C = func_8002EBCC; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { this->giDrawId = Randomizer_GetItemFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_FIRST_PRIZE, GI_BOMB_BAG_20).gid; } else { @@ -150,7 +150,7 @@ void EnExItem_WaitForObject(EnExItem* this, PlayState* play) { this->actionFunc = EnExItem_BowlPrize; } else { this->actionFunc = EnExItem_SetupBowlCounter; - this->actor.shape.yOffset = gSaveContext.n64ddFlag ? -10.0f : -18.0f; + this->actor.shape.yOffset = IS_RANDO ? -10.0f : -18.0f; } break; case EXITEM_HEART_PIECE_COUNTER: @@ -172,7 +172,7 @@ void EnExItem_WaitForObject(EnExItem* this, PlayState* play) { onCounter = true; case EXITEM_BOMBCHUS_BOWLING: this->unk_17C = func_8002EBCC; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { this->giDrawId = Randomizer_GetItemFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_BOMBCHUS, GI_BOMBCHUS_10).gid; } else { this->giDrawId = GID_BOMBCHU; @@ -228,7 +228,7 @@ void EnExItem_WaitForObject(EnExItem* this, PlayState* play) { this->scale = 0.5f; this->unkFloat = 0.5f; this->actor.velocity.y = 10.0f; - if (!gSaveContext.n64ddFlag || !Randomizer_GetSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) { + if (!IS_RANDO || !Randomizer_GetSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) { switch (this->type) { case EXITEM_GREEN_RUPEE_CHEST: this->giDrawId = GID_RUPEE_GREEN; @@ -376,7 +376,7 @@ void EnExItem_TargetPrizeApproach(EnExItem* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, -0x4000, 5, 0x1000, 0); } - if (!gSaveContext.n64ddFlag && this->timer != 0) { + if (!IS_RANDO && this->timer != 0) { if (this->prizeRotateTimer != 0) { tmpf1 = play->view.lookAt.x - play->view.eye.x; tmpf2 = play->view.lookAt.y - 10.0f - play->view.eye.y; @@ -402,7 +402,7 @@ void EnExItem_TargetPrizeApproach(EnExItem* this, PlayState* play) { this->actor.draw = NULL; func_8002DF54(play, NULL, 7); this->actor.parent = NULL; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GET_PLAYER(play)->stateFlags1 &= ~(PLAYER_STATE1_GETTING_ITEM | PLAYER_STATE1_ITEM_OVER_HEAD); getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_TARGET_IN_WOODS, GI_BULLET_BAG_50); getItemId = getItemEntry.getItemId; @@ -414,7 +414,7 @@ void EnExItem_TargetPrizeApproach(EnExItem* this, PlayState* play) { } } - if (!gSaveContext.n64ddFlag || getItemEntry.getItemId == GI_NONE) { + if (!IS_RANDO || getItemEntry.getItemId == GI_NONE) { func_8002F434(&this->actor, play, getItemId, 2000.0f, 1000.0f); } else { GiveItemEntryFromActor(&this->actor, play, getItemEntry, 2000.0f, 1000.0f); @@ -427,7 +427,7 @@ void EnExItem_TargetPrizeGive(EnExItem* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actionFunc = EnExItem_TargetPrizeFinish; } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { s32 getItemId = (CUR_UPG_VALUE(UPG_BULLET_BAG) == 2) ? GI_BULLET_BAG_50 : GI_BULLET_BAG_40; func_8002F434(&this->actor, play, getItemId, 2000.0f, 1000.0f); } else { @@ -510,7 +510,7 @@ void EnExItem_DrawItems(EnExItem* this, PlayState* play) { } if (this) {} func_8002ED80(&this->actor, play, 0); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GetItemEntry randoGetItem = (GetItemEntry)GET_ITEM_NONE; switch (this->type) { case EXITEM_BOMB_BAG_BOWLING: @@ -539,7 +539,7 @@ void EnExItem_DrawItems(EnExItem* this, PlayState* play) { void EnExItem_DrawHeartPiece(EnExItem* this, PlayState* play) { func_8002ED80(&this->actor, play, 0); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GetItemEntry randoGetItem = Randomizer_GetItemFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_SECOND_PRIZE, GI_HEART_PIECE); EnItem00_CustomItemsParticles(&this->actor, play, randoGetItem); diff --git a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 0cad40183..11a7eb026 100644 --- a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -968,7 +968,7 @@ void EnFr_SetReward(EnFr* this, PlayState* play) { if (!(gSaveContext.eventChkInf[13] & sSongIndex[songIndex])) { gSaveContext.eventChkInf[13] |= sSongIndex[songIndex]; GameInteractor_ExecuteOnFlagSet(FLAG_EVENT_CHECK_INF, (EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) + sSongIndexShift[songIndex]); - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { this->reward = GI_RUPEE_PURPLE; } else { this->getItemEntry = Randomizer_GetItemFromKnownCheck(EnFr_RandomizerCheckFromSongIndex(songIndex), GI_RUPEE_PURPLE); @@ -981,7 +981,7 @@ void EnFr_SetReward(EnFr* this, PlayState* play) { if (!(gSaveContext.eventChkInf[13] & sSongIndex[songIndex])) { gSaveContext.eventChkInf[13] |= sSongIndex[songIndex]; GameInteractor_ExecuteOnFlagSet(FLAG_EVENT_CHECK_INF, (EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) + sSongIndexShift[songIndex]); - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { this->reward = GI_HEART_PIECE; } else { this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_ZR_FROGS_IN_THE_RAIN, GI_HEART_PIECE); @@ -994,7 +994,7 @@ void EnFr_SetReward(EnFr* this, PlayState* play) { if (!(gSaveContext.eventChkInf[13] & sSongIndex[songIndex])) { gSaveContext.eventChkInf[13] |= sSongIndex[songIndex]; GameInteractor_ExecuteOnFlagSet(FLAG_EVENT_CHECK_INF, (EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) + sSongIndexShift[songIndex]); - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { this->reward = GI_HEART_PIECE; } else { this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_ZR_FROGS_OCARINA_GAME, GI_HEART_PIECE); @@ -1049,7 +1049,7 @@ void EnFr_Deactivate(EnFr* this, PlayState* play) { this->actionFunc = EnFr_Idle; } else { this->actionFunc = EnFr_GiveReward; - if (!gSaveContext.n64ddFlag || this->getItemEntry.getItemId == GI_NONE) { + if (!IS_RANDO || this->getItemEntry.getItemId == GI_NONE) { func_8002F434(&this->actor, play, this->reward, 30.0f, 100.0f); } else { GiveItemEntryFromActor(&this->actor, play, this->getItemEntry, 30.0f, 100.0f); @@ -1062,7 +1062,7 @@ void EnFr_GiveReward(EnFr* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = EnFr_SetIdle; } else { - if (!gSaveContext.n64ddFlag || this->getItemEntry.getItemId == GI_NONE) { + if (!IS_RANDO || this->getItemEntry.getItemId == GI_NONE) { func_8002F434(&this->actor, play, this->reward, 30.0f, 100.0f); } else { GiveItemEntryFromActor(&this->actor, play, this->getItemEntry, 30.0f, 100.0f); @@ -1071,7 +1071,7 @@ void EnFr_GiveReward(EnFr* this, PlayState* play) { } void EnFr_SetIdle(EnFr* this, PlayState* play) { - if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play) || (gSaveContext.n64ddFlag && this->reward == RG_ICE_TRAP)) { + if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play) || (IS_RANDO && this->reward == RG_ICE_TRAP)) { this->actionFunc = EnFr_Idle; } } diff --git a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c index d2b8f7bef..278fb18e2 100644 --- a/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/soh/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -172,7 +172,7 @@ void func_80A1DB60(EnFu* this, PlayState* play) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; } - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { this->actionFunc = func_WaitForSongGive; } } @@ -186,7 +186,7 @@ void func_80A1DBA0(EnFu* this, PlayState* play) { void func_80A1DBD4(EnFu* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (gSaveContext.n64ddFlag && (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING)) { + if (IS_RANDO && (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING)) { play->msgCtx.ocarinaMode = OCARINA_MODE_03; } @@ -199,7 +199,7 @@ void func_80A1DBD4(EnFu* this, PlayState* play) { this->actionFunc = func_80A1DB60; this->actor.flags &= ~ACTOR_FLAG_WILL_TALK; - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gSongOfStormsCs); gSaveContext.cutsceneTrigger = 1; Item_Give(play, ITEM_SONG_STORMS); @@ -249,7 +249,7 @@ void EnFu_WaitAdult(EnFu* this, PlayState* play) { } else if (player->stateFlags2 & 0x1000000) { this->actor.textId = 0x5035; Message_StartTextbox(play, this->actor.textId, NULL); - this->actionFunc = gSaveContext.n64ddFlag ? func_80A1DBD4 : EnFu_TeachSong; + this->actionFunc = IS_RANDO ? func_80A1DBD4 : EnFu_TeachSong; this->behaviorFlags |= FU_WAIT; } else if (Actor_ProcessTalkRequest(&this->actor, play)) { this->actionFunc = func_80A1DBA0; diff --git a/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c index b8e24e19d..9cbdf05c9 100644 --- a/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -359,7 +359,7 @@ void func_80A2FA50(EnGb* this, PlayState* play) { void func_80A2FB40(EnGb* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE && Message_ShouldAdvance(play)) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->dyna.actor, play, GI_BOTTLE, 100.0f, 10.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_MARKET_10_BIG_POES, GI_BOTTLE); @@ -374,7 +374,7 @@ void func_80A2FBB0(EnGb* this, PlayState* play) { this->dyna.actor.parent = NULL; this->actionFunc = func_80A2FC0C; } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->dyna.actor, play, GI_BOTTLE, 100.0f, 10.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_MARKET_10_BIG_POES, GI_BOTTLE); diff --git a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index fa5f7787a..813ed9373 100644 --- a/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/soh/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -95,7 +95,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { EnGe1* this = (EnGe1*)thisx; // When spawning the gate operator, also spawn an extra gate operator on the wasteland side - if (gSaveContext.n64ddFlag && (Randomizer_GetSettingValue(RSK_SHUFFLE_GERUDO_MEMBERSHIP_CARD) || + if (IS_RANDO && (Randomizer_GetSettingValue(RSK_SHUFFLE_GERUDO_MEMBERSHIP_CARD) || Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_ENTRANCES)) && (this->actor.params & 0xFF) == GE1_TYPE_GATE_OPERATOR) { // Spawn the extra gaurd with params matching the custom type added (0x0300 + 0x02) Actor_Spawn(&play->actorCtx, play, ACTOR_EN_GE1, -1358.0f, 88.0f, -3018.0f, 0, 0x95B0, 0, @@ -185,7 +185,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { if (EnGe1_CheckCarpentersFreed()) { // If the gtg gate is permanently open, don't let the gaurd charge to open it again - if (gSaveContext.n64ddFlag && gSaveContext.sceneFlags[93].swch & 0x00000004) { + if (IS_RANDO && gSaveContext.sceneFlags[93].swch & 0x00000004) { this->actionFunc = EnGe1_SetNormalText; } else { this->actionFunc = EnGe1_CheckForCard_GTGGuard; @@ -235,7 +235,7 @@ void EnGe1_SetAnimationIdle(EnGe1* this) { } s32 EnGe1_CheckCarpentersFreed(void) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { if (CHECK_QUEST_ITEM(QUEST_GERUDO_CARD)) { return 1; } else { @@ -269,7 +269,7 @@ void EnGe1_KickPlayer(EnGe1* this, PlayState* play) { play->nextEntranceIndex = 0x3B4; } - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { Entrance_OverrideGeurdoGuardCapture(); } @@ -532,7 +532,7 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, PlayState* play) { s32 getItemId; if (Actor_HasParent(&this->actor, play)) { - if (gSaveContext.n64ddFlag && gSaveContext.minigameScore >= 1500 && !Flags_GetInfTable(INFTABLE_190)) { + if (IS_RANDO && gSaveContext.minigameScore >= 1500 && !Flags_GetInfTable(INFTABLE_190)) { Flags_SetItemGetInf(ITEMGETINF_0F); Flags_SetInfTable(INFTABLE_190); this->stateFlags |= GE1_STATE_GIVE_QUIVER; @@ -549,7 +549,7 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, PlayState* play) { } } else { if (this->stateFlags & GE1_STATE_GIVE_QUIVER) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { switch (CUR_UPG_VALUE(UPG_QUIVER)) { //! @bug Asschest. See next function for details case 1: @@ -564,7 +564,7 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, PlayState* play) { getItemId = getItemEntry.getItemId; } } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { getItemId = GI_HEART_PIECE; } else { getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_HBA_1000_POINTS, GI_HEART_PIECE); @@ -572,7 +572,7 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, PlayState* play) { } } - if (!gSaveContext.n64ddFlag || getItemEntry.getItemId == GI_NONE) { + if (!IS_RANDO || getItemEntry.getItemId == GI_NONE) { func_8002F434(&this->actor, play, getItemId, 10000.0f, 50.0f); } else { GiveItemEntryFromActor(&this->actor, play, getItemEntry, 10000.0f, 50.0f); @@ -590,7 +590,7 @@ void EnGe1_BeginGiveItem_Archery(EnGe1* this, PlayState* play) { } if (this->stateFlags & GE1_STATE_GIVE_QUIVER) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { switch (CUR_UPG_VALUE(UPG_QUIVER)) { //! @bug Asschest. See next function for details case 1: @@ -605,7 +605,7 @@ void EnGe1_BeginGiveItem_Archery(EnGe1* this, PlayState* play) { getItemId = getItemEntry.getItemId; } } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { getItemId = GI_HEART_PIECE; } else { getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_HBA_1000_POINTS, GI_HEART_PIECE); @@ -613,7 +613,7 @@ void EnGe1_BeginGiveItem_Archery(EnGe1* this, PlayState* play) { } } - if (!gSaveContext.n64ddFlag || getItemEntry.getItemId == GI_NONE) { + if (!IS_RANDO || getItemEntry.getItemId == GI_NONE) { func_8002F434(&this->actor, play, getItemId, 10000.0f, 50.0f); } else { GiveItemEntryFromActor(&this->actor, play, getItemEntry, 10000.0f, 50.0f); diff --git a/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 6d5b673fd..eba22b432 100644 --- a/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/soh/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -227,7 +227,7 @@ s32 Ge2_DetectPlayerInUpdate(PlayState* play, EnGe2* this, Vec3f* pos, s16 yRot, } s32 EnGe2_CheckCarpentersFreed(void) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { if (CHECK_QUEST_ITEM(QUEST_GERUDO_CARD)) { return 1; } else { @@ -259,7 +259,7 @@ void EnGe2_CaptureClose(EnGe2* this, PlayState* play) { play->nextEntranceIndex = 0x3B4; } - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { Entrance_OverrideGeurdoGuardCapture(); } @@ -289,7 +289,7 @@ void EnGe2_CaptureCharge(EnGe2* this, PlayState* play) { play->nextEntranceIndex = 0x3B4; } - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { Entrance_OverrideGeurdoGuardCapture(); } @@ -471,7 +471,7 @@ void EnGe2_WaitTillCardGiven(EnGe2* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = EnGe2_SetActionAfterTalk; } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_GERUDO_CARD, 10000.0f, 50.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD); @@ -485,7 +485,7 @@ void EnGe2_GiveCard(EnGe2* this, PlayState* play) { Message_CloseTextbox(play); this->actor.flags &= ~ACTOR_FLAG_WILL_TALK; this->actionFunc = EnGe2_WaitTillCardGiven; - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_GERUDO_CARD, 10000.0f, 50.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD); diff --git a/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index 4cb698970..90d2981f0 100644 --- a/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/soh/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -144,7 +144,7 @@ void EnGe3_WaitTillCardGiven(EnGe3* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = EnGe3_Wait; } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_GERUDO_CARD, 10000.0f, 50.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD); @@ -158,7 +158,7 @@ void EnGe3_GiveCard(EnGe3* this, PlayState* play) { Message_CloseTextbox(play); this->actor.flags &= ~ACTOR_FLAG_WILL_TALK; this->actionFunc = EnGe3_WaitTillCardGiven; - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_GERUDO_CARD, 10000.0f, 50.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD); diff --git a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index cd113f804..f556a6c7f 100644 --- a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -1575,7 +1575,7 @@ void EnGeldB_Draw(Actor* thisx, PlayState* play) { play->nextEntranceIndex = 0x3B4; } - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { Entrance_OverrideGeurdoGuardCapture(); } diff --git a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index f575f60af..bb9ee05c2 100644 --- a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -416,7 +416,7 @@ void EnGirlA_InitItem(EnGirlA* this, PlayState* play) { return; } - if (!gSaveContext.n64ddFlag || Randomizer_GetSettingValue(RSK_SHOPSANITY) == RO_SHOPSANITY_OFF) { + if (!IS_RANDO || Randomizer_GetSettingValue(RSK_SHOPSANITY) == RO_SHOPSANITY_OFF) { this->objBankIndex = Object_GetIndex(&play->objectCtx, shopItemEntries[params].objID); } else { s16 objectId = shopItemEntries[params].objID; @@ -474,7 +474,7 @@ s32 EnGirlA_CanBuy_Arrows(PlayState* play, EnGirlA* this) { } s32 EnGirlA_CanBuy_Bombs(PlayState* play, EnGirlA* this) { - if (!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) { + if (!IS_RANDO && !CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) { return CANBUY_RESULT_CANT_GET_NOW; } if (AMMO(ITEM_BOMB) >= CUR_CAPACITY(UPG_BOMB_BAG)) { @@ -605,7 +605,7 @@ s32 EnGirlA_CanBuy_DekuShield(PlayState* play, EnGirlA* this) { s32 EnGirlA_CanBuy_GoronTunic(PlayState* play, EnGirlA* this) { if (LINK_AGE_IN_YEARS == YEARS_CHILD && - (!gSaveContext.n64ddFlag || Randomizer_GetSettingValue(RSK_SHOPSANITY) == RO_SHOPSANITY_OFF)) { + (!IS_RANDO || Randomizer_GetSettingValue(RSK_SHOPSANITY) == RO_SHOPSANITY_OFF)) { return CANBUY_RESULT_CANT_GET_NOW; } if (gBitFlags[9] & gSaveContext.inventory.equipment) { @@ -622,7 +622,7 @@ s32 EnGirlA_CanBuy_GoronTunic(PlayState* play, EnGirlA* this) { s32 EnGirlA_CanBuy_ZoraTunic(PlayState* play, EnGirlA* this) { if (LINK_AGE_IN_YEARS == YEARS_CHILD && - (!gSaveContext.n64ddFlag || Randomizer_GetSettingValue(RSK_SHOPSANITY) == RO_SHOPSANITY_OFF)) { + (!IS_RANDO || Randomizer_GetSettingValue(RSK_SHOPSANITY) == RO_SHOPSANITY_OFF)) { return CANBUY_RESULT_CANT_GET_NOW; } if (gBitFlags[10] & gSaveContext.inventory.equipment) { @@ -678,7 +678,7 @@ s32 EnGirlA_CanBuy_Unk20(PlayState* play, EnGirlA* this) { s32 EnGirlA_CanBuy_Bombchus(PlayState* play, EnGirlA* this) { // When in rando, don't allow buying bombchus when the player doesn't have required explosives // If bombchus are in logic, the player needs to have bombchus; otherwise they need a bomb bag - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { u8 bombchusInLogic = Randomizer_GetSettingValue(RSK_BOMBCHUS_IN_LOGIC); if ((!bombchusInLogic && CUR_CAPACITY(UPG_BOMB_BAG) == 0) || (bombchusInLogic && INV_CONTENT(ITEM_BOMBCHU) == ITEM_NONE)) { @@ -1027,7 +1027,7 @@ void EnGirlA_BuyEvent_ObtainBombchuPack(PlayState* play, EnGirlA* this) { // Normally, buying a bombchu pack sets a flag indicating the pack is now sold out // If they're in logic for rando, skip setting that flag so they can be purchased repeatedly - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_BOMBCHUS_IN_LOGIC)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_BOMBCHUS_IN_LOGIC)) { return; } @@ -1254,7 +1254,7 @@ void EnGirlA_InitializeItemAction(EnGirlA* this, PlayState* play) { this->itemGiveFunc = itemEntry->itemGiveFunc; this->buyEventFunc = itemEntry->buyEventFunc; // If chus are in logic, make the 10 pack affordable without a wallet upgrade - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_BOMBCHUS_IN_LOGIC) && + if (IS_RANDO && Randomizer_GetSettingValue(RSK_BOMBCHUS_IN_LOGIC) && this->getItemId == GI_BOMBCHUS_10) { this->basePrice = 99; } else { diff --git a/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 8faca98f4..f461e781c 100644 --- a/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/soh/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -96,7 +96,7 @@ void EnGm_Destroy(Actor* thisx, PlayState* play) { s32 func_80A3D7C8(void) { if (LINK_AGE_IN_YEARS == YEARS_CHILD) { return 0; - } else if ((gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_MERCHANTS) != RO_SHUFFLE_MERCHANTS_OFF) && + } else if ((IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MERCHANTS) != RO_SHUFFLE_MERCHANTS_OFF) && !Flags_GetRandomizerInf(RAND_INF_MERCHANTS_MEDIGORON)) { return 1; } else if (!(gBitFlags[2] & gSaveContext.inventory.equipment)) { // Don't have giant's knife @@ -215,7 +215,7 @@ void func_80A3DC44(EnGm* this, PlayState* play) { return; case 1: Flags_SetInfTable(INFTABLE_B1); - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_MERCHANTS) != RO_SHUFFLE_MERCHANTS_OFF && + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MERCHANTS) != RO_SHUFFLE_MERCHANTS_OFF && !Flags_GetRandomizerInf(RAND_INF_MERCHANTS_MEDIGORON)) { //Resets "Talked to Medigoron" flag in infTable to restore initial conversation state Flags_UnsetInfTable(INFTABLE_B1); @@ -256,7 +256,7 @@ void EnGm_ProcessChoiceIndex(EnGm* this, PlayState* play) { } else { GetItemEntry itemEntry; - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_MERCHANTS) != RO_SHUFFLE_MERCHANTS_OFF && + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MERCHANTS) != RO_SHUFFLE_MERCHANTS_OFF && !Flags_GetRandomizerInf(RAND_INF_MERCHANTS_MEDIGORON)) { itemEntry = Randomizer_GetItemFromKnownCheck(RC_GC_MEDIGORON, GI_SWORD_KNIFE); GiveItemEntryFromActor(&this->actor, play, itemEntry, 415.0f, 10.0f); @@ -281,7 +281,7 @@ void EnGm_ProcessChoiceIndex(EnGm* this, PlayState* play) { void func_80A3DF00(EnGm* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_MERCHANTS) != RO_SHUFFLE_MERCHANTS_OFF && + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MERCHANTS) != RO_SHUFFLE_MERCHANTS_OFF && !Flags_GetRandomizerInf(RAND_INF_MERCHANTS_MEDIGORON)) { Flags_SetRandomizerInf(RAND_INF_MERCHANTS_MEDIGORON); } @@ -289,7 +289,7 @@ void func_80A3DF00(EnGm* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = func_80A3DF60; } else { - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_MERCHANTS) != RO_SHUFFLE_MERCHANTS_OFF && + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MERCHANTS) != RO_SHUFFLE_MERCHANTS_OFF && !Flags_GetRandomizerInf(RAND_INF_MERCHANTS_MEDIGORON)) { GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_GC_MEDIGORON, GI_SWORD_KNIFE); GiveItemEntryFromActor(&this->actor, play, itemEntry, 415.0f, 10.0f); diff --git a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c index bdfff4f4d..ea9b13561 100644 --- a/soh/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/soh/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -95,7 +95,7 @@ u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { switch (thisx->params & 0xF0) { case 0x90: - if (!gSaveContext.n64ddFlag && gSaveContext.bgsFlag) { + if (!IS_RANDO && gSaveContext.bgsFlag) { return 0x305E; } else if (INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_CLAIM_CHECK) { if (Environment_GetBgsDayCount() >= CVarGetInteger("gForgeTime", 3)) { @@ -113,8 +113,8 @@ u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { return 0x3053; } case 0x00: - if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || - (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) { + if ((!IS_RANDO && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || + (IS_RANDO && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) { if (Flags_GetInfTable(INFTABLE_10F)) { return 0x3042; } else { @@ -859,7 +859,7 @@ void func_80A405CC(EnGo* this, PlayState* play) { void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) { if (((this->actor.params & 0xF0) == 0x90) && (this->interactInfo.talkState == NPC_TALK_STATE_ACTION)) { - if (!gSaveContext.n64ddFlag && gSaveContext.bgsFlag) { + if (!IS_RANDO && gSaveContext.bgsFlag) { this->interactInfo.talkState = NPC_TALK_STATE_IDLE; } else { if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_EYEDROPS) { @@ -958,7 +958,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { this->unk_20C = 0; if ((this->actor.params & 0xF0) == 0x90) { if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_CLAIM_CHECK) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { getItemId = GI_SWORD_BGS; } else { getItemEntry = Randomizer_GetItemFromKnownCheck(RC_DMT_TRADE_CLAIM_CHECK, GI_SWORD_BGS); @@ -967,7 +967,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { this->unk_20C = 1; } if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_EYEDROPS) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { getItemEntry = Randomizer_GetItemFromKnownCheck(RC_DMT_TRADE_EYEDROPS, GI_CLAIM_CHECK); getItemId = getItemEntry.getItemId; Randomizer_ConsumeAdultTradeItem(play, ITEM_EYEDROPS); @@ -976,7 +976,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { } } if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_SWORD_BROKEN) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { getItemEntry = Randomizer_GetItemFromKnownCheck(RC_DMT_TRADE_BROKEN_SWORD, GI_PRESCRIPTION); Randomizer_ConsumeAdultTradeItem(play, ITEM_SWORD_BROKEN); getItemId = getItemEntry.getItemId; @@ -992,7 +992,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { yDist = fabsf(this->actor.yDistToPlayer) + 1.0f; xzDist = this->actor.xzDistToPlayer + 1.0f; - if (!gSaveContext.n64ddFlag || getItemEntry.getItemId == GI_NONE) { + if (!IS_RANDO || getItemEntry.getItemId == GI_NONE) { func_8002F434(&this->actor, play, getItemId, xzDist, yDist); } else { GiveItemEntryFromActor(&this->actor, play, getItemEntry, xzDist, yDist); diff --git a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 76ecaea95..02c4d37a7 100644 --- a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -335,7 +335,7 @@ u16 EnGo2_GoronFireGenericGetTextId(EnGo2* this) { u16 EnGo2_GetTextIdGoronCityRollingBig(PlayState* play, EnGo2* this) { if (Flags_GetInfTable(INFTABLE_11E)) { return 0x3013; - } else if ((CUR_CAPACITY(UPG_BOMB_BAG) >= 20 || gSaveContext.n64ddFlag) && this->waypoint > 7 && this->waypoint < 12) { + } else if ((CUR_CAPACITY(UPG_BOMB_BAG) >= 20 || IS_RANDO) && this->waypoint > 7 && this->waypoint < 12) { return 0x3012; } else { return 0x3011; @@ -350,7 +350,7 @@ s16 EnGo2_UpdateTalkStateGoronCityRollingBig(PlayState* play, EnGo2* this) { if (Message_ShouldAdvance(play)) { if (this->actor.textId == 0x3012) { this->actionFunc = EnGo2_SetupGetItem; - if(!gSaveContext.n64ddFlag) { + if(!IS_RANDO) { EnGo2_GetItem(this, play, CUR_CAPACITY(UPG_BOMB_BAG) == 30 ? GI_BOMB_BAG_40 : GI_BOMB_BAG_30); } else { EnGo2_GetItemEntry(this, play, Randomizer_GetItemFromKnownCheck(RC_GC_ROLLING_GORON_AS_CHILD, GI_BOMB_BAG_40)); @@ -416,11 +416,11 @@ s16 EnGo2_UpdateTalkStateGoronDmtRollingSmall(PlayState* play, EnGo2* this) { } u16 EnGo2_GetTextIdGoronDmtDcEntrance(PlayState* play, EnGo2* this) { - if (((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || - (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && LINK_IS_ADULT) { + if (((!IS_RANDO && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || + (IS_RANDO && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && LINK_IS_ADULT) { return 0x3043; - } else if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) || - (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN))) { + } else if ((!IS_RANDO && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) || + (IS_RANDO && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN))) { return 0x3027; } else { return Flags_GetEventChkInf(EVENTCHKINF_BOMBED_DODONGOS_CAVERN_ENTRANCE) ? 0x3021 : Flags_GetInfTable(INFTABLE_E0) ? 0x302A : 0x3008; @@ -439,11 +439,11 @@ s16 EnGo2_UpdateTalkStateGoronDmtDcEntrance(PlayState* play, EnGo2* this) { } u16 EnGo2_GetTextIdGoronCityEntrance(PlayState* play, EnGo2* this) { - if (((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || - (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && LINK_IS_ADULT) { + if (((!IS_RANDO && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || + (IS_RANDO && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && LINK_IS_ADULT) { return 0x3043; - } else if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) || - (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN))) { + } else if ((!IS_RANDO && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) || + (IS_RANDO && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN))) { return 0x3027; } else { return Flags_GetInfTable(INFTABLE_F0) ? 0x3015 : 0x3014; @@ -462,11 +462,11 @@ s16 EnGo2_UpdateTalkStateGoronCityEntrance(PlayState* play, EnGo2* this) { } u16 EnGo2_GetTextIdGoronCityIsland(PlayState* play, EnGo2* this) { - if (((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || - (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && LINK_IS_ADULT) { + if (((!IS_RANDO && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || + (IS_RANDO && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && LINK_IS_ADULT) { return 0x3043; - } else if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) || - (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN))) { + } else if ((!IS_RANDO && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) || + (IS_RANDO && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN))) { return 0x3027; } else { return Flags_GetInfTable(INFTABLE_F4) ? 0x3017 : 0x3016; @@ -485,11 +485,11 @@ s16 EnGo2_UpdateTalkStateGoronCityIsland(PlayState* play, EnGo2* this) { } u16 EnGo2_GetTextIdGoronCityLowestFloor(PlayState* play, EnGo2* this) { - if (((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || - (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && LINK_IS_ADULT) { + if (((!IS_RANDO && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || + (IS_RANDO && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && LINK_IS_ADULT) { return 0x3043; - } else if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) || - (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN))) { + } else if ((!IS_RANDO && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) || + (IS_RANDO && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN))) { return 0x3027; } else { return CUR_UPG_VALUE(UPG_STRENGTH) != 0 ? 0x302C @@ -513,7 +513,7 @@ s16 EnGo2_UpdateTalkStateGoronCityLowestFloor(PlayState* play, EnGo2* this) { u16 EnGo2_GetTextIdGoronCityLink(PlayState* play, EnGo2* this) { // For rando, prioritize opening the doors in GC when Link the goron has been stopped when // the doors are not opened, otherwise let him talk about the DMC exit or that gorons are saved - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { if (!Flags_GetInfTable(INFTABLE_STOPPED_GORON_LINKS_ROLLING)) { return 0x3030; } else if (!Flags_GetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED)) { @@ -543,7 +543,7 @@ s16 EnGo2_UpdateTalkStateGoronCityLink(PlayState* play, EnGo2* this) { case TEXT_STATE_CLOSING: switch (this->actor.textId) { case 0x3036: - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { EnGo2_GetItem(this, play, GI_TUNIC_GORON); this->actionFunc = EnGo2_SetupGetItem; return NPC_TALK_STATE_ACTION; @@ -605,7 +605,7 @@ s16 EnGo2_UpdateTalkStateGoronCityLink(PlayState* play, EnGo2* this) { u16 EnGo2_GetTextIdGoronDmtBiggoron(PlayState* play, EnGo2* this) { Player* player = GET_PLAYER(play); - if (!gSaveContext.n64ddFlag && gSaveContext.bgsFlag) { + if (!IS_RANDO && gSaveContext.bgsFlag) { player->exchangeItemId = EXCH_ITEM_CLAIM_CHECK; return 0x305E; } else if (INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_CLAIM_CHECK) { @@ -627,11 +627,11 @@ s16 EnGo2_UpdateTalkStateGoronDmtBiggoron(PlayState* play, EnGo2* this) { switch (EnGo2_GetDialogState(this, play)) { case TEXT_STATE_DONE: if (this->actor.textId == 0x305E) { - if((!gSaveContext.n64ddFlag && gSaveContext.bgsFlag) || (gSaveContext.n64ddFlag && Flags_GetTreasure(play, 0x1F))) { + if((!IS_RANDO && gSaveContext.bgsFlag) || (IS_RANDO && Flags_GetTreasure(play, 0x1F))) { return NPC_TALK_STATE_IDLE; } - if(gSaveContext.n64ddFlag) { + if(IS_RANDO) { EnGo2_GetItemEntry(this, play, Randomizer_GetItemFromKnownCheck(RC_DMT_TRADE_CLAIM_CHECK, GI_SWORD_BGS)); Flags_SetTreasure(play, 0x1F); } else { @@ -663,7 +663,7 @@ s16 EnGo2_UpdateTalkStateGoronDmtBiggoron(PlayState* play, EnGo2* this) { if (Message_ShouldAdvance(play)) { if ((this->actor.textId == 0x3054) || (this->actor.textId == 0x3055)) { if (play->msgCtx.choiceIndex == 0) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_DMT_TRADE_BROKEN_SWORD, GI_PRESCRIPTION); Randomizer_ConsumeAdultTradeItem(play, ITEM_SWORD_BROKEN); EnGo2_GetItemEntry(this, play, getItemEntry); @@ -1070,7 +1070,7 @@ void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) { u16 textId; if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { - if ((!gSaveContext.n64ddFlag && gSaveContext.bgsFlag)) { + if ((!IS_RANDO && gSaveContext.bgsFlag)) { if (func_8002F368(play) == EXCH_ITEM_CLAIM_CHECK) { this->actor.textId = 0x3003; } else { @@ -1080,7 +1080,7 @@ void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) { } else if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_CLAIM_CHECK) { if (func_8002F368(play) == EXCH_ITEM_CLAIM_CHECK) { - if (gSaveContext.n64ddFlag && Flags_GetTreasure(play, 0x1F)) { + if (IS_RANDO && Flags_GetTreasure(play, 0x1F)) { textId = 0x3003; } else if (Environment_GetBgsDayCount() >= CVarGetInteger("gForgeTime", 3)) { textId = 0x305E; @@ -1089,7 +1089,7 @@ void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) { } this->actor.textId = textId; } else { - if (gSaveContext.n64ddFlag && Flags_GetTreasure(play, 0x1F)) { + if (IS_RANDO && Flags_GetTreasure(play, 0x1F)) { textId = 0x305E; } else if (Environment_GetBgsDayCount() >= CVarGetInteger("gForgeTime", 3)) { textId = 0x3002; @@ -1219,8 +1219,8 @@ s32 EnGo2_IsCameraModified(EnGo2* this, PlayState* play) { (this->actor.params & 0x1F) == GORON_CITY_STAIRWELL || (this->actor.params & 0x1F) == GORON_DMT_BIGGORON || (this->actor.params & 0x1F) == GORON_MARKET_BAZAAR) { return true; - } else if (((!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || - (gSaveContext.n64ddFlag && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && + } else if (((!IS_RANDO && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || + (IS_RANDO && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1)) { return true; } else { @@ -1278,8 +1278,8 @@ void EnGo2_SelectGoronWakingUp(EnGo2* this) { EnGo2_BiggoronWakingUp(this); break; case GORON_CITY_LINK: - if (((!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || - (gSaveContext.n64ddFlag && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && + if (((!IS_RANDO && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || + (IS_RANDO && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1)) { EnGo2_WakingUp(this); break; @@ -1624,8 +1624,8 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { case GORON_CITY_LOWEST_FLOOR: case GORON_CITY_STAIRWELL: case GORON_CITY_LOST_WOODS: - if (((!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || - (gSaveContext.n64ddFlag && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && LINK_IS_ADULT) { + if (((!IS_RANDO && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || + (IS_RANDO && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && LINK_IS_ADULT) { Actor_Kill(&this->actor); } this->actionFunc = EnGo2_CurledUp; @@ -1640,8 +1640,8 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { if ((Flags_GetInfTable(INFTABLE_GORON_CITY_DOORS_UNLOCKED))) { Path_CopyLastPoint(this->path, &this->actor.world.pos); this->actor.home.pos = this->actor.world.pos; - if (((!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || - (gSaveContext.n64ddFlag && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && + if (((!IS_RANDO && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || + (IS_RANDO && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1)) { EnGo2_GetItemAnimation(this, play); } else { @@ -1862,7 +1862,7 @@ void EnGo2_SetupGetItem(EnGo2* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = EnGo2_SetGetItem; } else { - if (!gSaveContext.n64ddFlag || this->getItemEntry.getItemId == GI_NONE) { + if (!IS_RANDO || this->getItemEntry.getItemId == GI_NONE) { func_8002F434(&this->actor, play, this->getItemId, this->actor.xzDistToPlayer + 1.0f, fabsf(this->actor.yDistToPlayer) + 1.0f); } else { GiveItemEntryFromActor(&this->actor, play, this->getItemEntry, this->actor.xzDistToPlayer + 1.0f, fabsf(this->actor.yDistToPlayer) + 1.0f); @@ -1876,7 +1876,7 @@ void EnGo2_SetGetItem(EnGo2* this, PlayState* play) { // For randomizer, handle updating the states for the gorons after receiving the item based on // the goron type rather then the item being received - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { switch (this->actor.params & 0x1F) { case GORON_DMT_BIGGORON: // Resolves #1301. unk_13EE is used to set the opacity of the HUD. The trade sequence discussion with Biggoron @@ -1925,12 +1925,12 @@ void EnGo2_BiggoronEyedrops(EnGo2* this, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_TARGETABLE; this->actor.shape.rot.y += 0x5B0; this->trackingMode = NPC_TRACKING_NONE; - this->animTimer = gSaveContext.n64ddFlag ? 0 : (this->skelAnime.endFrame + 60.0f + 60.0f); // eyeDrops animation timer + this->animTimer = IS_RANDO ? 0 : (this->skelAnime.endFrame + 60.0f + 60.0f); // eyeDrops animation timer this->eyeMouthTexState = 2; this->unk_20C = 0; this->goronState++; func_800F483C(0x28, 5); - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { OnePointCutscene_Init(play, 4190, -99, &this->actor, MAIN_CAM); } break; @@ -1959,7 +1959,7 @@ void EnGo2_BiggoronEyedrops(EnGo2* this, PlayState* play) { this->trackingMode = NPC_TRACKING_HEAD_AND_TORSO; this->skelAnime.playSpeed = 0.0f; this->skelAnime.curFrame = this->skelAnime.endFrame; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_DMT_TRADE_EYEDROPS, GI_CLAIM_CHECK); Randomizer_ConsumeAdultTradeItem(play, ITEM_EYEDROPS); EnGo2_GetItemEntry(this, play, getItemEntry); diff --git a/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c index a2be28dce..e2a4cdaa0 100644 --- a/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/soh/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -189,7 +189,7 @@ void func_80A4E648(EnGs* this, PlayState* play) { Actor_GetScreenPos(play, &this->actor, &sp26, &sp24); if ((sp26 >= 0) && (sp26 <= SCREEN_WIDTH) && (sp24 >= 0) && (sp24 <= SCREEN_HEIGHT) && (this->unk_19C != 3)) { if (func_8002F2CC(&this->actor, play, 40.0f) == 1) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { // if we're rando'd, always use the non-mask text id this->actor.textId = 0x2053; } else { diff --git a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index bc9bb416a..1b4529448 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -124,16 +124,16 @@ void EnHeishi1_Init(Actor* thisx, PlayState* play) { if (this->type != 5) { if ((gSaveContext.dayTime < 0xB888 || IS_DAY) && - ((!gSaveContext.n64ddFlag && !Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) || - (gSaveContext.n64ddFlag && !metZelda))) { + ((!IS_RANDO && !Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) || + (IS_RANDO && !metZelda))) { this->actionFunc = EnHeishi1_SetupWalk; } else { Actor_Kill(&this->actor); } } else { if ((gSaveContext.dayTime >= 0xB889) || !IS_DAY || - (!gSaveContext.n64ddFlag && Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) || - (gSaveContext.n64ddFlag && metZelda)) { + (!IS_RANDO && Flags_GetEventChkInf(EVENTCHKINF_ZELDA_FLED_HYRULE_CASTLE)) || + (IS_RANDO && metZelda)) { this->actionFunc = EnHeishi1_SetupWaitNight; } else { Actor_Kill(&this->actor); diff --git a/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index 16424c66d..bab56427d 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/soh/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -357,7 +357,7 @@ void EnHeishi4_MarketSneak(EnHeishi4* this, PlayState* play) { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE && Message_ShouldAdvance(play)) { switch (play->msgCtx.choiceIndex) { case 0: //yes - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_ENTRANCES) != RO_GENERIC_OFF){ + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_ENTRANCES) != RO_GENERIC_OFF){ play->nextEntranceIndex = Entrance_OverrideNextIndex(0x01FD); // Market Entrance -> HF } else { play->nextEntranceIndex = 0x00CD; // HF Near bridge (OoT cutscene entrance) to not fall in the water diff --git a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c index ad79d99e2..14b3703b8 100644 --- a/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/soh/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -81,7 +81,7 @@ void EnHs_Init(Actor* thisx, PlayState* play) { func_80A6E3A0(this, func_80A6E9AC); bool shouldSpawn; bool tradedMushroom = Flags_GetItemGetInf(ITEMGETINF_30); - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE)) { // To explain the logic because Fado and Grog are linked: // - If you have Cojiro, then spawn Grog and not Fado. // - If you don't have Cojiro but do have Odd Potion, spawn Fado and not Grog. @@ -148,7 +148,7 @@ void func_80A6E5EC(EnHs* this, PlayState* play) { void func_80A6E630(EnHs* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_80088AA0(180); } func_80A6E3A0(this, func_80A6E6B0); @@ -179,7 +179,7 @@ void func_80A6E740(EnHs* this, PlayState* play) { this->actor.parent = NULL; func_80A6E3A0(this, func_80A6E630); } else { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_TRADE_COJIRO, GI_ODD_MUSHROOM); Randomizer_ConsumeAdultTradeItem(play, ITEM_COJIRO); GiveItemEntryFromActor(&this->actor, play, itemEntry, 10000.0f, 50.0f); @@ -198,7 +198,7 @@ void func_80A6E7BC(EnHs* this, PlayState* play) { switch (play->msgCtx.choiceIndex) { case 0: func_80A6E3A0(this, func_80A6E740); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_TRADE_COJIRO, GI_ODD_MUSHROOM); Randomizer_ConsumeAdultTradeItem(play, ITEM_COJIRO); GiveItemEntryFromActor(&this->actor, play, itemEntry, 10000.0f, 50.0f); diff --git a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c index da82d9f2f..819a432c0 100644 --- a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -662,7 +662,7 @@ s16 func_80A70058(PlayState* play, Actor* thisx) { if (Flags_GetInfTable(INFTABLE_191)) { // Already brought the lost dog back func_80A6F7CC(this, play, GI_RUPEE_BLUE); } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_80A6F7CC(this, play, GI_HEART_PIECE); } else { this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_MARKET_LOST_DOG, GI_HEART_PIECE); @@ -1068,7 +1068,7 @@ void func_80A714C4(EnHy* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actionFunc = func_80A71530; } else { - if (!gSaveContext.n64ddFlag || this->getItemEntry.getItemId == GI_NONE) { + if (!IS_RANDO || this->getItemEntry.getItemId == GI_NONE) { func_8002F434(&this->actor, play, this->unkGetItemId, this->actor.xzDistToPlayer + 1.0f, fabsf(this->actor.yDistToPlayer) + 1.0f); } else { GiveItemEntryFromActor(&this->actor, play, this->getItemEntry, this->actor.xzDistToPlayer + 1.0f, fabsf(this->actor.yDistToPlayer) + 1.0f); @@ -1078,7 +1078,7 @@ void func_80A714C4(EnHy* this, PlayState* play) { void func_80A71530(EnHy* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { if (!Flags_GetInfTable(INFTABLE_191)) { Flags_SetInfTable(INFTABLE_191); } diff --git a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c index b47b4faf7..aaf0e0342 100644 --- a/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/soh/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -1440,7 +1440,7 @@ void func_80A781CC(Actor* thisx, PlayState* play) { this->actor.update = EnIk_Update; this->actor.draw = EnIk_Draw; // Don't initiate nabooru defeat CS in rando - if (!(gSaveContext.n64ddFlag)) { + if (!(IS_RANDO)) { Cutscene_SetSegment(play, gSpiritBossNabooruKnuckleDefeatCs); gSaveContext.cutsceneTrigger = 1; Actor_SetScale(&this->actor, 0.01f); diff --git a/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 2fcc58949..b933aec84 100644 --- a/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -332,7 +332,7 @@ void EnIshi_Init(Actor* thisx, PlayState* play) { } // If dungeon entrance randomizer is on, remove the grey boulders that normally // block child Link from reaching the Fire Temple entrance. - if (type == ROCK_LARGE && gSaveContext.n64ddFlag && + if (type == ROCK_LARGE && IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF && play->sceneNum == 0x061) { // Death Mountain Creater Actor_Kill(&this->actor); diff --git a/soh/src/overlays/actors/ovl_En_Js/z_en_js.c b/soh/src/overlays/actors/ovl_En_Js/z_en_js.c index a02dadbaa..50be2e458 100644 --- a/soh/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/soh/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -131,7 +131,7 @@ void func_80A89160(EnJs* this, PlayState* play) { this->actor.parent = NULL; En_Js_SetupAction(this, func_80A8910C); } else { - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_MERCHANTS) != RO_SHUFFLE_MERCHANTS_OFF && + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MERCHANTS) != RO_SHUFFLE_MERCHANTS_OFF && !Flags_GetRandomizerInf(RAND_INF_MERCHANTS_CARPET_SALESMAN)) { GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_WASTELAND_BOMBCHU_SALESMAN, GI_BOMBCHUS_10); gSaveContext.pendingSale = itemEntry.itemId; diff --git a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index 147347d87..0a118916b 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -119,7 +119,7 @@ void func_80A90264(EnKakasi2* this, PlayState* play) { bool skipScarecrow = play->msgCtx.msgMode == MSGMODE_OCARINA_PLAYING && ((CVarGetInteger("gSkipScarecrow", 0) && gSaveContext.scarecrowSpawnSongSet) || - (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_SCARECROWS_SONG))); + (IS_RANDO && Randomizer_GetSettingValue(RSK_SKIP_SCARECROWS_SONG))); if ((BREG(1) != 0) || skipScarecrow && (this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < this->maxSpawnDistance.y)) { diff --git a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 497d7acc9..25299f5b0 100644 --- a/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/soh/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -1027,7 +1027,7 @@ s32 EnKo_CanSpawn(EnKo* this, PlayState* play) { } case SCENE_LOST_WOODS: - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE)) { // To explain the logic because Fado and Grog are linked: // - If you have Cojiro, then spawn Grog and not Fado. // - If you don't have Cojiro but do have Odd Potion, spawn Fado and not Grog. @@ -1186,7 +1186,7 @@ void func_80A99048(EnKo* this, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_ELF, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 3); if (ENKO_TYPE == ENKO_TYPE_CHILD_3) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { if (!CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { this->collider.dim.height += 200; this->actionFunc = func_80A995CC; @@ -1234,7 +1234,7 @@ void func_80A99504(EnKo* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = func_80A99560; } else { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_TRADE_ODD_POTION, GI_SAW); Randomizer_ConsumeAdultTradeItem(play, ITEM_ODD_POTION); GiveItemEntryFromActor(&this->actor, play, itemEntry, 120.0f, 10.0f); diff --git a/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index 344691067..75e54c140 100644 --- a/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -278,7 +278,7 @@ void EnKusa_Destroy(Actor* thisx, PlayState* play2) { void EnKusa_SetupWaitObject(EnKusa* this) { // Kill bushes in Boss Rush. Used in Gohma's arena. - if (gSaveContext.isBossRush) { + if (IS_BOSS_RUSH) { Actor_Kill(this); } diff --git a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c index 2717dcdf5..75b7479f3 100644 --- a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -73,10 +73,10 @@ static AnimationInfo sAnimationInfo[] = { u16 EnKz_GetTextNoMaskChild(PlayState* play, EnKz* this) { Player* player = GET_PLAYER(play); - if ((gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_JABU_JABUS_BELLY)) || - (!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE))) { + if ((IS_RANDO && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_JABU_JABUS_BELLY)) || + (!IS_RANDO && CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE))) { // Allow turning in Ruto's letter even if you have already rescued her - if (gSaveContext.n64ddFlag && !Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) { + if (IS_RANDO && !Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) { player->exchangeItemId = EXCH_ITEM_LETTER_RUTO; } return 0x402B; @@ -94,7 +94,7 @@ u16 EnKz_GetTextNoMaskAdult(PlayState* play, EnKz* this) { // this works because both ITEM_NONE and later trade items are > ITEM_FROG if (INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_FROG) { if (!Flags_GetInfTable(INFTABLE_139)) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { return CHECK_OWNED_EQUIP(EQUIP_TUNIC, 2) ? 0x401F : 0x4012; } else { return 0x4012; @@ -243,7 +243,7 @@ void func_80A9CB18(EnKz* this, PlayState* play) { Player* player = GET_PLAYER(play); if (func_80A9C95C(play, this, &this->interactInfo.talkState, 340.0f, EnKz_GetText, func_80A9C6C0)) { - if (((gSaveContext.n64ddFlag && LINK_IS_CHILD) || this->actor.textId == 0x401A) && !Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) { + if (((IS_RANDO && LINK_IS_CHILD) || this->actor.textId == 0x401A) && !Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) { if (func_8002F368(play) == EXCH_ITEM_LETTER_RUTO) { this->actor.textId = 0x401B; this->sfxPlayed = false; @@ -257,7 +257,7 @@ void func_80A9CB18(EnKz* this, PlayState* play) { if (LINK_IS_ADULT) { if ((INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_PRESCRIPTION) && (func_8002F368(play) == EXCH_ITEM_PRESCRIPTION)) { - if (!gSaveContext.n64ddFlag || !Flags_GetTreasure(play, 0x1F)) { + if (!IS_RANDO || !Flags_GetTreasure(play, 0x1F)) { this->actor.textId = 0x4014; this->sfxPlayed = false; player->actor.textId = this->actor.textId; @@ -271,7 +271,7 @@ void func_80A9CB18(EnKz* this, PlayState* play) { this->actor.textId = CHECK_QUEST_ITEM(QUEST_SONG_SERENADE) ? 0x4045 : 0x401A; player->actor.textId = this->actor.textId; } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { this->actor.textId = CHECK_OWNED_EQUIP(EQUIP_TUNIC, 2) ? 0x401F : 0x4012; } else { this->actor.textId = 0x4012; @@ -344,7 +344,7 @@ void EnKz_Init(Actor* thisx, PlayState* play) { this->interactInfo.talkState = NPC_TALK_STATE_IDLE; Animation_ChangeByInfo(&this->skelanime, sAnimationInfo, ENKZ_ANIM_0); - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { if (Flags_GetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED)) { EnKz_SetMovedPos(this, play); } @@ -470,7 +470,7 @@ void EnKz_SetupGetItem(EnKz* this, PlayState* play) { this->interactInfo.talkState = NPC_TALK_STATE_TALKING; this->actionFunc = EnKz_StartTimer; } else { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { if (this->isTrading) { getItemEntry = Randomizer_GetItemFromKnownCheck(RC_ZD_TRADE_PRESCRIPTION, GI_FROG); getItemId = getItemEntry.getItemId; @@ -485,7 +485,7 @@ void EnKz_SetupGetItem(EnKz* this, PlayState* play) { } yRange = fabsf(this->actor.yDistToPlayer) + 1.0f; xzRange = this->actor.xzDistToPlayer + 1.0f; - if (!gSaveContext.n64ddFlag || getItemEntry.getItemId == GI_NONE) { + if (!IS_RANDO || getItemEntry.getItemId == GI_NONE) { func_8002F434(&this->actor, play, getItemId, xzRange, yRange); } else { GiveItemEntryFromActor(&this->actor, play, getItemEntry, xzRange, yRange); @@ -495,7 +495,7 @@ void EnKz_SetupGetItem(EnKz* this, PlayState* play) { void EnKz_StartTimer(EnKz* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_FROG && !gSaveContext.n64ddFlag) { + if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_FROG && !IS_RANDO) { func_80088AA0(180); // start timer2 with 3 minutes gSaveContext.eventInf[1] &= ~1; } diff --git a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index d31aab6e8..f388d4989 100644 --- a/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/soh/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -97,7 +97,7 @@ bool Randomizer_ObtainedMalonHCReward() { u16 EnMa1_GetText(PlayState* play, Actor* thisx) { // Special case for Malon Hyrule Castle Text. Placing it here at the beginning // has the added benefit of circumventing mask text if wearing bunny hood. - if (gSaveContext.n64ddFlag && play->sceneNum == SCENE_HYRULE_CASTLE) { + if (IS_RANDO && play->sceneNum == SCENE_HYRULE_CASTLE) { return Randomizer_ObtainedMalonHCReward() ? 0x2044 : 0x2043; } u16 faceReaction = Text_GetFaceReaction(play, 0x17); @@ -105,7 +105,7 @@ u16 EnMa1_GetText(PlayState* play, Actor* thisx) { if (faceReaction != 0) { return faceReaction; } - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { if (CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) { return 0x204A; } @@ -207,7 +207,7 @@ s32 func_80AA08C4(EnMa1* this, PlayState* play) { } if ((play->sceneNum == SCENE_HYRULE_CASTLE) && // if we're at hyrule castle (!Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) || // and talon hasn't left - (gSaveContext.n64ddFlag && + (IS_RANDO && !Randomizer_ObtainedMalonHCReward()))) { // or we're rando'd and haven't gotten malon's HC check if (Flags_GetInfTable(INFTABLE_ENTERED_HYRULE_CASTLE)) { // if we've met malon return 1; // make her appear at the castle @@ -227,7 +227,7 @@ s32 func_80AA08C4(EnMa1* this, PlayState* play) { // If we've gotten this far, we're in Lon Lon Ranch. Spawn Malon if it is daytime, Talon has left Hyrule Castle, and // either we are not randomized, or we are and we have received Malon's item at Hyrule Castle. if ((this->actor.shape.rot.z == 3) && IS_DAY && (Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) && - ((gSaveContext.n64ddFlag && Randomizer_ObtainedMalonHCReward()) || !gSaveContext.n64ddFlag)) { + ((IS_RANDO && Randomizer_ObtainedMalonHCReward()) || !IS_RANDO)) { return 1; } return 0; @@ -292,7 +292,7 @@ void EnMa1_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(22), &sColChkInfoInit); - if (gSaveContext.n64ddFlag) { // Skip Malon's multiple textboxes before getting an item + if (IS_RANDO) { // Skip Malon's multiple textboxes before getting an item Flags_SetInfTable(INFTABLE_ENTERED_HYRULE_CASTLE); Flags_SetInfTable(INFTABLE_MET_CHILD_MALON_AT_CASTLE_OR_MARKET); Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_CHILD_MALON_AT_CASTLE_OR_MARKET); @@ -313,13 +313,13 @@ void EnMa1_Init(Actor* thisx, PlayState* play) { // 1. Talon has not left Hyrule Castle. // 2. We are Randomized and have not obtained Malon's Weird Egg Check. // 3. We are not Randomized and have obtained Epona's Song - if (!Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) || (gSaveContext.n64ddFlag && !Randomizer_ObtainedMalonHCReward()) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && !gSaveContext.n64ddFlag) || - (gSaveContext.n64ddFlag && Flags_GetTreasure(play, 0x1F))) { + if (!Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) || (IS_RANDO && !Randomizer_ObtainedMalonHCReward()) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && !IS_RANDO) || + (IS_RANDO && Flags_GetTreasure(play, 0x1F))) { this->actionFunc = func_80AA0D88; EnMa1_ChangeAnim(this, ENMA1_ANIM_2); // If none of the above conditions were true, set Malon up to teach Epona's Song. } else { - if (gSaveContext.n64ddFlag) { // Skip straight to "let's sing it together" textbox in the ranch + if (IS_RANDO) { // Skip straight to "let's sing it together" textbox in the ranch Flags_SetEventChkInf(EVENTCHKINF_INVITED_TO_SING_WITH_CHILD_MALON); } @@ -349,13 +349,13 @@ void func_80AA0D88(EnMa1* this, PlayState* play) { // We want to Kill Malon's Actor outside of randomizer when Talon is freed. In Randomizer we don't kill Malon's // Actor here, otherwise if we wake up Talon first and then get her check she will spontaneously // disappear. - if ((play->sceneNum == SCENE_HYRULE_CASTLE) && (!gSaveContext.n64ddFlag && Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE))) { + if ((play->sceneNum == SCENE_HYRULE_CASTLE) && (!IS_RANDO && Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE))) { Actor_Kill(&this->actor); // We want Malon to give the Weird Egg Check (see function below) in the following situations: // 1. Talon as not left Hyrule Castle (Vanilla) OR // 2. We haven't obtained Malon's Weird Egg Check (Randomizer only) OR // 3. We have Epona's Song? (Vanilla only, not sure why it's here but I didn't write that one) - } else if ((!Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) || (gSaveContext.n64ddFlag && !Randomizer_ObtainedMalonHCReward())) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && !gSaveContext.n64ddFlag)) { + } else if ((!Flags_GetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE) || (IS_RANDO && !Randomizer_ObtainedMalonHCReward())) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA) && !IS_RANDO)) { if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { this->actionFunc = func_80AA0EA0; play->msgCtx.stateTimer = 4; @@ -369,7 +369,7 @@ void func_80AA0EA0(EnMa1* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = func_80AA0EFC; } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_WEIRD_EGG, 120.0f, 10.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_HC_MALON_EGG, GI_WEIRD_EGG); @@ -428,7 +428,7 @@ void func_80AA0F44(EnMa1* this, PlayState* play) { this->interactInfo.talkState = NPC_TALK_STATE_TALKING; this->actor.flags |= ACTOR_FLAG_WILL_TALK; // when rando'ed, skip to the Item Giving. Otherwise go to the song teaching code. - this->actionFunc = gSaveContext.n64ddFlag ? func_80AA1150 : func_80AA106C; + this->actionFunc = IS_RANDO ? func_80AA1150 : func_80AA106C; } else if (this->actor.xzDistToPlayer < 30.0f + (f32)this->collider.dim.radius) { // somehow flags that the player is close to malon so that pulling out the Ocarina // triggers the code above this. @@ -436,7 +436,7 @@ void func_80AA0F44(EnMa1* this, PlayState* play) { } // If rando'ed, a textbox is closing, it's malon's 'my mom wrote this song' text, AND we do have an ocarina // in our inventory. This allows us to grant the check when talking to malon with the ocarina in our inventory. - if (gSaveContext.n64ddFlag && (Actor_TextboxIsClosing(&this->actor, play) && play->msgCtx.textId == 0x2049) && + if (IS_RANDO && (Actor_TextboxIsClosing(&this->actor, play) && play->msgCtx.textId == 0x2049) && (INV_CONTENT(ITEM_OCARINA_FAIRY) != ITEM_NONE || INV_CONTENT(ITEM_OCARINA_TIME) != ITEM_NONE)) { this->actionFunc = EnMa1_WaitForSongGive; } @@ -474,7 +474,7 @@ void EnMa1_EndTeachSong(EnMa1* this, PlayState* play) { play->msgCtx.ocarinaMode = OCARINA_MODE_04; } - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { // Transition to the giving the song check on the next update run. this->actionFunc = EnMa1_WaitForSongGive; } @@ -484,12 +484,12 @@ void func_80AA1150(EnMa1* this, PlayState* play) { GET_PLAYER(play)->stateFlags2 |= 0x800000; // When rando'ed, trigger the "song learned" Ocarina mode. - if (gSaveContext.n64ddFlag && (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING)) { + if (IS_RANDO && (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING)) { play->msgCtx.ocarinaMode = OCARINA_MODE_03; } if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { play->nextEntranceIndex = 0x157; gSaveContext.nextCutsceneIndex = 0xFFF1; play->fadeTransition = 42; diff --git a/soh/src/overlays/actors/ovl_En_Md/z_en_md.c b/soh/src/overlays/actors/ovl_En_Md/z_en_md.c index c66229094..d757a5a02 100644 --- a/soh/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/soh/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -373,8 +373,8 @@ u16 EnMd_GetTextKokiriForest(PlayState* play, EnMd* this) { this->unk_209 = TEXT_STATE_NONE; // In rando, skip talking about the tree being dead so we can have the prompt for sword and shield instead - if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) || - (gSaveContext.n64ddFlag && Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD) && + if ((!IS_RANDO && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) || + (IS_RANDO && Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD) && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH))) { return 0x1045; @@ -489,7 +489,7 @@ u8 EnMd_ShouldSpawn(EnMd* this, PlayState* play) { // He will spawn in the forest if you haven't showed the sword and shield, and will remain // in the forest until you've obtained Zelda's letter or Deku Tree dies // This is to ensure Deku Tree can still be opened in dungeon entrance rando even if Ghoma is defeated - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { if (play->sceneNum == SCENE_LOST_WOODS) { return 1; } @@ -681,8 +681,8 @@ void EnMd_Init(Actor* thisx, PlayState* play) { if (((play->sceneNum == SCENE_KOKIRI_FOREST) && !Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) || ((play->sceneNum == SCENE_KOKIRI_FOREST) && (Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) && - ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) || - (gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE)))) || + ((!IS_RANDO && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) || + (IS_RANDO && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE)))) || ((play->sceneNum == SCENE_LOST_WOODS) && !Flags_GetEventChkInf(EVENTCHKINF_PLAYED_SARIAS_SONG_FOR_MIDO_AS_ADULT))) { this->actor.home.pos = this->actor.world.pos; this->actionFunc = func_80AAB948; @@ -745,8 +745,8 @@ void func_80AAB948(EnMd* this, PlayState* play) { } if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { - if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) || - gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE) && + if ((!IS_RANDO && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) || + IS_RANDO && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE) && Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) && (play->sceneNum == SCENE_KOKIRI_FOREST)) { play->msgCtx.msgMode = MSGMODE_PAUSED; @@ -814,8 +814,8 @@ void func_80AABD0C(EnMd* this, PlayState* play) { return; } - if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) || - gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE) && + if ((!IS_RANDO && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) || + IS_RANDO && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE) && Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) && !Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) && (play->sceneNum == SCENE_KOKIRI_FOREST)) { Message_CloseTextbox(play); diff --git a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c index 5e6cde3ce..e5501858c 100644 --- a/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c +++ b/soh/src/overlays/actors/ovl_En_Mk/z_en_mk.c @@ -96,12 +96,12 @@ void func_80AACA94(EnMk* this, PlayState* play) { if (Actor_HasParent(&this->actor, play) != 0) { this->actor.parent = NULL; this->actionFunc = func_80AACA40; - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_80088AA0(240); gSaveContext.eventInf[1] &= ~1; } } else { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_TRADE_FROG, GI_EYEDROPS); Randomizer_ConsumeAdultTradeItem(play, ITEM_FROG); GiveItemEntryFromActor(&this->actor, play, getItemEntry, 10000.0f, 50.0f); @@ -116,7 +116,7 @@ void func_80AACA94(EnMk* this, PlayState* play) { void func_80AACB14(EnMk* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { this->actionFunc = func_80AACA94; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_TRADE_FROG, GI_EYEDROPS); Randomizer_ConsumeAdultTradeItem(play, ITEM_FROG); GiveItemEntryFromActor(&this->actor, play, getItemEntry, 10000.0f, 50.0f); @@ -150,7 +150,7 @@ void func_80AACC04(EnMk* this, PlayState* play) { if (this->timer > 0) { this->timer--; } else { - this->timer = gSaveContext.n64ddFlag ? 0 : 16; + this->timer = IS_RANDO ? 0 : 16; this->actionFunc = func_80AACBAC; Animation_Change(&this->skelAnime, &object_mk_Anim_000D88, 1.0f, 0.0f, Animation_GetLastFrame(&object_mk_Anim_000D88), ANIMMODE_LOOP, -4.0f); @@ -163,7 +163,7 @@ void func_80AACCA0(EnMk* this, PlayState* play) { this->timer--; this->actor.shape.rot.y += 0x800; } else { - this->timer = gSaveContext.n64ddFlag ? 0 : 120; + this->timer = IS_RANDO ? 0 : 120; this->actionFunc = func_80AACC04; Animation_Change(&this->skelAnime, &object_mk_Anim_000724, 1.0f, 0.0f, Animation_GetLastFrame(&object_mk_Anim_000724), ANIMMODE_LOOP, -4.0f); @@ -179,7 +179,7 @@ void func_80AACD48(EnMk* this, PlayState* play) { this->actionFunc = func_80AACCA0; play->msgCtx.msgMode = MSGMODE_PAUSED; player->exchangeItemId = EXCH_ITEM_NONE; - this->timer = gSaveContext.n64ddFlag ? 0 : 16; + this->timer = IS_RANDO ? 0 : 16; Animation_Change(&this->skelAnime, &object_mk_Anim_000D88, 1.0f, 0.0f, Animation_GetLastFrame(&object_mk_Anim_000D88), ANIMMODE_LOOP, -4.0f); this->flags &= ~2; @@ -219,7 +219,7 @@ void func_80AACFA0(EnMk* this, PlayState* play) { Flags_SetItemGetInf(ITEMGETINF_10); } else { // not sure when/how/if this is getting called - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_HEART_PIECE, 10000.0f, 50.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_LAB_DIVE, GI_HEART_PIECE); @@ -231,7 +231,7 @@ void func_80AACFA0(EnMk* this, PlayState* play) { void func_80AAD014(EnMk* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { this->actionFunc = func_80AACFA0; - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_HEART_PIECE, 10000.0f, 50.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_LAB_DIVE, GI_HEART_PIECE); @@ -257,7 +257,7 @@ void EnMk_Wait(EnMk* this, PlayState* play) { } else { // Skip eye drop text on rando if Link went in the water, so you can still receive the dive check if (INV_CONTENT(ITEM_ODD_MUSHROOM) == ITEM_EYEDROPS && - (!gSaveContext.n64ddFlag || this->swimFlag == 0)) { + (!IS_RANDO || this->swimFlag == 0)) { player->actor.textId = 0x4032; this->actionFunc = func_80AACA40; } else { diff --git a/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c index 9f52cfbae..8c4f78a0c 100644 --- a/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/soh/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -128,13 +128,13 @@ void EnMs_Talk(EnMs* this, PlayState* play) { switch (play->msgCtx.choiceIndex) { case 0: // yes if (gSaveContext.rupees < - ((gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) + ((IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) ? 60 : sPrices[BEANS_BOUGHT])) { Message_ContinueTextbox(play, 0x4069); // not enough rupees text return; } - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) { GiveItemEntryFromActor(&this->actor, play, Randomizer_GetItemFromKnownCheck(RC_ZR_MAGIC_BEAN_SALESMAN, GI_BEAN), 90.0f, 10.0f); } else { @@ -152,12 +152,12 @@ void EnMs_Talk(EnMs* this, PlayState* play) { void EnMs_Sell(EnMs* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - Rupees_ChangeBy((gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) ? -60 : -sPrices[BEANS_BOUGHT]); + Rupees_ChangeBy((IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) ? -60 : -sPrices[BEANS_BOUGHT]); this->actor.parent = NULL; this->actionFunc = - (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) ? EnMs_Wait : EnMs_TalkAfterPurchase; + (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) ? EnMs_Wait : EnMs_TalkAfterPurchase; } else { - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_MAGIC_BEANS)) { GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_ZR_MAGIC_BEAN_SALESMAN, GI_BEAN); gSaveContext.pendingSale = itemEntry.itemId; gSaveContext.pendingSaleMod = itemEntry.modIndex; diff --git a/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c index 5e54cc990..a519209aa 100644 --- a/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/soh/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -1100,7 +1100,7 @@ void EnNb_LookUp(EnNb* this, PlayState* play) { } void EnNb_CrawlspaceSpawnCheck(EnNb* this, PlayState* play) { - if (!gSaveContext.n64ddFlag && !Flags_GetEventChkInf(EVENTCHKINF_NABOORU_CAPTURED_BY_TWINROVA) && LINK_IS_CHILD) { + if (!IS_RANDO && !Flags_GetEventChkInf(EVENTCHKINF_NABOORU_CAPTURED_BY_TWINROVA) && LINK_IS_CHILD) { EnNb_UpdatePath(this, play); // looking into crawlspace diff --git a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 03316928c..8ddf52fad 100644 --- a/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/soh/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -204,7 +204,7 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) { EnNiw* currentCucco; s32 phi_s1; - this->cuccosInPen = gSaveContext.n64ddFlag ? (7 - Randomizer_GetSettingValue(RSK_CUCCO_COUNT)) : 0; + this->cuccosInPen = IS_RANDO ? (7 - Randomizer_GetSettingValue(RSK_CUCCO_COUNT)) : 0; currentCucco = (EnNiw*)play->actorCtx.actorLists[ACTORCAT_PROP].head; while (currentCucco != NULL) { if (currentCucco->actor.id == ACTOR_EN_NIW) { @@ -308,7 +308,7 @@ void func_80ABA654(EnNiwLady* this, PlayState* play) { if (!Flags_GetItemGetInf(ITEMGETINF_0C)) { this->actor.parent = NULL; - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { this->getItemId = GI_BOTTLE; func_8002F434(&this->actor, play, GI_BOTTLE, 100.0f, 50.0f); } else { @@ -398,7 +398,7 @@ void func_80ABA9B8(EnNiwLady* this, PlayState* play) { Message_CloseTextbox(play); this->actor.parent = NULL; - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_POCKET_EGG, 200.0f, 100.0f); } else { this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG); @@ -433,7 +433,7 @@ void func_80ABAB08(EnNiwLady* this, PlayState* play) { case 0: Message_CloseTextbox(play); this->actor.parent = NULL; - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_COJIRO, 200.0f, 100.0f); } else { this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_TRADE_POCKET_CUCCO, GI_COJIRO); @@ -462,7 +462,7 @@ void func_80ABAC00(EnNiwLady* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actionFunc = func_80ABAC84; } else { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { getItemId = this->getItemEntry.getItemId; GiveItemEntryFromActor(&this->actor, play, this->getItemEntry, 200.0f, 100.0f); return; @@ -483,7 +483,7 @@ void func_80ABAC84(EnNiwLady* this, PlayState* play) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST); if (LINK_IS_ADULT) { // Flags for randomizer gives are set in the original message prompt choice handling - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { if (!Flags_GetItemGetInf(ITEMGETINF_2C)) { Flags_SetItemGetInf(ITEMGETINF_2C); } else { diff --git a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index 84cf88997..74afaacff 100644 --- a/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/soh/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -234,7 +234,7 @@ void func_80ABF4C8(EnOkarinaTag* this, PlayState* play) { if (play->msgCtx.ocarinaMode == OCARINA_MODE_04) { this->actionFunc = func_80ABF28C; } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) { - if (!gSaveContext.n64ddFlag || (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_DOOR_OF_TIME) != RO_DOOROFTIME_CLOSED)) { + if (!IS_RANDO || (IS_RANDO && Randomizer_GetSettingValue(RSK_DOOR_OF_TIME) != RO_DOOROFTIME_CLOSED)) { func_80078884(NA_SE_SY_CORRECT_CHIME); } if (this->switchFlag >= 0) { @@ -246,7 +246,7 @@ void func_80ABF4C8(EnOkarinaTag* this, PlayState* play) { Flags_SetEventChkInf(EVENTCHKINF_OPENED_ZORAS_DOMAIN); break; case 2: - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { play->csCtx.segment = D_80ABF9D0; gSaveContext.cutsceneTrigger = 1; } else { @@ -256,7 +256,7 @@ void func_80ABF4C8(EnOkarinaTag* this, PlayState* play) { func_800F574C(1.18921f, 0x5A); break; case 4: - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { if (Randomizer_GetSettingValue(RSK_DOOR_OF_TIME) == RO_DOOROFTIME_CLOSED && (INV_CONTENT(ITEM_OCARINA_FAIRY) != ITEM_OCARINA_TIME || !CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) || !CHECK_QUEST_ITEM(QUEST_GORON_RUBY) || @@ -274,7 +274,7 @@ void func_80ABF4C8(EnOkarinaTag* this, PlayState* play) { break; case 6: // Don't start the cutscene in a rando save. - if (!(gSaveContext.n64ddFlag)) { + if (!(IS_RANDO)) { play->csCtx.segment = LINK_IS_ADULT ? SEGMENTED_TO_VIRTUAL(&spot02_scene_Cs_003C80) : SEGMENTED_TO_VIRTUAL(&spot02_scene_Cs_005020); gSaveContext.cutsceneTrigger = 1; @@ -311,7 +311,7 @@ void func_80ABF708(EnOkarinaTag* this, PlayState* play) { yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y; this->unk_15A++; if (!(this->actor.xzDistToPlayer > 120.0f)) { - if (CHECK_QUEST_ITEM(QUEST_SONG_SUN) || gSaveContext.n64ddFlag) { + if (CHECK_QUEST_ITEM(QUEST_SONG_SUN) || IS_RANDO) { this->actor.textId = 0x5021; } yawDiffNew = ABS(yawDiff); @@ -335,10 +335,10 @@ void func_80ABF7CC(EnOkarinaTag* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) { Message_CloseTextbox(play); - if (!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_SONG_SUN)) { + if (!IS_RANDO && !CHECK_QUEST_ITEM(QUEST_SONG_SUN)) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gSunSongGraveSunSongTeachCs); gSaveContext.cutsceneTrigger = 1; - } else if (gSaveContext.n64ddFlag && !Flags_GetTreasure(play, 0x1F)) { + } else if (IS_RANDO && !Flags_GetTreasure(play, 0x1F)) { GivePlayerRandoRewardSunSong(this, play, RC_SONG_FROM_ROYAL_FAMILYS_TOMB); } this->actionFunc = func_80ABF708; diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 470beb5e2..5d3ebd5eb 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -430,7 +430,7 @@ void EnOssan_SpawnItemsOnShelves(EnOssan* this, PlayState* play, ShopItem* shopI this->shelfSlots[i] = NULL; } else { itemParams = sShopItemReplaceFunc[shopItems->shopItemIndex](shopItems->shopItemIndex); - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHOPSANITY) != RO_SHOPSANITY_OFF) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHOPSANITY) != RO_SHOPSANITY_OFF) { ShopItemIdentity shopItemIdentity = Randomizer_IdentifyShopItem(play->sceneNum, i); if (shopItemIdentity.randomizerCheck != RC_UNKNOWN_CHECK) { itemParams = shopItemIdentity.enGirlAShopItem; @@ -450,7 +450,7 @@ void EnOssan_SpawnItemsOnShelves(EnOssan* this, PlayState* play, ShopItem* shopI shelves->actor.world.pos.y + shopItems->yOffset, shelves->actor.world.pos.z + shopItems->zOffset, shelves->actor.shape.rot.x, shelves->actor.shape.rot.y + sItemShelfRot[i], shelves->actor.shape.rot.z, itemParams, true); - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHOPSANITY) != RO_SHOPSANITY_OFF) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHOPSANITY) != RO_SHOPSANITY_OFF) { this->shelfSlots[i]->randoSlotIndex = i; } } @@ -533,8 +533,8 @@ void EnOssan_TalkGoronShopkeeper(PlayState* play) { } else { Message_ContinueTextbox(play, 0x300F); } - } else if ((!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || - (gSaveContext.n64ddFlag && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) { + } else if ((!IS_RANDO && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) || + (IS_RANDO && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) { Message_ContinueTextbox(play, 0x3057); } else { Message_ContinueTextbox(play, 0x305B); @@ -607,7 +607,7 @@ void EnOssan_Init(Actor* thisx, PlayState* play) { // If you haven't given Zelda's Letter to the Kakariko Guard // or are rando'd and haven't gotten gotten the letter from zelda yet if (this->actor.params == OSSAN_TYPE_MASK && (!Flags_GetInfTable(INFTABLE_SHOWED_ZELDAS_LETTER_TO_GATE_GUARD) || - (gSaveContext.n64ddFlag && !Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)))) { + (IS_RANDO && !Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER)))) { Actor_Kill(&this->actor); return; } @@ -619,7 +619,7 @@ void EnOssan_Init(Actor* thisx, PlayState* play) { // Don't kill bombchu shop actor in rando, making it so the shop is immediately open // Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) - Completed Dodongo's Cavern - if (this->actor.params == OSSAN_TYPE_BOMBCHUS && !Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) && !gSaveContext.n64ddFlag) { + if (this->actor.params == OSSAN_TYPE_BOMBCHUS && !Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) && !IS_RANDO) { Actor_Kill(&this->actor); return; } @@ -946,7 +946,7 @@ void EnOssan_State_StartConversation(EnOssan* this, PlayState* play, Player* pla return; case OSSAN_HAPPY_STATE_ANGRY: // In ER, handle happy mask throwing link out with not enough rupees - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { play->nextEntranceIndex = Entrance_OverrideNextIndex(0x1D1); } else { play->nextEntranceIndex = 0x1D1; @@ -1383,7 +1383,7 @@ void EnOssan_GiveItemWithFanfare(PlayState* play, EnOssan* this) { Player* player = GET_PLAYER(play); osSyncPrintf("\n" VT_FGCOL(YELLOW) "初めて手にいれた!!" VT_RST "\n\n"); - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, this->shelfSlots[this->cursorIndex]->getItemId, 120.0f, 120.0f); } else { ShopItemIdentity shopItemIdentity = Randomizer_IdentifyShopItem(play->sceneNum, this->cursorIndex); @@ -1538,7 +1538,7 @@ void EnOssan_BuyGoronCityBombs(PlayState* play, EnOssan* this) { // Let players buy the right side of the goron shop in rando regardless of DC completion // Players will still need a bomb bag to buy bombs (handled by vanilla behaviour) // Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP) - Completed Dodongo's Cavern - if (!gSaveContext.n64ddFlag && !Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) { + if (!IS_RANDO && !Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)) { if (Flags_GetInfTable(INFTABLE_FC)) { EnOssan_SetStateCantGetItem(play, this, 0x302E); } else { @@ -1730,7 +1730,7 @@ void EnOssan_State_GiveItemWithFanfare(EnOssan* this, PlayState* play, Player* p this->stateFlag = OSSAN_STATE_ITEM_PURCHASED; return; } - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, this->shelfSlots[this->cursorIndex]->getItemId, 120.0f, 120.0f); } else { ShopItemIdentity shopItemIdentity = Randomizer_IdentifyShopItem(play->sceneNum, this->cursorIndex); diff --git a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c index 9f46dc0a3..b99c15f62 100644 --- a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -139,7 +139,7 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { if (((owlType != OWL_DEFAULT) && (switchFlag < 0x20) && Flags_GetSwitch(play, switchFlag)) || // Owl shortcuts at SPOT06: Lake Hylia and SPOT16: Death Mountain Trail - (gSaveContext.n64ddFlag && !(play->sceneNum == SCENE_LAKE_HYLIA || play->sceneNum == SCENE_DEATH_MOUNTAIN_TRAIL))) { + (IS_RANDO && !(play->sceneNum == SCENE_LAKE_HYLIA || play->sceneNum == SCENE_DEATH_MOUNTAIN_TRAIL))) { osSyncPrintf("savebitでフクロウ退避\n"); // "Save owl with savebit" Actor_Kill(&this->actor); return; @@ -634,7 +634,7 @@ void func_80ACB274(EnOwl* this, PlayState* play) { void EnOwl_WaitDeathMountainShortcut(EnOwl* this, PlayState* play) { EnOwl_LookAtLink(this, play); - if (!gSaveContext.isMagicAcquired && !gSaveContext.n64ddFlag) { + if (!gSaveContext.isMagicAcquired && !IS_RANDO) { if (func_80ACA558(this, play, 0x3062)) { Audio_PlayFanfare(NA_BGM_OWL); this->actionFunc = func_80ACB274; @@ -961,7 +961,7 @@ void func_80ACC00C(EnOwl* this, PlayState* play) { osSyncPrintf(VT_FGCOL(CYAN)); osSyncPrintf("SPOT 06 の デモがはしった\n"); // "Demo of SPOT 06 has been completed" osSyncPrintf(VT_RST); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { if (Randomizer_GetSettingValue(RSK_SHUFFLE_OWL_DROPS)) { play->nextEntranceIndex = Entrance_OverrideNextIndex(0x027E); } else { @@ -976,7 +976,7 @@ void func_80ACC00C(EnOwl* this, PlayState* play) { break; case 8: case 9: - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { if (Randomizer_GetSettingValue(RSK_SHUFFLE_OWL_DROPS)) { play->nextEntranceIndex = Entrance_OverrideNextIndex(0x0554); } else { diff --git a/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c index feefe662f..8489b1032 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c +++ b/soh/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c @@ -143,8 +143,8 @@ void EnPoRelay_SetupRace(EnPoRelay* this) { EnPoRelay_Vec3sToVec3f(&vec, &D_80AD8C30[this->pathIndex]); this->actionTimer = ((s16)(this->actor.shape.rot.y - this->actor.world.rot.y - 0x8000) >> 0xB) % 32U; func_80088B34(0); - this->hookshotSlotFull = (INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE && !gSaveContext.n64ddFlag) || - (gSaveContext.n64ddFlag && Flags_GetTreasure(gPlayState, 0x1E)); + this->hookshotSlotFull = (INV_CONTENT(ITEM_HOOKSHOT) != ITEM_NONE && !IS_RANDO) || + (IS_RANDO && Flags_GetTreasure(gPlayState, 0x1E)); this->unk_19A = Actor_WorldYawTowardPoint(&this->actor, &vec); this->actor.flags |= ACTOR_FLAG_NO_LOCKON; Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); @@ -331,7 +331,7 @@ void EnPoRelay_DisappearAndReward(EnPoRelay* this, PlayState* play) { } } if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.001f) != 0) { - if(!gSaveContext.n64ddFlag) { + if(!IS_RANDO) { if (this->hookshotSlotFull != 0) { sp60.x = this->actor.world.pos.x; sp60.y = this->actor.floorHeight; diff --git a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index ecfdac68d..ea324c5a5 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -184,7 +184,7 @@ void EnPoSisters_Init(Actor* thisx, PlayState* play) { this->epoch++; // Skip Poe Intro Cutscene - if (gSaveContext.n64ddFlag && thisx->params == 4124 && !Randomizer_GetSettingValue(RSK_ENABLE_GLITCH_CUTSCENES)) { + if (IS_RANDO && thisx->params == 4124 && !Randomizer_GetSettingValue(RSK_ENABLE_GLITCH_CUTSCENES)) { Flags_SetSwitch(play, 0x1B); Actor_Kill(thisx); } @@ -864,7 +864,7 @@ void func_80ADB338(EnPoSisters* this, PlayState* play) { this->unk_19C--; // Force Meg to respawn instantly after getting hit - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { this->unk_19C = 0; } } diff --git a/soh/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c b/soh/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c index 60c0c627c..9c9816365 100644 --- a/soh/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c +++ b/soh/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c @@ -41,7 +41,7 @@ void EnRiverSound_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->actor); } else if (this->actor.params == RS_SARIAS_SONG) { // Always have leading music in rando - if ((!CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) || CHECK_QUEST_ITEM(QUEST_SONG_SARIA)) && !gSaveContext.n64ddFlag) { + if ((!CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) || CHECK_QUEST_ITEM(QUEST_SONG_SARIA)) && !IS_RANDO) { Actor_Kill(&this->actor); } } diff --git a/soh/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/soh/src/overlays/actors/ovl_En_Rr/z_en_rr.c index 24577211d..49207d643 100644 --- a/soh/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/soh/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -305,7 +305,7 @@ void EnRr_SetupReleasePlayer(EnRr* this, PlayState* play) { this->retreat = true; } } - if (CUR_EQUIP_VALUE(EQUIP_TUNIC) != 1 /* Kokiri tunic */ && !gSaveContext.n64ddFlag /* Randomizer Save File */) { + if (CUR_EQUIP_VALUE(EQUIP_TUNIC) != 1 /* Kokiri tunic */ && !IS_RANDO /* Randomizer Save File */) { tunic = Inventory_DeleteEquipment(play, EQUIP_TUNIC); if (tunic != 0) { this->eatenTunic = tunic; diff --git a/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 5ee3f325a..97a3c0091 100644 --- a/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/soh/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -767,7 +767,7 @@ void func_80AEC2C0(EnRu1* this, PlayState* play) { bool shouldSpawnRuto() { // Flags_GetInfTable(INFTABLE_146) check is to prevent Ruto from spawning during the short period of time when // she's on the Zora's Sapphire pedestal but hasn't been kidnapped yet (would result in multiple Rutos otherwise) - return !Flags_GetInfTable(INFTABLE_145) || (gSaveContext.n64ddFlag && (Flags_GetInfTable(INFTABLE_146))); + return !Flags_GetInfTable(INFTABLE_145) || (IS_RANDO && (Flags_GetInfTable(INFTABLE_146))); } void func_80AEC320(EnRu1* this, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c index 8714457c7..825dc8ef8 100644 --- a/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/soh/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -390,7 +390,7 @@ s32 func_80AF5DFC(EnSa* this, PlayState* play) { return 1; } if (play->sceneNum == SCENE_SACRED_FOREST_MEADOW && (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER))) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { return 5; } return CHECK_QUEST_ITEM(QUEST_SONG_SARIA) ? 2 : 5; @@ -636,7 +636,7 @@ void func_80AF683C(EnSa* this, PlayState* play) { Player* player = GET_PLAYER(play); if (!(player->actor.world.pos.z >= -2220.0f) && !Play_InCsMode(play)) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GivePlayerRandoRewardSaria(this, play, RC_SONG_FROM_SARIA); return; } diff --git a/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c b/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c index f3666e422..6f48314ff 100644 --- a/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c +++ b/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c @@ -69,7 +69,7 @@ void EnShopnuts_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); Collider_UpdateCylinder(&this->actor, &this->collider); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { s16 respawnData = gSaveContext.respawn[RESPAWN_MODE_RETURN].data & ((1 << 8) - 1); ScrubIdentity scrubIdentity = Randomizer_IdentifyScrub(play->sceneNum, this->actor.params, respawnData); diff --git a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c index 64f69300a..49e88f903 100644 --- a/soh/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/soh/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -105,7 +105,7 @@ void func_80AFB768(EnSi* this, PlayState* play) { if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) { this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { Randomizer_UpdateSkullReward(this, play); } else { Item_Give(play, giveItemId); @@ -121,7 +121,7 @@ void func_80AFB768(EnSi* this, PlayState* play) { Message_StartTextbox(play, textId, NULL); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { if (getItemId != RG_ICE_TRAP) { Randomizer_GiveSkullReward(this, play); Audio_PlayFanfare_Rando(getItem); @@ -151,7 +151,7 @@ void func_80AFB89C(EnSi* this, PlayState* play) { this->actor.shape.rot.y += 0x400; if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_HOOKSHOT_ATTACHED)) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { Randomizer_UpdateSkullReward(this, play); } else { Item_Give(play, giveItemId); @@ -159,7 +159,7 @@ void func_80AFB89C(EnSi* this, PlayState* play) { Message_StartTextbox(play, textId, NULL); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { if (getItemId != RG_ICE_TRAP) { Randomizer_GiveSkullReward(this, play); Audio_PlayFanfare_Rando(getItem); @@ -210,7 +210,7 @@ void EnSi_Draw(Actor* thisx, PlayState* play) { if (this->actionFunc != func_80AFB950) { func_8002ED80(&this->actor, play, 0); func_8002EBCC(&this->actor, play, 0); - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { GetItem_Draw(play, GID_SKULL_TOKEN_2); } else { getItem = Randomizer_GetItemFromActor(this->actor.id, play->sceneNum, this->actor.params, GI_SKULL_TOKEN); diff --git a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c index be92dfc82..3492d6de9 100644 --- a/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/soh/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -1039,7 +1039,7 @@ void EnSkj_SariaSongTalk(EnSkj* this, PlayState* play) { EnSkj_SetupWaitInRange(this); } else { func_80AFFE24(this); - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_HEART_PIECE, EnSkj_GetItemXzRange(this), EnSkj_GetItemYRange(this)); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_SKULL_KID, GI_HEART_PIECE); @@ -1058,7 +1058,7 @@ void func_80AFFE44(EnSkj* this, PlayState* play) { this->actor.parent = NULL; EnSkj_SetupPostSariasSong(this); } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_HEART_PIECE, EnSkj_GetItemXzRange(this), EnSkj_GetItemYRange(this)); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_SKULL_KID, GI_HEART_PIECE); @@ -1540,7 +1540,7 @@ void EnSkj_WonOcarinaMiniGame(EnSkj* this, PlayState* play) { void EnSkj_WaitToGiveReward(EnSkj* this, PlayState* play) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { - if (gSaveContext.n64ddFlag && gSaveContext.ocarinaGameRoundNum != 3) { + if (IS_RANDO && gSaveContext.ocarinaGameRoundNum != 3) { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_OCARINA_MEMORY_GAME, GI_HEART_PIECE); GiveItemEntryFromActor(&this->actor, play, getItemEntry, 26.0f, 26.0f); } else { @@ -1556,7 +1556,7 @@ void EnSkj_GiveOcarinaGameReward(EnSkj* this, PlayState* play) { this->actor.parent = NULL; this->actionFunc = EnSkj_FinishOcarinaGameRound; } else { - if (gSaveContext.n64ddFlag && gSaveContext.ocarinaGameRoundNum != 3) { + if (IS_RANDO && gSaveContext.ocarinaGameRoundNum != 3) { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_OCARINA_MEMORY_GAME, GI_HEART_PIECE); GiveItemEntryFromActor(&this->actor, play, getItemEntry, 26.0f, 26.0f); } else { @@ -1573,11 +1573,11 @@ void EnSkj_FinishOcarinaGameRound(EnSkj* this, PlayState* play) { gSaveContext.ocarinaGameRoundNum++; } - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { gSaveContext.ocarinaGameRoundNum = 3; } - if (ocarinaGameRoundNum == 2 || gSaveContext.n64ddFlag) { + if (ocarinaGameRoundNum == 2 || IS_RANDO) { Flags_SetItemGetInf(ITEMGETINF_17); this->actionFunc = EnSkj_CleanupOcarinaGame; } else { diff --git a/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 3e641ee34..81242aa77 100644 --- a/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/soh/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -259,7 +259,7 @@ void EnSth_GivePlayerItem(EnSth* this, PlayState* play) { u16 getItemId = sGetItemIds[this->actor.params]; GetItemEntry getItemEntry = (GetItemEntry)GET_ITEM_NONE; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { switch (getItemId) { case GI_RUPEE_GOLD: if (!Flags_GetRandomizerInf(RAND_INF_KAK_100_GOLD_SKULLTULA_REWARD)) { @@ -301,7 +301,7 @@ void EnSth_GivePlayerItem(EnSth* this, PlayState* play) { } } - if (!gSaveContext.n64ddFlag || getItemEntry.getItemId == GI_NONE) { + if (!IS_RANDO || getItemEntry.getItemId == GI_NONE) { func_8002F434(&this->actor, play, getItemId, 10000.0f, 50.0f); } else { GiveItemEntryFromActor(&this->actor, play, getItemEntry, 10000.0f, 50.0f); diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 2537ed6ad..888b0ef34 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -155,7 +155,7 @@ void EnSyatekiMan_Init(Actor* thisx, PlayState* play) { s32 pad; EnSyatekiMan* this = (EnSyatekiMan*)thisx; - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_INTERIOR_ENTRANCES)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_INTERIOR_ENTRANCES)) { // If child is in the adult shooting gallery or adult in the child shooting gallery, then despawn the shooting gallery man if ((LINK_IS_CHILD && Entrance_SceneAndSpawnAre(SCENE_SHOOTING_GALLERY, 0x00)) || //Kakariko Village -> Adult Shooting Gallery, index 003B in the entrance table (LINK_IS_ADULT && Entrance_SceneAndSpawnAre(SCENE_SHOOTING_GALLERY, 0x01))) { //Market -> Child Shooting Gallery, index 016D in the entrance table @@ -354,11 +354,11 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, PlayState* play) { this->tempGallery = this->actor.parent; this->actor.parent = NULL; if (!LINK_IS_ADULT) { - if(gSaveContext.n64ddFlag && !Flags_GetTreasure(play, 0x1E)) { + if(IS_RANDO && !Flags_GetTreasure(play, 0x1E)) { this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_MARKET_SHOOTING_GALLERY_REWARD, GI_BULLET_BAG_50); this->getItemId = this->getItemEntry.getItemId; Flags_SetTreasure(play, 0x1E); - } else if (!gSaveContext.n64ddFlag && !Flags_GetItemGetInf(ITEMGETINF_0D)) { + } else if (!IS_RANDO && !Flags_GetItemGetInf(ITEMGETINF_0D)) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ Equip_Pachinko ☆☆☆☆☆ %d\n" VT_RST, CUR_UPG_VALUE(UPG_BULLET_BAG)); if (CUR_UPG_VALUE(UPG_BULLET_BAG) == 1) { @@ -371,11 +371,11 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, PlayState* play) { this->getItemId = GI_RUPEE_PURPLE; } } else { - if(gSaveContext.n64ddFlag && !Flags_GetTreasure(play, 0x1F)) { + if(IS_RANDO && !Flags_GetTreasure(play, 0x1F)) { this->getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_SHOOTING_GALLERY_REWARD, GI_QUIVER_50); this->getItemId = this->getItemEntry.getItemId; Flags_SetTreasure(play, 0x1F); - } else if (!gSaveContext.n64ddFlag && !Flags_GetItemGetInf(ITEMGETINF_0E)) { + } else if (!IS_RANDO && !Flags_GetItemGetInf(ITEMGETINF_0E)) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ Equip_Bow ☆☆☆☆☆ %d\n" VT_RST, CUR_UPG_VALUE(UPG_QUIVER)); switch (CUR_UPG_VALUE(UPG_QUIVER)) { @@ -394,7 +394,7 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, PlayState* play) { this->getItemId = GI_RUPEE_PURPLE; } } - if (!gSaveContext.n64ddFlag || this->getItemEntry.getItemId == GI_NONE) { + if (!IS_RANDO || this->getItemEntry.getItemId == GI_NONE) { func_8002F434(&this->actor, play, this->getItemId, 2000.0f, 1000.0f); } else { GiveItemEntryFromActor(&this->actor, play, this->getItemEntry, 2000.0f, 1000.0f); @@ -431,7 +431,7 @@ void EnSyatekiMan_GivePrize(EnSyatekiMan* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actionFunc = EnSyatekiMan_FinishPrize; } else { - if (!gSaveContext.n64ddFlag || this->getItemEntry.getItemId == GI_NONE) { + if (!IS_RANDO || this->getItemEntry.getItemId == GI_NONE) { func_8002F434(&this->actor, play, this->getItemId, 2000.0f, 1000.0f); } else { GiveItemEntryFromActor(&this->actor, play, this->getItemEntry, 2000.0f, 1000.0f); diff --git a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c index 3772b36f4..9b0dc07e2 100644 --- a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -466,7 +466,7 @@ void func_80B14B6C(EnTa* this, PlayState* play) { func_80B13AA0(this, func_80B14AF4, func_80B167C0); this->unk_2CC = 5; Flags_SetEventChkInf(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { OnePointCutscene_EndCutscene(play, csCamIdx); } Animation_PlayOnce(&this->skelAnime, &gTalonRunTransitionAnim); @@ -878,7 +878,7 @@ void func_80B15E80(EnTa* this, PlayState* play) { } else if (this->unk_2E0 & 2) { func_8002F434(&this->actor, play, GI_MILK, 10000.0f, 50.0f); } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_MILK_BOTTLE, 10000.0f, 50.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LLR_TALONS_CHICKENS, GI_MILK_BOTTLE); @@ -893,7 +893,7 @@ void func_80B15F54(EnTa* this, PlayState* play) { Message_CloseTextbox(play); this->unk_2E0 &= ~0x2; func_80B13AA0(this, func_80B15E80, func_80B16938); - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_MILK_BOTTLE, 10000.0f, 50.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LLR_TALONS_CHICKENS, GI_MILK_BOTTLE); diff --git a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 2b2903809..738db714d 100644 --- a/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/soh/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -408,7 +408,7 @@ s32 EnTk_ChooseReward(EnTk* this) { f32 luck; s32 reward; - if ((gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0)) && !Flags_GetCollectible(gPlayState, 0x1F) && this->heartPieceSpawned == 0) { + if ((IS_RANDO || CVarGetInteger("gDampeWin", 0)) && !Flags_GetCollectible(gPlayState, 0x1F) && this->heartPieceSpawned == 0) { return 3; } @@ -610,7 +610,7 @@ void EnTk_Dig(EnTk* this, PlayState* play) { this->rewardTimer = 0; - if (this->validDigHere == 1 || gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0)) { + if (this->validDigHere == 1 || IS_RANDO || CVarGetInteger("gDampeWin", 0)) { rewardOrigin.x = 0.0f; rewardOrigin.y = 0.0f; rewardOrigin.z = -40.0f; @@ -626,21 +626,21 @@ void EnTk_Dig(EnTk* this, PlayState* play) { // merging in dampe tour fix seems messy, so i'm just wrapping this whole thing // in an n64dd check for now - if (gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0)) { + if (IS_RANDO || CVarGetInteger("gDampeWin", 0)) { if (this->currentReward == 3) { /* * Upgrade the purple rupee reward to the heart piece if this * is the first grand prize dig. */ - if (!Flags_GetItemGetInf(ITEMGETINF_1C) && !(gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0))) { + if (!Flags_GetItemGetInf(ITEMGETINF_1C) && !(IS_RANDO || CVarGetInteger("gDampeWin", 0))) { Flags_SetItemGetInf(ITEMGETINF_1C); this->currentReward = 4; - } else if ((gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0)) && !Flags_GetCollectible(gPlayState, 0x1F) && this->heartPieceSpawned == 0) { + } else if ((IS_RANDO || CVarGetInteger("gDampeWin", 0)) && !Flags_GetCollectible(gPlayState, 0x1F) && this->heartPieceSpawned == 0) { this->currentReward = 4; } } - if ((gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0)) && this->currentReward == 4) { + if ((IS_RANDO || CVarGetInteger("gDampeWin", 0)) && this->currentReward == 4) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ITEM00, rewardPos.x, rewardPos.y, rewardPos.z, 0, 0, 0, 0x1F06, true); this->heartPieceSpawned = 1; @@ -676,7 +676,7 @@ void EnTk_Dig(EnTk* this, PlayState* play) { if (this->skelAnime.curFrame >= 32.0f && this->rewardTimer == 10) { /* Play a reward sound shortly after digging */ - if (!(gSaveContext.n64ddFlag || CVarGetInteger("gDampeWin", 0)) && this->validDigHere == 0) { + if (!(IS_RANDO || CVarGetInteger("gDampeWin", 0)) && this->validDigHere == 0) { /* Bad dig spot */ Audio_PlayActorSound2(&this->actor, NA_SE_SY_ERROR); } else if (this->currentReward == 4) { diff --git a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index 9ebb94750..d52b82d8d 100644 --- a/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/soh/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -319,7 +319,7 @@ void func_80B20768(EnToryo* this, PlayState* play) { this->actor.parent = NULL; this->unk_1E4 = 5; } else { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GetItemEntry itemEntry = Randomizer_GetItemFromKnownCheck(RC_GV_TRADE_SAW, GI_SWORD_BROKEN); Randomizer_ConsumeAdultTradeItem(play, ITEM_SAW); GiveItemEntryFromActor(&this->actor, play, itemEntry, 100.0f, 10.0f); diff --git a/soh/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c b/soh/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c index 1355481c1..98a6a01b5 100644 --- a/soh/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c +++ b/soh/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c @@ -142,7 +142,7 @@ void func_80B3943C(EnWonderTalk* this, PlayState* play) { if ((Actor_ProcessTalkRequest(&this->actor, play))) { if (this->unk_156 != TEXT_STATE_DONE) { // not if we're rando'd in the temple of time talking to the altar - if(!(gSaveContext.n64ddFlag && play->sceneNum == 67)) { + if(!(IS_RANDO && play->sceneNum == 67)) { this->actionFunc = func_80B395F0; } } else { diff --git a/soh/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c b/soh/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c index 9c9007a57..509d66027 100644 --- a/soh/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c +++ b/soh/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c @@ -254,7 +254,7 @@ void func_80B3A4F8(EnWonderTalk2* this, PlayState* play) { if (!this->unk_156) { // Whether or not to skip the text in rando bool randoSkipText = false; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { // Scenes for which all of this type of wonder talk should be skipped. switch (play->sceneNum) { case 0x0007: // Shadow Temple diff --git a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c index 5bf11c5b3..ffc6717d4 100644 --- a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -277,7 +277,7 @@ void func_80B3C9EC(EnXc* this) { this->action = SHEIK_ACTION_BLOCK_PEDESTAL; this->drawMode = SHEIK_DRAW_DEFAULT; this->unk_30C = 1; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { Actor_Kill(&this->actor); } return; @@ -317,7 +317,7 @@ s32 EnXc_MinuetCS(EnXc* this, PlayState* play) { if (z < -2225.0f) { if (!Play_InCsMode(play)) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gMinuetCs); gSaveContext.cutsceneTrigger = 1; Flags_SetEventChkInf(EVENTCHKINF_LEARNED_MINUET_OF_FOREST); @@ -353,7 +353,7 @@ s32 EnXc_BoleroCS(EnXc* this, PlayState* play) { if ((posRot->pos.x > -784.0f) && (posRot->pos.x < -584.0f) && (posRot->pos.y > 447.0f) && (posRot->pos.y < 647.0f) && (posRot->pos.z > -446.0f) && (posRot->pos.z < -246.0f) && !Play_InCsMode(play)) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(&gDeathMountainCraterBoleroCs); gSaveContext.cutsceneTrigger = 1; Flags_SetEventChkInf(EVENTCHKINF_LEARNED_BOLERO_OF_FIRE); @@ -370,7 +370,7 @@ s32 EnXc_BoleroCS(EnXc* this, PlayState* play) { } void EnXc_SetupSerenadeAction(EnXc* this, PlayState* play) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { this->action = SHEIK_ACTION_SERENADE; return; } @@ -390,11 +390,11 @@ s32 EnXc_SerenadeCS(EnXc* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 stateFlags = player->stateFlags1; - if (((CHECK_OWNED_EQUIP(EQUIP_BOOTS, 1) && !gSaveContext.n64ddFlag) || - (Flags_GetTreasure(play, 2) && gSaveContext.n64ddFlag)) && + if (((CHECK_OWNED_EQUIP(EQUIP_BOOTS, 1) && !IS_RANDO) || + (Flags_GetTreasure(play, 2) && IS_RANDO)) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_SERENADE_OF_WATER) && !(stateFlags & 0x20000000) && !Play_InCsMode(play)) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { Cutscene_SetSegment(play, &gIceCavernSerenadeCs); gSaveContext.cutsceneTrigger = 1; Flags_SetEventChkInf(EVENTCHKINF_LEARNED_SERENADE_OF_WATER); // Learned Serenade of Water Flag @@ -2213,10 +2213,10 @@ void EnXc_InitTempleOfTime(EnXc* this, PlayState* play) { gSaveContext.cutsceneTrigger = 1; func_80B3EBF0(this, play); } else if ((!Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) && (Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) && - !gSaveContext.n64ddFlag) || + !IS_RANDO) || (!Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) && - gSaveContext.n64ddFlag)) { - if (!gSaveContext.n64ddFlag) { + IS_RANDO)) { + if (!IS_RANDO) { Flags_SetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT); Item_Give(play, ITEM_SONG_PRELUDE); play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gTempleOfTimePreludeCs); @@ -2379,7 +2379,7 @@ void EnXc_Update(Actor* thisx, PlayState* play) { s32 action = this->action; if (this->actor.params == SHEIK_TYPE_9) { - if (gSaveContext.n64ddFlag && LINK_IS_ADULT) { + if (IS_RANDO && LINK_IS_ADULT) { if (CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_PRELUDE_OF_LIGHT)) { GivePlayerRandoRewardSheikSong(this, play, RC_SHEIK_AT_TEMPLE, 0x20, RG_PRELUDE_OF_LIGHT); } diff --git a/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c b/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c index 77653aff5..3f5412b05 100644 --- a/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c +++ b/soh/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c @@ -389,7 +389,7 @@ void EnZl4_Init(Actor* thisx, PlayState* play) { this->actor.textId = -1; this->eyeExpression = this->mouthExpression = ZL4_MOUTH_NEUTRAL; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ZL4_ANIM_0); this->actionFunc = EnZl4_Idle; return; @@ -1226,7 +1226,7 @@ void EnZl4_Idle(EnZl4* this, PlayState* play) { EnZl4_GetText, func_80B5B9B0); func_80B5BB78(this, play); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GivePlayerRandoRewardZeldaChild(this, play, RC_HC_ZELDAS_LETTER); return; } diff --git a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c index 170b90d8e..fbf82d2a6 100644 --- a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -4921,7 +4921,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, PlayState* play) { if (D_80B7A670 == 0.0f) { this->actor.textId = 0x408C; this->unk_15C = 20; - } else if (D_80B7E07C == 0 && !gSaveContext.n64ddFlag) { + } else if (D_80B7E07C == 0 && !IS_RANDO) { D_80B7A678 = D_80B7A670; if ((s16)D_80B7E078 < (s16)D_80B7A670) { if (D_80B7E07E == 2) { @@ -4934,7 +4934,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, PlayState* play) { this->actor.textId = 0x408B; this->unk_15C = 20; } - } else if (!gSaveContext.n64ddFlag) { + } else if (!IS_RANDO) { this->actor.textId = 0x409B; this->unk_15C = 11; } @@ -5052,7 +5052,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, PlayState* play) { HIGH_SCORE(HS_FISHING) |= 0x400; Flags_SetRandomizerInf(RAND_INF_CHILD_FISHING); sSinkingLureLocation = (u8)Rand_ZeroFloat(3.999f) + 1; - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { getItemId = GI_HEART_PIECE; } else { getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_CHILD_FISHING, GI_HEART_PIECE); @@ -5069,7 +5069,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, PlayState* play) { HIGH_SCORE(HS_FISHING) |= 0x800; Flags_SetRandomizerInf(RAND_INF_ADULT_FISHING); sSinkingLureLocation = (u8)Rand_ZeroFloat(3.999f) + 1; - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { getItemId = GI_SCALE_GOLD; } else { getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_ADULT_FISHING, GI_SCALE_GOLD); @@ -5084,7 +5084,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, PlayState* play) { } this->actor.parent = NULL; - if (!gSaveContext.n64ddFlag || getItemEntry.getItemId == GI_NONE) { + if (!IS_RANDO || getItemEntry.getItemId == GI_NONE) { func_8002F434(&this->actor, play, getItemId, 2000.0f, 1000.0f); } else { GiveItemEntryFromActor(&this->actor, play, getItemEntry, 2000.0f, 1000.0f); @@ -5149,7 +5149,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->unk_15C = 24; } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_SCALE_GOLD, 2000.0f, 1000.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_ADULT_FISHING, GI_SCALE_GOLD); @@ -5161,7 +5161,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, PlayState* play) { case 24: D_80B7A674 = false; if (((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) || - (gSaveContext.n64ddFlag && GET_PLAYER(play)->getItemId == GI_ICE_TRAP)) { + (IS_RANDO && GET_PLAYER(play)->getItemId == GI_ICE_TRAP)) { if (D_80B7E07C == 0) { this->unk_15C = 0; } else { diff --git a/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c b/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c index 35f6d5457..abb65c191 100644 --- a/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c +++ b/soh/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c @@ -59,7 +59,7 @@ void ItemBHeart_Update(Actor* thisx, PlayState* play) { Flags_SetCollectible(play, 0x1F); Actor_Kill(&this->actor); } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_HEART_CONTAINER_2, 30.0f, 40.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromActor(this->actor.id, play->sceneNum, this->actor.params, GI_HEART_CONTAINER_2); @@ -98,7 +98,7 @@ void ItemBHeart_Draw(Actor* thisx, PlayState* play) { actorIt = actorIt->next; } - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GetItemEntry_Draw(play, Randomizer_GetItemFromActor(this->actor.id, play->sceneNum,this->actor.params, GI_HEART_CONTAINER_2)); } else { diff --git a/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index e7822399c..189f9cfe7 100644 --- a/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -83,8 +83,8 @@ void ItemEtcetera_Init(Actor* thisx, PlayState* play) { case ITEM_ETC_LETTER: Actor_SetScale(&this->actor, 0.5f); this->futureActionFunc = func_80B858B4; - if ((Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_RUTOS_LETTER) && !gSaveContext.n64ddFlag) || - (gSaveContext.n64ddFlag && Flags_GetTreasure(play, 0x1E))) { + if ((Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_RUTOS_LETTER) && !IS_RANDO) || + (IS_RANDO && Flags_GetTreasure(play, 0x1E))) { Actor_Kill(&this->actor); } break; @@ -122,7 +122,7 @@ void func_80B857D0(ItemEtcetera* this, PlayState* play) { void func_80B85824(ItemEtcetera* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { if ((this->actor.params & 0xFF) == 7) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { Flags_SetTreasure(play, 0x1F); } } @@ -133,7 +133,7 @@ void func_80B85824(ItemEtcetera* this, PlayState* play) { } Actor_Kill(&this->actor); } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, this->getItemId, 30.0f, 50.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_SUN, GI_ARROW_FIRE); @@ -148,7 +148,7 @@ void func_80B858B4(ItemEtcetera* this, PlayState* play) { Flags_SetEventChkInf(EVENTCHKINF_OBTAINED_RUTOS_LETTER); Flags_SetSwitch(play, 0xB); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { Flags_SetTreasure(play, 0x1E); } } @@ -156,7 +156,7 @@ void func_80B858B4(ItemEtcetera* this, PlayState* play) { } else { if (0) {} // Necessary to match - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, this->getItemId, 30.0f, 50.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LH_UNDERWATER_ITEM, GI_LETTER_RUTO); @@ -229,7 +229,7 @@ void ItemEtcetera_DrawThroughLens(Actor* thisx, PlayState* play) { func_8002EBCC(&this->actor, play, 0); func_8002ED80(&this->actor, play, 0); - if(gSaveContext.n64ddFlag && play->sceneNum == 16) { + if(IS_RANDO && play->sceneNum == 16) { GetItemEntry randoGetItem = GetChestGameRandoGetItem(this->actor.room, this->giDrawId, play); EnItem00_CustomItemsParticles(&this->actor, play, randoGetItem); if (randoGetItem.itemId != ITEM_NONE) { @@ -246,7 +246,7 @@ void ItemEtcetera_Draw(Actor* thisx, PlayState* play) { ItemEtcetera* this = (ItemEtcetera*)thisx; s32 type = this->actor.params & 0xFF; - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GetItemEntry randoGetItem = (GetItemEntry)GET_ITEM_NONE; if (type == ITEM_ETC_ARROW_FIRE) { randoGetItem = Randomizer_GetItemFromKnownCheck(RC_LH_SUN, GI_ARROW_FIRE); diff --git a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index 3e4694423..5cfb6b81f 100644 --- a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -169,7 +169,7 @@ void ItemOcarina_DoNothing(ItemOcarina* this, PlayState* play) { void ItemOcarina_StartSoTCutscene(ItemOcarina* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gHyruleFieldZeldaSongOfTimeCs); gSaveContext.cutsceneTrigger = 1; } else { @@ -189,7 +189,7 @@ void ItemOcarina_WaitInWater(ItemOcarina* this, PlayState* play) { this->actionFunc = ItemOcarina_StartSoTCutscene; this->actor.draw = NULL; } else { - if (!gSaveContext.n64ddFlag) { + if (!IS_RANDO) { func_8002F434(&this->actor, play, GI_OCARINA_OOT, 30.0f, 50.0f); } else { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_HF_OCARINA_OF_TIME_ITEM, GI_OCARINA_OOT); @@ -214,7 +214,7 @@ void ItemOcarina_Draw(Actor* thisx, PlayState* play) { func_8002EBCC(thisx, play, 0); func_8002ED80(thisx, play, 0); - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { GetItemEntry randoGetItem = Randomizer_GetItemFromKnownCheck(RC_HF_OCARINA_OF_TIME_ITEM, GI_OCARINA_OOT); EnItem00_CustomItemsParticles(&this->actor, play, randoGetItem); GetItemEntry_Draw(play, randoGetItem); diff --git a/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index 7a893b50a..217fc434f 100644 --- a/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/soh/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -123,7 +123,7 @@ void ObjLightswitch_InitCollider(ObjLightswitch* this, PlayState* play) { s32 pad; // Initialize this with the sun switch, so it can't be affected by toggling while the actor is loaded - sunLightArrowsEnabledOnSunSwitchLoad = CVarGetInteger("gSunlightArrows", 0) || (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SUNLIGHT_ARROWS)); + sunLightArrowsEnabledOnSunSwitchLoad = CVarGetInteger("gSunlightArrows", 0) || (IS_RANDO && Randomizer_GetSettingValue(RSK_SUNLIGHT_ARROWS)); Collider_InitJntSph(play, &this->collider); // If "Sunlight Arrows" is enabled, set up the collider to allow Light Arrow hits diff --git a/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index 4fe1d1e02..27b4c17cd 100644 --- a/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -275,7 +275,7 @@ void ObjOshihiki_Init(Actor* thisx, PlayState* play2) { // In MQ Spirit, remove the large silver block in the hole as child so the chest in the silver block hallway // can be guaranteed accessible - if (gSaveContext.n64ddFlag && LINK_IS_CHILD && ResourceMgr_IsGameMasterQuest() && + if (IS_RANDO && LINK_IS_CHILD && ResourceMgr_IsGameMasterQuest() && play->sceneNum == SCENE_SPIRIT_TEMPLE && thisx->room == 6 && // Spirit Temple silver block hallway thisx->params == 0x9C7) { // Silver block that is marked as in the hole Actor_Kill(thisx); diff --git a/soh/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/soh/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 6cecb0fa7..2346b34ff 100644 --- a/soh/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/soh/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -222,7 +222,7 @@ void ObjTsubo_WaterBreak(ObjTsubo* this, PlayState* play) { void ObjTsubo_SetupWaitForObject(ObjTsubo* this) { // Remove pots in Boss Rush. Present in Barinade's and Ganondorf's arenas. - if (gSaveContext.isBossRush) { + if (IS_BOSS_RUSH) { Actor_Kill(this); } diff --git a/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index 1cbc48473..e5d1410ea 100644 --- a/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -136,7 +136,7 @@ void ObjectKankyo_Init(Actor* thisx, PlayState* play) { this->effects[5].size = 0.0f; } - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { if (Flags_GetRandomizerInf(RAND_INF_TRIALS_DONE_FOREST_TRIAL)) { this->effects[0].size = 0.0f; } diff --git a/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index d85770a32..0c280171f 100644 --- a/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/soh/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -162,8 +162,8 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { func_80078884(NA_SE_SY_CORRECT_CHIME); osSyncPrintf(VT_FGCOL(CYAN) "SHOT_SUN HIT!!!!!!!\n" VT_RST); - if ((INV_CONTENT(ITEM_ARROW_FIRE) == ITEM_NONE && !gSaveContext.n64ddFlag) || - (!Flags_GetTreasure(play, 0x1F) && gSaveContext.n64ddFlag)) { + if ((INV_CONTENT(ITEM_ARROW_FIRE) == ITEM_NONE && !IS_RANDO) || + (!Flags_GetTreasure(play, 0x1F) && IS_RANDO)) { Actor_Spawn(&play->actorCtx, play, ACTOR_ITEM_ETCETERA, 700.0f, -800.0f, 7261.0f, 0, 0, 0, 7, true); play->csCtx.segment = SEGMENTED_TO_VIRTUAL(gLakeHyliaFireArrowsCS); gSaveContext.cutsceneTrigger = 1; diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index 4023f6449..d0c4b362e 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -4275,7 +4275,7 @@ s32 func_80839034(PlayState* play, Player* this, CollisionPoly* poly, u32 bgId) play->nextEntranceIndex = play->setupExitList[sp3C - 1]; // Main override for entrance rando and entrance skips - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { play->nextEntranceIndex = Entrance_OverrideNextIndex(play->nextEntranceIndex); } @@ -4286,7 +4286,7 @@ s32 func_80839034(PlayState* play, Player* this, CollisionPoly* poly, u32 bgId) gSaveContext.nextTransitionType = 3; } else if (play->nextEntranceIndex >= 0x7FF9) { // handle dynamic exits - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { play->nextEntranceIndex = Entrance_OverrideDynamicExit(D_80854514[play->nextEntranceIndex - 0x7FF9] + play->curSpawn); } else { play->nextEntranceIndex = @@ -4446,7 +4446,7 @@ s32 func_80839800(Player* this, PlayState* play) { (!(this->stateFlags1 & PLAYER_STATE1_ITEM_OVER_HEAD) || ((this->heldActor != NULL) && (this->heldActor->id == ACTOR_EN_RU1)))) { // Disable doors in Boss Rush so the player can't leave the boss rooms backwards. - if ((CHECK_BTN_ALL(sControlInput->press.button, BTN_A) || (func_8084F9A0 == this->func_674)) && !gSaveContext.isBossRush) { + if ((CHECK_BTN_ALL(sControlInput->press.button, BTN_A) || (func_8084F9A0 == this->func_674)) && !IS_BOSS_RUSH) { doorActor = this->doorActor; if (this->doorType <= PLAYER_DOORTYPE_AJAR) { @@ -6358,7 +6358,7 @@ s32 func_8083E5A8(Player* this, PlayState* play) { iREG(67) = false; - if (gSaveContext.n64ddFlag && giEntry.getItemId == RG_ICE_TRAP && giEntry.getItemFrom == ITEM_FROM_FREESTANDING) { + if (IS_RANDO && giEntry.getItemId == RG_ICE_TRAP && giEntry.getItemFrom == ITEM_FROM_FREESTANDING) { this->actor.freezeTimer = 30; Player_SetPendingFlag(this, play); Message_StartTextbox(play, 0xF8, NULL); @@ -6370,7 +6370,7 @@ s32 func_8083E5A8(Player* this, PlayState* play) { // Show the cutscene for picking up an item. In vanilla, this happens in bombchu bowling alley (because getting bombchus need to show the cutscene) // and whenever the player doesn't have the item yet. In rando, we're overruling this because we need to keep showing the cutscene // because those items can be randomized and thus it's important to keep showing the cutscene. - uint8_t showItemCutscene = play->sceneNum == SCENE_BOMBCHU_BOWLING_ALLEY || Item_CheckObtainability(giEntry.itemId) == ITEM_NONE || gSaveContext.n64ddFlag; + uint8_t showItemCutscene = play->sceneNum == SCENE_BOMBCHU_BOWLING_ALLEY || Item_CheckObtainability(giEntry.itemId) == ITEM_NONE || IS_RANDO; // Only skip cutscenes for drops when they're items/consumables from bushes/rocks/enemies. uint8_t isDropToSkip = (interactedActor->id == ACTOR_EN_ITEM00 && interactedActor->params != 6 && interactedActor->params != 17) || @@ -6384,7 +6384,7 @@ s32 func_8083E5A8(Player* this, PlayState* play) { // Same as above but for rando. Rando is different because we want to enable cutscenes for items that the player already has because // those items could be a randomized item coming from scrubs, freestanding PoH's and keys. So we need to once again overrule // this specifically for items coming from bushes/rocks/enemies when the player has already picked that item up. - uint8_t skipItemCutsceneRando = gSaveContext.n64ddFlag && Item_CheckObtainability(giEntry.itemId) != ITEM_NONE && isDropToSkip; + uint8_t skipItemCutsceneRando = IS_RANDO && Item_CheckObtainability(giEntry.itemId) != ITEM_NONE && isDropToSkip; // Show cutscene when picking up a item. if (showItemCutscene && !skipItemCutscene && !skipItemCutsceneRando) { @@ -9658,7 +9658,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { s32 sp4C; // In ER, once Link has spawned we know the scene has loaded, so we can sanitize the last known entrance type - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { Grotto_SanitizeEntranceType(); } @@ -12706,7 +12706,7 @@ s32 func_8084DFF4(PlayState* play, Player* this) { // Use this if we do have a getItemEntry if (giEntry.modIndex == MOD_NONE) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { Audio_PlayFanfare_Rando(giEntry); } else if (((giEntry.itemId >= ITEM_RUPEE_GREEN) && (giEntry.itemId <= ITEM_RUPEE_RED)) || ((giEntry.itemId >= ITEM_RUPEE_PURPLE) && (giEntry.itemId <= ITEM_RUPEE_GOLD)) || @@ -12724,7 +12724,7 @@ s32 func_8084DFF4(PlayState* play, Player* this) { Audio_PlayFanfare(temp1); } } else if (giEntry.modIndex == MOD_RANDOMIZER) { - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { Audio_PlayFanfare_Rando(giEntry); } else if (giEntry.itemId == RG_DOUBLE_DEFENSE || giEntry.itemId == RG_MAGIC_SINGLE || giEntry.itemId == RG_MAGIC_DOUBLE) { @@ -12763,7 +12763,7 @@ s32 func_8084DFF4(PlayState* play, Player* this) { play->msgCtx.msgMode = MSGMODE_TEXT_DONE; } else { if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { - if (this->getItemId == GI_GAUNTLETS_SILVER && !gSaveContext.n64ddFlag) { + if (this->getItemId == GI_GAUNTLETS_SILVER && !IS_RANDO) { play->nextEntranceIndex = 0x0123; play->sceneLoadFlag = 0x14; gSaveContext.nextCutsceneIndex = 0xFFF1; @@ -12941,16 +12941,16 @@ void func_8084E6D4(Player* this, PlayState* play) { } } else { func_80832DBC(this); - if ((this->getItemId == GI_ICE_TRAP && !gSaveContext.n64ddFlag) || - (gSaveContext.n64ddFlag && (this->getItemId == RG_ICE_TRAP || this->getItemEntry.getItemId == RG_ICE_TRAP))) { + if ((this->getItemId == GI_ICE_TRAP && !IS_RANDO) || + (IS_RANDO && (this->getItemId == RG_ICE_TRAP || this->getItemEntry.getItemId == RG_ICE_TRAP))) { this->stateFlags1 &= ~(PLAYER_STATE1_GETTING_ITEM | PLAYER_STATE1_ITEM_OVER_HEAD); - if ((this->getItemId != GI_ICE_TRAP && !gSaveContext.n64ddFlag) || - (gSaveContext.n64ddFlag && (this->getItemId != RG_ICE_TRAP || this->getItemEntry.getItemId != RG_ICE_TRAP))) { + if ((this->getItemId != GI_ICE_TRAP && !IS_RANDO) || + (IS_RANDO && (this->getItemId != RG_ICE_TRAP || this->getItemEntry.getItemId != RG_ICE_TRAP))) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x, this->actor.world.pos.y + 100.0f, this->actor.world.pos.z, 0, 0, 0, 0, true); func_8083C0E8(this, play); - } else if (gSaveContext.n64ddFlag) { + } else if (IS_RANDO) { gSaveContext.pendingIceTrapCount++; Player_SetPendingFlag(this, play); func_8083C0E8(this, play); @@ -13490,7 +13490,7 @@ void func_8084F88C(Player* this, PlayState* play) { } else if (this->unk_84F < 0) { Play_TriggerRespawn(play); // In ER, handle DMT and other special void outs to respawn from last entrance from grotto - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { Grotto_ForceRegularVoidOut(); } } else { diff --git a/soh/src/overlays/gamestates/ovl_file_choose/file_choose.h b/soh/src/overlays/gamestates/ovl_file_choose/file_choose.h index 3f76ebd0d..d77517996 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/file_choose.h +++ b/soh/src/overlays/gamestates/ovl_file_choose/file_choose.h @@ -173,13 +173,6 @@ typedef enum { /* 99 */ FS_KBD_BTN_NONE = 99 } KeyboardButton; -typedef enum { - /* 00 */ FS_QUEST_NORMAL, - /* 01 */ FS_QUEST_MASTER, - /* 02 */ FS_QUEST_RANDOMIZER, - /* 03 */ FS_QUEST_BOSSRUSH, -} FileSelectQuest; - void FileChoose_SetupCopySource(GameState* thisx); void FileChoose_SelectCopySource(GameState* thisx); void FileChoose_SetupCopyDest1(GameState* thisx); diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 5cf7b3202..ef95b6a71 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -20,6 +20,7 @@ #include "soh/Enhancements/enhancementTypes.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include +#include "z64save.h" typedef struct { s16 left; @@ -664,8 +665,8 @@ static void DrawMoreInfo(FileChooseContext* this, s16 fileIndex, u8 alpha) { DrawCounters(this, fileIndex, alpha); } -#define MIN_QUEST (ResourceMgr_GameHasOriginal() ? FS_QUEST_NORMAL : FS_QUEST_MASTER) -#define MAX_QUEST FS_QUEST_BOSSRUSH +#define MIN_QUEST (ResourceMgr_GameHasOriginal() ? QUEST_NORMAL : QUEST_MASTER) +#define MAX_QUEST QUEST_BOSSRUSH void Sram_InitDebugSave(void); void Sram_InitBossRushSave(); @@ -962,7 +963,7 @@ void DrawSeedHashSprites(FileChooseContext* this) { // Draw icons on the main menu, when a rando file is selected, and when quest selection is set to rando if ((this->configMode == CM_MAIN_MENU && (this->selectMode != SM_CONFIRM_FILE || Save_GetSaveMetaInfo(this->selectedFileIndex)->randoSave == 1)) || - (this->configMode == CM_QUEST_MENU && this->questType[this->buttonIndex] == FS_QUEST_RANDOMIZER)) { + (this->configMode == CM_QUEST_MENU && this->questType[this->buttonIndex] == QUEST_RANDOMIZER)) { if (this->fileInfoAlpha[this->selectedFileIndex] > 0) { // Use file info alpha to match fading @@ -988,7 +989,7 @@ void DrawSeedHashSprites(FileChooseContext* this) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0xFF, 0xFF, 0xFF, alpha); // Draw Seed Icons for spoiler log - if (this->configMode == CM_QUEST_MENU && this->questType[this->buttonIndex] == FS_QUEST_RANDOMIZER && strnlen(CVarGetString("gSpoilerLog", ""), 1) != 0 && fileSelectSpoilerFileLoaded) { + if (this->configMode == CM_QUEST_MENU && this->questType[this->buttonIndex] == QUEST_RANDOMIZER && strnlen(CVarGetString("gSpoilerLog", ""), 1) != 0 && fileSelectSpoilerFileLoaded) { u16 xStart = 64; for (unsigned int i = 0; i < 5; i++) { SpriteLoad(this, GetSeedTexture(gSaveContext.seedIcons[i])); @@ -1080,14 +1081,15 @@ void FileChoose_UpdateMainMenu(GameState* thisx) { this->logoAlpha = 0; } else if(!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(this->buttonIndex))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - } - else { + } else if (this->n64ddFlags[this->buttonIndex] == this->n64ddFlag) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->actionTimer = 8; this->selectMode = SM_FADE_MAIN_TO_SELECT; this->selectedFileIndex = this->buttonIndex; this->menuMode = FS_MENU_MODE_SELECT; this->nextTitleLabel = FS_TITLE_OPEN_FILE; + } else if (!this->n64ddFlags[this->buttonIndex]) { + Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } } else { if (this->warningLabel == FS_WARNING_NONE) { @@ -1263,16 +1265,16 @@ void FileChoose_UpdateQuestMenu(GameState* thisx) { if (ABS(this->stickRelX) > 30 || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DLEFT | BTN_DRIGHT))) { if (this->stickRelX > 30 || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DRIGHT))) { this->questType[this->buttonIndex] += 1; - while ((this->questType[this->buttonIndex] == FS_QUEST_MASTER && !ResourceMgr_GameHasMasterQuest()) || - (this->questType[this->buttonIndex] == FS_QUEST_RANDOMIZER && !hasRandomizerQuest())) { + while ((this->questType[this->buttonIndex] == QUEST_MASTER && !ResourceMgr_GameHasMasterQuest()) || + (this->questType[this->buttonIndex] == QUEST_RANDOMIZER && !hasRandomizerQuest())) { // If Master Quest is selected without a Master Quest OTR present or when Randomizer Quest is // selected without a loaded Randomizer seed, skip past it. this->questType[this->buttonIndex] += 1; } } else if (this->stickRelX < -30 || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DLEFT))) { this->questType[this->buttonIndex] -= 1; - while ((this->questType[this->buttonIndex] == FS_QUEST_MASTER && !ResourceMgr_GameHasMasterQuest()) || - (this->questType[this->buttonIndex] == FS_QUEST_RANDOMIZER && !hasRandomizerQuest())) { + while ((this->questType[this->buttonIndex] == QUEST_MASTER && !ResourceMgr_GameHasMasterQuest()) || + (this->questType[this->buttonIndex] == QUEST_RANDOMIZER && !hasRandomizerQuest())) { // If Master Quest is selected without a Master Quest OTR present or when Randomizer Quest is // selected without a loaded Randomizer seed, skip past it. this->questType[this->buttonIndex] -= 1; @@ -1292,20 +1294,18 @@ void FileChoose_UpdateQuestMenu(GameState* thisx) { } if (CHECK_BTN_ALL(input->press.button, BTN_A)) { + gSaveContext.questId = this->questType[this->buttonIndex]; - gSaveContext.isMasterQuest = this->questType[this->buttonIndex] == FS_QUEST_MASTER; - gSaveContext.n64ddFlag = this->questType[this->buttonIndex] == FS_QUEST_RANDOMIZER; - gSaveContext.isBossRush = this->questType[this->buttonIndex] == FS_QUEST_BOSSRUSH; gSaveContext.isBossRushPaused = false; - if (this->questType[this->buttonIndex] == FS_QUEST_BOSSRUSH) { + if (this->questType[this->buttonIndex] == QUEST_BOSSRUSH) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->prevConfigMode = this->configMode; this->configMode = CM_ROTATE_TO_BOSS_RUSH_MENU; return; } else { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - osSyncPrintf("Selected Dungeon Quest: %d\n", gSaveContext.isMasterQuest); + osSyncPrintf("Selected Dungeon Quest: %d\n", IS_MASTER_QUEST); this->prevConfigMode = this->configMode; this->configMode = CM_ROTATE_TO_NAME_ENTRY; this->logoAlpha = 0; @@ -2217,7 +2217,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) { this->stickRightPrompt.stickColorA, this->stickRightPrompt.stickTexX, this->stickRightPrompt.stickTexY, this->stickRightPrompt.z, 0, 0, 1.0f, 1.0f); switch (this->questType[this->buttonIndex]) { - case FS_QUEST_NORMAL: + case QUEST_NORMAL: default: gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->logoAlpha); FileChoose_DrawTextureI8(this->state.gfxCtx, gTitleTheLegendOfTextTex, 72, 8, 156, 108, 72, 8, 1024, 1024); @@ -2225,7 +2225,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) { FileChoose_DrawImageRGBA32(this->state.gfxCtx, 160, 135, gTitleZeldaShieldLogoTex, 160, 160); break; - case FS_QUEST_MASTER: + case QUEST_MASTER: gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->logoAlpha); FileChoose_DrawTextureI8(this->state.gfxCtx, gTitleTheLegendOfTextTex, 72, 8, 156, 108, 72, 8, 1024, 1024); FileChoose_DrawTextureI8(this->state.gfxCtx, gTitleOcarinaOfTimeTMTextTex, 96, 8, 154, 163, 96, 8, 1024, 1024); @@ -2233,7 +2233,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) { FileChoose_DrawImageRGBA32(this->state.gfxCtx, 182, 180, gTitleMasterQuestSubtitleTex, 128, 32); break; - case FS_QUEST_RANDOMIZER: + case QUEST_RANDOMIZER: DrawSeedHashSprites(this); gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->logoAlpha); FileChoose_DrawTextureI8(this->state.gfxCtx, gTitleTheLegendOfTextTex, 72, 8, 156, 108, 72, 8, 1024, 1024); @@ -2242,7 +2242,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) { FileChoose_DrawImageRGBA32(this->state.gfxCtx, 182, 180, gTitleRandomizerSubtitleTex, 128, 32); break; - case FS_QUEST_BOSSRUSH: + case QUEST_BOSSRUSH: gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, this->logoAlpha); FileChoose_DrawTextureI8(this->state.gfxCtx, gTitleTheLegendOfTextTex, 72, 8, 156, 108, 72, 8, 1024, 1024); FileChoose_DrawTextureI8(this->state.gfxCtx, gTitleOcarinaOfTimeTMTextTex, 96, 8, 154, 163, 96, 8, 1024, 1024); @@ -2354,7 +2354,7 @@ void FileChoose_DrawWindowContents(GameState* thisx) { // draw file button gSPVertex(POLY_OPA_DISP++, &this->windowContentVtx[temp], 20, 0); - isActive = 0; + isActive = ((this->n64ddFlag == this->n64ddFlags[i]) || (this->nameBoxAlpha[i] == 0)) ? 0 : 1; if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i)) && Save_GetSaveMetaInfo(i)->valid) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[1][0], sWindowContentColors[1][1], @@ -2385,6 +2385,16 @@ void FileChoose_DrawWindowContents(GameState* thisx) { G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, 4, 6, 7, 5, 0); + // draw disk label for 64DD + if (this->n64ddFlags[i]) { + gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sWindowContentColors[isActive][0], sWindowContentColors[isActive][1], + sWindowContentColors[isActive][2], this->nameBoxAlpha[i]); + gDPLoadTextureBlock(POLY_OPA_DISP++, gFileSelDISKButtonTex, G_IM_FMT_IA, G_IM_SIZ_16b, 44, 16, 0, + G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); + gSP1Quadrangle(POLY_OPA_DISP++, 8, 10, 11, 9, 0); + } + // draw rando label if (Save_GetSaveMetaInfo(i)->randoSave) { if (!FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(i))) { @@ -2433,14 +2443,14 @@ void FileChoose_DrawWindowContents(GameState* thisx) { G_TX_NOLOD, G_TX_NOLOD); gSP1Quadrangle(POLY_OPA_DISP++, 12, 14, 15, 13, 0); - if (Save_GetSaveMetaInfo(i)->randoSave || Save_GetSaveMetaInfo(i)->requiresMasterQuest) { + if (this->n64ddFlags[i] || Save_GetSaveMetaInfo(i)->randoSave || Save_GetSaveMetaInfo(i)->requiresMasterQuest) { gSP1Quadrangle(POLY_OPA_DISP++, 16, 18, 19, 17, 0); } } // draw file info for (fileIndex = 0; fileIndex < 3; fileIndex++) { - isActive = 0; + isActive = ((this->n64ddFlag == this->n64ddFlags[fileIndex]) || (this->nameBoxAlpha[fileIndex] == 0)) ? 0 : 1; FileChoose_DrawFileInfo(&this->state, fileIndex, isActive); } @@ -2807,7 +2817,9 @@ void FileChoose_ConfirmFile(GameState* thisx) { func_800AA000(300.0f, 180, 20, 100); Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); // Reset Boss Rush because it's only ever saved in memory. - gSaveContext.isBossRush = 0; + if (IS_BOSS_RUSH) { + gSaveContext.questId = 0; + } this->selectMode = SM_FADE_OUT; func_800F6964(0xF); } else { @@ -3017,7 +3029,7 @@ void FileChoose_LoadGame(GameState* thisx) { } } - if (gSaveContext.n64ddFlag) { + if (IS_RANDO) { // Setup the modified entrance table and entrance shuffle table for rando Entrance_Init(); @@ -3221,6 +3233,8 @@ void FileChoose_Main(GameState* thisx) { OPEN_DISPS(this->state.gfxCtx); + this->n64ddFlag = 0; + gSPSegment(POLY_OPA_DISP++, 0x00, NULL); gSPSegment(POLY_OPA_DISP++, 0x01, this->staticSegment); gSPSegment(POLY_OPA_DISP++, 0x02, this->parameterSegment); @@ -3559,6 +3573,8 @@ void FileChoose_InitContext(GameState* thisx) { for (int buttonIndex = 0; buttonIndex < ARRAY_COUNT(gSaveContext.buttonStatus); buttonIndex++) { gSaveContext.buttonStatus[buttonIndex] = BTN_ENABLED; } + + this->n64ddFlags[0] = this->n64ddFlags[1] = this->n64ddFlags[2] = 0; } void FileChoose_Destroy(GameState* thisx) { diff --git a/soh/src/overlays/gamestates/ovl_select/z_select.c b/soh/src/overlays/gamestates/ovl_select/z_select.c index 3d3db1f3e..4453c8e58 100644 --- a/soh/src/overlays/gamestates/ovl_select/z_select.c +++ b/soh/src/overlays/gamestates/ovl_select/z_select.c @@ -39,7 +39,7 @@ void Select_LoadGame(SelectContext* this, s32 entranceIndex) { gSaveContext.entranceIndex = entranceIndex; // Check the entrance to see if the exit should be overriden to a grotto return point for entrance rando - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { // Ignore return value as we want to load into the entrance specified by the debug menu Grotto_OverrideSpecialEntrance(Entrance_GetOverride(entranceIndex)); } @@ -103,7 +103,7 @@ void Select_Grotto_LoadGame(SelectContext* this, s32 grottoIndex) { gSaveContext.respawn[RESPAWN_MODE_RETURN].pos = this->betterGrottos[grottoIndex].pos; // Check the entrance to see if the exit should be overriden to a grotto return point for entrance rando - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { // Use grotto content and parent scene num to identify the right grotto s16 grottoEntrance = Grotto_GetRenamedGrottoIndexFromOriginal(this->betterGrottos[grottoIndex].data, this->betterGrottos[grottoIndex].exitScene); // Ignore return value as we want to load into the entrance specified by the debug menu diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index aca82529c..dd6ea6a16 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -177,7 +177,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { s16 cursorY; s16 oldCursorPoint; bool dpad = (CVarGetInteger("gDpadPause", 0) && !CHECK_BTN_ALL(input->cur.button, BTN_CUP)); - bool pauseAnyCursor = (CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && gSaveContext.n64ddFlag) || + bool pauseAnyCursor = (CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && IS_RANDO) || (CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_ALWAYS_ON); OPEN_DISPS(play->state.gfxCtx); @@ -481,7 +481,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } if (pauseCtx->cursorItem[PAUSE_EQUIP] == ITEM_BRACELET) { - if (LINK_AGE_IN_YEARS == YEARS_CHILD || gSaveContext.n64ddFlag) { + if (LINK_AGE_IN_YEARS == YEARS_CHILD || IS_RANDO) { pauseCtx->nameColorSet = 0; } else { pauseCtx->nameColorSet = 1; @@ -690,7 +690,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } else if (CUR_UPG_VALUE(sAdultUpgrades[i]) != 0) { if (drawGreyItems && ((sAdultUpgradeItemBases[i] + CUR_UPG_VALUE(sAdultUpgrades[i]) - 1) == ITEM_BRACELET && - !(gSaveContext.n64ddFlag))) { // Grey Out the Goron Bracelet when Not Randomized + !(IS_RANDO))) { // Grey Out the Goron Bracelet when Not Randomized gDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255); gSPGrayscale(POLY_KAL_DISP++, true); } diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index 19bda2fed..54b0abab3 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -237,7 +237,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { s16 oldCursorPoint; s16 moveCursorResult; bool dpad = (CVarGetInteger("gDpadPause", 0) && !CHECK_BTN_ALL(input->cur.button, BTN_CUP)); - bool pauseAnyCursor = (CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && gSaveContext.n64ddFlag) || + bool pauseAnyCursor = (CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && IS_RANDO) || (CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_ALWAYS_ON); // only allow mask select when: @@ -543,7 +543,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { ? 9 : 1; } - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE) && + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE) && cursorSlot == SLOT_TRADE_ADULT && CHECK_BTN_ALL(input->press.button, BTN_A)) { Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); gSelectingAdultTrade = !gSelectingAdultTrade; @@ -680,7 +680,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { // Adult trade item cycle KaleidoScope_DrawItemCycleExtras(play, SLOT_TRADE_ADULT, gSelectingAdultTrade, - gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE), + IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ADULT_TRADE), Randomizer_GetPrevAdultTradeItem(), Randomizer_GetNextAdultTradeItem()); // Child mask item cycle (mimics the left/right item behavior from the cycling logic above) u8 childTradeItem = INV_CONTENT(ITEM_TRADE_CHILD); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 3476020c2..284f65e69 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -1514,7 +1514,7 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { gDPSetCombineMode(POLY_KAL_DISP++, G_CC_MODULATEIA, G_CC_MODULATEIA); gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha); - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { POLY_KAL_DISP = KaleidoScope_QuadTextureIA8( POLY_KAL_DISP, sPromptChoiceTexs[gSaveContext.language][0], 48, 16, 12); } else { @@ -1928,7 +1928,7 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { } } else { bool pauseAnyCursor = - (CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && gSaveContext.n64ddFlag) || + (CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && IS_RANDO) || (CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_ALWAYS_ON); if (!pauseCtx->pageIndex && (!pauseAnyCursor || (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE))) { // pageIndex == PAUSE_ITEM pauseCtx->infoPanelVtx[16].v.ob[0] = pauseCtx->infoPanelVtx[18].v.ob[0] = @@ -2066,7 +2066,7 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { void KaleidoScope_UpdateNamePanel(PlayState* play) { PauseContext* pauseCtx = &play->pauseCtx; u16 sp2A; - bool pauseAnyCursor = (CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && gSaveContext.n64ddFlag) || + bool pauseAnyCursor = (CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_RANDO_ONLY && IS_RANDO) || (CVarGetInteger("gPauseAnyCursor", 0) == PAUSE_ANY_CURSOR_ALWAYS_ON); if ((pauseCtx->namedItem != pauseCtx->cursorItem[pauseCtx->pageIndex]) || @@ -3651,7 +3651,7 @@ void KaleidoScope_Update(PlayState* play) case 0: // Boss Rush skips past the "Save?" window when pressing B while paused. if (CHECK_BTN_ALL(input->press.button, BTN_START) || - (CHECK_BTN_ALL(input->press.button, BTN_B) && gSaveContext.isBossRush)) { + (CHECK_BTN_ALL(input->press.button, BTN_B) && IS_BOSS_RUSH)) { if (CVarGetInteger("gCheatEasyPauseBufferEnabled", 0) || CVarGetInteger("gCheatEasyInputBufferingEnabled", 0)) { // Easy pause buffer is 13 frames, 12 for kaledio to end, and one more to advance a single frame CVarSetInteger("gCheatEasyPauseBufferTimer", 13); @@ -4035,7 +4035,7 @@ void KaleidoScope_Update(PlayState* play) VREG(88) = 66; WREG(2) = 0; pauseCtx->alpha = 255; - if (!gSaveContext.isBossRush) { + if (!IS_BOSS_RUSH) { pauseCtx->state = 0xE; } else { pauseCtx->state = 0xF; @@ -4083,7 +4083,7 @@ void KaleidoScope_Update(PlayState* play) case 0x10: if (CHECK_BTN_ALL(input->press.button, BTN_A) || CHECK_BTN_ALL(input->press.button, BTN_START)) { - if (pauseCtx->promptChoice == 0 && !gSaveContext.isBossRush) { + if (pauseCtx->promptChoice == 0 && !IS_BOSS_RUSH) { Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); Play_SaveSceneFlags(play); @@ -4135,7 +4135,7 @@ void KaleidoScope_Update(PlayState* play) } // In ER, handle overriding the game over respawn entrance - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { Entrance_SetGameOverEntrance(); } } else { @@ -4156,11 +4156,11 @@ void KaleidoScope_Update(PlayState* play) R_PAUSE_MENU_MODE = 0; func_800981B8(&play->objectCtx); func_800418D0(&play->colCtx, play); - if (pauseCtx->promptChoice == 0 && !gSaveContext.isBossRush) { + if (pauseCtx->promptChoice == 0 && !IS_BOSS_RUSH) { Play_TriggerRespawn(play); gSaveContext.respawnFlag = -2; // In ER, handle death warp to last entrance from grottos - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { + if (IS_RANDO && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { Grotto_ForceGrottoReturn(); } gSaveContext.nextTransitionType = 2; @@ -4180,7 +4180,9 @@ void KaleidoScope_Update(PlayState* play) osSyncPrintf(VT_RST); } else { play->state.running = 0; - gSaveContext.isBossRush = false; + if (IS_BOSS_RUSH) { + gSaveContext.questId = 0; + } SET_NEXT_GAMESTATE(&play->state, Opening_Init, OpeningContext); GameInteractor_ExecuteOnExitGame(gSaveContext.fileNum); }