diff --git a/src/d/actor/d_a_b_ds.cpp b/src/d/actor/d_a_b_ds.cpp index 3ecba6f4a1..6aad3f323a 100644 --- a/src/d/actor/d_a_b_ds.cpp +++ b/src/d/actor/d_a_b_ds.cpp @@ -4089,6 +4089,8 @@ void daB_DS_c::executeBattle2Dead() { // Give the boss item u8 agDungeonReward = randomizer_getItemAtLocation("Arbiters Grounds Dungeon Reward"); g_randomizerState.addItemToEventQueue(agDungeonReward); + // Set custom item flag + dComIfGs_onItem(0x9E, -1); } #endif /* dSv_event_flag_c::F_0265 - Arbiter's Grounds - Arbiter's Grounds clear */ diff --git a/src/d/actor/d_a_obj_life_container.cpp b/src/d/actor/d_a_obj_life_container.cpp index dec5ae27bd..231525b5e6 100644 --- a/src/d/actor/d_a_obj_life_container.cpp +++ b/src/d/actor/d_a_obj_life_container.cpp @@ -224,6 +224,8 @@ int daObjLife_c::create() { } else if (getStageID() == Ook) { // Special case for Gale Boomerang check itemId = verifyProgressiveItem(randomizer_getItemAtLocation("Forest Temple Gale Boomerang")); + // Set rando custom collection flag + dComIfGs_onItem(0x9D, -1); } else { u8 flag = getSaveBitNo(); u8 stageIdx = getStageID(); diff --git a/src/dusk/randomizer/game/randomizer_context.cpp b/src/dusk/randomizer/game/randomizer_context.cpp index 0451e3fb84..e059e9246f 100644 --- a/src/dusk/randomizer/game/randomizer_context.cpp +++ b/src/dusk/randomizer/game/randomizer_context.cpp @@ -781,10 +781,17 @@ static void randomizer_setTempFlag(RandomizerContext::itemLocationData data) { // If stage is 0xFF, then this is an event flag if (data.stage == 0xFF) { g_randomizerState.mTrackerTempEventFlag = data.flag; - } else { + } + // If it's less than 0x80 then it's a switch flag + else if (data.flag < 0x80) { g_randomizerState.mTrackerTempSwitchFlag.stage = getStageSaveId(data.stage); g_randomizerState.mTrackerTempSwitchFlag.flag = data.flag; } + // Otherwise it's an item flag. Currently, any item flags that go through here are custom + // so we just set the bit directly. + else { + dComIfGs_onItem(data.flag, getStageSaveId(data.stage)); + } } void randomizer_setTempFlagForLocation(const std::string& locationName) { @@ -1061,6 +1068,9 @@ RandomizerContext WriteSeedData(randomizer::logic::world::World* world) { } else if (metaData["Switch Flag"]) { itemData.stage = metaData["Switch Flag"]["Stage"].as(); itemData.flag = metaData["Switch Flag"]["Flag"].as(); + } else if (metaData["Item Flag"]) { + itemData.stage = metaData["Item Flag"]["Stage"].as(); + itemData.flag = metaData["Item Flag"]["Flag"].as(); } }; diff --git a/src/dusk/randomizer/game/tools.cpp b/src/dusk/randomizer/game/tools.cpp index 112e99c52c..c5ffe150b3 100644 --- a/src/dusk/randomizer/game/tools.cpp +++ b/src/dusk/randomizer/game/tools.cpp @@ -504,6 +504,11 @@ bool isLocationObtained(randomizer::logic::location::Location* location) { auto stageId = getStageSaveId(switchFlagNode["Stage"].as()); return tracker_isStageSwitch(stageId, flag); } + if (auto& itemFlagNode = locationMeta["Item Flag"]) { + auto flag = itemFlagNode["Flag"].as(); + auto stageId = getStageSaveId(itemFlagNode["Stage"].as()); + return tracker_isStageItem(stageId, flag); + } return false; } @@ -546,7 +551,7 @@ int getLocationItem(randomizer::logic::location::Location* location) { return context.mSkyCharacterOverrides[key]; } if (auto& bugRewardNode = locationMeta["Bug Reward"]) { - u8 bugItemId = bugRewardNode["Item Id"].as(); + u8 bugItemId = bugRewardNode[0]["Item Id"].as(); return context.mBugRewardOverrides[bugItemId]; } diff --git a/src/dusk/randomizer/generator/data/locations.yaml b/src/dusk/randomizer/generator/data/locations.yaml index 11bba31382..975a23f1b4 100644 --- a/src/dusk/randomizer/generator/data/locations.yaml +++ b/src/dusk/randomizer/generator/data/locations.yaml @@ -4790,9 +4790,9 @@ Metadata: Name Lookup: - Forest Temple Gale Boomerang - Switch Flag: + Item Flag: Stage: 8 - Flag: 0x59 + Flag: 0x9D - Name: Forest Temple Big Key Chest Original Item: Forest Temple Big Key @@ -4890,7 +4890,9 @@ FLW Message: - Group: 5 Message Id: 5001 - Event Flag: 0x0602 # late + Item Flag: + Stage: 7 + Flag: 0x9E # GORON MINES @@ -5754,7 +5756,9 @@ Metadata: Name Lookup: - Arbiters Grounds Dungeon Reward - Event Flag: 0x2010 + Item Flag: + Stage: 25 + Flag: 0x9E # SNOWPEAK RUINS @@ -6278,7 +6282,9 @@ FLW Message: - Group: 5 Message Id: 9401 - Event Flag: 0x2004 + Item Flag: + Stage: 10 + Flag: 0x9E # CITY IN THE SKY