1 /*****************************************************************************
2 * Copyright (c) 2014-2020 OpenRCT2 developers
3 *
4 * For a complete list of all authors, please refer to contributors.md
5 * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
6 *
7 * OpenRCT2 is licensed under the GNU General Public License version 3.
8 *****************************************************************************/
9
10 /**
11 * Whether a particular ride has a running track or not. Will probably end up
12 * being used in various places in the game.
13 *
14 * Data source is 0x0097E3AC
15 *
16 * Generating function is here
17 * https://gist.github.com/kevinburke/eaeb1d8149a6eef0dcc1
18 */
19
20 #include "RideData.h"
21
22 #include "../Cheats.h"
23 #include "../audio/audio.h"
24 #include "../interface/Colour.h"
25 #include "../localisation/Localisation.h"
26 #include "../management/Research.h"
27 #include "../sprites.h"
28 #include "Ride.h"
29 #include "ShopItem.h"
30 #include "Track.h"
31 #include "Vehicle.h"
32 #include "coaster/meta/AirPoweredVerticalCoaster.h"
33 #include "coaster/meta/BobsleighCoaster.h"
34 #include "coaster/meta/ClassicMiniRollerCoaster.h"
35 #include "coaster/meta/CompactInvertedCoaster.h"
36 #include "coaster/meta/CorkscrewRollerCoaster.h"
37 #include "coaster/meta/FlyingRollerCoaster.h"
38 #include "coaster/meta/GigaCoaster.h"
39 #include "coaster/meta/HeartlineTwisterCoaster.h"
40 #include "coaster/meta/HybridCoaster.h"
41 #include "coaster/meta/HyperTwister.h"
42 #include "coaster/meta/Hypercoaster.h"
43 #include "coaster/meta/InvertedHairpinCoaster.h"
44 #include "coaster/meta/InvertedImpulseCoaster.h"
45 #include "coaster/meta/InvertedRollerCoaster.h"
46 #include "coaster/meta/JuniorRollerCoaster.h"
47 #include "coaster/meta/LIMLaunchedRollerCoaster.h"
48 #include "coaster/meta/LayDownRollerCoaster.h"
49 #include "coaster/meta/LoopingRollerCoaster.h"
50 #include "coaster/meta/MineRide.h"
51 #include "coaster/meta/MineTrainCoaster.h"
52 #include "coaster/meta/MiniRollerCoaster.h"
53 #include "coaster/meta/MiniSuspendedCoaster.h"
54 #include "coaster/meta/MultiDimensionRollerCoaster.h"
55 #include "coaster/meta/ReverseFreefallCoaster.h"
56 #include "coaster/meta/ReverserRollerCoaster.h"
57 #include "coaster/meta/SideFrictionRollerCoaster.h"
58 #include "coaster/meta/SingleRailRollerCoaster.h"
59 #include "coaster/meta/SpinningWildMouse.h"
60 #include "coaster/meta/SpiralRollerCoaster.h"
61 #include "coaster/meta/StandUpRollerCoaster.h"
62 #include "coaster/meta/SteelWildMouse.h"
63 #include "coaster/meta/Steeplechase.h"
64 #include "coaster/meta/SuspendedSwingingCoaster.h"
65 #include "coaster/meta/TwisterRollerCoaster.h"
66 #include "coaster/meta/VerticalDropCoaster.h"
67 #include "coaster/meta/VirginiaReel.h"
68 #include "coaster/meta/WaterCoaster.h"
69 #include "coaster/meta/WoodenRollerCoaster.h"
70 #include "coaster/meta/WoodenWildMouse.h"
71 #include "gentle/meta/CarRide.h"
72 #include "gentle/meta/Circus.h"
73 #include "gentle/meta/CrookedHouse.h"
74 #include "gentle/meta/Dodgems.h"
75 #include "gentle/meta/FerrisWheel.h"
76 #include "gentle/meta/FlyingSaucers.h"
77 #include "gentle/meta/GhostTrain.h"
78 #include "gentle/meta/HauntedHouse.h"
79 #include "gentle/meta/Maze.h"
80 #include "gentle/meta/MerryGoRound.h"
81 #include "gentle/meta/MiniGolf.h"
82 #include "gentle/meta/MiniHelicopters.h"
83 #include "gentle/meta/MonorailCycles.h"
84 #include "gentle/meta/MonsterTrucks.h"
85 #include "gentle/meta/ObservationTower.h"
86 #include "gentle/meta/SpaceRings.h"
87 #include "gentle/meta/SpiralSlide.h"
88 #include "shops/meta/CashMachine.h"
89 #include "shops/meta/DrinkStall.h"
90 #include "shops/meta/FirstAid.h"
91 #include "shops/meta/FoodStall.h"
92 #include "shops/meta/InformationKiosk.h"
93 #include "shops/meta/Shop.h"
94 #include "shops/meta/Toilets.h"
95 #include "thrill/meta/3DCinema.h"
96 #include "thrill/meta/Enterprise.h"
97 #include "thrill/meta/GoKarts.h"
98 #include "thrill/meta/LaunchedFreefall.h"
99 #include "thrill/meta/MagicCarpet.h"
100 #include "thrill/meta/MotionSimulator.h"
101 #include "thrill/meta/RotoDrop.h"
102 #include "thrill/meta/SwingingInverterShip.h"
103 #include "thrill/meta/SwingingShip.h"
104 #include "thrill/meta/TopSpin.h"
105 #include "thrill/meta/Twist.h"
106 #include "transport/meta/Chairlift.h"
107 #include "transport/meta/Lift.h"
108 #include "transport/meta/MiniatureRailway.h"
109 #include "transport/meta/Monorail.h"
110 #include "transport/meta/SuspendedMonorail.h"
111 #include "water/meta/BoatHire.h"
112 #include "water/meta/DinghySlide.h"
113 #include "water/meta/LogFlume.h"
114 #include "water/meta/RiverRafts.h"
115 #include "water/meta/RiverRapids.h"
116 #include "water/meta/SplashBoats.h"
117 #include "water/meta/SubmarineRide.h"
118
119 #include <iterator>
120
121 // clang-format off
122
123 const rct_ride_entry_vehicle CableLiftVehicle = {
124 /* .rotation_frame_mask = */ 31,
125 /* .num_vertical_frames = */ 0,
126 /* .num_horizontal_frames = */ 0,
127 /* .spacing = */ 0,
128 /* .car_mass = */ 0,
129 /* .tab_height = */ 0,
130 /* .num_seats = */ 0,
131 /* .sprite_flags = */ VEHICLE_SPRITE_FLAG_FLAT | VEHICLE_SPRITE_FLAG_GENTLE_SLOPES | VEHICLE_SPRITE_FLAG_STEEP_SLOPES,
132 /* .sprite_width = */ 0,
133 /* .sprite_height_negative = */ 0,
134 /* .sprite_height_positive = */ 0,
135 /* .animation = */ 0,
136 /* .flags = */ 0,
137 /* .base_num_frames = */ 1,
138 /* .base_image_id = */ 29110,
139 /* .restraint_image_id = */ 0,
140 /* .gentle_slope_image_id = */ 29142,
141 /* .steep_slope_image_id = */ 29214,
142 /* .vertical_slope_image_id = */ 0,
143 /* .diagonal_slope_image_id = */ 0,
144 /* .banked_image_id = */ 0,
145 /* .inline_twist_image_id = */ 0,
146 /* .flat_to_gentle_bank_image_id = */ 0,
147 /* .diagonal_to_gentle_slope_bank_image_id = */ 0,
148 /* .gentle_slope_to_bank_image_id = */ 0,
149 /* .gentle_slope_bank_turn_image_id = */ 0,
150 /* .flat_bank_to_gentle_slope_image_id = */ 0,
151 /* .corkscrew_image_id = */ 0,
152 /* .no_vehicle_images = */ 0,
153 /* .no_seating_rows = */ 0,
154 /* .spinning_inertia = */ 0,
155 /* .spinning_friction = */ 255,
156 /* .friction_sound_id = */ OpenRCT2::Audio::SoundId::LiftClassic,
157 /* .log_flume_reverser_vehicle_type = */ 0,
158 /* .sound_range = */ 0,
159 /* .double_sound_frequency = */ 0,
160 /* .powered_acceleration = */ 0,
161 /* .powered_max_speed = */ 0,
162 /* .car_visual = */ 0,
163 /* .effect_visual = */ 1,
164 /* .draw_order = */ 14,
165 /* .num_vertical_frames_override = */ 0,
166 /* .peep_loading_positions = */ 0
167 };
168
169 /* rct2: 0x009A0AA0 */
170 const uint16_t RideFilmLength[3] = {
171 5000, // MOUSE_TAILS
172 6000, // STORM_CHASERS
173 7000, // SPACE_RAIDERS
174 };
175
176 const rct_string_id RideModeNames[] = {
177 STR_RIDE_MODE_NORMAL,
178 STR_RIDE_MODE_CONTINUOUS_CIRCUIT,
179 STR_RIDE_MODE_REVERSE_INCLINE_LAUNCHED_SHUTTLE,
180 STR_RIDE_MODE_POWERED_LAUNCH_PASSTROUGH,
181 STR_RIDE_MODE_SHUTTLE,
182 STR_RIDE_MODE_BOAT_HIRE,
183 STR_RIDE_MODE_UPWARD_LAUNCH,
184 STR_RIDE_MODE_ROTATING_LIFT,
185 STR_RIDE_MODE_STATION_TO_STATION,
186 STR_RIDE_MODE_SINGLE_RIDE_PER_ADMISSION,
187 STR_RIDE_MODE_UNLIMITED_RIDES_PER_ADMISSION,
188 STR_RIDE_MODE_MAZE,
189 STR_RIDE_MODE_RACE,
190 STR_RIDE_MODE_DODGEMS,
191 STR_RIDE_MODE_SWING,
192 STR_RIDE_MODE_SHOP_STALL,
193 STR_RIDE_MODE_ROTATION,
194 STR_RIDE_MODE_FORWARD_ROTATION,
195 STR_RIDE_MODE_BACKWARD_ROTATION,
196 STR_RIDE_MODE_FILM_AVENGING_AVIATORS,
197 STR_RIDE_MODE_3D_FILM_MOUSE_TAILS,
198 STR_RIDE_MODE_SPACE_RINGS,
199 STR_RIDE_MODE_BEGINNERS,
200 STR_RIDE_MODE_LIM_POWERED_LAUNCH,
201 STR_RIDE_MODE_FILM_THRILL_RIDERS,
202 STR_RIDE_MODE_3D_FILM_STORM_CHASERS,
203 STR_RIDE_MODE_3D_FILM_SPACE_RAIDERS,
204 STR_RIDE_MODE_INTENSE,
205 STR_RIDE_MODE_BERSERK,
206 STR_RIDE_MODE_HAUNTED_HOUSE,
207 STR_RIDE_MODE_CIRCUS_SHOW,
208 STR_RIDE_MODE_DOWNWARD_LAUNCH,
209 STR_RIDE_MODE_CROOKED_HOUSE,
210 STR_RIDE_MODE_FREEFALL_DROP,
211 STR_RIDE_MODE_CONTINUOUS_CIRCUIT_BLOCK_SECTIONED,
212 STR_RIDE_MODE_POWERED_LAUNCH,
213 STR_RIDE_MODE_POWERED_LAUNCH_BLOCK_SECTIONED_MODE,
214 };
215 // clang-format on
216
217 constexpr const RideTypeDescriptor RideTypeDescriptors[RIDE_TYPE_COUNT] = {
218 /* RIDE_TYPE_SPIRAL_ROLLER_COASTER */ SpiralRollerCoasterRTD,
219 /* RIDE_TYPE_STAND_UP_ROLLER_COASTER */ StandUpRollerCoasterRTD,
220 /* RIDE_TYPE_SUSPENDED_SWINGING_COASTER */ SuspendedSwingingCoasterRTD,
221 /* RIDE_TYPE_INVERTED_ROLLER_COASTER */ InvertedRollerCoasterRTD,
222 /* RIDE_TYPE_JUNIOR_ROLLER_COASTER */ JuniorRollerCoasterRTD,
223 /* RIDE_TYPE_MINIATURE_RAILWAY */ MiniatureRailwayRTD,
224 /* RIDE_TYPE_MONORAIL */ MonorailRTD,
225 /* RIDE_TYPE_MINI_SUSPENDED_COASTER */ MiniSuspendedCoasterRTD,
226 /* RIDE_TYPE_BOAT_HIRE */ BoatHireRTD,
227 /* RIDE_TYPE_WOODEN_WILD_MOUSE */ WoodenWildMouseRTD,
228 /* RIDE_TYPE_STEEPLECHASE */ SteeplechaseRTD,
229 /* RIDE_TYPE_CAR_RIDE */ CarRideRTD,
230 /* RIDE_TYPE_LAUNCHED_FREEFALL */ LaunchedFreefallRTD,
231 /* RIDE_TYPE_BOBSLEIGH_COASTER */ BobsleighCoasterRTD,
232 /* RIDE_TYPE_OBSERVATION_TOWER */ ObservationTowerRTD,
233 /* RIDE_TYPE_LOOPING_ROLLER_COASTER */ LoopingRollerCoasterRTD,
234 /* RIDE_TYPE_DINGHY_SLIDE */ DinghySlideRTD,
235 /* RIDE_TYPE_MINE_TRAIN_COASTER */ MineTrainCoasterRTD,
236 /* RIDE_TYPE_CHAIRLIFT */ ChairliftRTD,
237 /* RIDE_TYPE_CORKSCREW_ROLLER_COASTER */ CorkscrewRollerCoasterRTD,
238 /* RIDE_TYPE_MAZE */ MazeRTD,
239 /* RIDE_TYPE_SPIRAL_SLIDE */ SpiralSlideRTD,
240 /* RIDE_TYPE_GO_KARTS */ GoKartsRTD,
241 /* RIDE_TYPE_LOG_FLUME */ LogFlumeRTD,
242 /* RIDE_TYPE_RIVER_RAPIDS */ RiverRapidsRTD,
243 /* RIDE_TYPE_DODGEMS */ DodgemsRTD,
244 /* RIDE_TYPE_SWINGING_SHIP */ SwingingShipRTD,
245 /* RIDE_TYPE_SWINGING_INVERTER_SHIP */ SwingingInverterShipRTD,
246 /* RIDE_TYPE_FOOD_STALL */ FoodStallRTD,
247 /* RIDE_TYPE_1D */ DummyRTD,
248 /* RIDE_TYPE_DRINK_STALL */ DrinkStallRTD,
249 /* RIDE_TYPE_1F */ DummyRTD,
250 /* RIDE_TYPE_SHOP */ ShopRTD,
251 /* RIDE_TYPE_MERRY_GO_ROUND */ MerryGoRoundRTD,
252 /* RIDE_TYPE_22 */ DummyRTD,
253 /* RIDE_TYPE_INFORMATION_KIOSK */ InformationKioskRTD,
254 /* RIDE_TYPE_TOILETS */ ToiletsRTD,
255 /* RIDE_TYPE_FERRIS_WHEEL */ FerrisWheelRTD,
256 /* RIDE_TYPE_MOTION_SIMULATOR */ MotionSimulatorRTD,
257 /* RIDE_TYPE_3D_CINEMA */ CinemaRTD,
258 /* RIDE_TYPE_TOP_SPIN */ TopSpinRTD,
259 /* RIDE_TYPE_SPACE_RINGS */ SpaceRingsRTD,
260 /* RIDE_TYPE_REVERSE_FREEFALL_COASTER */ ReverseFreefallCoasterRTD,
261 /* RIDE_TYPE_LIFT */ LiftRTD,
262 /* RIDE_TYPE_VERTICAL_DROP_ROLLER_COASTER */ VerticalDropCoasterRTD,
263 /* RIDE_TYPE_CASH_MACHINE */ CashMachineRTD,
264 /* RIDE_TYPE_TWIST */ TwistRTD,
265 /* RIDE_TYPE_HAUNTED_HOUSE */ HauntedHouseRTD,
266 /* RIDE_TYPE_FIRST_AID */ FirstAidRTD,
267 /* RIDE_TYPE_CIRCUS */ CircusRTD,
268 /* RIDE_TYPE_GHOST_TRAIN */ GhostTrainRTD,
269 /* RIDE_TYPE_TWISTER_ROLLER_COASTER */ TwisterRollerCoasterRTD,
270 /* RIDE_TYPE_WOODEN_ROLLER_COASTER */ WoodenRollerCoasterRTD,
271 /* RIDE_TYPE_SIDE_FRICTION_ROLLER_COASTER */ SideFrictionRollerCoasterRTD,
272 /* RIDE_TYPE_STEEL_WILD_MOUSE */ SteelWildMouseRTD,
273 /* RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER */ MultiDimensionRollerCoasterRTD,
274 /* RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER_ALT */ MultiDimensionRollerCoasterAltRTD,
275 /* RIDE_TYPE_FLYING_ROLLER_COASTER */ FlyingRollerCoasterRTD,
276 /* RIDE_TYPE_FLYING_ROLLER_COASTER_ALT */ FlyingRollerCoasterAltRTD,
277 /* RIDE_TYPE_VIRGINIA_REEL */ VirginiaReelRTD,
278 /* RIDE_TYPE_SPLASH_BOATS */ SplashBoatsRTD,
279 /* RIDE_TYPE_MINI_HELICOPTERS */ MiniHelicoptersRTD,
280 /* RIDE_TYPE_LAY_DOWN_ROLLER_COASTER */ LayDownRollerCoasterRTD,
281 /* RIDE_TYPE_SUSPENDED_MONORAIL */ SuspendedMonorailRTD,
282 /* RIDE_TYPE_LAY_DOWN_ROLLER_COASTER_ALT */ LayDownRollerCoasterAltRTD,
283 /* RIDE_TYPE_REVERSER_ROLLER_COASTER */ ReverserRollerCoasterRTD,
284 /* RIDE_TYPE_HEARTLINE_TWISTER_COASTER */ HeartlineTwisterCoasterRTD,
285 /* RIDE_TYPE_MINI_GOLF */ MiniGolfRTD,
286 /* RIDE_TYPE_GIGA_COASTER */ GigaCoasterRTD,
287 /* RIDE_TYPE_ROTO_DROP */ RotoDropRTD,
288 /* RIDE_TYPE_FLYING_SAUCERS */ FlyingSaucersRTD,
289 /* RIDE_TYPE_CROOKED_HOUSE */ CrookedHouseRTD,
290 /* RIDE_TYPE_MONORAIL_CYCLES */ MonorailCyclesRTD,
291 /* RIDE_TYPE_COMPACT_INVERTED_COASTER */ CompactInvertedCoasterRTD,
292 /* RIDE_TYPE_WATER_COASTER */ WaterCoasterRTD,
293 /* RIDE_TYPE_AIR_POWERED_VERTICAL_COASTER */ AirPoweredVerticalCoasterRTD,
294 /* RIDE_TYPE_INVERTED_HAIRPIN_COASTER */ InvertedHairpinCoasterRTD,
295 /* RIDE_TYPE_MAGIC_CARPET */ MagicCarpetRTD,
296 /* RIDE_TYPE_SUBMARINE_RIDE */ SubmarineRideRTD,
297 /* RIDE_TYPE_RIVER_RAFTS */ RiverRaftsRTD,
298 /* RIDE_TYPE_50 */ DummyRTD,
299 /* RIDE_TYPE_ENTERPRISE */ EnterpriseRTD,
300 /* RIDE_TYPE_52 */ DummyRTD,
301 /* RIDE_TYPE_53 */ DummyRTD,
302 /* RIDE_TYPE_54 */ DummyRTD,
303 /* RIDE_TYPE_55 */ DummyRTD,
304 /* RIDE_TYPE_INVERTED_IMPULSE_COASTER */ InvertedImpulseCoasterRTD,
305 /* RIDE_TYPE_MINI_ROLLER_COASTER */ MiniRollerCoasterRTD,
306 /* RIDE_TYPE_MINE_RIDE */ MineRideRTD,
307 /* RIDE_TYPE_59 */ DummyRTD,
308 /* RIDE_TYPE_LIM_LAUNCHED_ROLLER_COASTER */ LIMLaunchedRollerCoasterRTD,
309 /* RIDE_TYPE_HYPERCOASTER, */ HypercoasterRTD,
310 /* RIDE_TYPE_HYPER_TWISTER, */ HyperTwisterRTD,
311 /* RIDE_TYPE_MONSTER_TRUCKS, */ MonsterTrucksRTD,
312 /* RIDE_TYPE_SPINNING_WILD_MOUSE, */ SpinningWildMouseRTD,
313 /* RIDE_TYPE_CLASSIC_MINI_ROLLER_COASTER, */ ClassicMiniRollerCoasterRTD,
314 /* RIDE_TYPE_HYBRID_COASTER */ HybridCoasterRTD,
315 /* RIDE_TYPE_SINGLE_RAIL_ROLLER_COASTER */ SingleRailRollerCoasterRTD,
316 };
317
HasFlag(uint64_t flag) const318 bool RideTypeDescriptor::HasFlag(uint64_t flag) const
319 {
320 return Flags & flag;
321 }
322
GetAvailableTrackPieces() const323 uint64_t RideTypeDescriptor::GetAvailableTrackPieces() const
324 {
325 if (gCheatsEnableAllDrawableTrackPieces)
326 {
327 return EnabledTrackPieces | ExtraTrackPieces;
328 }
329 return EnabledTrackPieces;
330 }
331
SupportsTrackPiece(const uint64_t trackPiece) const332 bool RideTypeDescriptor::SupportsTrackPiece(const uint64_t trackPiece) const
333 {
334 return GetAvailableTrackPieces() & (1ULL << trackPiece);
335 }
336
GetResearchCategory() const337 ResearchCategory RideTypeDescriptor::GetResearchCategory() const
338 {
339 switch (Category)
340 {
341 case RIDE_CATEGORY_TRANSPORT:
342 return ResearchCategory::Transport;
343 case RIDE_CATEGORY_GENTLE:
344 return ResearchCategory::Gentle;
345 case RIDE_CATEGORY_ROLLERCOASTER:
346 return ResearchCategory::Rollercoaster;
347 case RIDE_CATEGORY_THRILL:
348 return ResearchCategory::Thrill;
349 case RIDE_CATEGORY_WATER:
350 return ResearchCategory::Water;
351 case RIDE_CATEGORY_SHOP:
352 return ResearchCategory::Shop;
353 case RIDE_CATEGORY_NONE:
354 break;
355 }
356 log_error("Cannot get Research Category of invalid RideCategory");
357 return ResearchCategory::Transport;
358 }
359