about summary refs log tree commit diff stats
path: root/src/game_data.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-05-06 12:44:17 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-05-06 12:44:17 -0400
commit86bb1a4c792704e8cce1bac1ca7c947a8742c396 (patch)
treeda5e4c85b74e46a7b5528f55d791c5aea2b41ed4 /src/game_data.cpp
parentd20664f90a84da691baeae5fb55bb28f409ed577 (diff)
downloadlingo-ap-tracker-86bb1a4c792704e8cce1bac1ca7c947a8742c396.tar.gz
lingo-ap-tracker-86bb1a4c792704e8cce1bac1ca7c947a8742c396.tar.bz2
lingo-ap-tracker-86bb1a4c792704e8cce1bac1ca7c947a8742c396.zip
Detect fake pilgrimage
Diffstat (limited to 'src/game_data.cpp')
-rw-r--r--src/game_data.cpp24
1 files changed, 24 insertions, 0 deletions
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) {