about summary refs log tree commit diff stats
path: root/src/tracker_state.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-03-02 21:17:14 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2024-03-02 21:17:14 -0500
commite07e0318666e9b05b2a78b7de0979d5706cc28b7 (patch)
treee01a2587666d01a59eddb38003e008420505b845 /src/tracker_state.cpp
parent2c2d9e9f39ea780b5a04159f9c62fd5540471b86 (diff)
downloadlingo-ap-tracker-e07e0318666e9b05b2a78b7de0979d5706cc28b7.tar.gz
lingo-ap-tracker-e07e0318666e9b05b2a78b7de0979d5706cc28b7.tar.bz2
lingo-ap-tracker-e07e0318666e9b05b2a78b7de0979d5706cc28b7.zip
Added sunwarp shuffle
Diffstat (limited to 'src/tracker_state.cpp')
-rw-r--r--src/tracker_state.cpp36
1 files changed, 30 insertions, 6 deletions
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 {
85 85
86 const Room& room_obj = GD_GetRoom(room_exit.destination_room); 86 const Room& room_obj = GD_GetRoom(room_exit.destination_room);
87 for (const Exit& out_edge : room_obj.exits) { 87 for (const Exit& out_edge : room_obj.exits) {
88 if (out_edge.type != EntranceType::kPainting || 88 if (out_edge.type == EntranceType::kPainting &&
89 !AP_IsPaintingShuffle()) { 89 AP_IsPaintingShuffle()) {
90 new_boundary.push_back(out_edge); 90 continue;
91 } 91 }
92
93 if (out_edge.type == EntranceType::kSunwarp &&
94 AP_IsSunwarpShuffle()) {
95 continue;
96 }
97
98 new_boundary.push_back(out_edge);
92 } 99 }
93 100
94 if (AP_IsPaintingShuffle()) { 101 if (AP_IsPaintingShuffle()) {
@@ -104,6 +111,21 @@ class StateCalculator {
104 } 111 }
105 } 112 }
106 113
114 if (AP_IsSunwarpShuffle()) {
115 for (int index : room_obj.sunwarps) {
116 if (AP_GetSunwarpMapping().count(index)) {
117 const SunwarpMapping& sm = AP_GetSunwarpMapping().at(index);
118
119 Exit sunwarp_exit;
120 sunwarp_exit.destination_room =
121 GD_GetRoomForSunwarp(sm.exit_index);
122 sunwarp_exit.door = GD_GetSunwarpDoors().at(sm.dots - 1);
123
124 new_boundary.push_back(sunwarp_exit);
125 }
126 }
127 }
128
107 if (AP_HasEarlyColorHallways() && room_obj.name == "Starting Room") { 129 if (AP_HasEarlyColorHallways() && room_obj.name == "Starting Room") {
108 new_boundary.push_back( 130 new_boundary.push_back(
109 {.destination_room = GD_GetRoomByName("Outside The Undeterred"), 131 {.destination_room = GD_GetRoomByName("Outside The Undeterred"),
@@ -139,12 +161,14 @@ class StateCalculator {
139 161
140 const std::set<int>& GetReachableRooms() const { return reachable_rooms_; } 162 const std::set<int>& GetReachableRooms() const { return reachable_rooms_; }
141 163
142 const std::map<int, Decision>& GetDoorDecisions() const { return door_decisions_; } 164 const std::map<int, Decision>& GetDoorDecisions() const {
165 return door_decisions_;
166 }
143 167
144 const std::set<int>& GetSolveablePanels() const { return solveable_panels_; } 168 const std::set<int>& GetSolveablePanels() const { return solveable_panels_; }
145 169
146 private: 170 private:
147 Decision IsNonGroupedDoorReachable(const Door& door_obj) { 171 Decision IsNonGroupedDoorReachable(const Door& door_obj) {
148 bool has_item = AP_HasItem(door_obj.ap_item_id); 172 bool has_item = AP_HasItem(door_obj.ap_item_id);
149 173
150 if (!has_item) { 174 if (!has_item) {
@@ -209,7 +233,7 @@ class StateCalculator {
209 if (result != kMaybe) { 233 if (result != kMaybe) {
210 door_decisions_[door_id] = result; 234 door_decisions_[door_id] = result;
211 } 235 }
212 236
213 return result; 237 return result;
214 } 238 }
215 239