From 004fb711a86d91985d8e94e1b87089db2ac2cadc Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 16 Apr 2024 11:34:49 -0400 Subject: Support panels mode door shuffle --- src/ap_state.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/ap_state.cpp') diff --git a/src/ap_state.cpp b/src/ap_state.cpp index 58670e6..62c9f3f 100644 --- a/src/ap_state.cpp +++ b/src/ap_state.cpp @@ -57,6 +57,7 @@ struct APState { std::optional> player_pos; DoorShuffleMode door_shuffle_mode = kNO_DOORS; + bool group_doors = false; bool color_shuffle = false; bool painting_shuffle = false; int mastery_requirement = 21; @@ -128,6 +129,7 @@ struct APState { player_pos = std::nullopt; victory_data_storage_key.clear(); door_shuffle_mode = kNO_DOORS; + group_doors = false; color_shuffle = false; painting_shuffle = false; painting_mapping.clear(); @@ -212,6 +214,17 @@ struct APState { data_storage_prefix = "Lingo_" + std::to_string(apclient->get_player_number()) + "_"; door_shuffle_mode = slot_data["shuffle_doors"].get(); + if (slot_data.contains("group_doors")) { + group_doors = slot_data.contains("group_doors") && + slot_data["group_doors"].get() == 1; + } else { + // If group_doors doesn't exist yet, that means kPANELS_MODE is actually + // kSIMPLE_DOORS. + if (door_shuffle_mode == kPANELS_MODE) { + door_shuffle_mode = kDOORS_MODE; + group_doors = true; + } + } color_shuffle = slot_data["shuffle_colors"].get() == 1; painting_shuffle = slot_data["shuffle_paintings"].get() == 1; mastery_requirement = slot_data["mastery_achievements"].get(); @@ -346,7 +359,7 @@ struct APState { } else { data_storage.erase(key); } - + TrackerLog("Data storage " + key + " retrieved as null"); } } @@ -426,6 +439,8 @@ bool AP_HasItem(int item_id, int quantity) { DoorShuffleMode AP_GetDoorShuffleMode() { return GetState().door_shuffle_mode; } +bool AP_AreDoorsGrouped() { return GetState().group_doors; } + bool AP_IsColorShuffle() { return GetState().color_shuffle; } bool AP_IsPaintingShuffle() { return GetState().painting_shuffle; } -- cgit 1.4.1