Merge branch 'rando-next' into tokensanity-bgs-fix
This commit is contained in:
commit
9fda6a0764
|
@ -2001,22 +2001,22 @@ namespace SohImGui {
|
|||
|
||||
if (ImGui::BeginMenu("Rando Enhancements"))
|
||||
{
|
||||
EnhancementCheckbox("Quest Item Fanfares", "gRandoQuestItemFanfares");
|
||||
EnhancementCheckbox("Rando-Relevant Navi Hints", "gRandoRelevantNavi");
|
||||
Tooltip(
|
||||
"Play unique fanfares when obtaining quest items "
|
||||
"(medallions/stones/songs). Note that these fanfares are longer than usual."
|
||||
"Replace Navi's overworld quest hints with rando-related gameplay hints."
|
||||
);
|
||||
PaddedEnhancementCheckbox("Random Rupee Names", "gRandomizeRupeeNames", true, false);
|
||||
Tooltip(
|
||||
"When obtaining rupees, randomize what the rupee is called in the textbox."
|
||||
);
|
||||
PaddedEnhancementCheckbox("Rando-Relevant Navi Hints", "gRandoRelevantNavi", true, false);
|
||||
Tooltip(
|
||||
"Replace Navi's overworld quest hints with rando-related gameplay hints."
|
||||
);
|
||||
PaddedEnhancementCheckbox("Key Colors Match Dungeon", "gRandoMatchKeyColors", true, false);
|
||||
Tooltip(
|
||||
"Matches the color of small keys and boss keys to the dungeon they belong to. This helps identify keys from afar and adds a little bit of flair.");
|
||||
PaddedEnhancementCheckbox("Quest Item Fanfares", "gRandoQuestItemFanfares", true, false);
|
||||
Tooltip(
|
||||
"Play unique fanfares when obtaining quest items "
|
||||
"(medallions/stones/songs). Note that these fanfares are longer than usual."
|
||||
);
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
|
|
|
@ -181,6 +181,7 @@ source_group("Header Files\\soh\\Enhancements\\debugger" FILES ${Header_Files__s
|
|||
|
||||
set(Header_Files__soh__Enhancements__randomizer
|
||||
"soh/Enhancements/randomizer/randomizer.h"
|
||||
"soh/Enhancements/randomizer/randomizer_inf.h"
|
||||
"soh/Enhancements/randomizer/randomizer_item_tracker.h"
|
||||
"soh/Enhancements/randomizer/adult_trade_shuffle.h"
|
||||
"soh/Enhancements/randomizer/randomizer_check_objects.h"
|
||||
|
|
|
@ -11,6 +11,7 @@ extern "C"
|
|||
|
||||
#include "../../libultraship/libultraship/luslog.h"
|
||||
#include <soh/Enhancements/item-tables/ItemTableTypes.h>
|
||||
#include <soh/Enhancements/randomizer/randomizer_inf.h>
|
||||
|
||||
#if defined(INCLUDE_GAME_PRINTF) && !defined(NDEBUG)
|
||||
#define osSyncPrintf(fmt, ...) lusprintf(__FILE__, __LINE__, 0, fmt, __VA_ARGS__)
|
||||
|
@ -558,6 +559,8 @@ s32 Flags_GetEventChkInf(s32 flag);
|
|||
void Flags_SetEventChkInf(s32 flag);
|
||||
s32 Flags_GetInfTable(s32 flag);
|
||||
void Flags_SetInfTable(s32 flag);
|
||||
s32 Flags_GetRandomizerInf(RandomizerInf flag);
|
||||
void Flags_SetRandomizerInf(RandomizerInf flag);
|
||||
u16 func_80037C30(GlobalContext* globalCtx, s16 arg1);
|
||||
s32 func_80037D98(GlobalContext* globalCtx, Actor* actor, s16 arg2, s32* arg3);
|
||||
s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* arg3, Vec3f arg4);
|
||||
|
|
|
@ -368,7 +368,7 @@ typedef enum {
|
|||
FLAG_SCENE_CLEAR,
|
||||
FLAG_SCENE_COLLECTIBLE,
|
||||
FLAG_EVENT_CHECK_INF,
|
||||
FLAG_COW_MILKED
|
||||
FLAG_RANDOMIZER_INF
|
||||
} FlagType;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include "z64math.h"
|
||||
#include "z64audio.h"
|
||||
#include "soh/Enhancements/randomizer/randomizerTypes.h"
|
||||
#include "soh/Enhancements/randomizer/randomizer_inf.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 buttonItems[8];
|
||||
|
@ -182,9 +183,7 @@ typedef struct {
|
|||
char ganonHintText[150];
|
||||
char ganonText[250];
|
||||
u8 seedIcons[5];
|
||||
u8 dungeonsDone[8];
|
||||
u8 trialsDone[6];
|
||||
u8 cowsMilked[10];
|
||||
u16 randomizerInf[2];
|
||||
u8 temporaryWeapon;
|
||||
u16 adultTradeItems;
|
||||
} SaveContext; // size = 0x1428
|
||||
|
|
|
@ -1144,7 +1144,7 @@ s16 Randomizer::GetItemFromGet(RandomizerGet randoGet, GetItemID ogItemId) {
|
|||
case RG_GIANTS_KNIFE:
|
||||
return GI_SWORD_KNIFE;
|
||||
case RG_BIGGORON_SWORD:
|
||||
return !CHECK_OWNED_EQUIP(EQUIP_SWORD, 2) ? GI_SWORD_BGS : GI_RUPEE_BLUE;
|
||||
return !gSaveContext.bgsFlag ? GI_SWORD_BGS : GI_RUPEE_BLUE;
|
||||
|
||||
case RG_DEKU_SHIELD:
|
||||
return GI_SHIELD_DEKU;
|
||||
|
@ -3327,8 +3327,8 @@ void DrawRandoEditor(bool& open) {
|
|||
ImGui::PushStyleVar(ImGuiStyleVar_CellPadding, cellPadding);
|
||||
if (ImGui::BeginTable("tableRandoOther", 3, ImGuiTableFlags_BordersH | ImGuiTableFlags_BordersV)) {
|
||||
ImGui::TableSetupColumn("Timesavers", ImGuiTableColumnFlags_WidthStretch, 200.0f);
|
||||
ImGui::TableSetupColumn("Hint Settings", ImGuiTableColumnFlags_WidthStretch, 200.0f);
|
||||
ImGui::TableSetupColumn("Item Pool Settings", ImGuiTableColumnFlags_WidthStretch, 200.0f);
|
||||
ImGui::TableSetupColumn("World Settings", ImGuiTableColumnFlags_WidthStretch, 200.0f);
|
||||
ImGui::TableSetupColumn("Item Pool & Hint Settings", ImGuiTableColumnFlags_WidthStretch, 200.0f);
|
||||
ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
|
||||
ImGui::TableHeadersRow();
|
||||
ImGui::PopItemFlag();
|
||||
|
@ -3400,10 +3400,49 @@ void DrawRandoEditor(bool& open) {
|
|||
"The cutscenes of the Poes in Forest Temple and Darunia in Fire Temple will not be skipped. "
|
||||
"These cutscenes are only useful for glitched gameplay and can be safely skipped otherwise.");
|
||||
|
||||
// COLUMN 2 - HINT SETTINGS
|
||||
// COLUMN 2 - WORLD SETTINGS
|
||||
ImGui::TableNextColumn();
|
||||
window->DC.CurrLineTextBaseOffset = 0.0f;
|
||||
ImGui::PushItemWidth(-FLT_MIN);
|
||||
ImGui::Text("Coming soon");
|
||||
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
// COLUMN 3 - ITEM POOL & HINT SETTINGS
|
||||
ImGui::TableNextColumn();
|
||||
window->DC.CurrLineTextBaseOffset = 0.0f;
|
||||
ImGui::PushItemWidth(-FLT_MIN);
|
||||
|
||||
ImGui::Text(Settings::ItemPoolValue.GetName().c_str());
|
||||
InsertHelpHoverText("Sets how many major items appear in the item pool.\n"
|
||||
"\n"
|
||||
"Plentiful - Extra major items are added to the pool.\n"
|
||||
"\n"
|
||||
"Balanced - Original item pool.\n"
|
||||
"\n"
|
||||
"Scarce - Some excess items are removed, including health upgrades.\n"
|
||||
"\n"
|
||||
"Minimal - Most excess items are removed.");
|
||||
SohImGui::EnhancementCombobox("gRandomizeItemPool", randoItemPool, 4, 1);
|
||||
PaddedSeparator();
|
||||
|
||||
// Ice Traps
|
||||
ImGui::Text(Settings::IceTrapValue.GetName().c_str());
|
||||
InsertHelpHoverText("Sets how many items are replaced by ice traps.\n"
|
||||
"\n"
|
||||
"Off - No ice traps.\n"
|
||||
"\n"
|
||||
"Normal - Only Ice Traps from the base item pool are shuffled in.\n"
|
||||
"\n"
|
||||
"Extra - Chance to replace added junk items with additional ice traps.\n"
|
||||
"\n"
|
||||
"Mayhem - All added junk items will be Ice Traps.\n"
|
||||
"\n"
|
||||
"Onslaught - All junk items will be replaced by Ice Traps, even those "
|
||||
"in the base pool.");
|
||||
SohImGui::EnhancementCombobox("gRandomizeIceTraps", randoIceTraps, 5, 1);
|
||||
|
||||
PaddedSeparator();
|
||||
|
||||
// Gossip Stone Hints
|
||||
ImGui::Text(Settings::GossipStoneHints.GetName().c_str());
|
||||
|
@ -3453,40 +3492,7 @@ void DrawRandoEditor(bool& open) {
|
|||
SohImGui::EnhancementCombobox("gRandomizeHintDistribution", randoHintDistribution, 4, 1);
|
||||
ImGui::Unindent();
|
||||
}
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
// COLUMN 3 - ITEM POOL SETTINGS
|
||||
ImGui::TableNextColumn();
|
||||
window->DC.CurrLineTextBaseOffset = 0.0f;
|
||||
ImGui::PushItemWidth(-FLT_MIN);
|
||||
ImGui::Text(Settings::ItemPoolValue.GetName().c_str());
|
||||
InsertHelpHoverText("Sets how many major items appear in the item pool.\n"
|
||||
"\n"
|
||||
"Plentiful - Extra major items are added to the pool.\n"
|
||||
"\n"
|
||||
"Balanced - Original item pool.\n"
|
||||
"\n"
|
||||
"Scarce - Some excess items are removed, including health upgrades.\n"
|
||||
"\n"
|
||||
"Minimal - Most excess items are removed.");
|
||||
SohImGui::EnhancementCombobox("gRandomizeItemPool", randoItemPool, 4, 1);
|
||||
PaddedSeparator();
|
||||
|
||||
// Ice Traps
|
||||
ImGui::Text(Settings::IceTrapValue.GetName().c_str());
|
||||
InsertHelpHoverText("Sets how many items are replaced by ice traps.\n"
|
||||
"\n"
|
||||
"Off - No ice traps.\n"
|
||||
"\n"
|
||||
"Normal - Only Ice Traps from the base item pool are shuffled in.\n"
|
||||
"\n"
|
||||
"Extra - Chance to replace added junk items with additional ice traps.\n"
|
||||
"\n"
|
||||
"Mayhem - All added junk items will be Ice Traps.\n"
|
||||
"\n"
|
||||
"Onslaught - All junk items will be replaced by Ice Traps, even those "
|
||||
"in the base pool.");
|
||||
SohImGui::EnhancementCombobox("gRandomizeIceTraps", randoIceTraps, 5, 1);
|
||||
ImGui::PopItemWidth();
|
||||
ImGui::EndTable();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
|
||||
typedef enum {
|
||||
RAND_INF_DUNGEONS_DONE_DEKU_TREE,
|
||||
RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN,
|
||||
RAND_INF_DUNGEONS_DONE_JABU_JABUS_BELLY,
|
||||
RAND_INF_DUNGEONS_DONE_FOREST_TEMPLE,
|
||||
RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE,
|
||||
RAND_INF_DUNGEONS_DONE_WATER_TEMPLE,
|
||||
RAND_INF_DUNGEONS_DONE_SPIRIT_TEMPLE,
|
||||
RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE,
|
||||
|
||||
RAND_INF_TRIALS_DONE_LIGHT_TRIAL,
|
||||
RAND_INF_TRIALS_DONE_FOREST_TRIAL,
|
||||
RAND_INF_TRIALS_DONE_FIRE_TRIAL,
|
||||
RAND_INF_TRIALS_DONE_WATER_TRIAL,
|
||||
RAND_INF_TRIALS_DONE_SPIRIT_TRIAL,
|
||||
RAND_INF_TRIALS_DONE_SHADOW_TRIAL,
|
||||
|
||||
RAND_INF_COWS_MILKED_LINKS_HOUSE_COW,
|
||||
RAND_INF_COWS_MILKED_HF_COW_GROTTO_COW,
|
||||
RAND_INF_COWS_MILKED_LLR_STABLES_LEFT_COW,
|
||||
RAND_INF_COWS_MILKED_LLR_STABLES_RIGHT_COW,
|
||||
RAND_INF_COWS_MILKED_LLR_TOWER_LEFT_COW,
|
||||
RAND_INF_COWS_MILKED_LLR_TOWER_RIGHT_COW,
|
||||
RAND_INF_COWS_MILKED_KAK_IMPAS_HOUSE_COW,
|
||||
RAND_INF_COWS_MILKED_DMT_COW_GROTTO_COW,
|
||||
RAND_INF_COWS_MILKED_GV_COW,
|
||||
RAND_INF_COWS_MILKED_JABU_JABUS_BELLY_MQ_COW,
|
||||
RAND_INF_COWS_MILKED_HF_COW_GROTTO_GOSSIP_STONE,
|
||||
|
||||
// If you add anything to this list, you need to update the size of randomizerInf in z64save.h to be ceil(RAND_INF_MAX / 16)
|
||||
|
||||
RAND_INF_MAX,
|
||||
} RandomizerInf;
|
|
@ -85,7 +85,7 @@ std::vector<ItemTrackerDungeon> itemTrackerDungeonsWithMapsHorizontal = {
|
|||
{ SCENE_MIZUSIN, { ITEM_KEY_SMALL, ITEM_KEY_BOSS, ITEM_DUNGEON_MAP, ITEM_COMPASS } },
|
||||
{ SCENE_JYASINZOU, { ITEM_KEY_SMALL, ITEM_KEY_BOSS, ITEM_DUNGEON_MAP, ITEM_COMPASS } },
|
||||
{ SCENE_HAKADAN, { ITEM_KEY_SMALL, ITEM_KEY_BOSS, ITEM_DUNGEON_MAP, ITEM_COMPASS } },
|
||||
{ SCENE_GANON, { ITEM_KEY_SMALL, ITEM_KEY_BOSS } },
|
||||
{ SCENE_GANONTIKA, { ITEM_KEY_SMALL, ITEM_KEY_BOSS } },
|
||||
{ SCENE_HAKADANCH, { ITEM_KEY_SMALL, ITEM_DUNGEON_MAP, ITEM_COMPASS } },
|
||||
{ SCENE_ICE_DOUKUTO, { ITEM_DUNGEON_MAP, ITEM_COMPASS } },
|
||||
{ SCENE_MEN, { ITEM_KEY_SMALL } },
|
||||
|
@ -97,7 +97,7 @@ std::vector<ItemTrackerDungeon> itemTrackerDungeonsHorizontal = {
|
|||
{ SCENE_MIZUSIN, { ITEM_KEY_SMALL, ITEM_KEY_BOSS } },
|
||||
{ SCENE_JYASINZOU, { ITEM_KEY_SMALL, ITEM_KEY_BOSS } },
|
||||
{ SCENE_HAKADAN, { ITEM_KEY_SMALL, ITEM_KEY_BOSS } },
|
||||
{ SCENE_GANON, { ITEM_KEY_SMALL, ITEM_KEY_BOSS } },
|
||||
{ SCENE_GANONTIKA, { ITEM_KEY_SMALL, ITEM_KEY_BOSS } },
|
||||
{ SCENE_HAKADANCH, { ITEM_KEY_SMALL } },
|
||||
{ SCENE_MEN, { ITEM_KEY_SMALL } },
|
||||
};
|
||||
|
@ -114,7 +114,7 @@ std::vector<ItemTrackerDungeon> itemTrackerDungeonsWithMapsCompact = {
|
|||
{ SCENE_DDAN, { ITEM_DUNGEON_MAP, ITEM_COMPASS } },
|
||||
{ SCENE_BDAN, { ITEM_DUNGEON_MAP, ITEM_COMPASS } },
|
||||
{ SCENE_ICE_DOUKUTO, { ITEM_DUNGEON_MAP, ITEM_COMPASS } },
|
||||
{ SCENE_GANON, { ITEM_KEY_SMALL, ITEM_KEY_BOSS } },
|
||||
{ SCENE_GANONTIKA, { ITEM_KEY_SMALL, ITEM_KEY_BOSS } },
|
||||
{ SCENE_MEN, { ITEM_KEY_SMALL } },
|
||||
};
|
||||
|
||||
|
@ -124,7 +124,7 @@ std::vector<ItemTrackerDungeon> itemTrackerDungeonsCompact = {
|
|||
{ SCENE_MIZUSIN, { ITEM_KEY_SMALL, ITEM_KEY_BOSS } },
|
||||
{ SCENE_JYASINZOU, { ITEM_KEY_SMALL, ITEM_KEY_BOSS } },
|
||||
{ SCENE_HAKADAN, { ITEM_KEY_SMALL, ITEM_KEY_BOSS } },
|
||||
{ SCENE_GANON, { ITEM_KEY_SMALL, ITEM_KEY_BOSS } },
|
||||
{ SCENE_GANONTIKA, { ITEM_KEY_SMALL, ITEM_KEY_BOSS } },
|
||||
{ SCENE_HAKADANCH, { ITEM_KEY_SMALL } },
|
||||
{ SCENE_MEN, { ITEM_KEY_SMALL } },
|
||||
{ SCENE_GERUDOWAY, { ITEM_KEY_SMALL } },
|
||||
|
@ -141,7 +141,7 @@ std::map<uint16_t, std::string> itemTrackerDungeonShortNames = {
|
|||
{ SCENE_DDAN, "DCVN" },
|
||||
{ SCENE_BDAN, "JABU" },
|
||||
{ SCENE_ICE_DOUKUTO, "ICE" },
|
||||
{ SCENE_GANON, "GANON" },
|
||||
{ SCENE_GANONTIKA, "GANON" },
|
||||
{ SCENE_MEN, "GTG" },
|
||||
{ SCENE_GERUDOWAY, "HIDE" },
|
||||
};
|
||||
|
@ -288,7 +288,7 @@ ImVec2 GetItemCurrentAndMax(ItemTrackerItem item) {
|
|||
case SCENE_HAKADANCH:
|
||||
result.y = 3;
|
||||
break;
|
||||
case SCENE_GANON:
|
||||
case SCENE_GANONTIKA:
|
||||
result.y = 2;
|
||||
break;
|
||||
case SCENE_MEN:
|
||||
|
@ -608,7 +608,12 @@ std::vector<ItemTrackerItem> GetDungeonItemsVector(std::vector<ItemTrackerDungeo
|
|||
dungeonItems.push_back(ITEM_TRACKER_ITEM(ITEM_KEY_SMALL, dungeons[j].id, DrawDungeonItem));
|
||||
break;
|
||||
case ITEM_KEY_BOSS:
|
||||
dungeonItems.push_back(ITEM_TRACKER_ITEM(ITEM_KEY_BOSS, dungeons[j].id, DrawDungeonItem));
|
||||
// Swap Ganon's Castle boss key to the right scene ID manually
|
||||
if (dungeons[j].id == SCENE_GANONTIKA) {
|
||||
dungeonItems.push_back(ITEM_TRACKER_ITEM(ITEM_KEY_BOSS, SCENE_GANON, DrawDungeonItem));
|
||||
} else {
|
||||
dungeonItems.push_back(ITEM_TRACKER_ITEM(ITEM_KEY_BOSS, dungeons[j].id, DrawDungeonItem));
|
||||
}
|
||||
break;
|
||||
case ITEM_DUNGEON_MAP:
|
||||
dungeonItems.push_back(ITEM_TRACKER_ITEM(ITEM_DUNGEON_MAP, dungeons[j].id, DrawDungeonItem));
|
||||
|
|
|
@ -758,15 +758,8 @@ void SaveManager::LoadBaseVersion1() {
|
|||
SaveManager::Instance->LoadData("angle", gSaveContext.horseData.angle);
|
||||
});
|
||||
|
||||
SaveManager::Instance->LoadArray("dungeonsDone", ARRAY_COUNT(gSaveContext.dungeonsDone), [](size_t i) {
|
||||
SaveManager::Instance->LoadData("", gSaveContext.dungeonsDone[i]);
|
||||
});
|
||||
|
||||
SaveManager::Instance->LoadArray("trialsDone", ARRAY_COUNT(gSaveContext.trialsDone),
|
||||
[](size_t i) { SaveManager::Instance->LoadData("", gSaveContext.trialsDone[i]); });
|
||||
|
||||
SaveManager::Instance->LoadArray("cowsMilked", ARRAY_COUNT(gSaveContext.cowsMilked), [](size_t i) {
|
||||
SaveManager::Instance->LoadData("", gSaveContext.cowsMilked[i]);
|
||||
SaveManager::Instance->LoadArray("randomizerInf", ARRAY_COUNT(gSaveContext.randomizerInf), [](size_t i) {
|
||||
SaveManager::Instance->LoadData("", gSaveContext.randomizerInf[i]);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -922,15 +915,8 @@ void SaveManager::LoadBaseVersion2() {
|
|||
SaveManager::Instance->LoadData("angle", gSaveContext.horseData.angle);
|
||||
});
|
||||
|
||||
SaveManager::Instance->LoadArray("dungeonsDone", ARRAY_COUNT(gSaveContext.dungeonsDone), [](size_t i) {
|
||||
SaveManager::Instance->LoadData("", gSaveContext.dungeonsDone[i]);
|
||||
});
|
||||
|
||||
SaveManager::Instance->LoadArray("trialsDone", ARRAY_COUNT(gSaveContext.trialsDone),
|
||||
[](size_t i) { SaveManager::Instance->LoadData("", gSaveContext.trialsDone[i]); });
|
||||
|
||||
SaveManager::Instance->LoadArray("cowsMilked", ARRAY_COUNT(gSaveContext.cowsMilked), [](size_t i) {
|
||||
SaveManager::Instance->LoadData("", gSaveContext.cowsMilked[i]);
|
||||
SaveManager::Instance->LoadArray("randomizerInf", ARRAY_COUNT(gSaveContext.randomizerInf), [](size_t i) {
|
||||
SaveManager::Instance->LoadData("", gSaveContext.randomizerInf[i]);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1082,15 +1068,8 @@ void SaveManager::SaveBase() {
|
|||
SaveManager::Instance->SaveData("angle", gSaveContext.horseData.angle);
|
||||
});
|
||||
|
||||
SaveManager::Instance->SaveArray("dungeonsDone", ARRAY_COUNT(gSaveContext.dungeonsDone), [](size_t i) {
|
||||
SaveManager::Instance->SaveData("", gSaveContext.dungeonsDone[i]);
|
||||
});
|
||||
|
||||
SaveManager::Instance->SaveArray("trialsDone", ARRAY_COUNT(gSaveContext.trialsDone),
|
||||
[](size_t i) { SaveManager::Instance->SaveData("", gSaveContext.trialsDone[i]); });
|
||||
|
||||
SaveManager::Instance->SaveArray("cowsMilked", ARRAY_COUNT(gSaveContext.cowsMilked), [](size_t i) {
|
||||
SaveManager::Instance->SaveData("", gSaveContext.cowsMilked[i]);
|
||||
SaveManager::Instance->SaveArray("randomizerInf", ARRAY_COUNT(gSaveContext.randomizerInf), [](size_t i) {
|
||||
SaveManager::Instance->SaveData("", gSaveContext.randomizerInf[i]);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -4705,6 +4705,20 @@ void Flags_SetInfTable(s32 flag) {
|
|||
gSaveContext.infTable[flag >> 4] |= (1 << (flag & 0xF));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests if "randomizerInf" flag is set.
|
||||
*/
|
||||
s32 Flags_GetRandomizerInf(RandomizerInf flag) {
|
||||
return gSaveContext.randomizerInf[flag >> 4] & (1 << (flag & 0xF));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets "randomizerInf" flag.
|
||||
*/
|
||||
void Flags_SetRandomizerInf(RandomizerInf flag) {
|
||||
gSaveContext.randomizerInf[flag >> 4] |= (1 << (flag & 0xF));
|
||||
}
|
||||
|
||||
u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) {
|
||||
u16 retTextId = 0;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <string.h>
|
||||
#include <soh/Enhancements/randomizer/randomizerTypes.h>
|
||||
#include <soh/Enhancements/randomizer/randomizer_inf.h>
|
||||
|
||||
#define NUM_DUNGEONS 8
|
||||
#define NUM_TRIALS 6
|
||||
|
@ -702,19 +703,9 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) {
|
|||
fileChooseCtx->n64ddFlag = 1;
|
||||
gSaveContext.n64ddFlag = 1;
|
||||
|
||||
// Sets all the dungeons to incomplete when generating a rando save. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/82
|
||||
for (u8 i = 0; i < NUM_DUNGEONS; i++) {
|
||||
gSaveContext.dungeonsDone[i] = 0;
|
||||
}
|
||||
|
||||
// Sets all Ganon's Trials to incomplete when generating a rando save. Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
|
||||
for (u8 i = 0; i < NUM_TRIALS; i++) {
|
||||
gSaveContext.trialsDone[i] = 0;
|
||||
}
|
||||
|
||||
// Sets all cows to unmilked when generating a rando save.
|
||||
for (u8 i = 0; i < NUM_COWS; i++) {
|
||||
gSaveContext.cowsMilked[i] = 0;
|
||||
// Sets all rando flags to false
|
||||
for (s32 i = 0; i < ARRAY_COUNT(gSaveContext.randomizerInf); i++) {
|
||||
gSaveContext.randomizerInf[i] = 0;
|
||||
}
|
||||
|
||||
// Set Cutscene flags to skip them
|
||||
|
|
|
@ -132,35 +132,35 @@ u8 CheckMedallionCount() {
|
|||
u8 CheckDungeonCount() {
|
||||
u8 dungeonCount = 0;
|
||||
|
||||
if (gSaveContext.dungeonsDone[0] == 1) {
|
||||
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE)) {
|
||||
dungeonCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.dungeonsDone[1] == 1) {
|
||||
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN)) {
|
||||
dungeonCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.dungeonsDone[2] == 1) {
|
||||
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_JABU_JABUS_BELLY)) {
|
||||
dungeonCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.dungeonsDone[3] == 1) {
|
||||
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FOREST_TEMPLE)) {
|
||||
dungeonCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.dungeonsDone[4] == 1) {
|
||||
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE)) {
|
||||
dungeonCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.dungeonsDone[5] == 1) {
|
||||
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_WATER_TEMPLE)) {
|
||||
dungeonCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.dungeonsDone[6] == 1) {
|
||||
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_SPIRIT_TEMPLE)) {
|
||||
dungeonCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.dungeonsDone[7] == 1) {
|
||||
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE)) {
|
||||
dungeonCount++;
|
||||
}
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ void BgSpot06Objects_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
if (LINK_IS_ADULT &&
|
||||
((!gSaveContext.n64ddFlag && !(gSaveContext.eventChkInf[6] & 0x200)) ||
|
||||
(gSaveContext.n64ddFlag && !gSaveContext.dungeonsDone[5]))) {
|
||||
(gSaveContext.n64ddFlag && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_WATER_TEMPLE)))) {
|
||||
if (gSaveContext.sceneSetupIndex < 4) {
|
||||
this->lakeHyliaWaterLevel = -681.0f;
|
||||
globalCtx->colCtx.colHeader->waterBoxes[LHWB_GERUDO_VALLEY_RIVER_LOWER].ySurface =
|
||||
|
|
|
@ -76,27 +76,27 @@ s32 DemoKekkai_CheckEventFlag(s32 params) {
|
|||
u32 TrialsDoneCount() {
|
||||
u8 trialCount = 0;
|
||||
|
||||
if (gSaveContext.trialsDone[0] == 1) {
|
||||
if (Flags_GetRandomizerInf(RAND_INF_TRIALS_DONE_LIGHT_TRIAL)) {
|
||||
trialCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.trialsDone[1] == 1) {
|
||||
if (Flags_GetRandomizerInf(RAND_INF_TRIALS_DONE_FOREST_TRIAL)) {
|
||||
trialCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.trialsDone[2] == 1) {
|
||||
if (Flags_GetRandomizerInf(RAND_INF_TRIALS_DONE_FIRE_TRIAL)) {
|
||||
trialCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.trialsDone[3] == 1) {
|
||||
if (Flags_GetRandomizerInf(RAND_INF_TRIALS_DONE_WATER_TRIAL)) {
|
||||
trialCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.trialsDone[4] == 1) {
|
||||
if (Flags_GetRandomizerInf(RAND_INF_TRIALS_DONE_SPIRIT_TRIAL)) {
|
||||
trialCount++;
|
||||
}
|
||||
|
||||
if (gSaveContext.trialsDone[5] == 1) {
|
||||
if (Flags_GetRandomizerInf(RAND_INF_TRIALS_DONE_SHADOW_TRIAL)) {
|
||||
trialCount++;
|
||||
}
|
||||
|
||||
|
@ -249,22 +249,22 @@ void DemoKekkai_TrialBarrierDispel(Actor* thisx, GlobalContext* globalCtx) {
|
|||
if (gSaveContext.n64ddFlag) {
|
||||
switch (thisx->params) {
|
||||
case KEKKAI_WATER:
|
||||
gSaveContext.trialsDone[2] = 1;
|
||||
Flags_SetRandomizerInf(RAND_INF_TRIALS_DONE_WATER_TRIAL);
|
||||
break;
|
||||
case KEKKAI_LIGHT:
|
||||
gSaveContext.trialsDone[5] = 1;
|
||||
Flags_SetRandomizerInf(RAND_INF_TRIALS_DONE_LIGHT_TRIAL);
|
||||
break;
|
||||
case KEKKAI_FIRE:
|
||||
gSaveContext.trialsDone[1] = 1;
|
||||
Flags_SetRandomizerInf(RAND_INF_TRIALS_DONE_FIRE_TRIAL);
|
||||
break;
|
||||
case KEKKAI_SHADOW:
|
||||
gSaveContext.trialsDone[3] = 1;
|
||||
Flags_SetRandomizerInf(RAND_INF_TRIALS_DONE_SHADOW_TRIAL);
|
||||
break;
|
||||
case KEKKAI_SPIRIT:
|
||||
gSaveContext.trialsDone[4] = 1;
|
||||
Flags_SetRandomizerInf(RAND_INF_TRIALS_DONE_SPIRIT_TRIAL);
|
||||
break;
|
||||
case KEKKAI_FOREST:
|
||||
gSaveContext.trialsDone[0] = 1;
|
||||
Flags_SetRandomizerInf(RAND_INF_TRIALS_DONE_FOREST_TRIAL);
|
||||
break;
|
||||
}
|
||||
Flags_SetEventChkInf(eventFlags[thisx->params]);
|
||||
|
|
|
@ -546,7 +546,7 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
if (globalCtx->sceneNum == SCENE_DDAN_BOSS) {
|
||||
if (!Flags_GetEventChkInf(0x25)) {
|
||||
Flags_SetEventChkInf(0x25);
|
||||
gSaveContext.dungeonsDone[0] = 1;
|
||||
Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN);
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x47A;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
|
@ -563,7 +563,7 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
if (!Flags_GetEventChkInf(7) || gSaveContext.n64ddFlag) {
|
||||
Flags_SetEventChkInf(7);
|
||||
Flags_SetEventChkInf(9);
|
||||
gSaveContext.dungeonsDone[1] = 1;
|
||||
Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE);
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x0457;
|
||||
gSaveContext.nextCutsceneIndex = 0;
|
||||
|
@ -671,7 +671,7 @@ void DoorWarp1_RutoWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->warpTimer > sWarpTimerTarget && gSaveContext.nextCutsceneIndex == 0xFFEF) {
|
||||
gSaveContext.eventChkInf[3] |= 0x80;
|
||||
gSaveContext.dungeonsDone[2] = 1;
|
||||
Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_JABU_JABUS_BELLY);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x10E;
|
||||
|
@ -785,7 +785,7 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
if (globalCtx->sceneNum == SCENE_MORIBOSSROOM) {
|
||||
if (!(gSaveContext.eventChkInf[4] & 0x100)) {
|
||||
gSaveContext.eventChkInf[4] |= 0x100;
|
||||
gSaveContext.dungeonsDone[3] = 1;
|
||||
Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_FOREST_TEMPLE);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x608;
|
||||
|
@ -807,7 +807,7 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
} else if (globalCtx->sceneNum == SCENE_FIRE_BS) {
|
||||
if (!(gSaveContext.eventChkInf[4] & 0x200)) {
|
||||
gSaveContext.eventChkInf[4] |= 0x200;
|
||||
gSaveContext.dungeonsDone[4] = 1;
|
||||
Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x564;
|
||||
|
@ -828,7 +828,7 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
} else if (globalCtx->sceneNum == SCENE_MIZUSIN_BS) {
|
||||
if (!(gSaveContext.eventChkInf[4] & 0x400)) {
|
||||
gSaveContext.eventChkInf[4] |= 0x400;
|
||||
gSaveContext.dungeonsDone[5] = 1;
|
||||
Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_WATER_TEMPLE);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x60C;
|
||||
|
@ -849,7 +849,7 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
} else if (globalCtx->sceneNum == SCENE_JYASINBOSS) {
|
||||
if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) || gSaveContext.n64ddFlag) {
|
||||
gSaveContext.dungeonsDone[6] = 1;
|
||||
Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_SPIRIT_TEMPLE);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x610;
|
||||
|
@ -870,7 +870,7 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
} else if (globalCtx->sceneNum == SCENE_HAKADAN_BS) {
|
||||
if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) || gSaveContext.n64ddFlag) {
|
||||
gSaveContext.dungeonsDone[7] = 1;
|
||||
Flags_SetRandomizerInf(RAND_INF_DUNGEONS_DONE_SHADOW_TEMPLE);
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
globalCtx->nextEntranceIndex = 0x580;
|
||||
|
|
|
@ -218,51 +218,51 @@ void func_809DF730(EnCow* this, GlobalContext* globalCtx) {
|
|||
CowInfo EnCow_GetInfo(EnCow* this, GlobalContext* globalCtx) {
|
||||
struct CowInfo cowInfo;
|
||||
|
||||
cowInfo.cowId = -1;
|
||||
cowInfo.randomizerInf = -1;
|
||||
cowInfo.randomizerCheck = RC_UNKNOWN_CHECK;
|
||||
|
||||
switch (globalCtx->sceneNum) {
|
||||
case SCENE_SOUKO: // Lon Lon Tower
|
||||
if (this->actor.world.pos.x == -229 && this->actor.world.pos.z == 157) {
|
||||
cowInfo.cowId = 0;
|
||||
cowInfo.randomizerInf = RAND_INF_COWS_MILKED_LLR_TOWER_LEFT_COW;
|
||||
cowInfo.randomizerCheck = RC_LLR_TOWER_LEFT_COW;
|
||||
} else if (this->actor.world.pos.x == -142 && this->actor.world.pos.z == -140) {
|
||||
cowInfo.cowId = 1;
|
||||
cowInfo.randomizerInf = RAND_INF_COWS_MILKED_LLR_TOWER_RIGHT_COW;
|
||||
cowInfo.randomizerCheck = RC_LLR_TOWER_RIGHT_COW;
|
||||
}
|
||||
break;
|
||||
case SCENE_MALON_STABLE:
|
||||
if (this->actor.world.pos.x == 116 && this->actor.world.pos.z == -254) {
|
||||
cowInfo.cowId = 2;
|
||||
cowInfo.randomizerInf = RAND_INF_COWS_MILKED_LLR_STABLES_RIGHT_COW;
|
||||
cowInfo.randomizerCheck = RC_LLR_STABLES_RIGHT_COW;
|
||||
} else if (this->actor.world.pos.x == -122 && this->actor.world.pos.z == -254) {
|
||||
cowInfo.cowId = 3;
|
||||
cowInfo.randomizerInf = RAND_INF_COWS_MILKED_LLR_STABLES_LEFT_COW;
|
||||
cowInfo.randomizerCheck = RC_LLR_STABLES_LEFT_COW;
|
||||
}
|
||||
break;
|
||||
case SCENE_KAKUSIANA: // Grotto
|
||||
if (this->actor.world.pos.x == 2444 && this->actor.world.pos.z == -471) {
|
||||
cowInfo.cowId = 4;
|
||||
cowInfo.randomizerInf = RAND_INF_COWS_MILKED_DMT_COW_GROTTO_COW;
|
||||
cowInfo.randomizerCheck = RC_DMT_COW_GROTTO_COW;
|
||||
} else if (this->actor.world.pos.x == 3485 && this->actor.world.pos.z == -291) {
|
||||
cowInfo.cowId = 5;
|
||||
cowInfo.randomizerInf = RAND_INF_COWS_MILKED_HF_COW_GROTTO_COW;
|
||||
cowInfo.randomizerCheck = RC_HF_COW_GROTTO_COW;
|
||||
}
|
||||
break;
|
||||
case SCENE_LINK_HOME:
|
||||
cowInfo.cowId = 6;
|
||||
cowInfo.randomizerInf = RAND_INF_COWS_MILKED_LINKS_HOUSE_COW;
|
||||
cowInfo.randomizerCheck = RC_KF_LINKS_HOUSE_COW;
|
||||
break;
|
||||
case SCENE_LABO: // Impa's house
|
||||
cowInfo.cowId = 7;
|
||||
cowInfo.randomizerInf = RAND_INF_COWS_MILKED_KAK_IMPAS_HOUSE_COW;
|
||||
cowInfo.randomizerCheck = RC_KAK_IMPAS_HOUSE_COW;
|
||||
break;
|
||||
case SCENE_SPOT09: // Gerudo Valley
|
||||
cowInfo.cowId = 8;
|
||||
cowInfo.randomizerInf = RAND_INF_COWS_MILKED_GV_COW;
|
||||
cowInfo.randomizerCheck = RC_GV_COW;
|
||||
break;
|
||||
case SCENE_SPOT08: // Jabu's Belly
|
||||
cowInfo.cowId = 9;
|
||||
case SCENE_BDAN: // Jabu's Belly
|
||||
cowInfo.randomizerInf = RAND_INF_COWS_MILKED_JABU_JABUS_BELLY_MQ_COW;
|
||||
cowInfo.randomizerCheck = RC_JABU_JABUS_BELLY_MQ_COW;
|
||||
break;
|
||||
}
|
||||
|
@ -290,8 +290,8 @@ void EnCow_MoveForRandomizer(EnCow* this, GlobalContext* globalCtx) {
|
|||
void EnCow_SetCowMilked(EnCow* this, GlobalContext* globalCtx) {
|
||||
CowInfo cowInfo = EnCow_GetInfo(this, globalCtx);
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
player->pendingFlag.flagID = cowInfo.cowId;
|
||||
player->pendingFlag.flagType = FLAG_COW_MILKED;
|
||||
player->pendingFlag.flagID = cowInfo.randomizerInf;
|
||||
player->pendingFlag.flagType = FLAG_RANDOMIZER_INF;
|
||||
}
|
||||
|
||||
void func_809DF778(EnCow* this, GlobalContext* globalCtx) {
|
||||
|
@ -337,7 +337,7 @@ void func_809DF8FC(EnCow* this, GlobalContext* globalCtx) {
|
|||
|
||||
bool EnCow_HasBeenMilked(EnCow* this, GlobalContext* globalCtx) {
|
||||
CowInfo cowInfo = EnCow_GetInfo(this, globalCtx);
|
||||
return gSaveContext.cowsMilked[cowInfo.cowId];
|
||||
return Flags_GetRandomizerInf(cowInfo.randomizerInf);
|
||||
}
|
||||
|
||||
void EnCow_GivePlayerRandomizedItem(EnCow* this, GlobalContext* globalCtx) {
|
||||
|
|
|
@ -22,7 +22,7 @@ typedef struct EnCow {
|
|||
} EnCow; // size = 0x0280
|
||||
|
||||
typedef struct CowInfo {
|
||||
int cowId;
|
||||
RandomizerInf randomizerInf;
|
||||
RandomizerCheck randomizerCheck;
|
||||
} CowInfo;
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ u16 EnGo_GetTextID(GlobalContext* globalCtx, Actor* thisx) {
|
|||
}
|
||||
case 0x00:
|
||||
if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[4])) {
|
||||
(gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) {
|
||||
if (gSaveContext.infTable[16] & 0x8000) {
|
||||
return 0x3042;
|
||||
} else {
|
||||
|
|
|
@ -416,10 +416,10 @@ s16 EnGo2_GetStateGoronDmtRollingSmall(GlobalContext* globalCtx, EnGo2* this) {
|
|||
|
||||
u16 EnGo2_GetTextIdGoronDmtDcEntrance(GlobalContext* globalCtx, EnGo2* this) {
|
||||
if (((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[4])) && LINK_IS_ADULT) {
|
||||
(gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && LINK_IS_ADULT) {
|
||||
return 0x3043;
|
||||
} else if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[0])) {
|
||||
(gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN))) {
|
||||
return 0x3027;
|
||||
} else {
|
||||
return gSaveContext.eventChkInf[2] & 0x8 ? 0x3021 : gSaveContext.infTable[14] & 0x1 ? 0x302A : 0x3008;
|
||||
|
@ -439,10 +439,10 @@ s16 EnGo2_GetStateGoronDmtDcEntrance(GlobalContext* globalCtx, EnGo2* this) {
|
|||
|
||||
u16 EnGo2_GetTextIdGoronCityEntrance(GlobalContext* globalCtx, EnGo2* this) {
|
||||
if (((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[4])) && LINK_IS_ADULT) {
|
||||
(gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && LINK_IS_ADULT) {
|
||||
return 0x3043;
|
||||
} else if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[0])) {
|
||||
(gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN))) {
|
||||
return 0x3027;
|
||||
} else {
|
||||
return gSaveContext.infTable[15] & 0x1 ? 0x3015 : 0x3014;
|
||||
|
@ -462,10 +462,10 @@ s16 EnGo2_GetStateGoronCityEntrance(GlobalContext* globalCtx, EnGo2* this) {
|
|||
|
||||
u16 EnGo2_GetTextIdGoronCityIsland(GlobalContext* globalCtx, EnGo2* this) {
|
||||
if (((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[4])) && LINK_IS_ADULT) {
|
||||
(gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && LINK_IS_ADULT) {
|
||||
return 0x3043;
|
||||
} else if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[0])) {
|
||||
(gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN))) {
|
||||
return 0x3027;
|
||||
} else {
|
||||
return gSaveContext.infTable[15] & 0x10 ? 0x3017 : 0x3016;
|
||||
|
@ -485,10 +485,10 @@ s16 EnGo2_GetStateGoronCityIsland(GlobalContext* globalCtx, EnGo2* this) {
|
|||
|
||||
u16 EnGo2_GetTextIdGoronCityLowestFloor(GlobalContext* globalCtx, EnGo2* this) {
|
||||
if (((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[4])) && LINK_IS_ADULT) {
|
||||
(gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && LINK_IS_ADULT) {
|
||||
return 0x3043;
|
||||
} else if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[0])) {
|
||||
(gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DODONGOS_CAVERN))) {
|
||||
return 0x3027;
|
||||
} else {
|
||||
return CUR_UPG_VALUE(UPG_STRENGTH) != 0 ? 0x302C
|
||||
|
@ -1589,7 +1589,7 @@ void EnGo2_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
case GORON_CITY_STAIRWELL:
|
||||
case GORON_CITY_LOST_WOODS:
|
||||
if (((!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
|
||||
(gSaveContext.n64ddFlag && !gSaveContext.dungeonsDone[4])) && LINK_IS_ADULT) {
|
||||
(gSaveContext.n64ddFlag && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) && LINK_IS_ADULT) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
this->actionFunc = EnGo2_CurledUp;
|
||||
|
|
|
@ -73,7 +73,7 @@ static AnimationInfo sAnimationInfo[] = {
|
|||
u16 EnKz_GetTextNoMaskChild(GlobalContext* globalCtx, EnKz* this) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if ((gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[2]) ||
|
||||
if ((gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_JABU_JABUS_BELLY)) ||
|
||||
(!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE))) {
|
||||
return 0x402B;
|
||||
} else if (gSaveContext.eventChkInf[3] & 8) {
|
||||
|
|
|
@ -373,7 +373,7 @@ u16 EnMd_GetTextKokiriForest(GlobalContext* globalCtx, EnMd* this) {
|
|||
this->unk_209 = TEXT_STATE_NONE;
|
||||
|
||||
if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) ||
|
||||
(gSaveContext.n64ddFlag && gSaveContext.dungeonsDone[1])) {
|
||||
(gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE))) {
|
||||
return 0x1045;
|
||||
}
|
||||
|
||||
|
@ -486,7 +486,7 @@ u8 EnMd_ShouldSpawn(EnMd* this, GlobalContext* globalCtx) {
|
|||
if (gSaveContext.n64ddFlag) {
|
||||
// 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] ||
|
||||
if (Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE) ||
|
||||
Randomizer_GetSettingValue(RSK_FOREST) == 1 ||
|
||||
gSaveContext.eventChkInf[0] & 0x10) {
|
||||
return 0;
|
||||
|
|
|
@ -518,7 +518,7 @@ void EnOssan_TalkGoronShopkeeper(GlobalContext* globalCtx) {
|
|||
Message_ContinueTextbox(globalCtx, 0x300F);
|
||||
}
|
||||
} else if ((!gSaveContext.n64ddFlag && !CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE)) ||
|
||||
(gSaveContext.n64ddFlag && !gSaveContext.dungeonsDone[4])) {
|
||||
(gSaveContext.n64ddFlag && !Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_FIRE_TEMPLE))) {
|
||||
Message_ContinueTextbox(globalCtx, 0x3057);
|
||||
} else {
|
||||
Message_ContinueTextbox(globalCtx, 0x305B);
|
||||
|
|
|
@ -17,7 +17,8 @@ s32 func_80AFB748(EnSi* this, GlobalContext* globalCtx);
|
|||
void func_80AFB768(EnSi* this, GlobalContext* globalCtx);
|
||||
void func_80AFB89C(EnSi* this, GlobalContext* globalCtx);
|
||||
void func_80AFB950(EnSi* this, GlobalContext* globalCtx);
|
||||
void Randomizer_GrantSkullReward(EnSi* this, GlobalContext* globalCtx);
|
||||
void Randomizer_UpdateSkullReward(EnSi* this, GlobalContext* globalCtx);
|
||||
void Randomizer_GiveSkullReward(EnSi* this, GlobalContext* globalCtx);
|
||||
|
||||
s32 textId = 0xB4;
|
||||
s32 giveItemId = ITEM_SKULL_TOKEN;
|
||||
|
@ -99,21 +100,25 @@ void func_80AFB768(EnSi* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) {
|
||||
this->collider.base.ocFlags2 &= ~OC2_HIT_PLAYER;
|
||||
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
Randomizer_GrantSkullReward(this, globalCtx);
|
||||
Randomizer_UpdateSkullReward(this, globalCtx);
|
||||
} else {
|
||||
Item_Give(globalCtx, giveItemId);
|
||||
}
|
||||
if ((CVar_GetS32("gSkulltulaFreeze", 0) != 1 || giveItemId != ITEM_SKULL_TOKEN) && getItemId != RG_ICE_TRAP) {
|
||||
player->actor.freezeTimer = 20;
|
||||
}
|
||||
|
||||
Message_StartTextbox(globalCtx, textId, NULL);
|
||||
|
||||
if (gSaveContext.n64ddFlag && getItemId != RG_ICE_TRAP) {
|
||||
Randomizer_GiveSkullReward(this, globalCtx);
|
||||
Audio_PlayFanfare_Rando(getItem);
|
||||
} else {
|
||||
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
|
||||
}
|
||||
|
||||
player->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
this->actionFunc = func_80AFB950;
|
||||
} else {
|
||||
|
@ -133,16 +138,20 @@ void func_80AFB89C(EnSi* this, GlobalContext* globalCtx) {
|
|||
|
||||
if (!CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_13)) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
Randomizer_GrantSkullReward(this, globalCtx);
|
||||
Randomizer_UpdateSkullReward(this, globalCtx);
|
||||
} else {
|
||||
Item_Give(globalCtx, giveItemId);
|
||||
}
|
||||
|
||||
Message_StartTextbox(globalCtx, textId, NULL);
|
||||
|
||||
if (gSaveContext.n64ddFlag && getItemId != RG_ICE_TRAP) {
|
||||
Randomizer_GiveSkullReward(this, globalCtx);
|
||||
Audio_PlayFanfare_Rando(getItem);
|
||||
} else {
|
||||
Audio_PlayFanfare(NA_BGM_SMALL_ITEM_GET);
|
||||
}
|
||||
|
||||
player->getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
this->actionFunc = func_80AFB950;
|
||||
}
|
||||
|
@ -190,23 +199,28 @@ void EnSi_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
void Randomizer_GrantSkullReward(EnSi* this, GlobalContext* globalCtx) {
|
||||
void Randomizer_UpdateSkullReward(EnSi* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
getItem = Randomizer_GetRandomizedItem(GI_SKULL_TOKEN, this->actor.id, this->actor.params, globalCtx->sceneNum);
|
||||
getItemId = getItem.getItemId;
|
||||
if (getItemId == RG_ICE_TRAP) {
|
||||
player->getItemEntry = getItem;
|
||||
player->pendingIceTrap = true;
|
||||
textId = 0xF8;
|
||||
} else {
|
||||
textId = getItem.textId;
|
||||
giveItemId = getItem.itemId;
|
||||
if (getItem.modIndex == MOD_NONE) {
|
||||
Item_Give(globalCtx, giveItemId);
|
||||
} else if (getItem.modIndex == MOD_RANDOMIZER) {
|
||||
Randomizer_Item_Give(globalCtx, getItem);
|
||||
}
|
||||
}
|
||||
// player->getItemId = getItemId;
|
||||
}
|
||||
|
||||
void Randomizer_GiveSkullReward(EnSi* this, GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (getItem.modIndex == MOD_NONE) {
|
||||
Item_Give(globalCtx, giveItemId);
|
||||
} else if (getItem.modIndex == MOD_RANDOMIZER) {
|
||||
Randomizer_Item_Give(globalCtx, getItem);
|
||||
}
|
||||
player->getItemEntry = getItem;
|
||||
}
|
||||
|
|
|
@ -6083,8 +6083,8 @@ void Player_SetPendingFlag(Player* this, GlobalContext* globalCtx) {
|
|||
case FLAG_SCENE_TREASURE:
|
||||
Flags_SetTreasure(globalCtx, this->pendingFlag.flagID);
|
||||
break;
|
||||
case FLAG_COW_MILKED:
|
||||
gSaveContext.cowsMilked[this->pendingFlag.flagID] = 1;
|
||||
case FLAG_RANDOMIZER_INF:
|
||||
Flags_SetRandomizerInf(this->pendingFlag.flagID);
|
||||
break;
|
||||
case FLAG_EVENT_CHECK_INF:
|
||||
Flags_SetEventChkInf(this->pendingFlag.flagID);
|
||||
|
|
Loading…
Reference in New Issue