diff --git a/BUILDING.md b/BUILDING.md index 5999f1eb9dc..1821f2bc30e 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -12,7 +12,7 @@ 8. Build the solution. 9. Launching `OTRExporter/extract_assets.py` will generate an `oot.otr` archive file in `OTRExporter/oot.otr`. 10. Run `soh/soh.sln` - 11. Switch the solution to `Release x86`. + 11. Switch the solution to `Release x86` or `Release x64`. 12. Build the solution. 13. Copy the `OTRExporter/oot.otr` archive file to `soh/Release`. 14. Launch `soh.exe`. diff --git a/Jenkinsfile b/Jenkinsfile index 8ea6317a456..7f3589ec844 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -125,6 +125,11 @@ pipeline { agent { label "SoH-Mac-Builders" } + environment { + CC = 'clang -arch arm64 -arch x86_64' + CXX = 'clang++ -arch arm64 -arch x86_64' + MACOSX_DEPLOYMENT_TARGET = 10.15 + } steps { checkout([ $class: 'GitSCM', @@ -137,8 +142,8 @@ pipeline { sh ''' cp ../../ZELOOTD.z64 OTRExporter/baserom_non_mq.z64 cd soh - export CC="clang -arch arm64 -arch x86_64"; export CXX="clang++ -arch arm64 -arch x86_64"; make setup -j4 OPTFLAGS=-O2 DEBUG=0 LD="ld" - export CC="clang -arch arm64 -arch x86_64"; export CXX="clang++ -arch arm64 -arch x86_64"; make -j4 DEBUG=0 OPTFLAGS=-O2 LD="ld" + make setup -j4 OPTFLAGS=-O2 DEBUG=0 LD="ld" + make -j4 DEBUG=0 OPTFLAGS=-O2 LD="ld" make -j4 appbundle mv ../README.md readme.txt 7z a soh-mac.7z soh.app readme.txt diff --git a/OTRExporter/extract_assets.py b/OTRExporter/extract_assets.py index 67b4ca6e45c..6862fb07446 100755 --- a/OTRExporter/extract_assets.py +++ b/OTRExporter/extract_assets.py @@ -4,10 +4,15 @@ import shutil from rom_info import Z64Rom import rom_chooser +import struct def BuildOTR(xmlPath, rom): shutil.copytree("assets", "Extract/assets") + checksum = int(Z64Rom(rom).checksum.value, 16) + with open("Extract/version", "wb") as f: + f.write(struct.pack(' /dev/null 2>&1 cp "$ASSETDIR"/oot.otr "$OLDPWD" echo "Restart $APPIMAGE to play!" @@ -31,7 +42,11 @@ while [[ ! -e "$PWD"/oot.otr ]]; do rm -r "$ASSETDIR" break else - echo -e "\nPlace ROM in this folder\n" + if [ -n "$ZENITY" ]; then + zenity --error --timeout=5 --text="Place ROM in $OWD" --title="Missing ROM file" --width=500 --width=200 + else + echo -e "\nPlace ROM in this folder\n" + fi exit fi done diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index 153a193e8d3..b9ce62aee9a 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -68,6 +68,7 @@ namespace SohImGui { static ImVector s_GroupPanelLabelStack; bool p_open = false; bool needs_save = false; + int lastBackendID = 0; const char* filters[3] = { "Three-Point", @@ -75,6 +76,14 @@ namespace SohImGui { "None" }; + std::pair backends[] = { +#ifdef _WIN32 + { "dx11", "DirectX" }, +#endif + { "sdl", "OpenGL" } + }; + + const char* powers[9] = { "Vanilla (1x)", "Double (2x)", @@ -91,6 +100,21 @@ namespace SohImGui { std::map> windowCategories; std::map customWindows; + int GetBackendID(std::shared_ptr cfg) { + std::string backend = cfg->getString("Window.GfxBackend"); + if (backend.empty()) { + return 0; + } + + for (size_t i = 0; i < (sizeof(backends) / sizeof(backends[0])); i++) { + if(backend == backends[i].first) { + return i; + } + } + + return 0; + } + int ClampFloatToInt(float value, int min, int max) { return fmin(fmax(value, min), max); } @@ -315,6 +339,8 @@ namespace SohImGui { io = &ImGui::GetIO(); io->ConfigFlags |= ImGuiConfigFlags_DockingEnable; io->Fonts->AddFontDefault(); + + lastBackendID = GetBackendID(GlobalCtx2::GetInstance()->GetConfig()); if (CVar_GetS32("gOpenMenuBar", 0) != 1) { SohImGui::overlay->TextDrawNotification(30.0f, true, "Press F1 to access enhancements menu"); } @@ -451,11 +477,21 @@ namespace SohImGui { } } - void EnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, int defaultValue) + void EnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, int defaultValue, bool PlusMinusButton) { int val = CVar_GetS32(cvarName, defaultValue); - ImGui::Text(text, val); + if(PlusMinusButton) { + std::string MinusBTNName = " - ##"; + MinusBTNName += cvarName; + if (ImGui::Button(MinusBTNName.c_str())) { + val--; + CVar_SetS32(cvarName, val); + needs_save = true; + } + ImGui::SameLine(); + ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); + } if (ImGui::SliderInt(id, &val, min, max, format)) { @@ -463,6 +499,18 @@ namespace SohImGui { needs_save = true; } + if(PlusMinusButton) { + std::string PlusBTNName = " + ##"; + PlusBTNName += cvarName; + ImGui::SameLine(); + ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); + if (ImGui::Button(PlusBTNName.c_str())) { + val++; + CVar_SetS32(cvarName, val); + needs_save = true; + } + } + if (val < min) { val = min; @@ -478,7 +526,7 @@ namespace SohImGui { } } - void EnhancementSliderFloat(const char* text, const char* id, const char* cvarName, float min, float max, const char* format, float defaultValue, bool isPercentage) + void EnhancementSliderFloat(const char* text, const char* id, const char* cvarName, float min, float max, const char* format, float defaultValue, bool isPercentage, bool PlusMinusButton) { float val = CVar_GetFloat(cvarName, defaultValue); @@ -487,12 +535,36 @@ namespace SohImGui { else ImGui::Text(text, static_cast(100 * val)); + if(PlusMinusButton) { + std::string MinusBTNName = " - ##"; + MinusBTNName += cvarName; + if (ImGui::Button(MinusBTNName.c_str())) { + val -= 0.1f; + CVar_SetFloat(cvarName, val); + needs_save = true; + } + ImGui::SameLine(); + ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); + } + if (ImGui::SliderFloat(id, &val, min, max, format)) { CVar_SetFloat(cvarName, val); needs_save = true; } + if(PlusMinusButton) { + std::string PlusBTNName = " + ##"; + PlusBTNName += cvarName; + ImGui::SameLine(); + ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); + if (ImGui::Button(PlusBTNName.c_str())) { + val += 0.1f; + CVar_SetFloat(cvarName, val); + needs_save = true; + } + } + if (val < min) { val = min; @@ -653,6 +725,8 @@ namespace SohImGui { ImGui::NewFrame(); const std::shared_ptr wnd = GlobalCtx2::GetInstance()->GetWindow(); + const std::shared_ptr pConf = GlobalCtx2::GetInstance()->GetConfig(); + ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus | ImGuiWindowFlags_NoResize; @@ -808,6 +882,16 @@ namespace SohImGui { ImGui::Text("Jitter fix: >= %d FPS", fps); } + std::string MinusBTNELT = " - ##ExtraLatencyThreshold"; + std::string PlusBTNELT = " + ##ExtraLatencyThreshold"; + if (ImGui::Button(MinusBTNELT.c_str())) { + val--; + CVar_SetS32(cvar, val); + needs_save = true; + } + ImGui::SameLine(); + ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); + if (ImGui::SliderInt("##ExtraLatencyThreshold", &val, 0, 250, "", ImGuiSliderFlags_AlwaysClamp)) { CVar_SetS32(cvar, val); @@ -820,6 +904,26 @@ namespace SohImGui { "to work on one frame while GPU works on the previous frame.\n" "This setting should be used when your computer is too slow\n" "to do CPU + GPU work in time."); + + ImGui::SameLine(); + ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); + if (ImGui::Button(PlusBTNELT.c_str())) { + val++; + CVar_SetS32(cvar, val); + needs_save = true; + } + } + + + ImGui::Text("Renderer API (Needs reload)"); + if (ImGui::BeginCombo("##RApi", backends[lastBackendID].second)) { + for (uint8_t i = 0; i < sizeof(backends) / sizeof(backends[0]); i++) { + if (ImGui::Selectable(backends[i].second, i == lastBackendID)) { + pConf->setString("Window.GfxBackend", backends[i].first); + lastBackendID = i; + } + } + ImGui::EndCombo(); } EXPERIMENTAL(); @@ -915,54 +1019,54 @@ namespace SohImGui { { EnhancementCheckbox("Change Red Potion Effect", "gRedPotionEffect"); Tooltip("Enable the following changes to the amount of health restored by Red Potions"); - EnhancementSliderInt("Red Potion Health: %d", "##REDPOTIONHEALTH", "gRedPotionHealth", 1, 100, ""); + EnhancementSliderInt("Red Potion Health: %d", "##REDPOTIONHEALTH", "gRedPotionHealth", 1, 100, "", 0, true); Tooltip("Changes the amount of health restored by Red Potions"); EnhancementCheckbox("Red Potion Percent Restore", "gRedPercentRestore"); Tooltip("Toggles from Red Potions restoring a fixed amount of health to a percent of the player's current max health"); EnhancementCheckbox("Change Green Potion Effect", "gGreenPotionEffect"); Tooltip("Enable the following changes to the amount of mana restored by Green Potions"); - EnhancementSliderInt("Green Potion Mana: %d", "##GREENPOTIONMANA", "gGreenPotionMana", 1, 100, ""); + EnhancementSliderInt("Green Potion Mana: %d", "##GREENPOTIONMANA", "gGreenPotionMana", 1, 100, "", 0, true); Tooltip("Changes the amount of mana restored by Green Potions, base max mana is 48, max upgraded mana is 96"); EnhancementCheckbox("Green Potion Percent Restore", "gGreenPercentRestore"); Tooltip("Toggles from Green Potions restoring a fixed amount of mana to a percent of the player's current max mana"); EnhancementCheckbox("Change Blue Potion Effects", "gBluePotionEffects"); Tooltip("Enable the following changes to the amount of health and mana restored by Blue Potions"); - EnhancementSliderInt("Blue Potion Health: %d", "##BLUEPOTIONHEALTH", "gBluePotionHealth", 1, 100, ""); + EnhancementSliderInt("Blue Potion Health: %d", "##BLUEPOTIONHEALTH", "gBluePotionHealth", 1, 100, "", 0, true); Tooltip("Changes the amount of health restored by Blue Potions"); EnhancementCheckbox("Blue Potion Health Percent Restore", "gBlueHealthPercentRestore"); Tooltip("Toggles from Blue Potions restoring a fixed amount of health to a percent of the player's current max health"); - EnhancementSliderInt("Blue Potion Mana: %d", "##BLUEPOTIONMANA", "gBluePotionMana", 1, 100, ""); + EnhancementSliderInt("Blue Potion Mana: %d", "##BLUEPOTIONMANA", "gBluePotionMana", 1, 100, "", 0, true); Tooltip("Changes the amount of mana restored by Blue Potions, base max mana is 48, max upgraded mana is 96"); EnhancementCheckbox("Blue Potion Mana Percent Restore", "gBlueManaPercentRestore"); Tooltip("Toggles from Blue Potions restoring a fixed amount of mana to a percent of the player's current max mana"); EnhancementCheckbox("Change Milk Effect", "gMilkEffect"); Tooltip("Enable the following changes to the amount of health restored by Milk"); - EnhancementSliderInt("Milk Health: %d", "##MILKHEALTH", "gMilkHealth", 1, 100, ""); + EnhancementSliderInt("Milk Health: %d", "##MILKHEALTH", "gMilkHealth", 1, 100, "", 0, true); Tooltip("Changes the amount of health restored by Milk"); EnhancementCheckbox("Milk Percent Restore", "gMilkPercentRestore"); Tooltip("Toggles from Milk restoring a fixed amount of health to a percent of the player's current max health"); EnhancementCheckbox("Separate Half Milk Effect", "gSeparateHalfMilkEffect"); Tooltip("Enable the following changes to the amount of health restored by Half Milk\nIf this is disabled, Half Milk will behave the same as Full Milk."); - EnhancementSliderInt("Half Milk Health: %d", "##HALFMILKHEALTH", "gHalfMilkHealth", 1, 100, ""); + EnhancementSliderInt("Half Milk Health: %d", "##HALFMILKHEALTH", "gHalfMilkHealth", 1, 100, "", 0, true); Tooltip("Changes the amount of health restored by Half Milk"); EnhancementCheckbox("Half Milk Percent Restore", "gHalfMilkPercentRestore"); Tooltip("Toggles from Half Milk restoring a fixed amount of health to a percent of the player's current max health"); EnhancementCheckbox("Change Fairy Effect", "gFairyEffect"); Tooltip("Enable the following changes to the amount of health restored by Fairies"); - EnhancementSliderInt("Fairy: %d", "##FAIRYHEALTH", "gFairyHealth", 1, 100, ""); + EnhancementSliderInt("Fairy: %d", "##FAIRYHEALTH", "gFairyHealth", 1, 100, "", 0, true); Tooltip("Changes the amount of health restored by Fairies"); EnhancementCheckbox("Fairy Percent Restore", "gFairyPercentRestore"); Tooltip("Toggles from Fairies restoring a fixed amount of health to a percent of the player's current max health"); EnhancementCheckbox("Change Fairy Revive Effect", "gFairyReviveEffect"); Tooltip("Enable the following changes to the amount of health restored by Fairy Revivals"); - EnhancementSliderInt("Fairy Revival: %d", "##FAIRYREVIVEHEALTH", "gFairyReviveHealth", 1, 100, ""); + EnhancementSliderInt("Fairy Revival: %d", "##FAIRYREVIVEHEALTH", "gFairyReviveHealth", 1, 100, "", 0, true); Tooltip("Changes the amount of health restored by Fairy Revivals"); EnhancementCheckbox("Fairy Revive Percent Restore", "gFairyRevivePercentRestore"); Tooltip("Toggles from Fairy Revivals restoring a fixed amount of health to a percent of the player's current max health"); @@ -1051,7 +1155,7 @@ namespace SohImGui { EnhancementRadioButton("Random cycle", "gPauseLiveLink", 16); Tooltip("Randomize the animation played on the menu after a certain time"); if (CVar_GetS32("gPauseLiveLink", 0) >= 16) { - EnhancementSliderInt("Frame to wait: %d", "##MinFrameCount", "gMinFrameCount", 1, 1000, ""); + EnhancementSliderInt("Frame to wait: %d", "##MinFrameCount", "gMinFrameCount", 1, 1000, "", 0, true); } ImGui::EndMenu(); @@ -1123,6 +1227,16 @@ namespace SohImGui { ImGui::Text("Frame interpolation: %d FPS", fps); } + std::string MinusBTNFPSI = " - ##FPSInterpolation"; + std::string PlusBTNFPSI = " + ##FPSInterpolation"; + if (ImGui::Button(MinusBTNFPSI.c_str())) { + val--; + CVar_SetS32(fps_cvar, val); + needs_save = true; + } + ImGui::SameLine(); + ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); + if (ImGui::SliderInt("##FPSInterpolation", &val, 20, 250, "", ImGuiSliderFlags_AlwaysClamp)) { CVar_SetS32(fps_cvar, val); @@ -1135,6 +1249,14 @@ namespace SohImGui { "and might give a worse result.\n" "For consistent input lag, set this value and your monitor's refresh rate to a multiple of 20\n" "Ctrl+Click for keyboard input"); + + ImGui::SameLine(); + ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); + if (ImGui::Button(PlusBTNFPSI.c_str())) { + val++; + CVar_SetS32(fps_cvar, val); + needs_save = true; + } } if (impl.backend == Backend::DX11) { @@ -1162,6 +1284,7 @@ namespace SohImGui { Tooltip("Holding down B skips text\nKnown to cause a cutscene softlock in Water Temple\nSoftlock can be fixed by pressing D-Right in Debug mode"); EnhancementCheckbox("Free Camera", "gFreeCamera"); + Tooltip("Enables camera control\nNote: You must remap C buttons off of\nthe right stick in the controller\nconfig menu, and map the camera stick\nto the right stick."); ImGui::EndMenu(); } diff --git a/libultraship/libultraship/ImGuiImpl.h b/libultraship/libultraship/ImGuiImpl.h index 1b2ba06c120..580d5cdb619 100644 --- a/libultraship/libultraship/ImGuiImpl.h +++ b/libultraship/libultraship/ImGuiImpl.h @@ -70,8 +70,8 @@ namespace SohImGui { void EnhancementRadioButton(const char* text, const char* cvarName, int id); void EnhancementCheckbox(const char* text, const char* cvarName); void EnhancementButton(const char* text, const char* cvarName); - void EnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, int defaultValue = 0); - void EnhancementSliderFloat(const char* text, const char* id, const char* cvarName, float min, float max, const char* format, float defaultValue, bool isPercentage); + void EnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, int defaultValue = 0, bool PlusMinusButton = false); + void EnhancementSliderFloat(const char* text, const char* id, const char* cvarName, float min, float max, const char* format, float defaultValue, bool isPercentage, bool PlusMinusButton = false); void EnhancementCombobox(const char* name, const char* ComboArray[], size_t arraySize, uint8_t FirstTimeValue); void EnhancementColor(const char* text, const char* cvarName, ImVec4 ColorRGBA, ImVec4 default_colors, bool allow_rainbow = true, bool has_alpha=false, bool TitleSameLine=false); void EnhancementCombo(const std::string& name, const char* cvarName, const std::vector& items, int defaultValue = 0); diff --git a/libultraship/libultraship/InputEditor.cpp b/libultraship/libultraship/InputEditor.cpp index 0d170e305e8..f03e94d57a2 100644 --- a/libultraship/libultraship/InputEditor.cpp +++ b/libultraship/libultraship/InputEditor.cpp @@ -5,6 +5,7 @@ #include "ImGuiImpl.h" #include "Utils/StringHelper.h" #include "Lib/ImGui/imgui_internal.h" +#include "Cvar.h" namespace Ship { @@ -249,13 +250,14 @@ namespace Ship { if (!this->Opened) { BtnReading = -1; + CVar_SetS32("gControllerConfigurationEnabled", 0); return; } ImGui::SetNextWindowSizeConstraints(ImVec2(641, 250), ImVec2(1200, 290)); //OTRTODO: Disable this stupid workaround ( ReadRawPress() only works when the window is on the main viewport ) ImGui::SetNextWindowViewport(ImGui::GetMainViewport()->ID); - ImGui::Begin("Controller Configuration", nullptr, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize); + ImGui::Begin("Controller Configuration", &this->Opened, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize); ImGui::BeginTabBar("##Controllers"); diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_dxgi.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_dxgi.cpp index 620fb527143..6e0c2e4d6dd 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_dxgi.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_dxgi.cpp @@ -229,9 +229,8 @@ static void onkeyup(WPARAM w_param, LPARAM l_param) { } } -char fileName[256]; - static LRESULT CALLBACK gfx_dxgi_wnd_proc(HWND h_wnd, UINT message, WPARAM w_param, LPARAM l_param) { + char fileName[256]; SohImGui::EventImpl event_impl; event_impl.win32 = { h_wnd, static_cast(message), static_cast(w_param), static_cast(l_param) }; SohImGui::Update(event_impl); diff --git a/libultraship/libultraship/Window.cpp b/libultraship/libultraship/Window.cpp index b8f8957c40f..9d28ecf5ebb 100644 --- a/libultraship/libultraship/Window.cpp +++ b/libultraship/libultraship/Window.cpp @@ -212,8 +212,8 @@ namespace Ship { pConf->setString("Window.GfxBackend", ""); pConf->setBool("Window.Fullscreen.Enabled", false); - pConf->setInt("Window.Fullscreen.Width", 640); - pConf->setInt("Window.Fullscreen.Height", 480); + pConf->setInt("Window.Fullscreen.Width", 1920); + pConf->setInt("Window.Fullscreen.Height", 1080); pConf->setString("Game.SaveName", ""); pConf->setString("Game.Main Archive", ""); @@ -233,8 +233,14 @@ namespace Ship { SetAudioPlayer(); bIsFullscreen = pConf->getBool("Window.Fullscreen.Enabled", false); - dwWidth = pConf->getInt("Window.Fullscreen.Width", bIsFullscreen ? 1920 : 640); - dwHeight = pConf->getInt("Window.Fullscreen.Height", bIsFullscreen ? 1080 : 480); + if (bIsFullscreen) { + dwWidth = pConf->getInt("Window.Fullscreen.Width", 1920); + dwHeight = pConf->getInt("Window.Fullscreen.Height", 1080); + } else { + dwWidth = pConf->getInt("Window.Width", 640); + dwHeight = pConf->getInt("Window.Height", 480); + } + dwMenubar = pConf->getBool("Window.Options", false); const std::string& gfx_backend = pConf->getString("Window.GfxBackend"); SetWindowManager(&WmApi, &RenderingApi, gfx_backend); diff --git a/soh/include/z64save.h b/soh/include/z64save.h index 86e9627999d..e58d7a9250a 100644 --- a/soh/include/z64save.h +++ b/soh/include/z64save.h @@ -3,7 +3,7 @@ #include "ultra64.h" #include "z64math.h" -#include +#include "soh/Enhancements/randomizer/randomizerTypes.h" typedef struct { /* 0x00 */ u8 buttonItems[8]; diff --git a/soh/macosx/Info.plist b/soh/macosx/Info.plist index f657ef65786..d42198f02f7 100644 --- a/soh/macosx/Info.plist +++ b/soh/macosx/Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable soh CFBundleGetInfoString - 2.0.0 + 3.0.0 CFBundleIconFile soh.icns CFBundleIdentifier @@ -22,14 +22,14 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.0.0 + 3.0.0 CFBundleSignature ZOoT CFBundleVersion - 2.0.0 + 3.0.0 NSHumanReadableCopyright Copyright 2022 HarbourMasters. LSMinimumSystemVersion - 10.3 + 10.15 diff --git a/soh/randomizer_generation.cpp b/soh/randomizer_generation.cpp deleted file mode 100644 index a55d5fcf0a9..00000000000 --- a/soh/randomizer_generation.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include - -void GenerateRandomizer() { - int ret = Playthrough::Playthrough_Init(std::hash{}(Settings::seed)); - - if (ret < 0) { - if (ret == -1) { // Failed to generate after 5 tries - SPDLOG_ERROR( - "\n\nFailed to generate after 5 tries.\nPress B to go back to the menu.\nA different seed might be " - "successful."); - return; - } else { - SPDLOG_ERROR("\n\nError %d with fill.\nPress Select to exit or B to go back to the menu.\n", ret); - return; - } - } - - const auto& randomizerHash = GetRandomizerHash(); -} \ No newline at end of file diff --git a/soh/soh.vcxproj b/soh/soh.vcxproj index 43054c711a2..974fb25c8aa 100644 --- a/soh/soh.vcxproj +++ b/soh/soh.vcxproj @@ -985,7 +985,7 @@ - + diff --git a/soh/soh.vcxproj.filters b/soh/soh.vcxproj.filters index 457e23ed163..5f48ff04252 100644 --- a/soh/soh.vcxproj.filters +++ b/soh/soh.vcxproj.filters @@ -4052,7 +4052,7 @@ Header Files - + Header Files diff --git a/soh/soh/Enhancements/debugger/colViewer.cpp b/soh/soh/Enhancements/debugger/colViewer.cpp index 1cab6ef6491..e98ff039950 100644 --- a/soh/soh/Enhancements/debugger/colViewer.cpp +++ b/soh/soh/Enhancements/debugger/colViewer.cpp @@ -529,7 +529,7 @@ void DrawColCheckList(std::vector& dl, Collider** objects, int32_t count) { Mtx m; MtxF mt; - SkinMatrix_SetTranslate(&mt, cyl->dim.pos.x, cyl->dim.pos.y, cyl->dim.pos.z); + SkinMatrix_SetTranslate(&mt, cyl->dim.pos.x, cyl->dim.pos.y + cyl->dim.yShift, cyl->dim.pos.z); MtxF ms; int32_t radius = cyl->dim.radius == 0 ? 1 : cyl->dim.radius; SkinMatrix_SetScale(&ms, radius / 128.0f, cyl->dim.height / 128.0f, radius / 128.0f); diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index 60c3e6c4e3c..f31a5e42ad4 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -1561,6 +1561,18 @@ void DrawPlayerTab() { ImGui::InputScalar("C Down", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[2], &one, NULL); ImGui::SameLine(); ImGui::InputScalar("C Right", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[3], &one, NULL); + + if (CVar_GetS32("gDpadEquips", 0)) { + ImGui::NewLine(); + ImGui::Text("Current D-pad Equips"); + ImGui::InputScalar("D-pad Up ", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[4], &one, NULL); // Two spaces at the end for aligning, not elegant but it's working + ImGui::SameLine(); + ImGui::InputScalar("D-pad Down", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[5], &one, NULL); + // Intentionnal to not put everything on the same line, else it's taking too much for lower resolution. + ImGui::InputScalar("D-pad Left", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[6], &one, NULL); + ImGui::SameLine(); + ImGui::InputScalar("D-pad Right", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[7], &one, NULL); + } }); } else { diff --git a/soh/soh/Enhancements/randomizer/3drando/menu.cpp b/soh/soh/Enhancements/randomizer/3drando/menu.cpp index 80e5d63b2e3..7a0c16def9d 100644 --- a/soh/soh/Enhancements/randomizer/3drando/menu.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/menu.cpp @@ -14,7 +14,7 @@ #include "location_access.hpp" #include "debug.hpp" #include -#include "randomizerTypes.h" +#include "soh/Enhancements/randomizer/randomizerTypes.h" namespace { bool seedChanged; diff --git a/soh/soh/Enhancements/randomizer/3drando/menu.hpp b/soh/soh/Enhancements/randomizer/3drando/menu.hpp index 2f393313595..737c1d3cfab 100644 --- a/soh/soh/Enhancements/randomizer/3drando/menu.hpp +++ b/soh/soh/Enhancements/randomizer/3drando/menu.hpp @@ -2,7 +2,7 @@ #include #include -#include "randomizerTypes.h" +#include "soh/Enhancements/randomizer/randomizerTypes.h" #define MAIN_MENU 0 #define OPTION_SUB_MENU 1 diff --git a/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp b/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp index 772cd4a5f04..cfcbdfa917c 100644 --- a/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/playthrough.cpp @@ -6,7 +6,7 @@ #include "logic.hpp" #include "random.hpp" #include "spoiler_log.hpp" -#include "randomizerTypes.h" +#include "soh/Enhancements/randomizer/randomizerTypes.h" namespace Playthrough { diff --git a/soh/randomizerTypes.h b/soh/soh/Enhancements/randomizer/randomizerTypes.h similarity index 100% rename from soh/randomizerTypes.h rename to soh/soh/Enhancements/randomizer/randomizerTypes.h diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 14fa89f6ce6..309c0a951cc 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1370,23 +1370,23 @@ extern "C" void* getN64WeirdFrame(s32 i) { return &weirdFrameBytes[i + sizeof(n64WeirdFrames)]; } -extern "C" s16 GetItemModelFromId(s16 itemId) { +extern "C" s16 Randomizer_GetItemModelFromId(s16 itemId) { return OTRGlobals::Instance->gRandomizer->GetItemModelFromId(itemId); } -extern "C" s32 GetItemIDFromGetItemID(s32 getItemId) { +extern "C" s32 Randomizer_GetItemIDFromGetItemID(s32 getItemId) { return OTRGlobals::Instance->gRandomizer->GetItemIDFromGetItemID(getItemId); } -extern "C" void LoadRandomizerSettings(const char* spoilerFileName) { +extern "C" void Randomizer_LoadSettings(const char* spoilerFileName) { OTRGlobals::Instance->gRandomizer->LoadRandomizerSettings(spoilerFileName); } -extern "C" void LoadHintLocations(const char* spoilerFileName) { +extern "C" void Randomizer_LoadHintLocations(const char* spoilerFileName) { OTRGlobals::Instance->gRandomizer->LoadHintLocations(spoilerFileName); } -extern "C" void LoadItemLocations(const char* spoilerFileName, bool silent) { +extern "C" void Randomizer_LoadItemLocations(const char* spoilerFileName, bool silent) { OTRGlobals::Instance->gRandomizer->LoadItemLocations(spoilerFileName, silent); } @@ -1394,11 +1394,11 @@ extern "C" bool SpoilerFileExists(const char* spoilerFileName) { return OTRGlobals::Instance->gRandomizer->SpoilerFileExists(spoilerFileName); } -extern "C" u8 GetRandoSettingValue(RandomizerSettingKey randoSettingKey) { +extern "C" u8 Randomizer_GetSettingValue(RandomizerSettingKey randoSettingKey) { return OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(randoSettingKey); } -extern "C" RandomizerCheck GetCheckFromActor(s16 sceneNum, s16 actorId, s16 actorParams) { +extern "C" RandomizerCheck Randomizer_GetCheckFromActor(s16 sceneNum, s16 actorId, s16 actorParams) { return OTRGlobals::Instance->gRandomizer->GetCheckFromActor(sceneNum, actorId, actorParams); } @@ -1474,34 +1474,34 @@ extern "C" int CopyScrubMessage(u16 scrubTextId, char* buffer, const int maxBuff return CopyStringToCharBuffer(scrubText, buffer, maxBufferSize); } -extern "C" int CopyAltarMessage(char* buffer, const int maxBufferSize) { +extern "C" int Randomizer_CopyAltarMessage(char* buffer, const int maxBufferSize) { const std::string& altarText = (LINK_IS_ADULT) ? OTRGlobals::Instance->gRandomizer->GetAdultAltarText() : OTRGlobals::Instance->gRandomizer->GetChildAltarText(); return CopyStringToCharBuffer(altarText, buffer, maxBufferSize); } -extern "C" int CopyGanonText(char* buffer, const int maxBufferSize) { +extern "C" int Randomizer_CopyGanonText(char* buffer, const int maxBufferSize) { const std::string& ganonText = OTRGlobals::Instance->gRandomizer->GetGanonText(); return CopyStringToCharBuffer(ganonText, buffer, maxBufferSize); } -extern "C" int CopyGanonHintText(char* buffer, const int maxBufferSize) { +extern "C" int Randomizer_CopyGanonHintText(char* buffer, const int maxBufferSize) { const std::string& ganonText = OTRGlobals::Instance->gRandomizer->GetGanonHintText(); return CopyStringToCharBuffer(ganonText, buffer, maxBufferSize); } -extern "C" int CopyHintFromCheck(RandomizerCheck check, char* buffer, const int maxBufferSize) { +extern "C" int Randomizer_CopyHintFromCheck(RandomizerCheck check, char* buffer, const int maxBufferSize) { // we don't want to make a copy of the std::string returned from GetHintFromCheck // so we're just going to let RVO take care of it const std::string& hintText = OTRGlobals::Instance->gRandomizer->GetHintFromCheck(check); return CopyStringToCharBuffer(hintText, buffer, maxBufferSize); } -extern "C" s32 GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum) { +extern "C" s32 Randomizer_GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum) { return OTRGlobals::Instance->gRandomizer->GetRandomizedItemId(ogId, actorId, actorParams, sceneNum); } -extern "C" s32 GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId) { +extern "C" s32 Randomizer_GetItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId) { return OTRGlobals::Instance->gRandomizer->GetRandomizedItemIdFromKnownCheck(randomizerCheck, ogId); } diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h index 8f46d13fc76..83618f994ed 100644 --- a/soh/soh/OTRGlobals.h +++ b/soh/soh/OTRGlobals.h @@ -83,20 +83,19 @@ void AudioMgr_CreateNextAudioBuffer(s16* samples, u32 num_samples); int Controller_ShouldRumble(size_t i); void* getN64WeirdFrame(s32 i); Sprite* GetSeedTexture(uint8_t index); -void LoadRandomizerSettings(const char* spoilerFileName); -u8 GetRandoSettingValue(RandomizerSettingKey randoSettingKey); -RandomizerCheck GetCheckFromActor(s16 actorId, s16 actorParams, s16 sceneNum); -int CopyAltarMessage(char* buffer, const int maxBufferSize); -int CopyHintFromCheck(RandomizerCheck check, char* buffer, const int maxBufferSize); -int CopyGanonText(char* buffer, const int maxBufferSize); -int CopyGanonHintText(char* buffer, const int maxBufferSize); -void LoadHintLocations(const char* spoilerFileName); -void LoadItemLocations(const char* spoilerFileName, bool silent); -s16 GetItemModelFromId(s16 itemId); -s32 GetItemIDFromGetItemID(s32 getItemId); -s32 GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum); -s32 GetRandomizedItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId); -int Randomizer_GetCustomGetItemMessage(GetItemID giid, char* buffer, const int maxBufferSize); +void Randomizer_LoadSettings(const char* spoilerFileName); +u8 Randomizer_GetSettingValue(RandomizerSettingKey randoSettingKey); +RandomizerCheck Randomizer_GetCheckFromActor(s16 actorId, s16 actorParams, s16 sceneNum); +int Randomizer_CopyAltarMessage(char* buffer, const int maxBufferSize); +int Randomizer_CopyHintFromCheck(RandomizerCheck check, char* buffer, const int maxBufferSize); +int Randomizer_CopyGanonText(char* buffer, const int maxBufferSize); +int Randomizer_CopyGanonHintText(char* buffer, const int maxBufferSize); +void Randomizer_LoadHintLocations(const char* spoilerFileName); +void Randomizer_LoadItemLocations(const char* spoilerFileName, bool silent); +s16 Randomizer_GetItemModelFromId(s16 itemId); +s32 Randomizer_GetItemIDFromGetItemID(s32 getItemId); +s32 Randomizer_GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum); +s32 Randomizer_GetItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId); int CustomMessage_RetrieveIfExists(GlobalContext* globalCtx); #endif diff --git a/soh/src/code/game.c b/soh/src/code/game.c index 9e0cfb50b51..9089606e6e4 100644 --- a/soh/src/code/game.c +++ b/soh/src/code/game.c @@ -409,7 +409,9 @@ void GameState_Update(GameState* gameState) { // Unrestricted Items if (CVar_GetS32("gNoRestrictItems", 0) != 0) { if (gGlobalCtx) { + u8 sunsBackup = gGlobalCtx->interfaceCtx.restrictions.sunsSong; memset(&gGlobalCtx->interfaceCtx.restrictions, 0, sizeof(gGlobalCtx->interfaceCtx.restrictions)); + gGlobalCtx->interfaceCtx.restrictions.sunsSong = sunsBackup; } } diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 42ab8064c8e..70771880c30 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -5983,7 +5983,7 @@ s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar } s32 GetChestGameRandoGetItemId(s8 room, s16 ogDrawId, GlobalContext* globalCtx) { - if (GetRandoSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) { + if (Randomizer_GetSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) { // RANDOTODO update this logic when we implement keysanity // because 3drando replaces the keys not the rupees if (ogDrawId == GID_RUPEE_GREEN || @@ -5993,27 +5993,27 @@ s32 GetChestGameRandoGetItemId(s8 room, s16 ogDrawId, GlobalContext* globalCtx) switch(room) { case 1: if(!Flags_GetCollectible(globalCtx, 0x1B)) { - return GetRandomizedItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_ITEM_1, GI_RUPEE_GREEN); + return Randomizer_GetItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_ITEM_1, GI_RUPEE_GREEN); } break; case 2: if(!Flags_GetCollectible(globalCtx, 0x1C)) { - return GetRandomizedItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_ITEM_2, GI_RUPEE_GREEN); + return Randomizer_GetItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_ITEM_2, GI_RUPEE_GREEN); } break; case 3: if(!Flags_GetCollectible(globalCtx, 0x1D)) { - return GetRandomizedItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_ITEM_3, GI_RUPEE_BLUE); + return Randomizer_GetItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_ITEM_3, GI_RUPEE_BLUE); } break; case 4: if(!Flags_GetCollectible(globalCtx, 0x1E)) { - return GetRandomizedItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_ITEM_4, GI_RUPEE_BLUE); + return Randomizer_GetItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_ITEM_4, GI_RUPEE_BLUE); } break; case 5: if(!Flags_GetCollectible(globalCtx, 0x1F)) { - return GetRandomizedItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_ITEM_5, GI_RUPEE_RED); + return Randomizer_GetItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_ITEM_5, GI_RUPEE_RED); } break; } @@ -6021,7 +6021,7 @@ s32 GetChestGameRandoGetItemId(s8 room, s16 ogDrawId, GlobalContext* globalCtx) } if(ogDrawId == GID_HEART_PIECE) { - return GetRandomizedItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_REWARD, GI_HEART_PIECE); + return Randomizer_GetItemIdFromKnownCheck(RC_MARKET_TREASURE_CHEST_GAME_REWARD, GI_HEART_PIECE); } return GI_NONE; @@ -6031,7 +6031,7 @@ s16 GetChestGameRandoGiDrawId(s8 room, s16 ogDrawId, GlobalContext* globalCtx) { s32 randoGetItemId = GetChestGameRandoGetItemId(room, ogDrawId, globalCtx); if(randoGetItemId != GI_NONE) { - return GetItemModelFromId(randoGetItemId); + return Randomizer_GetItemModelFromId(randoGetItemId); } return ogDrawId; diff --git a/soh/src/code/z_camera.c b/soh/src/code/z_camera.c index 287edeb6067..10a89acdbc4 100644 --- a/soh/src/code/z_camera.c +++ b/soh/src/code/z_camera.c @@ -1431,70 +1431,53 @@ s32 SetCameraManual(Camera* camera) { } s32 Camera_Free(Camera* camera) { - Normal1* norm1 = (Normal1*)camera->paramData; + Vec3f* eye = &camera->eye; + Vec3f* at = &camera->at; + Vec3f* eyeNext = &camera->eyeNext; + VecSph spA8; + CamColChk sp6C; + Parallel1* para1 = (Parallel1*)camera->paramData; + f32 playerHeight; - f32 playerHeight = Player_GetHeight(camera->player); - f32 sp94; - CamColChk camBgChk; - PosRot* playerPosRot = &camera->playerPosRot; - Vec3f at; + at->x = Camera_LERPCeilF(camera->player->actor.world.pos.x, camera->at.x, 0.5f, 1.0f); + at->y = Camera_LERPCeilF(camera->player->actor.world.pos.y + (camera->player->rideActor != NULL + ? Player_GetHeight(camera->player) / 2 + : Player_GetHeight(camera->player)) / + 1.2f, + camera->at.y, 0.5f, 1.0f); + at->z = Camera_LERPCeilF(camera->player->actor.world.pos.z, camera->at.z, 0.5f, 1.0f); - sCameraInterfaceFlags = norm1->interfaceFlags; + playerHeight = Player_GetHeight(camera->player); if (RELOAD_PARAMS) { - VecSph eyeAdjustment1; - OLib_Vec3fDiffToVecSphGeo(&eyeAdjustment1, &camera->at, &camera->eye); + OLib_Vec3fDiffToVecSphGeo(&spA8, &camera->at, &camera->eye); - camera->globalCtx->camX = eyeAdjustment1.yaw; - camera->globalCtx->camY = eyeAdjustment1.pitch; + camera->globalCtx->camX = spA8.yaw; + camera->globalCtx->camY = spA8.pitch; CameraModeValue* values = sCameraSettings[camera->setting].cameraModes[camera->mode].values; - f32 yNormal = (1.0f + PCT(R_CAM_YOFFSET_NORM) - PCT(R_CAM_YOFFSET_NORM) * (68.0f / playerHeight)); - sp94 = yNormal * PCT(playerHeight); + f32 yNormal = (1.0f + PCT(OREG(46))) - (PCT(OREG(46)) * (68.0f / playerHeight)); - norm1->yOffset = NEXTSETTING * sp94; - norm1->distMin = NEXTSETTING * sp94; - norm1->distMax = NEXTSETTING * sp94; - norm1->pitchTarget = DEGF_TO_BINANG(NEXTSETTING); - norm1->unk_0C = NEXTSETTING; - norm1->unk_10 = NEXTSETTING; - norm1->unk_14 = NEXTPCT; - norm1->fovTarget = NEXTSETTING; - norm1->atLERPScaleMax = NEXTPCT; - norm1->interfaceFlags = NEXTSETTING; + para1->yOffset = NEXTPCT * playerHeight * yNormal; + para1->distTarget = NEXTPCT * playerHeight * yNormal; + para1->pitchTarget = DEGF_TO_BINANG(NEXTSETTING); + para1->yawTarget = DEGF_TO_BINANG(NEXTSETTING); + para1->unk_08 = NEXTSETTING; + para1->unk_0C = NEXTSETTING; + para1->fovTarget = NEXTSETTING; + para1->unk_14 = NEXTPCT; + para1->interfaceFlags = NEXTSETTING; + para1->unk_18 = NEXTPCT * playerHeight * yNormal; + para1->unk_1C = NEXTPCT; } if (R_RELOAD_CAM_PARAMS) { Camera_CopyPREGToModeValues(camera); } - VecSph eyeAdjustment; - const f32 camSpeed = 0.5f; - - camera->animState = 0; - - at.x = Camera_LERPCeilF(camera->player->actor.world.pos.x, camera->at.x, camSpeed, 1.0f); - at.y = Camera_LERPCeilF(camera->player->actor.world.pos.y + (camera->player->rideActor != NULL ? Player_GetHeight(camera->player) / 2 : Player_GetHeight(camera->player)) / 1.2f, camera->at.y, camSpeed, 1.0f); - at.z = Camera_LERPCeilF(camera->player->actor.world.pos.z, camera->at.z, camSpeed, 1.0f); - - OLib_Vec3fDiffToVecSphGeo(&eyeAdjustment, &at, &camera->eye); - - camBgChk.pos = camera->eye; + sCameraInterfaceFlags = 1; - float maxRadius = 150.0f; - if (Camera_BGCheckInfo(camera, &at, &camBgChk)) { - VecSph collSphere; - OLib_Vec3fDiffToVecSphGeo(&collSphere, &at, &camBgChk.pos); - float rad = collSphere.r; - - if (rad >= maxRadius) { - camera->dist = eyeAdjustment.r = Camera_LERPCeilF(maxRadius, camera->dist, camSpeed / 4, 1.0f); - } else { - camera->dist = eyeAdjustment.r = rad; - } - } else { - camera->dist = eyeAdjustment.r = Camera_LERPCeilF(maxRadius, camera->dist, camSpeed / 4, 1.0f); - } + camera->animState = 1; f32 newCamX = -D_8015BD7C->state.input[0].cur.cam_x; f32 newCamY = D_8015BD7C->state.input[0].cur.cam_y; @@ -1509,15 +1492,22 @@ s32 Camera_Free(Camera* camera) { camera->globalCtx->camY = -0x228C; } - eyeAdjustment.yaw = camera->globalCtx->camX; - eyeAdjustment.pitch = camera->globalCtx->camY; + camera->dist = Camera_LERPCeilF(para1->distTarget, camera->dist, 1.0f / camera->rUpdateRateInv, 0.0f); + OLib_Vec3fDiffToVecSphGeo(&spA8, at, eyeNext); + + spA8.r = camera->dist; + spA8.yaw = camera->globalCtx->camX; + spA8.pitch = camera->globalCtx->camY; - Camera_Vec3fVecSphGeoAdd(&camera->eye, &at, &eyeAdjustment); + Camera_Vec3fVecSphGeoAdd(eyeNext, at, &spA8); + if (camera->status == CAM_STAT_ACTIVE) { + sp6C.pos = *eyeNext; + Camera_BGCheckInfo(camera, at, &sp6C); + *eye = sp6C.pos; + } - camera->at = at; - camera->fov = Camera_LERPCeilF(60.0f, camera->fov, camSpeed / 2, 1.0f); - camera->roll = 0; - camera->eyeNext = camera->eye; + camera->fov = Camera_LERPCeilF(65.0f, camera->fov, camera->fovUpdateRate, 1.0f); + camera->roll = Camera_LERPCeilS(0, camera->roll, 0.5, 0xA); return 1; } diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c index 7b55150eee2..46b5fd9cf34 100644 --- a/soh/src/code/z_demo.c +++ b/soh/src/code/z_demo.c @@ -2124,7 +2124,7 @@ void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx) { // If we are rando and tower escape skip is on, then set the flag to say we saw the towers fall // and exit. - if (gSaveContext.n64ddFlag && GetRandoSettingValue(RSK_SKIP_TOWER_ESCAPE)) { + if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_TOWER_ESCAPE)) { return; } gSaveContext.cutsceneIndex = 0xFFF0; diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c index 0c26f8be913..51870bc17de 100644 --- a/soh/src/code/z_en_item00.c +++ b/soh/src/code/z_en_item00.c @@ -509,7 +509,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { } if ((gSaveContext.n64ddFlag || getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) { - getItemId = GetRandomizedItemId(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum); + getItemId = Randomizer_GetRandomizedItemId(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum); func_8002F554(&this->actor, globalCtx, getItemId); } @@ -548,7 +548,7 @@ void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) { } if (this->actor.params == ITEM00_HEART_PIECE) { - if ((CVar_GetS32("gNewDrops", 0) !=0) && !gSaveContext.n64ddFlag) { + if (CVar_GetS32("gNewDrops", 0) && !gSaveContext.n64ddFlag) { this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 20.0f + 50.0f; } else { this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f; @@ -881,7 +881,7 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) { if (gSaveContext.n64ddFlag) { - getItemId = GetRandomizedItemId(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum); + getItemId = Randomizer_GetRandomizedItemId(getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum); } func_8002F554(&this->actor, globalCtx, getItemId); } @@ -1297,14 +1297,14 @@ void EnItem00_DrawRupee(EnItem00* this, GlobalContext* globalCtx) { * Draw Function used for most collectible types of En_Item00 (ammo, bombs, sticks, nuts, magic...). */ void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) { - if ((gSaveContext.n64ddFlag && this->getItemId != GI_NONE) || this->actor.params == ITEM00_SMALL_KEY) { + if (gSaveContext.n64ddFlag && (this->getItemId != GI_NONE || this->actor.params == ITEM00_SMALL_KEY)) { f32 mtxScale = 16.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); - s32 randoGetItemId = GetRandomizedItemId(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum); + s32 randoGetItemId = Randomizer_GetRandomizedItemId(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum); if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } - GetItem_Draw(globalCtx, GetItemModelFromId(randoGetItemId)); + GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId)); } else { s32 texIndex = this->actor.params - 3; @@ -1360,11 +1360,11 @@ void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) { if (gSaveContext.n64ddFlag) { f32 mtxScale = 16.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); - s32 randoGetItemId = GetRandomizedItemId(GI_HEART_PIECE, this->actor.id, this->ogParams, globalCtx->sceneNum); + s32 randoGetItemId = Randomizer_GetRandomizedItemId(GI_HEART_PIECE, this->actor.id, this->ogParams, globalCtx->sceneNum); if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } - GetItem_Draw(globalCtx, GetItemModelFromId(randoGetItemId)); + GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId)); } else { s32 pad; diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index ad37aea162e..196821e9e72 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -1678,11 +1678,11 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) { // if we're rando'd and talking to a gossip stone if (gSaveContext.n64ddFlag && textId == 0x2053 && - GetRandoSettingValue(RSK_GOSSIP_STONE_HINTS) != 0 && - (GetRandoSettingValue(RSK_GOSSIP_STONE_HINTS) == 1 || - (GetRandoSettingValue(RSK_GOSSIP_STONE_HINTS) == 2 && + Randomizer_GetSettingValue(RSK_GOSSIP_STONE_HINTS) != 0 && + (Randomizer_GetSettingValue(RSK_GOSSIP_STONE_HINTS) == 1 || + (Randomizer_GetSettingValue(RSK_GOSSIP_STONE_HINTS) == 2 && Player_GetMask(globalCtx) == PLAYER_MASK_TRUTH) || - (GetRandoSettingValue(RSK_GOSSIP_STONE_HINTS) == 3 && + (Randomizer_GetSettingValue(RSK_GOSSIP_STONE_HINTS) == 3 && CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY)))) { s16 actorParams = msgCtx->talkActor->params; @@ -1702,11 +1702,11 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) { } } - RandomizerCheck hintCheck = GetCheckFromActor(globalCtx->sceneNum, msgCtx->talkActor->id, actorParams); + RandomizerCheck hintCheck = Randomizer_GetCheckFromActor(globalCtx->sceneNum, msgCtx->talkActor->id, actorParams); // Pass the sizeof the message buffer so we don't hardcode any sizes and can rely on globals. // If no hint can be found, this just returns 0 size and doesn't modify the buffer, so no worries. - msgCtx->msgLength = font->msgLength = CopyHintFromCheck(hintCheck, font->msgBuf, sizeof(font->msgBuf)); + msgCtx->msgLength = font->msgLength = Randomizer_CopyHintFromCheck(hintCheck, font->msgBuf, sizeof(font->msgBuf)); } else if (gSaveContext.n64ddFlag && (textId == 0x7040 || textId == 0x7088)) { // rando hints at altar msgCtx->msgLength = font->msgLength = CopyAltarMessage(font->msgBuf, sizeof(font->msgBuf)); @@ -1714,9 +1714,9 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) { msgCtx->msgLength = font->msgLength = CopyScrubMessage(textId, font->msgBuf, sizeof(font->msgBuf)); } else if (gSaveContext.n64ddFlag && textId == 0x70CC) { if (INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) { - msgCtx->msgLength = font->msgLength = CopyGanonText(font->msgBuf, sizeof(font->msgBuf)); + msgCtx->msgLength = font->msgLength = Randomizer_CopyGanonText(font->msgBuf, sizeof(font->msgBuf)); } else { - msgCtx->msgLength = font->msgLength = CopyGanonHintText(font->msgBuf, sizeof(font->msgBuf)); + msgCtx->msgLength = font->msgLength = Randomizer_CopyGanonHintText(font->msgBuf, sizeof(font->msgBuf)); } } else { msgCtx->msgLength = font->msgLength; @@ -2220,14 +2220,14 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) { } } else { osSyncPrintf("Na_StartOcarinaSinglePlayCheck2( message->ocarina_no );\n"); - func_800ECC04((1 << msgCtx->ocarinaAction) + 0x8000); + func_800ECC04((1 << (msgCtx->ocarinaAction % 32)) + 0x8000); } msgCtx->msgMode = MSGMODE_OCARINA_PLAYING; } else if (msgCtx->msgMode == MSGMODE_SONG_DEMONSTRATION_STARTING) { msgCtx->stateTimer = 20; msgCtx->msgMode = MSGMODE_SONG_DEMONSTRATION_SELECT_INSTRUMENT; } else { - func_800ECC04((1 << (msgCtx->ocarinaAction + 0x11)) + 0x8000); + func_800ECC04((1 << ((msgCtx->ocarinaAction + 0x11) % 32)) + 0x8000); // "Performance Check" osSyncPrintf("演奏チェック=%d\n", msgCtx->ocarinaAction - OCARINA_ACTION_PLAYBACK_MINUET); msgCtx->msgMode = MSGMODE_SONG_PLAYBACK; diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 0ac1e1048c5..4a79bd3bc58 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -1810,13 +1810,13 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { return ITEM_NONE; } else if (item == ITEM_WALLET_ADULT) { Inventory_ChangeUpgrade(UPG_WALLET, 1); - if (gSaveContext.n64ddFlag && GetRandoSettingValue(RSK_FULL_WALLETS)) { + if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_FULL_WALLETS)) { Rupees_ChangeBy(200); } return ITEM_NONE; } else if (item == ITEM_WALLET_GIANT) { Inventory_ChangeUpgrade(UPG_WALLET, 2); - if (gSaveContext.n64ddFlag && GetRandoSettingValue(RSK_FULL_WALLETS)) { + if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_FULL_WALLETS)) { Rupees_ChangeBy(500); } return ITEM_NONE; diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index c6938718fc0..5656f4c07ef 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -198,7 +198,7 @@ void GivePlayerRandoRewardSongOfTime(GlobalContext* globalCtx, RandomizerCheck c if (gSaveContext.entranceIndex == 0x050F && player != NULL && !Player_InBlockingCsMode(globalCtx, player) && !Flags_GetTreasure(globalCtx, 0x1F) && gSaveContext.nextTransition == 0xFF) { - GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_SONG_OF_TIME); + GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_SONG_OF_TIME); GiveItemWithoutActor(globalCtx, getItemId); Flags_SetTreasure(globalCtx, 0x1F); } @@ -212,7 +212,7 @@ void GivePlayerRandoRewardNocturne(GlobalContext* globalCtx, RandomizerCheck che gSaveContext.entranceIndex == 0x0195) && LINK_IS_ADULT && CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER) && player != NULL && !Player_InBlockingCsMode(globalCtx, player) && !Flags_GetEventChkInf(0xAA)) { - GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_NOCTURNE_OF_SHADOW); + GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_NOCTURNE_OF_SHADOW); GiveItemWithoutActor(globalCtx, getItemId); Flags_SetEventChkInf(0xAA); } @@ -224,7 +224,7 @@ void GivePlayerRandoRewardRequiem(GlobalContext* globalCtx, RandomizerCheck chec if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) { if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(0xAC) && player != NULL && !Player_InBlockingCsMode(globalCtx, player)) { - GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_SONG_OF_TIME); + GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_SONG_OF_TIME); GiveItemWithoutActor(globalCtx, getItemId); Flags_SetEventChkInf(0xAC); } @@ -238,7 +238,7 @@ void GivePlayerRandoRewardZeldaLightArrowsGift(GlobalContext* globalCtx, Randomi (gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_TOKINOMA) && !Flags_GetTreasure(globalCtx, 0x1E) && player != NULL && !Player_InBlockingCsMode(globalCtx, player) && globalCtx->sceneLoadFlag == 0 && player->getItemId == GI_NONE) { - GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_ARROW_LIGHT); + GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_ARROW_LIGHT); GiveItemWithoutActor(globalCtx, getItemId); Flags_SetTreasure(globalCtx, 0x1E); } @@ -247,7 +247,7 @@ void GivePlayerRandoRewardZeldaLightArrowsGift(GlobalContext* globalCtx, Randomi void GivePlayerRandoRewardSariaGift(GlobalContext* globalCtx, RandomizerCheck check) { Player* player = GET_PLAYER(globalCtx); if (gSaveContext.entranceIndex == 0x05E0) { - GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_ZELDAS_LULLABY); + GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_ZELDAS_LULLABY); if ((!Flags_GetEventChkInf(0xC1) || (player->getItemId == getItemId && getItemId != GI_ICE_TRAP)) && player != NULL && !Player_InBlockingCsMode(globalCtx, player)) { @@ -271,7 +271,7 @@ void Gameplay_Init(GameState* thisx) { u8 tempSetupIndex; s32 pad[2]; - if (gSaveContext.n64ddFlag && GetRandoSettingValue(RSK_SKIP_CHILD_STEALTH)) { + if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_CHILD_STEALTH)) { if (gSaveContext.entranceIndex == 0x7A) { gSaveContext.entranceIndex = 0x400; } else if (gSaveContext.entranceIndex == 0x296) { diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index c88fc9ba1e1..7670762c598 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -416,7 +416,7 @@ void GiveLinkDungeonReward(GetItemID getItemId) { } void GiveLinksPocketMedallion() { - GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(RC_LINKS_POCKET, RG_NONE); + GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(RC_LINKS_POCKET, RG_NONE); GiveLinkDungeonReward(getItemId); } @@ -644,7 +644,7 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { // Give Link's pocket item GiveLinksPocketMedallion(); - int openForest = GetRandoSettingValue(RSK_FOREST); + int openForest = Randomizer_GetSettingValue(RSK_FOREST); switch (openForest) { case 0: // closed break; @@ -657,28 +657,28 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { break; } - int doorOfTime = GetRandoSettingValue(RSK_DOOR_OF_TIME); + int doorOfTime = Randomizer_GetSettingValue(RSK_DOOR_OF_TIME); switch (doorOfTime) { case 0: // open gSaveContext.eventChkInf[4] |= 0x800; break; } - int kakGate = GetRandoSettingValue(RSK_KAK_GATE); + int kakGate = Randomizer_GetSettingValue(RSK_KAK_GATE); switch (kakGate) { case 1: // open gSaveContext.infTable[7] |= 0x40; break; } - if(GetRandoSettingValue(RSK_STARTING_KOKIRI_SWORD)) GiveLinkKokiriSword(); - if(GetRandoSettingValue(RSK_STARTING_DEKU_SHIELD)) GiveLinkDekuShield(); + if(Randomizer_GetSettingValue(RSK_STARTING_KOKIRI_SWORD)) GiveLinkKokiriSword(); + if(Randomizer_GetSettingValue(RSK_STARTING_DEKU_SHIELD)) GiveLinkDekuShield(); - if(GetRandoSettingValue(RSK_STARTING_OCARINA)) { + if(Randomizer_GetSettingValue(RSK_STARTING_OCARINA)) { INV_CONTENT(ITEM_OCARINA_FAIRY) = ITEM_OCARINA_FAIRY; } - if(GetRandoSettingValue(RSK_STARTING_MAPS_COMPASSES)) { + if(Randomizer_GetSettingValue(RSK_STARTING_MAPS_COMPASSES)) { uint32_t mapBitMask = 1 << 1; uint32_t compassBitMask = 1 << 2; uint32_t startingDungeonItemsBitMask = mapBitMask | compassBitMask; @@ -687,13 +687,13 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { } } - if (GetRandoSettingValue(RSK_STARTING_CONSUMABLES)) { + if (Randomizer_GetSettingValue(RSK_STARTING_CONSUMABLES)) { GiveLinkDekuSticks(10); GiveLinkDekuNuts(20); } - if(GetRandoSettingValue(RSK_SKIP_CHILD_ZELDA)) { - s32 giid = GetRandomizedItemIdFromKnownCheck(RC_SONG_FROM_IMPA, GI_ZELDAS_LULLABY); + if(Randomizer_GetSettingValue(RSK_SKIP_CHILD_ZELDA)) { + s32 giid = Randomizer_GetItemIdFromKnownCheck(RC_SONG_FROM_IMPA, GI_ZELDAS_LULLABY); if(giid >= GI_ZELDAS_LULLABY && giid <= GI_PRELUDE_OF_LIGHT) { GiveLinkSong(giid); @@ -780,7 +780,7 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { } else if (giid == GI_DOUBLE_DEFENSE) { GiveLinkDoubleDefense(); } else { - s32 iid = GetItemIDFromGetItemID(giid); + s32 iid = Randomizer_GetItemIDFromGetItemID(giid); if (iid != -1) INV_CONTENT(iid) = iid; } @@ -801,18 +801,18 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { INV_CONTENT(ITEM_LETTER_ZELDA) = ITEM_LETTER_ZELDA; } - if (GetRandoSettingValue(RSK_FULL_WALLETS)) { + if (Randomizer_GetSettingValue(RSK_FULL_WALLETS)) { GiveLinkRupees(9001); } // For Ganon's boss key "Start With" is 0 - if(GetRandoSettingValue(RSK_GANONS_BOSS_KEY) == 0) { + if(Randomizer_GetSettingValue(RSK_GANONS_BOSS_KEY) == 0) { gSaveContext.inventory.dungeonItems[10] |= 1; } - HIGH_SCORE(HS_POE_POINTS) = 1000 - (100 * GetRandoSettingValue(RSK_BIG_POE_COUNT)); + HIGH_SCORE(HS_POE_POINTS) = 1000 - (100 * Randomizer_GetSettingValue(RSK_BIG_POE_COUNT)); - if(GetRandoSettingValue(RSK_SKIP_EPONA_RACE)) { + if(Randomizer_GetSettingValue(RSK_SKIP_EPONA_RACE)) { gSaveContext.eventChkInf[1] |= (1 << 8); } @@ -839,7 +839,7 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { gSaveContext.infTable[25] |= 0x20; // fast gerudo fortress - if (GetRandoSettingValue(RSK_GERUDO_FORTRESS) == 1 || GetRandoSettingValue(RSK_GERUDO_FORTRESS) == 2) { + if (Randomizer_GetSettingValue(RSK_GERUDO_FORTRESS) == 1 || Randomizer_GetSettingValue(RSK_GERUDO_FORTRESS) == 2) { gSaveContext.eventChkInf[9] |= 2; gSaveContext.eventChkInf[9] |= 4; gSaveContext.eventChkInf[9] |= 8; @@ -858,14 +858,14 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { } // open gerudo fortress - if (GetRandoSettingValue(RSK_GERUDO_FORTRESS) == 2) { + if (Randomizer_GetSettingValue(RSK_GERUDO_FORTRESS) == 2) { gSaveContext.eventChkInf[9] |= 1; gSaveContext.sceneFlags[12].swch |= (1 << 0x01); gSaveContext.sceneFlags[12].swch |= (1 << 0x05); gSaveContext.sceneFlags[12].swch |= (1 << 0x11); gSaveContext.sceneFlags[12].collect |= (1 << 0x0C); - if (!GetRandoSettingValue(RSK_SHUFFLE_GERUDO_MEMBERSHIP_CARD)) { + if (!Randomizer_GetSettingValue(RSK_SHUFFLE_GERUDO_MEMBERSHIP_CARD)) { GiveLinkGerudoCard(); } } 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 a31d488555a..7be483bd9a8 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 @@ -69,7 +69,7 @@ const ActorInit Bg_Dy_Yoseizo_InitVars = { void GivePlayerRandoRewardGreatFairy(BgDyYoseizo* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); - GetItemID getItemId = GetRandomizedItemId(GI_NONE, this->actor.id, this->fountainType + 1, globalCtx->sceneNum); + GetItemID getItemId = Randomizer_GetRandomizedItemId(GI_NONE, this->actor.id, this->fountainType + 1, globalCtx->sceneNum); if (this->actor.parent == GET_PLAYER(globalCtx) && !Flags_GetTreasure(globalCtx, this->fountainType + 1) && !Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) { 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 b2d8367f525..ec4dc030e55 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 @@ -46,7 +46,7 @@ void BgGateShutter_Init(Actor* thisx, GlobalContext* globalCtx) { this->somePos.z = thisx->world.pos.z; if (((gSaveContext.infTable[7] & 0x40) || (!gSaveContext.n64ddFlag && (gSaveContext.eventChkInf[4] & 0x20)) || - (gSaveContext.n64ddFlag && GetRandoSettingValue(RSK_KAK_GATE))) && + (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_KAK_GATE))) && (globalCtx->sceneNum == SCENE_SPOT01)) { 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 ddb3f99cf9f..9e46c39ef17 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 @@ -50,7 +50,7 @@ void BgGjyoBridge_Init(Actor* thisx, GlobalContext* globalCtx) { this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); - int bridge = GetRandoSettingValue(RSK_RAINBOW_BRIDGE); + int bridge = Randomizer_GetSettingValue(RSK_RAINBOW_BRIDGE); if (gSaveContext.eventChkInf[4] & 0x2000 || (gSaveContext.n64ddFlag && bridge == 0)) { this->actionFunc = func_808787A4; } else { @@ -176,12 +176,12 @@ void BgGjyoBridge_TriggerCutscene(BgGjyoBridge* this, GlobalContext* globalCtx) LaunchBridgeCutscene(this, globalCtx); } } else { - int bridge = GetRandoSettingValue(RSK_RAINBOW_BRIDGE); - int bridgeStoneCount = GetRandoSettingValue(RSK_RAINBOW_BRIDGE_STONE_COUNT); - int bridgeMedallionCount = GetRandoSettingValue(RSK_RAINBOW_BRIDGE_MEDALLION_COUNT); - int bridgeRewardCount = GetRandoSettingValue(RSK_RAINBOW_BRIDGE_REWARD_COUNT); - int bridgeDungeonCount = GetRandoSettingValue(RSK_RAINBOW_BRIDGE_DUNGEON_COUNT); - int bridgeTokenCount = GetRandoSettingValue(RSK_RAINBOW_BRIDGE_TOKEN_COUNT); + int bridge = Randomizer_GetSettingValue(RSK_RAINBOW_BRIDGE); + int bridgeStoneCount = Randomizer_GetSettingValue(RSK_RAINBOW_BRIDGE_STONE_COUNT); + int bridgeMedallionCount = Randomizer_GetSettingValue(RSK_RAINBOW_BRIDGE_MEDALLION_COUNT); + int bridgeRewardCount = Randomizer_GetSettingValue(RSK_RAINBOW_BRIDGE_REWARD_COUNT); + int bridgeDungeonCount = Randomizer_GetSettingValue(RSK_RAINBOW_BRIDGE_DUNGEON_COUNT); + int bridgeTokenCount = Randomizer_GetSettingValue(RSK_RAINBOW_BRIDGE_TOKEN_COUNT); if (CheckPlayerPosition(player, globalCtx)) { switch (bridge) { 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 db575543622..f7a85fc26db 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 @@ -1504,7 +1504,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx) if (this->csTimer == 180) { globalCtx->sceneLoadFlag = 0x14; - if (gSaveContext.n64ddFlag && GetRandoSettingValue(RSK_SKIP_TOWER_ESCAPE)) { + if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_TOWER_ESCAPE)) { Flags_SetEventChkInf(0xC7); globalCtx->nextEntranceIndex = 0x517; } 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 a59e8fa68fa..cd49f75586d 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 @@ -899,12 +899,12 @@ void func_80986BF8(DemoIm* this, GlobalContext* globalCtx) { } void GivePlayerRandoRewardImpa(Actor* impa, GlobalContext* globalCtx, RandomizerCheck check) { - GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_ZELDAS_LULLABY); + GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_ZELDAS_LULLABY); if (impa->parent != NULL && impa->parent->id == GET_PLAYER(globalCtx)->actor.id && !Flags_GetTreasure(globalCtx, 0x1F)) { Flags_SetTreasure(globalCtx, 0x1F); - } else if (!Flags_GetTreasure(globalCtx, 0x1F) && !GetRandoSettingValue(RSK_SKIP_CHILD_ZELDA)) { + } else if (!Flags_GetTreasure(globalCtx, 0x1F) && !Randomizer_GetSettingValue(RSK_SKIP_CHILD_ZELDA)) { func_8002F434(impa, globalCtx, getItemId, 75.0f, 50.0f); } else if (!Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) { gSaveContext.eventChkInf[5] |= 0x200; 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 04b5b72476f..46ecf597920 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 @@ -128,7 +128,7 @@ void DemoKekkai_Init(Actor* thisx, GlobalContext* globalCtx) { this->collider2.dim.yShift = 300; if (gSaveContext.n64ddFlag) { - int trialsToComplete = GetRandoSettingValue(RSK_TRIAL_COUNT); + int trialsToComplete = Randomizer_GetSettingValue(RSK_TRIAL_COUNT); if (trialsToComplete <= TrialsDoneCount()) { Actor_Kill(thisx); return; 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 20fc6355d7c..291208752fa 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 @@ -462,7 +462,7 @@ s32 DoorWarp1_PlayerInRange(DoorWarp1* this, GlobalContext* globalCtx) { } void GivePlayerRandoReward(DoorWarp1* this, Player* player, GlobalContext* globalCtx, u8 ruto, u8 adult) { - GetItemID getItemId = GetRandomizedItemId(GI_NONE, this->actor.id, this->actor.params, globalCtx->sceneNum); + GetItemID getItemId = Randomizer_GetRandomizedItemId(GI_NONE, this->actor.id, this->actor.params, globalCtx->sceneNum); if (this->actor.parent != NULL && this->actor.parent->id == GET_PLAYER(globalCtx)->actor.id && !Flags_GetTreasure(globalCtx, 0x1F)) { 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 ed6eef1a966..b5c7d8a4a62 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 @@ -127,7 +127,7 @@ void func_809B0558(EnAni* this, GlobalContext* globalCtx) { gSaveContext.itemGetInf[1] |= 0x20; } else { if (gSaveContext.n64ddFlag) { - s32 getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE); + s32 getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE); func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 200.0f); } else { func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f); @@ -141,7 +141,7 @@ void func_809B05F0(EnAni* this, GlobalContext* globalCtx) { } if (gSaveContext.n64ddFlag) { - s32 getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE); + s32 getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE); func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 200.0f); } else { func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f); 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 5d86e72fb4a..ee9ce13293c 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 @@ -186,14 +186,14 @@ void EnBomBowlPit_GivePrize(EnBomBowlPit* this, GlobalContext* globalCtx) { switch (this->prizeIndex) { case EXITEM_BOMB_BAG_BOWLING: this->getItemId = - GetRandomizedItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_FIRST_PRIZE, GI_BOMB_BAG_20); + Randomizer_GetItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_FIRST_PRIZE, GI_BOMB_BAG_20); break; case EXITEM_HEART_PIECE_BOWLING: this->getItemId = - GetRandomizedItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_SECOND_PRIZE, GI_HEART_PIECE); + Randomizer_GetItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_SECOND_PRIZE, GI_HEART_PIECE); break; case EXITEM_BOMBCHUS_BOWLING: - this->getItemId = GetRandomizedItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_BOMBCHUS, GI_BOMBCHUS_10); + this->getItemId = Randomizer_GetItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_BOMBCHUS, GI_BOMBCHUS_10); break; } } 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 617e7ff00b7..533ba593aca 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 @@ -421,7 +421,7 @@ void EnBox_WaitOpen(EnBox* this, GlobalContext* globalCtx) { Flags_SetTreasure(globalCtx, this->dyna.actor.params & 0x1F); // treasure chest game rando - if (GetRandoSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) { + if (Randomizer_GetSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) { if (gSaveContext.n64ddFlag && globalCtx->sceneNum == 16 && (this->dyna.actor.params & 0x60) != 0x20) { if((this->dyna.actor.params & 0xF) < 2) { Flags_SetCollectible(globalCtx, 0x1B); @@ -445,10 +445,10 @@ void EnBox_WaitOpen(EnBox* this, GlobalContext* globalCtx) { func_8002DBD0(&this->dyna.actor, &sp4C, &player->actor.world.pos); if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f && Player_IsFacingActor(&this->dyna.actor, 0x3000, globalCtx)) { - int32_t item = GetRandomizedItemId(this->dyna.actor.params >> 5 & 0x7F, this->dyna.actor.id, this->dyna.actor.params, globalCtx->sceneNum); + int32_t item = Randomizer_GetRandomizedItemId(this->dyna.actor.params >> 5 & 0x7F, this->dyna.actor.id, this->dyna.actor.params, globalCtx->sceneNum); // RANDOTODO treasure chest game rando - if (GetRandoSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) { + if (Randomizer_GetSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) { if (gSaveContext.n64ddFlag && globalCtx->sceneNum == 16 && (this->dyna.actor.params & 0x60) != 0x20) { if((this->dyna.actor.params & 0xF) < 2) { if(Flags_GetCollectible(globalCtx, 0x1B)) { @@ -590,7 +590,7 @@ void EnBox_Update(Actor* thisx, GlobalContext* globalCtx) { } if (((!gSaveContext.n64ddFlag && ((this->dyna.actor.params >> 5 & 0x7F) == 0x7C)) || - (gSaveContext.n64ddFlag && GetRandomizedItemId(this->dyna.actor.params >> 5 & 0x7F, + (gSaveContext.n64ddFlag && Randomizer_GetRandomizedItemId(this->dyna.actor.params >> 5 & 0x7F, this->dyna.actor.id, this->dyna.actor.params, globalCtx->sceneNum) == GI_ICE_TRAP)) && this->actionFunc == EnBox_Open && this->skelanime.curFrame > 45 && 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 6760542cfa1..9f43a5f54c2 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 @@ -453,7 +453,7 @@ void func_809EEA00(EnDivingGame* this, GlobalContext* globalCtx) { if ((this->unk_292 == Message_GetState(&globalCtx->msgCtx) && Message_ShouldAdvance(globalCtx))) { Message_CloseTextbox(globalCtx); this->actor.parent = NULL; - func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_ZD_DIVING_MINIGAME, GI_SCALE_SILVER) : GI_SCALE_SILVER, 90.0f, 10.0f); + func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_ZD_DIVING_MINIGAME, GI_SCALE_SILVER) : GI_SCALE_SILVER, 90.0f, 10.0f); this->actionFunc = func_809EEA90; } } @@ -463,7 +463,7 @@ void func_809EEA90(EnDivingGame* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { this->actionFunc = func_809EEAF8; } else { - func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_ZD_DIVING_MINIGAME, GI_SCALE_SILVER) : GI_SCALE_SILVER, 90.0f, 10.0f); + func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_ZD_DIVING_MINIGAME, GI_SCALE_SILVER) : GI_SCALE_SILVER, 90.0f, 10.0f); } } 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 0d0a31f5206..a89d583ae5d 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 @@ -371,7 +371,7 @@ void EnDns_Talk(EnDns* this, GlobalContext* globalCtx) { void func_809EFDD0(EnDns* this, GlobalContext* globalCtx) { if (this->actor.params == 0x9) { if (gSaveContext.n64ddFlag) { - func_8002F434(&this->actor, globalCtx, GetRandomizedItemId(GI_STICK_UPGRADE_30, this->actor.id, this->actor.params, globalCtx->sceneNum), 130.0f, 100.0f); + func_8002F434(&this->actor, globalCtx, Randomizer_GetRandomizedItemId(GI_STICK_UPGRADE_30, this->actor.id, this->actor.params, globalCtx->sceneNum), 130.0f, 100.0f); } else if (CUR_UPG_VALUE(UPG_STICKS) < 2) { func_8002F434(&this->actor, globalCtx, GI_STICK_UPGRADE_20, 130.0f, 100.0f); } else { @@ -379,14 +379,14 @@ void func_809EFDD0(EnDns* this, GlobalContext* globalCtx) { } } else if (this->actor.params == 0xA) { if (gSaveContext.n64ddFlag) { - func_8002F434(&this->actor, globalCtx, GetRandomizedItemId(GI_NUT_UPGRADE_40, this->actor.id, this->actor.params, globalCtx->sceneNum), 130.0f, 100.0f); + func_8002F434(&this->actor, globalCtx, Randomizer_GetRandomizedItemId(GI_NUT_UPGRADE_40, this->actor.id, this->actor.params, globalCtx->sceneNum), 130.0f, 100.0f); } else if (CUR_UPG_VALUE(UPG_NUTS) < 2) { func_8002F434(&this->actor, globalCtx, GI_NUT_UPGRADE_30, 130.0f, 100.0f); } else { func_8002F434(&this->actor, globalCtx, GI_NUT_UPGRADE_40, 130.0f, 100.0f); } } else { - func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemId(this->dnsItemEntry->getItemId, this->actor.id, this->actor.params, globalCtx->sceneNum) : this->dnsItemEntry->getItemId, 130.0f, 100.0f); + func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetRandomizedItemId(this->dnsItemEntry->getItemId, this->actor.id, this->actor.params, globalCtx->sceneNum) : this->dnsItemEntry->getItemId, 130.0f, 100.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 b500efea526..6d3a4accd9c 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 @@ -139,13 +139,13 @@ void EnDntDemo_Judge(EnDntDemo* this, GlobalContext* globalCtx) { switch (Player_GetMask(globalCtx)) { case PLAYER_MASK_SKULL: if (!Flags_GetTreasure(globalCtx, 0x1F)) { - GiveItemWithoutActor(globalCtx, GetRandomizedItemIdFromKnownCheck(RC_DEKU_THEATER_SKULL_MASK, GI_STICK_UPGRADE_30)); + GiveItemWithoutActor(globalCtx, Randomizer_GetItemIdFromKnownCheck(RC_DEKU_THEATER_SKULL_MASK, GI_STICK_UPGRADE_30)); Flags_SetTreasure(globalCtx, 0x1F); } break; case PLAYER_MASK_TRUTH: if (!Flags_GetTreasure(globalCtx, 0x1E)) { - GiveItemWithoutActor(globalCtx, GetRandomizedItemIdFromKnownCheck(RC_DEKU_THEATER_MASK_OF_TRUTH, GI_NUT_UPGRADE_40)); + GiveItemWithoutActor(globalCtx, Randomizer_GetItemIdFromKnownCheck(RC_DEKU_THEATER_MASK_OF_TRUTH, GI_NUT_UPGRADE_40)); Flags_SetTreasure(globalCtx, 0x1E); } break; 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 f90092d2f35..e7f9b51aabe 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 @@ -548,7 +548,7 @@ void func_809FEC70(EnDu* this, GlobalContext* globalCtx) { EnDu_SetupAction(this, func_809FECE4); } else { f32 xzRange = this->actor.xzDistToPlayer + 1.0f; - func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_GC_DARUNIAS_JOY, GI_BRACELET) : GI_BRACELET, xzRange, fabsf(this->actor.yDistToPlayer) + 1.0f); + func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_GC_DARUNIAS_JOY, GI_BRACELET) : GI_BRACELET, xzRange, fabsf(this->actor.yDistToPlayer) + 1.0f); } } 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 1b76ceaa98a..b42ad6cbf29 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 @@ -138,8 +138,8 @@ void EnExItem_WaitForObject(EnExItem* this, GlobalContext* globalCtx) { case EXITEM_BOMB_BAG_BOWLING: this->unk_17C = func_8002EBCC; if (gSaveContext.n64ddFlag) { - this->giDrawId = GetItemModelFromId( - GetRandomizedItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_FIRST_PRIZE, GI_BOMB_BAG_20)); + this->giDrawId = Randomizer_GetItemModelFromId( + Randomizer_GetItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_FIRST_PRIZE, GI_BOMB_BAG_20)); } else { this->giDrawId = GID_BOMB_BAG_30; } @@ -173,8 +173,8 @@ void EnExItem_WaitForObject(EnExItem* this, GlobalContext* globalCtx) { case EXITEM_BOMBCHUS_BOWLING: this->unk_17C = func_8002EBCC; if (gSaveContext.n64ddFlag) { - this->giDrawId = GetItemModelFromId( - GetRandomizedItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_BOMBCHUS, GI_BOMBCHUS_10)); + this->giDrawId = Randomizer_GetItemModelFromId( + Randomizer_GetItemIdFromKnownCheck(RC_MARKET_BOMBCHU_BOWLING_BOMBCHUS, GI_BOMBCHUS_10)); } else { this->giDrawId = GID_BOMBCHU; } @@ -229,7 +229,7 @@ void EnExItem_WaitForObject(EnExItem* this, GlobalContext* globalCtx) { this->scale = 0.5f; this->unkFloat = 0.5f; this->actor.velocity.y = 10.0f; - if (!gSaveContext.n64ddFlag || !GetRandoSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) { + if (!gSaveContext.n64ddFlag || !Randomizer_GetSettingValue(RSK_SHUFFLE_CHEST_MINIGAME)) { switch (this->type) { case EXITEM_GREEN_RUPEE_CHEST: this->giDrawId = GID_RUPEE_GREEN; @@ -404,7 +404,7 @@ void EnExItem_TargetPrizeApproach(EnExItem* this, GlobalContext* globalCtx) { this->actor.parent = NULL; if (gSaveContext.n64ddFlag) { GET_PLAYER(globalCtx)->stateFlags1 &= ~(PLAYER_STATE1_10 | PLAYER_STATE1_11); - getItemId = GetRandomizedItemIdFromKnownCheck(RC_LW_TARGET_IN_WOODS, GI_BULLET_BAG_50); + getItemId = Randomizer_GetItemIdFromKnownCheck(RC_LW_TARGET_IN_WOODS, GI_BULLET_BAG_50); } else { if (CUR_UPG_VALUE(UPG_BULLET_BAG) == 1) { getItemId = GI_BULLET_BAG_40; @@ -424,7 +424,7 @@ void EnExItem_TargetPrizeGive(EnExItem* this, GlobalContext* globalCtx) { this->actionFunc = EnExItem_TargetPrizeFinish; } else { if (gSaveContext.n64ddFlag) { - getItemId = GetRandomizedItemIdFromKnownCheck(RC_LW_TARGET_IN_WOODS, GI_BULLET_BAG_50); + getItemId = Randomizer_GetItemIdFromKnownCheck(RC_LW_TARGET_IN_WOODS, GI_BULLET_BAG_50); } else { getItemId = (CUR_UPG_VALUE(UPG_BULLET_BAG) == 2) ? GI_BULLET_BAG_50 : GI_BULLET_BAG_40; } @@ -510,12 +510,12 @@ void EnExItem_DrawItems(EnExItem* this, GlobalContext* globalCtx) { switch (this->type) { case EXITEM_BOMB_BAG_BOWLING: case EXITEM_BOMB_BAG_COUNTER: - randoGetItemId = GetRandomizedItemIdFromKnownCheck( + randoGetItemId = Randomizer_GetItemIdFromKnownCheck( RC_MARKET_BOMBCHU_BOWLING_FIRST_PRIZE, GI_BOMB_BAG_20); break; case EXITEM_BOMBCHUS_BOWLING: case EXITEM_BOMBCHUS_COUNTER: - randoGetItemId = GetRandomizedItemIdFromKnownCheck( + randoGetItemId = Randomizer_GetItemIdFromKnownCheck( RC_MARKET_BOMBCHU_BOWLING_BOMBCHUS, GI_BOMBCHUS_10); break; } @@ -532,12 +532,12 @@ void EnExItem_DrawHeartPiece(EnExItem* this, GlobalContext* globalCtx) { func_8002ED80(&this->actor, globalCtx, 0); if (gSaveContext.n64ddFlag) { - s32 randoGetItemId = GetRandomizedItemIdFromKnownCheck( + s32 randoGetItemId = Randomizer_GetItemIdFromKnownCheck( RC_MARKET_BOMBCHU_BOWLING_SECOND_PRIZE, GI_HEART_PIECE); if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } - GetItem_Draw(globalCtx, GetItemModelFromId(randoGetItemId)); + GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId)); } else { GetItem_Draw(globalCtx, GID_HEART_PIECE); } 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 e31f316a605..e6a85b33189 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 @@ -940,7 +940,7 @@ void EnFr_SetReward(EnFr* this, GlobalContext* globalCtx) { if (!gSaveContext.n64ddFlag) { this->reward = GI_HEART_PIECE; } else { - this->reward = GetRandomizedItemIdFromKnownCheck(RC_ZR_FROGS_IN_THE_RAIN, GI_HEART_PIECE); + this->reward = Randomizer_GetItemIdFromKnownCheck(RC_ZR_FROGS_IN_THE_RAIN, GI_HEART_PIECE); } } else { this->reward = GI_RUPEE_BLUE; @@ -951,7 +951,7 @@ void EnFr_SetReward(EnFr* this, GlobalContext* globalCtx) { if (!gSaveContext.n64ddFlag) { this->reward = GI_HEART_PIECE; } else { - this->reward = GetRandomizedItemIdFromKnownCheck(RC_ZR_FROGS_OCARINA_GAME, GI_HEART_PIECE); + this->reward = Randomizer_GetItemIdFromKnownCheck(RC_ZR_FROGS_OCARINA_GAME, GI_HEART_PIECE); } } else { this->reward = GI_RUPEE_PURPLE; 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 e08424d38a9..24676a5776f 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 @@ -154,7 +154,7 @@ void GivePlayerRandoRewardSongOfStorms(EnFu* windmillGuy, GlobalContext* globalC Flags_SetTreasure(globalCtx, 0x1F); windmillGuy->actionFunc = func_80A1DBD4; } else if (!Flags_GetTreasure(globalCtx, 0x1F)) { - GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_SONG_OF_STORMS); + GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_SONG_OF_STORMS); func_8002F434(&windmillGuy->actor, globalCtx, getItemId, 10000.0f, 100.0f); } } 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 c41c067c22b..a92ef3d6d35 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 @@ -351,7 +351,7 @@ void func_80A2FA50(EnGb* this, GlobalContext* globalCtx) { void func_80A2FB40(EnGb* this, GlobalContext* globalCtx) { if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE && Message_ShouldAdvance(globalCtx)) { - func_8002F434(&this->dyna.actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_MARKET_10_BIG_POES, GI_BOTTLE) : GI_BOTTLE, 100.0f, 10.0f); + func_8002F434(&this->dyna.actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_MARKET_10_BIG_POES, GI_BOTTLE) : GI_BOTTLE, 100.0f, 10.0f); this->actionFunc = func_80A2FBB0; } } @@ -361,7 +361,7 @@ void func_80A2FBB0(EnGb* this, GlobalContext* globalCtx) { this->dyna.actor.parent = NULL; this->actionFunc = func_80A2FC0C; } else { - func_8002F434(&this->dyna.actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_MARKET_10_BIG_POES, GI_BOTTLE) : GI_BOTTLE, 100.0f, 10.0f); + func_8002F434(&this->dyna.actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_MARKET_10_BIG_POES, GI_BOTTLE) : GI_BOTTLE, 100.0f, 10.0f); } } 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 e9cae8032cc..d34fb977beb 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 @@ -533,14 +533,14 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, GlobalContext* globalCtx) { break; } } else { - getItemId = GetRandomizedItemIdFromKnownCheck( + getItemId = Randomizer_GetItemIdFromKnownCheck( RC_GF_HBA_1500_POINTS, CUR_UPG_VALUE(UPG_QUIVER) == 1 ? GI_QUIVER_40 : GI_QUIVER_50); } } else { if (!gSaveContext.n64ddFlag) { getItemId = GI_HEART_PIECE; } else { - getItemId = GetRandomizedItemIdFromKnownCheck(RC_GF_HBA_1000_POINTS, GI_HEART_PIECE); + getItemId = Randomizer_GetItemIdFromKnownCheck(RC_GF_HBA_1000_POINTS, GI_HEART_PIECE); } } func_8002F434(&this->actor, globalCtx, getItemId, 10000.0f, 50.0f); @@ -567,14 +567,14 @@ void EnGe1_BeginGiveItem_Archery(EnGe1* this, GlobalContext* globalCtx) { break; } } else { - getItemId = GetRandomizedItemIdFromKnownCheck(RC_GF_HBA_1500_POINTS, + getItemId = Randomizer_GetItemIdFromKnownCheck(RC_GF_HBA_1500_POINTS, CUR_UPG_VALUE(UPG_QUIVER) == 1 ? GI_QUIVER_40 : GI_QUIVER_50); } } else { if (!gSaveContext.n64ddFlag) { getItemId = GI_HEART_PIECE; } else { - getItemId = GetRandomizedItemIdFromKnownCheck(RC_GF_HBA_1000_POINTS, GI_HEART_PIECE); + getItemId = Randomizer_GetItemIdFromKnownCheck(RC_GF_HBA_1000_POINTS, GI_HEART_PIECE); } } 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 2fc6ef1dff7..5310fc65e94 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 @@ -457,7 +457,7 @@ void EnGe2_WaitTillCardGiven(EnGe2* this, GlobalContext* globalCtx) { this->actor.parent = NULL; this->actionFunc = EnGe2_SetActionAfterTalk; } else { - func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD) : GI_GERUDO_CARD, 10000.0f, 50.0f); + func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD) : GI_GERUDO_CARD, 10000.0f, 50.0f); } } @@ -466,7 +466,7 @@ void EnGe2_GiveCard(EnGe2* this, GlobalContext* globalCtx) { Message_CloseTextbox(globalCtx); this->actor.flags &= ~ACTOR_FLAG_16; this->actionFunc = EnGe2_WaitTillCardGiven; - func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD) : GI_GERUDO_CARD, 10000.0f, 50.0f); + func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD) : GI_GERUDO_CARD, 10000.0f, 50.0f); } } 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 3a2c50fab29..556e7c203a5 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 @@ -142,7 +142,7 @@ void EnGe3_WaitTillCardGiven(EnGe3* this, GlobalContext* globalCtx) { this->actor.parent = NULL; this->actionFunc = EnGe3_Wait; } else { - func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD) : GI_GERUDO_CARD, 10000.0f, 50.0f); + func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD) : GI_GERUDO_CARD, 10000.0f, 50.0f); } } @@ -151,7 +151,7 @@ void EnGe3_GiveCard(EnGe3* this, GlobalContext* globalCtx) { Message_CloseTextbox(globalCtx); this->actor.flags &= ~ACTOR_FLAG_16; this->actionFunc = EnGe3_WaitTillCardGiven; - func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD) : GI_GERUDO_CARD, 10000.0f, 50.0f); + func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_GF_GERUDO_MEMBERSHIP_CARD, GI_GERUDO_CARD) : GI_GERUDO_CARD, 10000.0f, 50.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 c1e6bd290f1..050bfc4d10e 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 @@ -955,7 +955,7 @@ void EnGo_GetItem(EnGo* this, GlobalContext* globalCtx) { this->unk_20C = 0; if ((this->actor.params & 0xF0) == 0x90) { if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_CLAIM_CHECK) { - getItemId = gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_DMT_TRADE_CLAIM_CHECK, GI_SWORD_BGS) : GI_SWORD_BGS; + getItemId = gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_DMT_TRADE_CLAIM_CHECK, GI_SWORD_BGS) : GI_SWORD_BGS; this->unk_20C = 1; } if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_EYEDROPS) { 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 21d375d3874..97f8fb5e043 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 @@ -342,7 +342,7 @@ s16 EnGo2_GetStateGoronCityRollingBig(GlobalContext* globalCtx, EnGo2* this) { if(!gSaveContext.n64ddFlag) { bombBagUpgrade = CUR_CAPACITY(UPG_BOMB_BAG) == 30 ? GI_BOMB_BAG_40 : GI_BOMB_BAG_30; } else { - bombBagUpgrade = GetRandomizedItemIdFromKnownCheck(RC_GC_ROLLING_GORON_AS_CHILD, GI_BOMB_BAG_40); + bombBagUpgrade = Randomizer_GetItemIdFromKnownCheck(RC_GC_ROLLING_GORON_AS_CHILD, GI_BOMB_BAG_40); } EnGo2_GetItem(this, globalCtx, bombBagUpgrade); Message_CloseTextbox(globalCtx); @@ -538,7 +538,7 @@ s16 EnGo2_GetStateGoronCityLink(GlobalContext* globalCtx, EnGo2* this) { } gSaveContext.infTable[16] |= 0x200; - EnGo2_GetItem(this, globalCtx, GetRandomizedItemIdFromKnownCheck(RC_GC_ROLLING_GORON_AS_ADULT, GI_TUNIC_GORON)); + EnGo2_GetItem(this, globalCtx, Randomizer_GetItemIdFromKnownCheck(RC_GC_ROLLING_GORON_AS_ADULT, GI_TUNIC_GORON)); this->actionFunc = EnGo2_SetupGetItem; Flags_SetTreasure(globalCtx, 0x1F); return 2; @@ -617,7 +617,7 @@ s16 EnGo2_GetStateGoronDmtBiggoron(GlobalContext* globalCtx, EnGo2* this) { return 0; } - EnGo2_GetItem(this, globalCtx, GetRandomizedItemIdFromKnownCheck(RC_DMT_TRADE_CLAIM_CHECK, GI_SWORD_BGS)); + EnGo2_GetItem(this, globalCtx, Randomizer_GetItemIdFromKnownCheck(RC_DMT_TRADE_CLAIM_CHECK, GI_SWORD_BGS)); Flags_SetTreasure(globalCtx, 0x1F); } else { EnGo2_GetItem(this, globalCtx, GI_SWORD_BGS); 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 92fc1f022b5..af4eb8ef4f6 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 @@ -659,7 +659,7 @@ s16 func_80A70058(GlobalContext* globalCtx, Actor* thisx) { gSaveContext.dogParams = 0; break; case 0x709F: - func_80A6F7CC(this, globalCtx, (gSaveContext.infTable[25] & 2) ? GI_RUPEE_BLUE : gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_MARKET_LOST_DOG, GI_HEART_PIECE) : GI_HEART_PIECE); + func_80A6F7CC(this, globalCtx, (gSaveContext.infTable[25] & 2) ? GI_RUPEE_BLUE : gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_MARKET_LOST_DOG, GI_HEART_PIECE) : GI_HEART_PIECE); this->actionFunc = func_80A714C4; break; } 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 97544bce67b..cda6e476df6 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 @@ -344,7 +344,7 @@ void EnKz_Init(Actor* thisx, GlobalContext* globalCtx) { EnKz_SetMovedPos(this, globalCtx); } } else { - int zorasFountain = GetRandoSettingValue(RSK_ZORAS_FOUNTAIN); + int zorasFountain = Randomizer_GetSettingValue(RSK_ZORAS_FOUNTAIN); switch (zorasFountain) { case 0: if (gSaveContext.eventChkInf[3] & 8) { @@ -464,10 +464,10 @@ void EnKz_SetupGetItem(EnKz* this, GlobalContext* globalCtx) { } else { if (gSaveContext.n64ddFlag) { if (this->isTrading) { - getItemId = GetRandomizedItemIdFromKnownCheck(RC_ZD_TRADE_PRESCRIPTION, GI_FROG); + getItemId = Randomizer_GetItemIdFromKnownCheck(RC_ZD_TRADE_PRESCRIPTION, GI_FROG); Flags_SetTreasure(globalCtx, 0x1F); } else { - getItemId = GetRandomizedItemIdFromKnownCheck(RC_ZD_KING_ZORA_THAWED, GI_TUNIC_ZORA); + getItemId = Randomizer_GetItemIdFromKnownCheck(RC_ZD_KING_ZORA_THAWED, GI_TUNIC_ZORA); } } else { getItemId = this->isTrading ? GI_FROG : GI_TUNIC_ZORA; 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 33e2bad2138..15b0b845524 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 @@ -338,7 +338,7 @@ void func_80AA0EA0(EnMa1* this, GlobalContext* globalCtx) { this->actionFunc = func_80AA0EFC; } else { if (gSaveContext.n64ddFlag) { - GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(RC_HC_MALON_EGG, GI_WEIRD_EGG); + GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(RC_HC_MALON_EGG, GI_WEIRD_EGG); func_8002F434(&this->actor, globalCtx, getItemId, 120.0f, 10.0f); } else { func_8002F434(&this->actor, globalCtx, GI_WEIRD_EGG, 120.0f, 10.0f); @@ -356,7 +356,7 @@ void func_80AA0EFC(EnMa1* this, GlobalContext* globalCtx) { } void GivePlayerRandoRewardMalon(EnMa1* malon, GlobalContext* globalCtx, RandomizerCheck check) { - GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_EPONAS_SONG); + GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_EPONAS_SONG); // Prevents flag from getting set if we weren't able to get the item (i.e. Player is holding shield // when closing the textbox). if (malon->actor.parent != NULL && malon->actor.parent->id == GET_PLAYER(globalCtx)->actor.id && 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 3bf4fcbb080..ffb02e8d23a 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 @@ -487,7 +487,7 @@ u8 EnMd_ShouldSpawn(EnMd* this, GlobalContext* globalCtx) { // if we have beaten deku tree or have open forest turned on // or have already shown mido we have an equipped sword/shield if (gSaveContext.dungeonsDone[1] || - GetRandoSettingValue(RSK_FOREST) == 1 || + Randomizer_GetSettingValue(RSK_FOREST) == 1 || gSaveContext.eventChkInf[0] & 0x10) { return 0; } 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 8f4c512e3c5..f42e0952232 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 @@ -198,14 +198,14 @@ void func_80AACFA0(EnMk* this, GlobalContext* globalCtx) { gSaveContext.itemGetInf[1] |= 1; } else { // not sure when/how/if this is getting called - func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_LH_LAB_DIVE, GI_HEART_PIECE) : GI_HEART_PIECE, 10000.0f, 50.0f); + func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_LH_LAB_DIVE, GI_HEART_PIECE) : GI_HEART_PIECE, 10000.0f, 50.0f); } } void func_80AAD014(EnMk* this, GlobalContext* globalCtx) { if (Actor_TextboxIsClosing(&this->actor, globalCtx)) { this->actionFunc = func_80AACFA0; - func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_LH_LAB_DIVE, GI_HEART_PIECE) : GI_HEART_PIECE, 10000.0f, 50.0f); + func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_LH_LAB_DIVE, GI_HEART_PIECE) : GI_HEART_PIECE, 10000.0f, 50.0f); } this->flags |= 1; 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 47a1e5e0d27..c31f2b923f4 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 @@ -200,7 +200,7 @@ void func_80ABA244(EnNiwLady* this, GlobalContext* globalCtx) { EnNiw* currentCucco; s32 phi_s1; - this->cuccosInPen = gSaveContext.n64ddFlag ? (7 - GetRandoSettingValue(RSK_CUCCO_COUNT)) : 0; + this->cuccosInPen = gSaveContext.n64ddFlag ? (7 - Randomizer_GetSettingValue(RSK_CUCCO_COUNT)) : 0; currentCucco = (EnNiw*)globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head; while (currentCucco != NULL) { if (currentCucco->actor.id == ACTOR_EN_NIW) { @@ -305,7 +305,7 @@ void func_80ABA654(EnNiwLady* this, GlobalContext* globalCtx) { this->actor.parent = NULL; if (gSaveContext.n64ddFlag) { - s32 itemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_ANJU_AS_CHILD, GI_BOTTLE); + s32 itemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_ANJU_AS_CHILD, GI_BOTTLE); func_8002F434(&this->actor, globalCtx, itemId, 100.0f, 50.0f); } else { this->getItemId = GI_BOTTLE; @@ -395,7 +395,7 @@ void func_80ABA9B8(EnNiwLady* this, GlobalContext* globalCtx) { this->actor.parent = NULL; if (gSaveContext.n64ddFlag) { - s32 itemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG); + s32 itemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG); func_8002F434(&this->actor, globalCtx, itemId, 200.0f, 100.0f); } else { func_8002F434(&this->actor, globalCtx, GI_POCKET_EGG, 200.0f, 100.0f); @@ -455,7 +455,7 @@ void func_80ABAC00(EnNiwLady* this, GlobalContext* globalCtx) { getItemId = !(gSaveContext.itemGetInf[2] & 0x1000) ? GI_POCKET_EGG : GI_COJIRO; if (gSaveContext.n64ddFlag && getItemId == GI_POCKET_EGG) { - getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG); + getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_ANJU_AS_ADULT, GI_POCKET_EGG); } } func_8002F434(&this->actor, globalCtx, getItemId, 200.0f, 100.0f); 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 b36a07dd53c..cc7360c0a0d 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, GlobalContext* globalCtx) { if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_04) { this->actionFunc = func_80ABF28C; } else if (globalCtx->msgCtx.ocarinaMode == OCARINA_MODE_03) { - if (!gSaveContext.n64ddFlag || (gSaveContext.n64ddFlag && GetRandoSettingValue(RSK_DOOR_OF_TIME) != 2)) { + if (!gSaveContext.n64ddFlag || (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_DOOR_OF_TIME) != 2)) { func_80078884(NA_SE_SY_CORRECT_CHIME); } if (this->switchFlag >= 0) { @@ -257,7 +257,7 @@ void func_80ABF4C8(EnOkarinaTag* this, GlobalContext* globalCtx) { break; case 4: if (gSaveContext.n64ddFlag) { - int doorOfTime = GetRandoSettingValue(RSK_DOOR_OF_TIME); + int doorOfTime = Randomizer_GetSettingValue(RSK_DOOR_OF_TIME); if (doorOfTime == 2 && (INV_CONTENT(ITEM_OCARINA_FAIRY) != ITEM_OCARINA_TIME || !CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) || !CHECK_QUEST_ITEM(QUEST_GORON_RUBY) || @@ -327,7 +327,7 @@ void GivePlayerRandoRewardSunSong(EnOkarinaTag* song, GlobalContext* globalCtx, !Flags_GetTreasure(globalCtx, 0x1F)) { Flags_SetTreasure(globalCtx, 0x1F); } else if (!Flags_GetTreasure(globalCtx, 0x1F)) { - GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_LETTER_ZELDA); + GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_LETTER_ZELDA); func_8002F434(&song->actor, globalCtx, getItemId, 10000.0f, 100.0f); } } 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 15cae19d054..c6dd38accf0 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 @@ -619,7 +619,7 @@ void func_80AF67D0(EnSa* this, GlobalContext* globalCtx) { void GivePlayerRandoRewardSaria(EnSa* saria, GlobalContext* globalCtx, RandomizerCheck check) { GetItemID getItemId = - GetRandomizedItemIdFromKnownCheck(check, GI_SARIAS_SONG); + Randomizer_GetItemIdFromKnownCheck(check, GI_SARIAS_SONG); if (saria->actor.parent != NULL && saria->actor.parent->id == GET_PLAYER(globalCtx)->actor.id && !Flags_GetTreasure(globalCtx, 0x1F)) { 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 332aefc0ba8..859afb4063c 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 @@ -1035,7 +1035,7 @@ void EnSkj_SariaSongTalk(EnSkj* this, GlobalContext* globalCtx) { EnSkj_SetupWaitInRange(this); } else { func_80AFFE24(this); - func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_LW_SKULL_KID, GI_HEART_PIECE) : GI_HEART_PIECE, EnSkj_GetItemXzRange(this), + func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_LW_SKULL_KID, GI_HEART_PIECE) : GI_HEART_PIECE, EnSkj_GetItemXzRange(this), EnSkj_GetItemYRange(this)); } } @@ -1050,7 +1050,7 @@ void func_80AFFE44(EnSkj* this, GlobalContext* globalCtx) { this->actor.parent = NULL; EnSkj_SetupPostSariasSong(this); } else { - func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_LW_SKULL_KID, GI_HEART_PIECE) : GI_HEART_PIECE, EnSkj_GetItemXzRange(this), EnSkj_GetItemYRange(this)); + func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_LW_SKULL_KID, GI_HEART_PIECE) : GI_HEART_PIECE, EnSkj_GetItemXzRange(this), EnSkj_GetItemYRange(this)); } } @@ -1529,7 +1529,7 @@ void EnSkj_WaitToGiveReward(EnSkj* this, GlobalContext* globalCtx) { if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(globalCtx)) { func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag && gSaveContext.ocarinaGameRoundNum != 3 - ? GetRandomizedItemIdFromKnownCheck(RC_LW_OCARINA_MEMORY_GAME, GI_HEART_PIECE) + ? Randomizer_GetItemIdFromKnownCheck(RC_LW_OCARINA_MEMORY_GAME, GI_HEART_PIECE) : sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum], 26.0f, 26.0f); @@ -1544,7 +1544,7 @@ void EnSkj_GiveOcarinaGameReward(EnSkj* this, GlobalContext* globalCtx) { } else { func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag && gSaveContext.ocarinaGameRoundNum != 3 - ? GetRandomizedItemIdFromKnownCheck(RC_LW_OCARINA_MEMORY_GAME, GI_HEART_PIECE) + ? Randomizer_GetItemIdFromKnownCheck(RC_LW_OCARINA_MEMORY_GAME, GI_HEART_PIECE) : sOcarinaGameRewards[gSaveContext.ocarinaGameRoundNum], 26.0f, 26.0f); } 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 d48aedc77b6..b01c6b8c427 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 @@ -245,19 +245,19 @@ void EnSth_GivePlayerItem(EnSth* this, GlobalContext* globalCtx) { case GI_RUPEE_GOLD: break; case GI_WALLET_ADULT: - getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_10_GOLD_SKULLTULA_REWARD, GI_WALLET_ADULT); + getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_10_GOLD_SKULLTULA_REWARD, GI_WALLET_ADULT); break; case GI_STONE_OF_AGONY: - getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_20_GOLD_SKULLTULA_REWARD, GI_STONE_OF_AGONY); + getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_20_GOLD_SKULLTULA_REWARD, GI_STONE_OF_AGONY); break; case GI_WALLET_GIANT: - getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_30_GOLD_SKULLTULA_REWARD, GI_WALLET_GIANT); + getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_30_GOLD_SKULLTULA_REWARD, GI_WALLET_GIANT); break; case GI_BOMBCHUS_10: - getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_40_GOLD_SKULLTULA_REWARD, GI_BOMBCHUS_10); + getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_40_GOLD_SKULLTULA_REWARD, GI_BOMBCHUS_10); break; case GI_HEART_PIECE: - getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_50_GOLD_SKULLTULA_REWARD, GI_HEART_PIECE); + getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_50_GOLD_SKULLTULA_REWARD, GI_HEART_PIECE); break; } } else { 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 4f779cd0a15..7b57bea89a8 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 @@ -336,7 +336,7 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, GlobalContext* globalCtx) { this->actor.parent = NULL; if (!LINK_IS_ADULT) { if(gSaveContext.n64ddFlag && !Flags_GetTreasure(globalCtx, 0x1E)) { - this->getItemId = GetRandomizedItemIdFromKnownCheck(RC_MARKET_SHOOTING_GALLERY_REWARD, GI_BULLET_BAG_50); + this->getItemId = Randomizer_GetItemIdFromKnownCheck(RC_MARKET_SHOOTING_GALLERY_REWARD, GI_BULLET_BAG_50); Flags_SetTreasure(globalCtx, 0x1E); } else if (!gSaveContext.n64ddFlag && !(gSaveContext.itemGetInf[0] & 0x2000)) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ Equip_Pachinko ☆☆☆☆☆ %d\n" VT_RST, @@ -351,7 +351,7 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, GlobalContext* globalCtx) { } } else { if(gSaveContext.n64ddFlag && !Flags_GetTreasure(globalCtx, 0x1F)) { - this->getItemId = GetRandomizedItemIdFromKnownCheck(RC_KAK_SHOOTING_GALLERY_REWARD, GI_QUIVER_50); + this->getItemId = Randomizer_GetItemIdFromKnownCheck(RC_KAK_SHOOTING_GALLERY_REWARD, GI_QUIVER_50); Flags_SetTreasure(globalCtx, 0x1F); } else if (!gSaveContext.n64ddFlag && !(gSaveContext.itemGetInf[0] & 0x4000)) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ Equip_Bow ☆☆☆☆☆ %d\n" VT_RST, 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 e9f23176c03..dad7d25e5fe 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 @@ -883,7 +883,7 @@ void func_80B15F54(EnTa* this, GlobalContext* globalCtx) { Message_CloseTextbox(globalCtx); this->unk_2E0 &= ~0x2; func_80B13AA0(this, func_80B15E80, func_80B16938); - func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? GetRandomizedItemIdFromKnownCheck(RC_LLR_TALONS_CHICKENS, GI_MILK_BOTTLE) : GI_MILK_BOTTLE, 10000.0f, 50.0f); + func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag ? Randomizer_GetItemIdFromKnownCheck(RC_LLR_TALONS_CHICKENS, GI_MILK_BOTTLE) : GI_MILK_BOTTLE, 10000.0f, 50.0f); } } 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 e4ccbf4a356..88ce05819f2 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 @@ -292,7 +292,7 @@ void GivePlayerRandoRewardSheikSong(EnXc* sheik, GlobalContext* globalCtx, Rando !(gSaveContext.eventChkInf[5] & sheikType)) { gSaveContext.eventChkInf[5] |= sheikType; } else if (!(gSaveContext.eventChkInf[5] & sheikType)) { - GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, ogSongId); + GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, ogSongId); if (check == RC_SHEIK_AT_TEMPLE && !Flags_GetTreasure(globalCtx, 0x1F)) { if (func_8002F434(&sheik->actor, globalCtx, getItemId, 10000.0f, 100.0f)) { Flags_SetTreasure(globalCtx, 0x1F); 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 87574aa56d3..d4250fca218 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 @@ -231,9 +231,9 @@ void GivePlayerRandoRewardZeldaChild(EnZl4* zelda, GlobalContext* globalCtx, Ran if (zelda->actor.parent != NULL && zelda->actor.parent->id == GET_PLAYER(globalCtx)->actor.id && !Flags_GetTreasure(globalCtx, 0x1E)) { Flags_SetTreasure(globalCtx, 0x1E); - } else if (!Flags_GetTreasure(globalCtx, 0x1E) && !GetRandoSettingValue(RSK_SKIP_CHILD_ZELDA) && Actor_TextboxIsClosing(&zelda->actor, globalCtx) && + } else if (!Flags_GetTreasure(globalCtx, 0x1E) && !Randomizer_GetSettingValue(RSK_SKIP_CHILD_ZELDA) && Actor_TextboxIsClosing(&zelda->actor, globalCtx) && (globalCtx->msgCtx.textId == 0x703C || globalCtx->msgCtx.textId == 0x703D)) { - GetItemID getItemId = GetRandomizedItemIdFromKnownCheck(check, GI_LETTER_ZELDA); + GetItemID getItemId = Randomizer_GetItemIdFromKnownCheck(check, GI_LETTER_ZELDA); func_8002F434(&zelda->actor, globalCtx, getItemId, 10000.0f, 100.0f); } else if (Flags_GetTreasure(globalCtx, 0x1E) && !Player_InBlockingCsMode(globalCtx, GET_PLAYER(globalCtx))) { gSaveContext.unk_13EE = 0x32; diff --git a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c index 8666ca30287..eb7c0a20a55 100644 --- a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -5044,7 +5044,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, GlobalContext* globalCtx) { HIGH_SCORE(HS_FISHING) |= 0x400; sSinkingLureLocation = (u8)Rand_ZeroFloat(3.999f) + 1; getItemId = gSaveContext.n64ddFlag ? - GetRandomizedItemIdFromKnownCheck(RC_LH_CHILD_FISHING, GI_HEART_PIECE) : + Randomizer_GetItemIdFromKnownCheck(RC_LH_CHILD_FISHING, GI_HEART_PIECE) : GI_HEART_PIECE; } } @@ -5054,7 +5054,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, GlobalContext* globalCtx) { HIGH_SCORE(HS_FISHING) |= 0x800; sSinkingLureLocation = (u8)Rand_ZeroFloat(3.999f) + 1; getItemId = gSaveContext.n64ddFlag ? - GetRandomizedItemIdFromKnownCheck(RC_LH_ADULT_FISHING, GI_SCALE_GOLD) : + Randomizer_GetItemIdFromKnownCheck(RC_LH_ADULT_FISHING, GI_SCALE_GOLD) : GI_SCALE_GOLD; } } @@ -5130,7 +5130,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, GlobalContext* globalCtx) { func_8002F434(&this->actor, globalCtx, GI_SCALE_GOLD, 2000.0f, 1000.0f); } else { func_8002F434(&this->actor, globalCtx, - GetRandomizedItemIdFromKnownCheck(RC_LH_ADULT_FISHING, GI_SCALE_GOLD), 2000.0f, + Randomizer_GetItemIdFromKnownCheck(RC_LH_ADULT_FISHING, GI_SCALE_GOLD), 2000.0f, 1000.0f); } } 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 17404ab77fb..e32ab216f39 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 @@ -60,7 +60,7 @@ void ItemBHeart_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->actor); } else { if (gSaveContext.n64ddFlag) { - s32 getItemId = GetRandomizedItemId(GI_HEART_CONTAINER_2, this->actor.id, this->actor.params, globalCtx->sceneNum); + s32 getItemId = Randomizer_GetRandomizedItemId(GI_HEART_CONTAINER_2, this->actor.id, this->actor.params, globalCtx->sceneNum); func_8002F434(&this->actor, globalCtx, getItemId, 30.0f, 40.0f); } else { func_8002F434(&this->actor, globalCtx, GI_HEART_CONTAINER_2, 30.0f, 40.0f); @@ -100,7 +100,7 @@ void ItemBHeart_Draw(Actor* thisx, GlobalContext* globalCtx) { if (gSaveContext.n64ddFlag) { GetItem_Draw(globalCtx, - GetItemModelFromId(GetRandomizedItemId(GI_HEART_CONTAINER_2, this->actor.id, this->actor.params, globalCtx->sceneNum))); + Randomizer_GetItemModelFromId(Randomizer_GetRandomizedItemId(GI_HEART_CONTAINER_2, this->actor.id, this->actor.params, globalCtx->sceneNum))); } else { if (flag) { func_80093D84(globalCtx->state.gfxCtx); 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 f1575306bf9..cfa115dafcc 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 @@ -133,7 +133,7 @@ void func_80B85824(ItemEtcetera* this, GlobalContext* globalCtx) { Actor_Kill(&this->actor); } else { if (gSaveContext.n64ddFlag) { - s32 getItemId = GetRandomizedItemIdFromKnownCheck(RC_LH_SUN, GI_ARROW_FIRE); + s32 getItemId = Randomizer_GetItemIdFromKnownCheck(RC_LH_SUN, GI_ARROW_FIRE); func_8002F434(&this->actor, globalCtx, getItemId, 30.0f, 50.0f); } else { func_8002F434(&this->actor, globalCtx, this->getItemId, 30.0f, 50.0f); @@ -156,7 +156,7 @@ void func_80B858B4(ItemEtcetera* this, GlobalContext* globalCtx) { if (0) {} // Necessary to match if (gSaveContext.n64ddFlag) { - s32 getItemId = GetRandomizedItemIdFromKnownCheck(RC_LH_UNDERWATER_ITEM, GI_LETTER_RUTO); + s32 getItemId = Randomizer_GetItemIdFromKnownCheck(RC_LH_UNDERWATER_ITEM, GI_LETTER_RUTO); func_8002F434(&this->actor, globalCtx, getItemId, 30.0f, 50.0f); } else { func_8002F434(&this->actor, globalCtx, this->getItemId, 30.0f, 50.0f); @@ -234,7 +234,7 @@ void ItemEtcetera_DrawThroughLens(Actor* thisx, GlobalContext* globalCtx) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } if (randoGetItemId != GI_NONE) { - GetItem_Draw(globalCtx, GetItemModelFromId(randoGetItemId)); + GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId)); return; } } @@ -250,9 +250,9 @@ void ItemEtcetera_Draw(Actor* thisx, GlobalContext* globalCtx) { if (gSaveContext.n64ddFlag) { s32 randoGetItemId = GI_NONE; if (type == ITEM_ETC_ARROW_FIRE) { - randoGetItemId = GetRandomizedItemIdFromKnownCheck(RC_LH_SUN, GI_ARROW_FIRE); + randoGetItemId = Randomizer_GetItemIdFromKnownCheck(RC_LH_SUN, GI_ARROW_FIRE); } else if (type == ITEM_ETC_LETTER) { - randoGetItemId = GetRandomizedItemIdFromKnownCheck(RC_LH_UNDERWATER_ITEM, GI_LETTER_RUTO); + randoGetItemId = Randomizer_GetItemIdFromKnownCheck(RC_LH_UNDERWATER_ITEM, GI_LETTER_RUTO); } if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { @@ -260,7 +260,7 @@ void ItemEtcetera_Draw(Actor* thisx, GlobalContext* globalCtx) { } if (randoGetItemId != GI_NONE) { - this->giDrawId = GetItemModelFromId(randoGetItemId); + this->giDrawId = Randomizer_GetItemModelFromId(randoGetItemId); } } 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 0b3d9382c26..9992d08b3ea 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 @@ -191,7 +191,7 @@ void ItemOcarina_WaitInWater(ItemOcarina* this, GlobalContext* globalCtx) { } else { func_8002F434(&this->actor, globalCtx, gSaveContext.n64ddFlag - ? GetRandomizedItemIdFromKnownCheck(RC_HF_OCARINA_OF_TIME_ITEM, GI_OCARINA_OOT) + ? Randomizer_GetItemIdFromKnownCheck(RC_HF_OCARINA_OF_TIME_ITEM, GI_OCARINA_OOT) : GI_OCARINA_OOT, 30.0f, 50.0f); @@ -214,11 +214,11 @@ void ItemOcarina_Draw(Actor* thisx, GlobalContext* globalCtx) { func_8002ED80(thisx, globalCtx, 0); if (gSaveContext.n64ddFlag) { - s32 randoGetItemId = GetRandomizedItemIdFromKnownCheck(RC_HF_OCARINA_OF_TIME_ITEM, GI_OCARINA_OOT); + s32 randoGetItemId = Randomizer_GetItemIdFromKnownCheck(RC_HF_OCARINA_OF_TIME_ITEM, GI_OCARINA_OOT); if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } - GetItem_Draw(globalCtx, GetItemModelFromId(randoGetItemId)); + GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId)); return; } 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 4d2c6e23b15..51587c9a7e9 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -620,7 +620,7 @@ static GetItemEntry sGetItemTable[] = { GET_ITEM(ITEM_NUT_UPGRADE_30, OBJECT_GI_NUTS, GID_NUTS, 0xA7, 0x80, CHEST_ANIM_SHORT), GET_ITEM(ITEM_NUT_UPGRADE_40, OBJECT_GI_NUTS, GID_NUTS, 0xA8, 0x80, CHEST_ANIM_SHORT), GET_ITEM(ITEM_BULLET_BAG_50, OBJECT_GI_DEKUPOUCH, GID_BULLET_BAG_50, 0x6C, 0x80, CHEST_ANIM_LONG), - GET_ITEM(ITEM_ARROW_ICE, OBJECT_GI_M_ARROW, GID_ARROW_ICE, 0x3C, 0x80, CHEST_ANIM_LONG), // Ice Traps + GET_ITEM(ITEM_ARROW_ICE, OBJECT_GI_M_ARROW, GID_ARROW_ICE, 0x3C, 0x80, CHEST_ANIM_SHORT), // Ice Traps GET_ITEM_NONE, GET_ITEM(ITEM_MEDALLION_LIGHT, OBJECT_GI_MEDAL, GID_MEDALLION_LIGHT, 0x40, 0x80, CHEST_ANIM_LONG), 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 576f550c755..2aef4bc64f4 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 @@ -431,9 +431,9 @@ void FileChoose_UpdateMainMenu(GameState* thisx) { CVar_SetString("gDroppedFile", ""); fileSelectSpoilerFileLoaded = false; const char* fileLoc = CVar_GetString("gSpoilerLog", ""); - LoadRandomizerSettings(fileLoc); - LoadHintLocations(fileLoc); - LoadItemLocations(fileLoc, silent); + Randomizer_LoadSettings(fileLoc); + Randomizer_LoadHintLocations(fileLoc); + Randomizer_LoadItemLocations(fileLoc, silent); fileSelectSpoilerFileLoaded = true; } @@ -1740,9 +1740,9 @@ void FileChoose_LoadGame(GameState* thisx) { this->state.running = false; } - LoadRandomizerSettings(""); - LoadHintLocations(""); - LoadItemLocations("", true); + Randomizer_LoadSettings(""); + Randomizer_LoadHintLocations(""); + Randomizer_LoadItemLocations("", true); gSaveContext.respawn[0].entranceIndex = -1; gSaveContext.respawnFlag = 0;