From e07e0318666e9b05b2a78b7de0979d5706cc28b7 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 2 Mar 2024 21:17:14 -0500 Subject: Added sunwarp shuffle --- src/game_data.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/game_data.cpp') diff --git a/src/game_data.cpp b/src/game_data.cpp index 75c5b7e..7db6413 100644 --- a/src/game_data.cpp +++ b/src/game_data.cpp @@ -53,6 +53,7 @@ struct GameData { std::vector door_definition_order_; std::map room_by_painting_; + std::map room_by_sunwarp_; std::vector achievement_panels_; @@ -112,7 +113,8 @@ struct GameData { if (option["room"]) { door_room = option["room"].as(); } - exit_obj.door = AddOrGetDoor(door_room, option["door"].as()); + exit_obj.door = + AddOrGetDoor(door_room, option["door"].as()); } if (option["painting"] && option["painting"].as()) { @@ -443,6 +445,18 @@ struct GameData { } } + if (room_it.second["sunwarps"]) { + for (const auto &sunwarp : room_it.second["sunwarps"]) { + int index = sunwarp["dots"].as() - 1; + if (sunwarp["direction"].as() == "exit") { + index += 6; + } + + rooms_[room_id].sunwarps.push_back(index); + room_by_sunwarp_[index] = room_id; + } + } + if (room_it.second["progression"]) { for (const auto &progression_it : room_it.second["progression"]) { std::string progressive_item_name = @@ -686,3 +700,7 @@ int GD_GetItemIdForColor(LingoColor color) { const std::vector &GD_GetSunwarpDoors() { return GetState().sunwarp_doors_; } + +int GD_GetRoomForSunwarp(int index) { + return GetState().room_by_sunwarp_.at(index); +} -- cgit 1.4.1