From e07e0318666e9b05b2a78b7de0979d5706cc28b7 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 2 Mar 2024 21:17:14 -0500 Subject: Added sunwarp shuffle --- src/tracker_state.cpp | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'src/tracker_state.cpp') diff --git a/src/tracker_state.cpp b/src/tracker_state.cpp index 5a99254..0101e98 100644 --- a/src/tracker_state.cpp +++ b/src/tracker_state.cpp @@ -85,10 +85,17 @@ class StateCalculator { const Room& room_obj = GD_GetRoom(room_exit.destination_room); for (const Exit& out_edge : room_obj.exits) { - if (out_edge.type != EntranceType::kPainting || - !AP_IsPaintingShuffle()) { - new_boundary.push_back(out_edge); + if (out_edge.type == EntranceType::kPainting && + AP_IsPaintingShuffle()) { + continue; } + + if (out_edge.type == EntranceType::kSunwarp && + AP_IsSunwarpShuffle()) { + continue; + } + + new_boundary.push_back(out_edge); } if (AP_IsPaintingShuffle()) { @@ -104,6 +111,21 @@ class StateCalculator { } } + if (AP_IsSunwarpShuffle()) { + for (int index : room_obj.sunwarps) { + if (AP_GetSunwarpMapping().count(index)) { + const SunwarpMapping& sm = AP_GetSunwarpMapping().at(index); + + Exit sunwarp_exit; + sunwarp_exit.destination_room = + GD_GetRoomForSunwarp(sm.exit_index); + sunwarp_exit.door = GD_GetSunwarpDoors().at(sm.dots - 1); + + new_boundary.push_back(sunwarp_exit); + } + } + } + if (AP_HasEarlyColorHallways() && room_obj.name == "Starting Room") { new_boundary.push_back( {.destination_room = GD_GetRoomByName("Outside The Undeterred"), @@ -139,12 +161,14 @@ class StateCalculator { const std::set& GetReachableRooms() const { return reachable_rooms_; } - const std::map& GetDoorDecisions() const { return door_decisions_; } + const std::map& GetDoorDecisions() const { + return door_decisions_; + } const std::set& GetSolveablePanels() const { return solveable_panels_; } private: - Decision IsNonGroupedDoorReachable(const Door& door_obj) { + Decision IsNonGroupedDoorReachable(const Door& door_obj) { bool has_item = AP_HasItem(door_obj.ap_item_id); if (!has_item) { @@ -209,7 +233,7 @@ class StateCalculator { if (result != kMaybe) { door_decisions_[door_id] = result; } - + return result; } -- cgit 1.4.1