diff options
Diffstat (limited to 'src/game_data.cpp')
| -rw-r--r-- | src/game_data.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
| 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 { | |||
| 53 | std::vector<int> door_definition_order_; | 53 | std::vector<int> door_definition_order_; |
| 54 | 54 | ||
| 55 | std::map<std::string, int> room_by_painting_; | 55 | std::map<std::string, int> room_by_painting_; |
| 56 | std::map<int, int> room_by_sunwarp_; | ||
| 56 | 57 | ||
| 57 | std::vector<int> achievement_panels_; | 58 | std::vector<int> achievement_panels_; |
| 58 | 59 | ||
| @@ -112,7 +113,8 @@ struct GameData { | |||
| 112 | if (option["room"]) { | 113 | if (option["room"]) { |
| 113 | door_room = option["room"].as<std::string>(); | 114 | door_room = option["room"].as<std::string>(); |
| 114 | } | 115 | } |
| 115 | exit_obj.door = AddOrGetDoor(door_room, option["door"].as<std::string>()); | 116 | exit_obj.door = |
| 117 | AddOrGetDoor(door_room, option["door"].as<std::string>()); | ||
| 116 | } | 118 | } |
| 117 | 119 | ||
| 118 | if (option["painting"] && option["painting"].as<bool>()) { | 120 | if (option["painting"] && option["painting"].as<bool>()) { |
| @@ -443,6 +445,18 @@ struct GameData { | |||
| 443 | } | 445 | } |
| 444 | } | 446 | } |
| 445 | 447 | ||
| 448 | if (room_it.second["sunwarps"]) { | ||
| 449 | for (const auto &sunwarp : room_it.second["sunwarps"]) { | ||
| 450 | int index = sunwarp["dots"].as<int>() - 1; | ||
| 451 | if (sunwarp["direction"].as<std::string>() == "exit") { | ||
| 452 | index += 6; | ||
| 453 | } | ||
| 454 | |||
| 455 | rooms_[room_id].sunwarps.push_back(index); | ||
| 456 | room_by_sunwarp_[index] = room_id; | ||
| 457 | } | ||
| 458 | } | ||
| 459 | |||
| 446 | if (room_it.second["progression"]) { | 460 | if (room_it.second["progression"]) { |
| 447 | for (const auto &progression_it : room_it.second["progression"]) { | 461 | for (const auto &progression_it : room_it.second["progression"]) { |
| 448 | std::string progressive_item_name = | 462 | std::string progressive_item_name = |
| @@ -686,3 +700,7 @@ int GD_GetItemIdForColor(LingoColor color) { | |||
| 686 | const std::vector<int> &GD_GetSunwarpDoors() { | 700 | const std::vector<int> &GD_GetSunwarpDoors() { |
| 687 | return GetState().sunwarp_doors_; | 701 | return GetState().sunwarp_doors_; |
| 688 | } | 702 | } |
| 703 | |||
| 704 | int GD_GetRoomForSunwarp(int index) { | ||
| 705 | return GetState().room_by_sunwarp_.at(index); | ||
| 706 | } | ||
