about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-09-28 13:48:57 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-09-28 13:48:57 -0400
commit18eccff16c3cd97ee02685d753ffefbaa7bbbb4c (patch)
tree5c1abfc991415a8f2a58f18cd70e6793cebd600e
parentd3654cb4846f186486ebf7ac205a2d677a930440 (diff)
downloadlingo-ap-tracker-0.5.3.tar.gz
lingo-ap-tracker-0.5.3.tar.bz2
lingo-ap-tracker-0.5.3.zip
Added early color hallways support v0.5.3
-rw-r--r--src/ap_state.cpp6
-rw-r--r--src/ap_state.h2
-rw-r--r--src/tracker_state.cpp5
3 files changed, 13 insertions, 0 deletions
diff --git a/src/ap_state.cpp b/src/ap_state.cpp index 8bc7ed0..50601d4 100644 --- a/src/ap_state.cpp +++ b/src/ap_state.cpp
@@ -59,6 +59,7 @@ struct APState {
59 int level_2_requirement = 223; 59 int level_2_requirement = 223;
60 LocationChecks location_checks = kNORMAL_LOCATIONS; 60 LocationChecks location_checks = kNORMAL_LOCATIONS;
61 VictoryCondition victory_condition = kTHE_END; 61 VictoryCondition victory_condition = kTHE_END;
62 bool early_color_hallways = false;
62 63
63 std::map<std::string, std::string> painting_mapping; 64 std::map<std::string, std::string> painting_mapping;
64 65
@@ -119,6 +120,7 @@ struct APState {
119 level_2_requirement = 223; 120 level_2_requirement = 223;
120 location_checks = kNORMAL_LOCATIONS; 121 location_checks = kNORMAL_LOCATIONS;
121 victory_condition = kTHE_END; 122 victory_condition = kTHE_END;
123 early_color_hallways = false;
122 124
123 connected = false; 125 connected = false;
124 has_connection_result = false; 126 has_connection_result = false;
@@ -211,6 +213,8 @@ struct APState {
211 location_checks = slot_data["location_checks"].get<LocationChecks>(); 213 location_checks = slot_data["location_checks"].get<LocationChecks>();
212 victory_condition = 214 victory_condition =
213 slot_data["victory_condition"].get<VictoryCondition>(); 215 slot_data["victory_condition"].get<VictoryCondition>();
216 early_color_hallways = slot_data.contains("early_color_hallways") &&
217 slot_data["early_color_hallways"].get<int>() == 1;
214 218
215 if (painting_shuffle && slot_data.contains("painting_entrance_to_exit")) { 219 if (painting_shuffle && slot_data.contains("painting_entrance_to_exit")) {
216 painting_mapping.clear(); 220 painting_mapping.clear();
@@ -394,3 +398,5 @@ VictoryCondition AP_GetVictoryCondition() {
394bool AP_HasAchievement(const std::string& achievement_name) { 398bool AP_HasAchievement(const std::string& achievement_name) {
395 return GetState().HasAchievement(achievement_name); 399 return GetState().HasAchievement(achievement_name);
396} 400}
401
402bool AP_HasEarlyColorHallways() { return GetState().early_color_hallways; }
diff --git a/src/ap_state.h b/src/ap_state.h index 64caeea..3fd51aa 100644 --- a/src/ap_state.h +++ b/src/ap_state.h
@@ -40,4 +40,6 @@ VictoryCondition AP_GetVictoryCondition();
40 40
41bool AP_HasAchievement(const std::string& achievement_name); 41bool AP_HasAchievement(const std::string& achievement_name);
42 42
43bool AP_HasEarlyColorHallways();
44
43#endif /* end of include guard: AP_STATE_H_664A4180 */ 45#endif /* end of include guard: AP_STATE_H_664A4180 */
diff --git a/src/tracker_state.cpp b/src/tracker_state.cpp index 0976461..002f447 100644 --- a/src/tracker_state.cpp +++ b/src/tracker_state.cpp
@@ -148,6 +148,11 @@ void RecalculateReachability() {
148 std::list<Exit> flood_boundary; 148 std::list<Exit> flood_boundary;
149 flood_boundary.push_back({.destination_room = GD_GetRoomByName("Menu")}); 149 flood_boundary.push_back({.destination_room = GD_GetRoomByName("Menu")});
150 150
151 if (AP_HasEarlyColorHallways()) {
152 flood_boundary.push_back(
153 {.destination_room = GD_GetRoomByName("Outside The Undeterred")});
154 }
155
151 bool reachable_changed = true; 156 bool reachable_changed = true;
152 while (reachable_changed) { 157 while (reachable_changed) {
153 reachable_changed = false; 158 reachable_changed = false;