about summary refs log tree commit diff stats
path: root/src/ap_state.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-08-25 22:14:51 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-08-25 22:14:51 -0400
commit9bf6a50624284ab7422f56375b3e57c894200faf (patch)
tree9951ee08e5ebbed1363d190b57fa01606e0fbb94 /src/ap_state.cpp
parentbaf43ede759f9ff0ca8c71de764e0389469f9ae1 (diff)
downloadlingo-ap-tracker-9bf6a50624284ab7422f56375b3e57c894200faf.tar.gz
lingo-ap-tracker-9bf6a50624284ab7422f56375b3e57c894200faf.tar.bz2
lingo-ap-tracker-9bf6a50624284ab7422f56375b3e57c894200faf.zip
Panelsanity support
Diffstat (limited to 'src/ap_state.cpp')
-rw-r--r--src/ap_state.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/ap_state.cpp b/src/ap_state.cpp index 02f1f5a..ced4f83 100644 --- a/src/ap_state.cpp +++ b/src/ap_state.cpp
@@ -62,7 +62,7 @@ struct APState {
62 bool painting_shuffle = false; 62 bool painting_shuffle = false;
63 int mastery_requirement = 21; 63 int mastery_requirement = 21;
64 int level_2_requirement = 223; 64 int level_2_requirement = 223;
65 bool reduce_checks = false; 65 LocationChecks location_checks = kNORMAL_LOCATIONS;
66 VictoryCondition victory_condition = kTHE_END; 66 VictoryCondition victory_condition = kTHE_END;
67 67
68 std::map<std::string, std::string> painting_mapping; 68 std::map<std::string, std::string> painting_mapping;
@@ -122,7 +122,7 @@ struct APState {
122 painting_mapping.clear(); 122 painting_mapping.clear();
123 mastery_requirement = 21; 123 mastery_requirement = 21;
124 level_2_requirement = 223; 124 level_2_requirement = 223;
125 reduce_checks = false; 125 location_checks = kNORMAL_LOCATIONS;
126 victory_condition = kTHE_END; 126 victory_condition = kTHE_END;
127 127
128 connected = false; 128 connected = false;
@@ -209,12 +209,11 @@ struct APState {
209 data_storage_prefix = 209 data_storage_prefix =
210 "Lingo_" + std::to_string(apclient->get_player_number()) + "_"; 210 "Lingo_" + std::to_string(apclient->get_player_number()) + "_";
211 door_shuffle_mode = slot_data["shuffle_doors"].get<DoorShuffleMode>(); 211 door_shuffle_mode = slot_data["shuffle_doors"].get<DoorShuffleMode>();
212 color_shuffle = slot_data["shuffle_colors"].get<bool>(); 212 color_shuffle = slot_data["shuffle_colors"].get<int>() == 1;
213 painting_shuffle = slot_data["shuffle_paintings"].get<bool>(); 213 painting_shuffle = slot_data["shuffle_paintings"].get<int>() == 1;
214 mastery_requirement = slot_data["mastery_achievements"].get<int>(); 214 mastery_requirement = slot_data["mastery_achievements"].get<int>();
215 level_2_requirement = slot_data["level_2_requirement"].get<int>(); 215 level_2_requirement = slot_data["level_2_requirement"].get<int>();
216 reduce_checks = (door_shuffle_mode == kNO_DOORS) && 216 location_checks = slot_data["location_checks"].get<LocationChecks>();
217 slot_data["reduce_checks"].get<bool>();
218 victory_condition = 217 victory_condition =
219 slot_data["victory_condition"].get<VictoryCondition>(); 218 slot_data["victory_condition"].get<VictoryCondition>();
220 219
@@ -444,7 +443,16 @@ int AP_GetMasteryRequirement() { return GetState().mastery_requirement; }
444 443
445int AP_GetLevel2Requirement() { return GetState().level_2_requirement; } 444int AP_GetLevel2Requirement() { return GetState().level_2_requirement; }
446 445
447bool AP_IsReduceChecks() { return GetState().reduce_checks; } 446bool AP_IsLocationVisible(int classification) {
447 switch (GetState().location_checks) {
448 case kNORMAL_LOCATIONS:
449 return classification & kLOCATION_NORMAL;
450 case kREDUCED_LOCATIONS:
451 return classification & kLOCATION_REDUCED;
452 case kPANELSANITY:
453 return classification & kLOCATION_INSANITY;
454 }
455}
448 456
449VictoryCondition AP_GetVictoryCondition() { 457VictoryCondition AP_GetVictoryCondition() {
450 return GetState().victory_condition; 458 return GetState().victory_condition;