From 86bb1a4c792704e8cce1bac1ca7c947a8742c396 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 6 May 2023 12:44:17 -0400 Subject: Detect fake pilgrimage --- assets/pilgrimage.yaml | 21 +++++++++++++++++++++ src/game_data.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 assets/pilgrimage.yaml 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 @@ +--- + - room: Starting Room + door: Main Door + - room: Second Room + door: Exit Door + - room: Crossroads + door: Tower Entrance + - room: Orange Tower Fourth Floor + door: Hot Crusts Door + - room: Outside The Initiated + door: Shortcut to Hub Room + - room: Orange Tower First Floor + door: Shortcut to Hub Room + - room: Directional Gallery + door: Shortcut to The Undeterred + - room: Orange Tower First Floor + door: Salt Pepper Door + - room: The Tenacious + door: Shortcut to Hub Room + - room: Outside The Agreeable + 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 { GameData() { YAML::Node lingo_config = YAML::LoadFile("assets/LL1.yaml"); YAML::Node areas_config = YAML::LoadFile("assets/areas.yaml"); + YAML::Node pilgrimage_config = YAML::LoadFile("assets/pilgrimage.yaml"); rooms_.reserve(lingo_config.size() * 2); @@ -374,6 +375,29 @@ struct GameData { .panels = door.panels}); } } + + // Set up fake pilgrimage. + int fake_pilgrim_panel_id = + AddOrGetPanel("Starting Room", "!! Fake Pilgrimage Panel"); + Panel &fake_pilgrim_panel_obj = panels_[fake_pilgrim_panel_id]; + + for (const auto &config_node : pilgrimage_config) { + fake_pilgrim_panel_obj.required_doors.push_back( + AddOrGetDoor(config_node["room"].as(), + config_node["door"].as())); + } + + int fake_pilgrim_door_id = + AddOrGetDoor("Starting Room", "!! Fake Pilgrimage Door"); + Door &fake_pilgrim_door_obj = doors_[fake_pilgrim_door_id]; + fake_pilgrim_door_obj.panels.push_back(fake_pilgrim_panel_id); + fake_pilgrim_door_obj.skip_item = true; + + int starting_room_id = AddOrGetRoom("Starting Room"); + Room &starting_room_obj = rooms_[starting_room_id]; + starting_room_obj.exits.push_back( + Exit{.destination_room = AddOrGetRoom("Pilgrim Antechamber"), + .door = fake_pilgrim_door_id}); } int AddOrGetRoom(std::string room) { -- cgit 1.4.1