From 8784b85cbc8a655e01943f4ebf1c7bcdeca136e8 Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Mon, 15 Jan 2024 22:21:45 -0300 Subject: [PATCH] Convert S4 scenarios to JSON patches --- data/scenario_patches/Alton Towers.json | 9 ++ .../Blackpool Pleasure Beach.json | 24 +++++ data/scenario_patches/Dynamite Dunes.json | 9 ++ data/scenario_patches/Fort Anachronism.json | 9 ++ data/scenario_patches/Haunted Harbour.json | 9 ++ data/scenario_patches/Leafy Lake.json | 9 ++ data/scenario_patches/Mystic Mountain.json | 9 ++ data/scenario_patches/Nevermore Park.json | 9 ++ data/scenario_patches/Pacific Pyramids.json | 9 ++ data/scenario_patches/Pokey Park.json | 9 ++ data/scenario_patches/Urban Park.json | 14 +++ data/scenario_patches/Utopia Park.json | 9 ++ .../katie's dreamland - s4.json | 19 ++++ src/openrct2/rct1/S4Importer.cpp | 89 +------------------ 14 files changed, 150 insertions(+), 86 deletions(-) create mode 100644 data/scenario_patches/Alton Towers.json create mode 100644 data/scenario_patches/Blackpool Pleasure Beach.json create mode 100644 data/scenario_patches/Dynamite Dunes.json create mode 100644 data/scenario_patches/Fort Anachronism.json create mode 100644 data/scenario_patches/Haunted Harbour.json create mode 100644 data/scenario_patches/Leafy Lake.json create mode 100644 data/scenario_patches/Mystic Mountain.json create mode 100644 data/scenario_patches/Nevermore Park.json create mode 100644 data/scenario_patches/Pacific Pyramids.json create mode 100644 data/scenario_patches/Pokey Park.json create mode 100644 data/scenario_patches/Urban Park.json create mode 100644 data/scenario_patches/Utopia Park.json create mode 100644 data/scenario_patches/katie's dreamland - s4.json diff --git a/data/scenario_patches/Alton Towers.json b/data/scenario_patches/Alton Towers.json new file mode 100644 index 0000000000..00b835b9da --- /dev/null +++ b/data/scenario_patches/Alton Towers.json @@ -0,0 +1,9 @@ +{ + "land_ownership": { + "available": { + "coordinates": [ + [ 11, 31 ], [ 68, 112 ], [ 72, 118 ] + ] + } + } +} diff --git a/data/scenario_patches/Blackpool Pleasure Beach.json b/data/scenario_patches/Blackpool Pleasure Beach.json new file mode 100644 index 0000000000..ad64a5a69b --- /dev/null +++ b/data/scenario_patches/Blackpool Pleasure Beach.json @@ -0,0 +1,24 @@ +{ + "land_ownership": { + "owned": { + "coordinates": [ + [ 93, 23 ], + [ 94, 23 ], + [ 95, 23 ], + [ 95, 24 ], + [ 96, 24 ], + [ 96, 25 ], + [ 97, 25 ], + [ 97, 26 ], + [ 97, 27 ], + [ 96, 28 ] + ] + }, + "construction_rights_owned": { + "coordinates": [ + [ 94, 24 ], + [ 95, 25 ] + ] + } + } +} diff --git a/data/scenario_patches/Dynamite Dunes.json b/data/scenario_patches/Dynamite Dunes.json new file mode 100644 index 0000000000..eea7acd5ce --- /dev/null +++ b/data/scenario_patches/Dynamite Dunes.json @@ -0,0 +1,9 @@ +{ + "land_ownership": { + "available": { + "coordinates": [ + [ 97, 18 ], [ 99, 19 ], [ 83, 34 ] + ] + } + } +} diff --git a/data/scenario_patches/Fort Anachronism.json b/data/scenario_patches/Fort Anachronism.json new file mode 100644 index 0000000000..adaa214d9c --- /dev/null +++ b/data/scenario_patches/Fort Anachronism.json @@ -0,0 +1,9 @@ +{ + "land_ownership": { + "available": { + "coordinates": [ + [ 36, 87 ], [ 54, 29 ], [ 53, 88 ] + ] + } + } +} diff --git a/data/scenario_patches/Haunted Harbour.json b/data/scenario_patches/Haunted Harbour.json new file mode 100644 index 0000000000..5f4d0927b2 --- /dev/null +++ b/data/scenario_patches/Haunted Harbour.json @@ -0,0 +1,9 @@ +{ + "land_ownership": { + "available": { + "coordinates": [ + [ 49, 42 ] + ] + } + } +} diff --git a/data/scenario_patches/Leafy Lake.json b/data/scenario_patches/Leafy Lake.json new file mode 100644 index 0000000000..db3e60f2cf --- /dev/null +++ b/data/scenario_patches/Leafy Lake.json @@ -0,0 +1,9 @@ +{ + "land_ownership": { + "available": { + "coordinates": [ + [ 49, 66 ], [ 74, 96 ] + ] + } + } +} diff --git a/data/scenario_patches/Mystic Mountain.json b/data/scenario_patches/Mystic Mountain.json new file mode 100644 index 0000000000..7d03b4a4fc --- /dev/null +++ b/data/scenario_patches/Mystic Mountain.json @@ -0,0 +1,9 @@ +{ + "land_ownership": { + "available": { + "coordinates": [ + [ 98, 69 ], [ 98, 70 ], [ 103, 64 ], [ 53, 79 ], [ 86, 93 ], [ 87, 93 ] + ] + } + } +} diff --git a/data/scenario_patches/Nevermore Park.json b/data/scenario_patches/Nevermore Park.json new file mode 100644 index 0000000000..646aeac504 --- /dev/null +++ b/data/scenario_patches/Nevermore Park.json @@ -0,0 +1,9 @@ +{ + "land_ownership": { + "owned": { + "coordinates": [ + [ 9, 74 ] + ] + } + } +} diff --git a/data/scenario_patches/Pacific Pyramids.json b/data/scenario_patches/Pacific Pyramids.json new file mode 100644 index 0000000000..c8a59ea90f --- /dev/null +++ b/data/scenario_patches/Pacific Pyramids.json @@ -0,0 +1,9 @@ +{ + "land_ownership": { + "available": { + "coordinates": [ + [ 93, 105 ], [ 63, 34 ], [ 76, 25 ], [ 85, 31 ], [ 96, 47 ], [ 96, 48 ] + ] + } + } +} diff --git a/data/scenario_patches/Pokey Park.json b/data/scenario_patches/Pokey Park.json new file mode 100644 index 0000000000..875e0d446c --- /dev/null +++ b/data/scenario_patches/Pokey Park.json @@ -0,0 +1,9 @@ +{ + "land_ownership": { + "available": { + "coordinates": [ + [ 84, 71 ], [ 64, 102 ] + ] + } + } +} diff --git a/data/scenario_patches/Urban Park.json b/data/scenario_patches/Urban Park.json new file mode 100644 index 0000000000..a12f66bc04 --- /dev/null +++ b/data/scenario_patches/Urban Park.json @@ -0,0 +1,14 @@ +{ + "land_ownership": { + "owned": { + "coordinates": [ + [ 64, 77 ], [ 61, 66 ], [ 61, 67 ], [ 39, 20 ] + ] + }, + "construction_rights_available": { + "coordinates": [ + [ 46, 47 ] + ] + } + } +} diff --git a/data/scenario_patches/Utopia Park.json b/data/scenario_patches/Utopia Park.json new file mode 100644 index 0000000000..8905803983 --- /dev/null +++ b/data/scenario_patches/Utopia Park.json @@ -0,0 +1,9 @@ +{ + "land_ownership": { + "available": { + "coordinates": [ + [ 85, 73 ], [ 71, 75 ], [ 90, 73 ] + ] + } + } +} diff --git a/data/scenario_patches/katie's dreamland - s4.json b/data/scenario_patches/katie's dreamland - s4.json new file mode 100644 index 0000000000..39ebe21609 --- /dev/null +++ b/data/scenario_patches/katie's dreamland - s4.json @@ -0,0 +1,19 @@ +{ + "land_ownership": { + "available": { + "coordinates": [ + [ 74, 70 ], [ 75, 70 ], [ 76, 70 ], [ 77, 73 ], [ 80, 77 ] + ] + }, + "construction_rights_owned": { + "coordinates": [ + [ 115, 63 ], [ 105, 66 ], [ 109, 66 ], [ 118, 67 ] + ] + }, + "owned": { + "coordinates": [ + [ 45, 69 ], [ 59, 74 ] + ] + } + } +} diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 600c8cc08c..c06f729c02 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -51,6 +51,7 @@ #include "../peep/RideUseSystem.h" #include "../rct12/CSStringConverter.h" #include "../rct12/EntryList.h" +#include "../rct12/ScenarioPatcher.h" #include "../ride/RideData.h" #include "../ride/Station.h" #include "../ride/Track.h" @@ -2515,92 +2516,8 @@ namespace OpenRCT2::RCT1 void FixLandOwnership() { - switch (_s4.ScenarioSlotIndex) - { - case SC_DYNAMITE_DUNES: - FixLandOwnershipTiles({ { 97, 18 }, { 99, 19 }, { 83, 34 } }); - break; - case SC_LEAFY_LAKE: - FixLandOwnershipTiles({ { 49, 66 }, { 74, 96 } }); - break; - case SC_TRINITY_ISLANDS: - FixLandOwnershipTilesWithOwnership({ { 80, 60 } }, OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED); - break; - case SC_KATIES_DREAMLAND: - FixLandOwnershipTiles({ { 74, 70 }, { 75, 70 }, { 76, 70 }, { 77, 73 }, { 80, 77 } }); - FixLandOwnershipTilesWithOwnership( - { { 115, 63 }, { 105, 66 }, { 109, 66 }, { 118, 67 } }, OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED); - FixLandOwnershipTilesWithOwnership({ { 45, 69 }, { 59, 74 } }, OWNERSHIP_OWNED); - break; - case SC_POKEY_PARK: - FixLandOwnershipTiles({ { 84, 71 }, { 64, 102 } }); - break; - case SC_WHITE_WATER_PARK: - FixLandOwnershipTilesWithOwnership({ { 42, 85 }, { 89, 42 } }, OWNERSHIP_OWNED); - break; - case SC_MELS_WORLD: - FixLandOwnershipTilesWithOwnership({ { 93, 76 }, { 93, 77 } }, OWNERSHIP_OWNED); - break; - case SC_MYSTIC_MOUNTAIN: - FixLandOwnershipTiles({ { 98, 69 }, { 98, 70 }, { 103, 64 }, { 53, 79 }, { 86, 93 }, { 87, 93 } }); - break; - case SC_PACIFIC_PYRAMIDS: - FixLandOwnershipTiles({ { 93, 105 }, { 63, 34 }, { 76, 25 }, { 85, 31 }, { 96, 47 }, { 96, 48 } }); - break; - case SC_THREE_MONKEYS_PARK: - FixLandOwnershipTilesWithOwnership({ { 89, 92 } }, OWNERSHIP_UNOWNED); - FixLandOwnershipTilesWithOwnership({ { 46, 22 } }, OWNERSHIP_OWNED); - break; - case SC_HAUNTED_HARBOUR: - FixLandOwnershipTiles({ { 49, 42 } }); - break; - case SC_COASTER_CANYON: - FixLandOwnershipTilesWithOwnership({ { 21, 55 } }, OWNERSHIP_OWNED); - break; - case SC_UTOPIA_PARK: - FixLandOwnershipTiles({ { 85, 73 }, { 71, 75 }, { 90, 73 } }); - break; - case SC_ROTTING_HEIGHTS: - FixLandOwnershipTilesWithOwnership({ { 35, 20 } }, OWNERSHIP_OWNED); - break; - case SC_URBAN_PARK: - FixLandOwnershipTiles({ { 64, 77 }, { 61, 66 }, { 61, 67 }, { 39, 20 } }); - FixLandOwnershipTilesWithOwnership({ { 46, 47 } }, OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE); - break; - case SC_GRAND_GLACIER: - FixLandOwnershipTilesWithOwnership({ { 99, 58 } }, OWNERSHIP_OWNED); - break; - case SC_WOODWORM_PARK: - FixLandOwnershipTilesWithOwnership({ { 62, 105 }, { 101, 55 } }, OWNERSHIP_OWNED); - break; - case SC_PLEASURE_ISLAND: - FixLandOwnershipTilesWithOwnership({ { 37, 66 } }, OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED); - break; - case SC_NEVERMORE_PARK: - FixLandOwnershipTilesWithOwnership({ { 9, 74 } }, OWNERSHIP_OWNED); - break; - case SC_ALTON_TOWERS: - FixLandOwnershipTilesWithOwnership({ { 11, 31 }, { 68, 112 }, { 72, 118 } }, OWNERSHIP_OWNED); - break; - case SC_BLACKPOOL_PLEASURE_BEACH: - FixLandOwnershipTilesWithOwnership( - { { 93, 23 }, - { 94, 23 }, - { 95, 23 }, - { 95, 24 }, - { 96, 24 }, - { 96, 25 }, - { 97, 25 }, - { 97, 26 }, - { 97, 27 }, - { 96, 28 } }, - OWNERSHIP_OWNED); - FixLandOwnershipTilesWithOwnership({ { 94, 24 }, { 95, 25 } }, OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED); - break; - case SC_FORT_ANACHRONISM: - FixLandOwnershipTiles({ { 36, 87 }, { 54, 29 }, { 53, 88 } }); - break; - } + RCT12::FetchAndApplyScenarioPatch(_s4.ScenarioName); + // TODO: investigate why Katie's Dreamland.s4 and .sea have different patches } /**