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/tracker_state.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src/tracker_state.cpp') diff --git a/src/tracker_state.cpp b/src/tracker_state.cpp index e02ee14..9d2c6d1 100644 --- a/src/tracker_state.cpp +++ b/src/tracker_state.cpp @@ -29,7 +29,7 @@ Decision IsDoorReachable_Helper(int door_id, const std::set& solveable_panels) { const Door& door_obj = GD_GetDoor(door_id); - if (AP_GetDoorShuffleMode() == kNO_DOORS || door_obj.skip_item) { + if (AP_GetDoorShuffleMode() != kDOORS_MODE || door_obj.skip_item) { if (!reachable_rooms.count(door_obj.room)) { return kMaybe; } @@ -41,7 +41,7 @@ Decision IsDoorReachable_Helper(int door_id, } return kYes; - } else if (AP_GetDoorShuffleMode() == kSIMPLE_DOORS && + } else if (AP_GetDoorShuffleMode() == kDOORS_MODE && AP_AreDoorsGrouped() && !door_obj.group_name.empty()) { return AP_HasItem(door_obj.group_ap_item_id) ? kYes : kNo; } else { @@ -136,6 +136,28 @@ Decision IsPanelReachable_Helper(int panel_id, } } + if (panel_obj.panel_door != -1 && AP_GetDoorShuffleMode() == kPANELS_MODE) { + const PanelDoor& panel_door_obj = GD_GetPanelDoor(panel_obj.panel_door); + + if (AP_AreDoorsGrouped() && panel_door_obj.group_ap_item_id != -1) { + return AP_HasItem(panel_door_obj.group_ap_item_id) ? kYes : kNo; + } else { + bool has_item = AP_HasItem(panel_door_obj.ap_item_id); + + if (!has_item) { + for (const ProgressiveRequirement& prog_req : + panel_door_obj.progressives) { + if (AP_HasItem(prog_req.ap_item_id, prog_req.quantity)) { + has_item = true; + break; + } + } + } + + return has_item ? kYes : kNo; + } + } + return kYes; } -- cgit 1.4.1