about summary refs log tree commit diff stats
path: root/src/game_data.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-03-02 21:17:14 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2024-03-02 21:17:14 -0500
commite07e0318666e9b05b2a78b7de0979d5706cc28b7 (patch)
treee01a2587666d01a59eddb38003e008420505b845 /src/game_data.cpp
parent2c2d9e9f39ea780b5a04159f9c62fd5540471b86 (diff)
downloadlingo-ap-tracker-e07e0318666e9b05b2a78b7de0979d5706cc28b7.tar.gz
lingo-ap-tracker-e07e0318666e9b05b2a78b7de0979d5706cc28b7.tar.bz2
lingo-ap-tracker-e07e0318666e9b05b2a78b7de0979d5706cc28b7.zip
Added sunwarp shuffle
Diffstat (limited to 'src/game_data.cpp')
-rw-r--r--src/game_data.cpp20
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) {
686const std::vector<int> &GD_GetSunwarpDoors() { 700const std::vector<int> &GD_GetSunwarpDoors() {
687 return GetState().sunwarp_doors_; 701 return GetState().sunwarp_doors_;
688} 702}
703
704int GD_GetRoomForSunwarp(int index) {
705 return GetState().room_by_sunwarp_.at(index);
706}