about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-05-05 12:56:06 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-05-05 12:56:06 -0400
commitb6628ef515a57e5ba22aefb3ec5e6f7f60554e41 (patch)
treee558a3965565e4e504cdc811a0a8bc87274890b1
parentdbbde171593492396c702528004d6b49de6c0d51 (diff)
downloadlingo-ap-tracker-b6628ef515a57e5ba22aefb3ec5e6f7f60554e41.tar.gz
lingo-ap-tracker-b6628ef515a57e5ba22aefb3ec5e6f7f60554e41.tar.bz2
lingo-ap-tracker-b6628ef515a57e5ba22aefb3ec5e6f7f60554e41.zip
Added support for variable THE MASTER
-rw-r--r--ap_state.cpp5
-rw-r--r--ap_state.h2
-rwxr-xr-xassets/areas.yaml2
-rw-r--r--game_data.cpp8
-rw-r--r--game_data.h7
-rw-r--r--tracker_state.cpp16
6 files changed, 40 insertions, 0 deletions
diff --git a/ap_state.cpp b/ap_state.cpp index c13b87c..70f183e 100644 --- a/ap_state.cpp +++ b/ap_state.cpp
@@ -52,6 +52,7 @@ std::map<int64_t, std::string> progressive_item_by_ap_id;
52DoorShuffleMode door_shuffle_mode = kNO_DOORS; 52DoorShuffleMode door_shuffle_mode = kNO_DOORS;
53bool color_shuffle = false; 53bool color_shuffle = false;
54bool painting_shuffle = false; 54bool painting_shuffle = false;
55int mastery_requirement = 21;
55 56
56std::map<std::string, std::string> painting_mapping; 57std::map<std::string, std::string> painting_mapping;
57 58
@@ -116,6 +117,7 @@ void AP_Connect(std::string server, std::string player, std::string password) {
116 color_shuffle = false; 117 color_shuffle = false;
117 painting_shuffle = false; 118 painting_shuffle = false;
118 painting_mapping.clear(); 119 painting_mapping.clear();
120 mastery_requirement = 21;
119 121
120 connected = false; 122 connected = false;
121 has_connection_result = false; 123 has_connection_result = false;
@@ -166,6 +168,7 @@ void AP_Connect(std::string server, std::string player, std::string password) {
166 door_shuffle_mode = slot_data["shuffle_doors"].get<DoorShuffleMode>(); 168 door_shuffle_mode = slot_data["shuffle_doors"].get<DoorShuffleMode>();
167 color_shuffle = slot_data["shuffle_colors"].get<bool>(); 169 color_shuffle = slot_data["shuffle_colors"].get<bool>();
168 painting_shuffle = slot_data["shuffle_paintings"].get<bool>(); 170 painting_shuffle = slot_data["shuffle_paintings"].get<bool>();
171 mastery_requirement = slot_data["mastery_achievements"].get<int>();
169 172
170 if (painting_shuffle && slot_data.contains("painting_entrance_to_exit")) { 173 if (painting_shuffle && slot_data.contains("painting_entrance_to_exit")) {
171 painting_mapping.clear(); 174 painting_mapping.clear();
@@ -321,3 +324,5 @@ bool AP_IsPaintingShuffle() { return painting_shuffle; }
321const std::map<std::string, std::string> AP_GetPaintingMapping() { 324const std::map<std::string, std::string> AP_GetPaintingMapping() {
322 return painting_mapping; 325 return painting_mapping;
323} 326}
327
328int AP_GetMasteryRequirement() { return mastery_requirement; }
diff --git a/ap_state.h b/ap_state.h index 434b7b2..d880c71 100644 --- a/ap_state.h +++ b/ap_state.h
@@ -28,4 +28,6 @@ bool AP_IsPaintingShuffle();
28 28
29const std::map<std::string, std::string> AP_GetPaintingMapping(); 29const std::map<std::string, std::string> AP_GetPaintingMapping();
30 30
31int AP_GetMasteryRequirement();
32
31#endif /* end of include guard: AP_STATE_H_664A4180 */ 33#endif /* end of include guard: AP_STATE_H_664A4180 */
diff --git a/assets/areas.yaml b/assets/areas.yaml index fea1529..b2aa69f 100755 --- a/assets/areas.yaml +++ b/assets/areas.yaml
@@ -105,6 +105,8 @@
105 map: [908, 1632] 105 map: [908, 1632]
106 The Wanderer: 106 The Wanderer:
107 map: [1587, 1765] 107 map: [1587, 1765]
108 Outside The Wanderer:
109 fold_into: The Wanderer
108 Rhyme Room (Smiley): 110 Rhyme Room (Smiley):
109 fold_into: Rhyme Room 111 fold_into: Rhyme Room
110 Rhyme Room (Cross): 112 Rhyme Room (Cross):
diff --git a/game_data.cpp b/game_data.cpp index 9b31f89..e15847e 100644 --- a/game_data.cpp +++ b/game_data.cpp
@@ -157,6 +157,14 @@ GameData::GameData() {
157 panel_obj.check = panel_it.second["check"].as<bool>(); 157 panel_obj.check = panel_it.second["check"].as<bool>();
158 } 158 }
159 159
160 if (panel_it.second["achievement"]) {
161 panel_obj.achievement = panel_it.second["achievement"].as<bool>();
162
163 if (panel_obj.achievement) {
164 achievement_panels_.push_back(panel_id);
165 }
166 }
167
160 if (panel_it.second["exclude_reduce"]) { 168 if (panel_it.second["exclude_reduce"]) {
161 panel_obj.exclude_reduce = 169 panel_obj.exclude_reduce =
162 panel_it.second["exclude_reduce"].as<bool>(); 170 panel_it.second["exclude_reduce"].as<bool>();
diff --git a/game_data.h b/game_data.h index 2df8bc5..0cc7a7b 100644 --- a/game_data.h +++ b/game_data.h
@@ -28,6 +28,7 @@ struct Panel {
28 std::vector<int> required_doors; 28 std::vector<int> required_doors;
29 bool check = false; 29 bool check = false;
30 bool exclude_reduce = false; 30 bool exclude_reduce = false;
31 bool achievement = false;
31}; 32};
32 33
33struct ProgressiveRequirement { 34struct ProgressiveRequirement {
@@ -104,6 +105,10 @@ class GameData {
104 return room_by_painting_.at(painting_id); 105 return room_by_painting_.at(painting_id);
105 } 106 }
106 107
108 const std::vector<int>& GetAchievementPanels() const {
109 return achievement_panels_;
110 }
111
107 private: 112 private:
108 int AddOrGetRoom(std::string room); 113 int AddOrGetRoom(std::string room);
109 int AddOrGetDoor(std::string room, std::string door); 114 int AddOrGetDoor(std::string room, std::string door);
@@ -121,6 +126,8 @@ class GameData {
121 std::map<std::string, int> area_by_id_; 126 std::map<std::string, int> area_by_id_;
122 127
123 std::map<std::string, int> room_by_painting_; 128 std::map<std::string, int> room_by_painting_;
129
130 std::vector<int> achievement_panels_;
124}; 131};
125 132
126const GameData& GetGameData(); 133const GameData& GetGameData();
diff --git a/tracker_state.cpp b/tracker_state.cpp index 6eaf87a..858ec3e 100644 --- a/tracker_state.cpp +++ b/tracker_state.cpp
@@ -16,6 +16,22 @@ bool IsPanelReachable_Helper(int panel_id,
16 return false; 16 return false;
17 } 17 }
18 18
19 if (panel_obj.name == "THE MASTER") {
20 int achievements_accessible = 0;
21
22 for (int achieve_id : GetGameData().GetAchievementPanels()) {
23 if (IsPanelReachable_Helper(achieve_id, reachable_rooms)) {
24 achievements_accessible++;
25
26 if (achievements_accessible >= AP_GetMasteryRequirement()) {
27 break;
28 }
29 }
30 }
31
32 return (achievements_accessible >= AP_GetMasteryRequirement());
33 }
34
19 for (int room_id : panel_obj.required_rooms) { 35 for (int room_id : panel_obj.required_rooms) {
20 if (!reachable_rooms.count(room_id)) { 36 if (!reachable_rooms.count(room_id)) {
21 return false; 37 return false;