diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-05-06 12:44:17 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-05-06 12:44:17 -0400 |
commit | 86bb1a4c792704e8cce1bac1ca7c947a8742c396 (patch) | |
tree | da5e4c85b74e46a7b5528f55d791c5aea2b41ed4 | |
parent | d20664f90a84da691baeae5fb55bb28f409ed577 (diff) | |
download | lingo-ap-tracker-86bb1a4c792704e8cce1bac1ca7c947a8742c396.tar.gz lingo-ap-tracker-86bb1a4c792704e8cce1bac1ca7c947a8742c396.tar.bz2 lingo-ap-tracker-86bb1a4c792704e8cce1bac1ca7c947a8742c396.zip |
Detect fake pilgrimage
-rw-r--r-- | assets/pilgrimage.yaml | 21 | ||||
-rw-r--r-- | src/game_data.cpp | 24 |
2 files changed, 45 insertions, 0 deletions
diff --git a/assets/pilgrimage.yaml b/assets/pilgrimage.yaml new file mode 100644 index 0000000..5bd59f8 --- /dev/null +++ b/assets/pilgrimage.yaml | |||
@@ -0,0 +1,21 @@ | |||
1 | --- | ||
2 | - room: Starting Room | ||
3 | door: Main Door | ||
4 | - room: Second Room | ||
5 | door: Exit Door | ||
6 | - room: Crossroads | ||
7 | door: Tower Entrance | ||
8 | - room: Orange Tower Fourth Floor | ||
9 | door: Hot Crusts Door | ||
10 | - room: Outside The Initiated | ||
11 | door: Shortcut to Hub Room | ||
12 | - room: Orange Tower First Floor | ||
13 | door: Shortcut to Hub Room | ||
14 | - room: Directional Gallery | ||
15 | door: Shortcut to The Undeterred | ||
16 | - room: Orange Tower First Floor | ||
17 | door: Salt Pepper Door | ||
18 | - room: The Tenacious | ||
19 | door: Shortcut to Hub Room | ||
20 | - room: Outside The Agreeable | ||
21 | door: Tenacious Entrance | ||
diff --git a/src/game_data.cpp b/src/game_data.cpp index 8c6dd26..482818b 100644 --- a/src/game_data.cpp +++ b/src/game_data.cpp | |||
@@ -50,6 +50,7 @@ struct GameData { | |||
50 | GameData() { | 50 | GameData() { |
51 | YAML::Node lingo_config = YAML::LoadFile("assets/LL1.yaml"); | 51 | YAML::Node lingo_config = YAML::LoadFile("assets/LL1.yaml"); |
52 | YAML::Node areas_config = YAML::LoadFile("assets/areas.yaml"); | 52 | YAML::Node areas_config = YAML::LoadFile("assets/areas.yaml"); |
53 | YAML::Node pilgrimage_config = YAML::LoadFile("assets/pilgrimage.yaml"); | ||
53 | 54 | ||
54 | rooms_.reserve(lingo_config.size() * 2); | 55 | rooms_.reserve(lingo_config.size() * 2); |
55 | 56 | ||
@@ -374,6 +375,29 @@ struct GameData { | |||
374 | .panels = door.panels}); | 375 | .panels = door.panels}); |
375 | } | 376 | } |
376 | } | 377 | } |
378 | |||
379 | // Set up fake pilgrimage. | ||
380 | int fake_pilgrim_panel_id = | ||
381 | AddOrGetPanel("Starting Room", "!! Fake Pilgrimage Panel"); | ||
382 | Panel &fake_pilgrim_panel_obj = panels_[fake_pilgrim_panel_id]; | ||
383 | |||
384 | for (const auto &config_node : pilgrimage_config) { | ||
385 | fake_pilgrim_panel_obj.required_doors.push_back( | ||
386 | AddOrGetDoor(config_node["room"].as<std::string>(), | ||
387 | config_node["door"].as<std::string>())); | ||
388 | } | ||
389 | |||
390 | int fake_pilgrim_door_id = | ||
391 | AddOrGetDoor("Starting Room", "!! Fake Pilgrimage Door"); | ||
392 | Door &fake_pilgrim_door_obj = doors_[fake_pilgrim_door_id]; | ||
393 | fake_pilgrim_door_obj.panels.push_back(fake_pilgrim_panel_id); | ||
394 | fake_pilgrim_door_obj.skip_item = true; | ||
395 | |||
396 | int starting_room_id = AddOrGetRoom("Starting Room"); | ||
397 | Room &starting_room_obj = rooms_[starting_room_id]; | ||
398 | starting_room_obj.exits.push_back( | ||
399 | Exit{.destination_room = AddOrGetRoom("Pilgrim Antechamber"), | ||
400 | .door = fake_pilgrim_door_id}); | ||
377 | } | 401 | } |
378 | 402 | ||
379 | int AddOrGetRoom(std::string room) { | 403 | int AddOrGetRoom(std::string room) { |