Skip to content

Commit

Permalink
Anchor + Triforce Hunt 5
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettjoecox committed Sep 4, 2023
1 parent dbb2229 commit 7228232
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ void to_json(json& j, const SaveContext& saveContext) {
{"inventory", saveContext.inventory},
{"sohStats", saveContext.sohStats},
{"adultTradeItems", saveContext.adultTradeItems},
{"triforcePiecesCollected", saveContext.triforcePiecesCollected},
};
}

Expand All @@ -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<uint32_t, AnchorClient> GameInteractorAnchor::AnchorClients = {};
std::vector<uint32_t> GameInteractorAnchor::FairyIndexToClientId = {};
std::string GameInteractorAnchor::clientVersion = "Anchor Build 11";
std::string GameInteractorAnchor::clientVersion = "Anchor + Triforce Hunt 5";
std::string GameInteractorAnchor::seed = "00000";
std::vector<std::pair<uint16_t, int16_t>> receivedItems = {};
std::vector<AnchorMessage> anchorMessages = {};
Expand Down Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion soh/soh/Enhancements/mods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
5 changes: 4 additions & 1 deletion soh/soh/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ std::vector<std::string> randomizerItemNames = {
"Buy Red Potion (40)",
"Buy Red Potion (50)",
"Triforce",
"Triforce Piece",
"Hint",
"Tycoon Wallet"
};
Expand Down Expand Up @@ -628,7 +629,8 @@ std::map<uint32_t, const char*> 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<int32_t, int32_t> randomizerGetToItemIdIcon = {
Expand Down Expand Up @@ -824,6 +826,7 @@ std::map<int32_t, int32_t> 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) {
Expand Down

0 comments on commit 7228232

Please sign in to comment.