diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_Anchor.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor_Anchor.cpp index 8cf52f13713..6746d63a6e7 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_Anchor.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_Anchor.cpp @@ -162,6 +162,7 @@ void to_json(json& j, const SaveContext& saveContext) { {"inventory", saveContext.inventory}, {"sohStats", saveContext.sohStats}, {"adultTradeItems", saveContext.adultTradeItems}, + {"triforcePiecesCollected", saveContext.triforcePiecesCollected}, }; } @@ -183,11 +184,12 @@ void from_json(const json& j, SaveContext& saveContext) { j.at("inventory").get_to(saveContext.inventory); j.at("sohStats").get_to(saveContext.sohStats); j.at("adultTradeItems").get_to(saveContext.adultTradeItems); + j.contains("triforcePiecesCollected") && j.at("triforcePiecesCollected").get_to(saveContext.triforcePiecesCollected); } std::map GameInteractorAnchor::AnchorClients = {}; std::vector GameInteractorAnchor::FairyIndexToClientId = {}; -std::string GameInteractorAnchor::clientVersion = "Anchor Build 11"; +std::string GameInteractorAnchor::clientVersion = "Anchor + Triforce Hunt 5"; std::string GameInteractorAnchor::seed = "00000"; std::vector> receivedItems = {}; std::vector anchorMessages = {}; @@ -473,6 +475,7 @@ void Anchor_ParseSaveStateFromRemote(nlohmann::json payload) { gSaveContext.swordHealth = loadedData.swordHealth; // TODO: Packet to live update this gSaveContext.adultTradeItems = loadedData.adultTradeItems; + gSaveContext.triforcePiecesCollected = loadedData.triforcePiecesCollected; for (int i = 0; i < 124; i++) { gSaveContext.sceneFlags[i] = loadedData.sceneFlags[i]; diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index 43f876aa800..4c954539297 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -780,7 +780,7 @@ void RegisterTriforceHunt() { // Give Boss Key when player loads back into the savefile. if (currentPieces >= requiredPieces && gPlayState->sceneLoadFlag != 0x14 && - (1 << 0 & gSaveContext.inventory.dungeonItems[SCENE_GANON]) == 0) { + (1 << 0 & gSaveContext.inventory.dungeonItems[SCENE_GANONS_TOWER]) == 0) { GetItemEntry getItemEntry = ItemTableManager::Instance->RetrieveItemEntry(MOD_RANDOMIZER, RG_GANONS_CASTLE_BOSS_KEY); GiveItemEntryWithoutActor(gPlayState, getItemEntry); } diff --git a/soh/soh/util.cpp b/soh/soh/util.cpp index 264c7b045fc..12d92562baa 100644 --- a/soh/soh/util.cpp +++ b/soh/soh/util.cpp @@ -470,6 +470,7 @@ std::vector randomizerItemNames = { "Buy Red Potion (40)", "Buy Red Potion (50)", "Triforce", + "Triforce Piece", "Hint", "Tycoon Wallet" }; @@ -628,7 +629,8 @@ std::map itemIcons = { ITEM_ICON(ITEM_DUNGEON_MAP), ITEM_ICON(ITEM_KEY_SMALL), ITEM_ICON(ITEM_MAGIC_SMALL), - ITEM_ICON(ITEM_MAGIC_LARGE) + ITEM_ICON(ITEM_MAGIC_LARGE), + ITEM_ICON(RG_TRIFORCE_PIECE), }; std::map randomizerGetToItemIdIcon = { @@ -824,6 +826,7 @@ std::map randomizerGetToItemIdIcon = { { RG_BUY_RED_POTION_40, ITEM_POTION_RED }, { RG_BUY_RED_POTION_50, ITEM_POTION_RED }, { RG_TYCOON_WALLET, ITEM_WALLET_GIANT }, + { RG_TRIFORCE_PIECE, RG_TRIFORCE_PIECE }, }; int32_t SohUtils::GetItemIdIconFromRandomizerGet(int32_t randomizerGet) {