2014-05-21 16:27:31 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* Copyright (c) 2014 Ted John
|
|
|
|
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
|
|
|
*
|
|
|
|
* This file is part of OpenRCT2.
|
|
|
|
*
|
|
|
|
* OpenRCT2 is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2014-10-06 18:36:58 +02:00
|
|
|
#include "../addresses.h"
|
2014-10-11 04:28:09 +02:00
|
|
|
#include "../interface/window.h"
|
2014-10-11 03:43:39 +02:00
|
|
|
#include "../world/map.h"
|
2014-05-21 16:27:31 +02:00
|
|
|
#include "ride.h"
|
2014-05-23 11:26:49 +02:00
|
|
|
#include "ride_data.h"
|
2014-05-24 15:31:42 +02:00
|
|
|
#include "ride_ratings.h"
|
2014-05-21 16:27:31 +02:00
|
|
|
|
2014-10-11 03:43:39 +02:00
|
|
|
enum {
|
|
|
|
RIDE_RATINGS_STATE_FIND_NEXT_RIDE,
|
2014-10-11 14:25:09 +02:00
|
|
|
RIDE_RATINGS_STATE_INITIALISE,
|
|
|
|
RIDE_RATINGS_STATE_2,
|
|
|
|
RIDE_RATINGS_STATE_CALCULATE,
|
|
|
|
RIDE_RATINGS_STATE_4,
|
|
|
|
RIDE_RATINGS_STATE_5
|
2014-10-11 03:43:39 +02:00
|
|
|
};
|
|
|
|
|
2014-10-11 04:28:09 +02:00
|
|
|
typedef void (*ride_ratings_calculation)(rct_ride *ride);
|
|
|
|
|
2014-10-11 03:43:39 +02:00
|
|
|
#define _rideRatingsState RCT2_GLOBAL(0x0138B591, uint8)
|
2014-10-11 14:25:09 +02:00
|
|
|
#define _rideRatingsCurrentRide RCT2_GLOBAL(0x0138B590, uint8)
|
|
|
|
|
|
|
|
static const ride_ratings_calculation ride_ratings_calculate_func_table[91];
|
2014-10-11 03:43:39 +02:00
|
|
|
|
|
|
|
static void ride_ratings_update_state_0();
|
|
|
|
static void ride_ratings_update_state_1();
|
|
|
|
static void ride_ratings_update_state_2();
|
|
|
|
static void ride_ratings_update_state_3();
|
|
|
|
static void ride_ratings_update_state_4();
|
|
|
|
static void ride_ratings_update_state_5();
|
|
|
|
static void loc_6B5BB2();
|
2014-10-11 04:28:09 +02:00
|
|
|
static void ride_ratings_calculate(rct_ride *ride);
|
2015-03-22 16:38:42 +01:00
|
|
|
static void ride_ratings_calculate_value(rct_ride *ride);
|
2014-10-11 03:43:39 +02:00
|
|
|
|
2015-04-26 17:09:16 +02:00
|
|
|
int sub_6C6402(rct_map_element **mapElement, int *x, int *y, int *z)
|
2014-10-11 03:43:39 +02:00
|
|
|
{
|
|
|
|
int eax, ebx, ecx, edx, esi, edi, ebp;
|
|
|
|
|
|
|
|
eax = *x;
|
|
|
|
ecx = *y;
|
2015-04-26 17:09:16 +02:00
|
|
|
esi = (int)*mapElement;
|
|
|
|
int result = RCT2_CALLFUNC_X(0x006C6402, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
2014-10-11 03:43:39 +02:00
|
|
|
*x = *((uint16*)&eax);
|
|
|
|
*y = *((uint16*)&ecx);
|
|
|
|
*z = *((uint8*)&edx);
|
2015-04-26 17:09:16 +02:00
|
|
|
*mapElement = (rct_map_element*)esi;
|
|
|
|
return result & (0x100);
|
2014-10-11 03:43:39 +02:00
|
|
|
}
|
|
|
|
|
2014-10-09 21:31:58 +02:00
|
|
|
/**
|
2014-10-11 03:43:39 +02:00
|
|
|
*
|
2014-10-09 21:31:58 +02:00
|
|
|
* rct2: 0x006B5A2A
|
|
|
|
*/
|
|
|
|
void ride_ratings_update_all()
|
|
|
|
{
|
2014-10-11 03:43:39 +02:00
|
|
|
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_SCENARIO_EDITOR)
|
|
|
|
return;
|
|
|
|
|
|
|
|
switch (_rideRatingsState) {
|
|
|
|
case RIDE_RATINGS_STATE_FIND_NEXT_RIDE:
|
|
|
|
ride_ratings_update_state_0();
|
|
|
|
break;
|
|
|
|
case RIDE_RATINGS_STATE_INITIALISE:
|
|
|
|
ride_ratings_update_state_1();
|
|
|
|
break;
|
2014-10-11 14:25:09 +02:00
|
|
|
case RIDE_RATINGS_STATE_2:
|
2014-10-11 03:43:39 +02:00
|
|
|
ride_ratings_update_state_2();
|
|
|
|
break;
|
2014-10-11 14:25:09 +02:00
|
|
|
case RIDE_RATINGS_STATE_CALCULATE:
|
2014-10-11 03:43:39 +02:00
|
|
|
ride_ratings_update_state_3();
|
|
|
|
break;
|
2014-10-11 14:25:09 +02:00
|
|
|
case RIDE_RATINGS_STATE_4:
|
2014-10-11 03:43:39 +02:00
|
|
|
ride_ratings_update_state_4();
|
|
|
|
break;
|
2014-10-11 14:25:09 +02:00
|
|
|
case RIDE_RATINGS_STATE_5:
|
2014-10-11 03:43:39 +02:00
|
|
|
ride_ratings_update_state_5();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* rct2: 0x006B5A5C
|
|
|
|
*/
|
|
|
|
static void ride_ratings_update_state_0()
|
|
|
|
{
|
|
|
|
rct_ride *ride;
|
|
|
|
|
|
|
|
_rideRatingsCurrentRide += 1;
|
|
|
|
if (_rideRatingsCurrentRide == 255)
|
|
|
|
_rideRatingsCurrentRide = 0;
|
|
|
|
|
|
|
|
ride = GET_RIDE(_rideRatingsCurrentRide);
|
|
|
|
if (ride->type != RIDE_TYPE_NULL && ride->status != RIDE_STATUS_CLOSED)
|
|
|
|
_rideRatingsState = RIDE_RATINGS_STATE_INITIALISE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* rct2: 0x006B5A94
|
|
|
|
*/
|
|
|
|
static void ride_ratings_update_state_1()
|
|
|
|
{
|
|
|
|
RCT2_GLOBAL(0x0138B594, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B596, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B598, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B59A, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B59C, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B59E, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5A0, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5A2, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5A4, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5A6, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5A8, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5AA, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5AC, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5AE, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5B0, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5B2, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5B4, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5B6, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5B8, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5BA, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5BC, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5BE, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5C0, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5C2, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5C4, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5C6, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5C8, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5CA, uint16) = 0;
|
|
|
|
RCT2_GLOBAL(0x0138B5CC, uint16) = 0;
|
2014-10-11 14:25:09 +02:00
|
|
|
_rideRatingsState = RIDE_RATINGS_STATE_2;
|
2014-10-11 03:43:39 +02:00
|
|
|
RCT2_GLOBAL(0x0138B5CE, uint16) = 0;
|
|
|
|
loc_6B5BB2();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* rct2: 0x006B5BB2
|
|
|
|
*/
|
|
|
|
static void loc_6B5BB2()
|
|
|
|
{
|
|
|
|
rct_ride *ride;
|
|
|
|
int i, x, y, z;
|
|
|
|
|
|
|
|
ride = GET_RIDE(_rideRatingsCurrentRide);
|
|
|
|
if (ride->type == RIDE_TYPE_NULL || ride->status == RIDE_STATUS_CLOSED) {
|
|
|
|
_rideRatingsState = RIDE_RATINGS_STATE_FIND_NEXT_RIDE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ride->type == RIDE_TYPE_MAZE) {
|
2014-10-11 14:25:09 +02:00
|
|
|
_rideRatingsState = RIDE_RATINGS_STATE_CALCULATE;
|
2014-10-11 03:43:39 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
if (ride->station_starts[i] != 0xFFFF) {
|
|
|
|
RCT2_GLOBAL(0x0138B5CE, uint16) &= ~1;
|
|
|
|
if (ride->entrances[i] == 0xFFFF)
|
|
|
|
RCT2_GLOBAL(0x0138B5CE, uint16) |= 1;
|
|
|
|
|
|
|
|
x = (ride->station_starts[i] & 0xFF) * 32;
|
|
|
|
y = (ride->station_starts[i] >> 8) * 32;
|
|
|
|
z = ride->station_heights[i] * 8;
|
|
|
|
|
|
|
|
RCT2_GLOBAL(0x0138B584, uint16) = x;
|
|
|
|
RCT2_GLOBAL(0x0138B586, uint16) = y;
|
|
|
|
RCT2_GLOBAL(0x0138B588, uint16) = z;
|
|
|
|
RCT2_GLOBAL(0x0138B592, uint8) = 255;
|
|
|
|
RCT2_GLOBAL(0x0138B58A, uint16) = x;
|
|
|
|
RCT2_GLOBAL(0x0138B58C, uint16) = y;
|
|
|
|
RCT2_GLOBAL(0x0138B58E, uint16) = z;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_rideRatingsState = RIDE_RATINGS_STATE_FIND_NEXT_RIDE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* rct2: 0x006B5C66
|
|
|
|
*/
|
|
|
|
static void ride_ratings_update_state_2()
|
|
|
|
{
|
2015-01-29 22:10:34 +01:00
|
|
|
// TODO test this function
|
2014-10-11 03:43:39 +02:00
|
|
|
RCT2_CALLPROC_EBPSAFE(0x006B5C66);
|
2014-10-11 14:25:09 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
rct_ride *ride;
|
|
|
|
rct_map_element *mapElement;
|
2015-01-30 20:20:19 +01:00
|
|
|
rct_xy_element trackElement, nextTrackElement;
|
2014-10-11 14:25:09 +02:00
|
|
|
int x, y, z, trackType, entranceIndex;
|
|
|
|
|
|
|
|
ride = GET_RIDE(_rideRatingsCurrentRide);
|
|
|
|
if (ride->type == RIDE_TYPE_NULL || ride->status == RIDE_STATUS_CLOSED) {
|
|
|
|
_rideRatingsState = RIDE_RATINGS_STATE_FIND_NEXT_RIDE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
x = RCT2_GLOBAL(0x0138B584, uint16) / 32;
|
|
|
|
y = RCT2_GLOBAL(0x0138B586, uint16) / 32;
|
|
|
|
z = RCT2_GLOBAL(0x0138B588, uint16) / 8;
|
|
|
|
|
2015-01-22 01:19:05 +01:00
|
|
|
mapElement = map_get_first_element_at(x, y);
|
2014-10-11 14:25:09 +02:00
|
|
|
trackType = RCT2_GLOBAL(0x0138B592, uint8);
|
|
|
|
|
|
|
|
do {
|
2015-01-22 01:19:05 +01:00
|
|
|
if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_TRACK)
|
2014-10-11 14:25:09 +02:00
|
|
|
continue;
|
|
|
|
if (mapElement->base_height != z)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (trackType == 255 || (!(mapElement->properties.track.sequence & 0x0F) && trackType == mapElement->properties.track.type)) {
|
|
|
|
if (trackType == 1) {
|
|
|
|
entranceIndex = (mapElement->properties.track.sequence >> 4) & 7;
|
|
|
|
RCT2_GLOBAL(0x0138B5CE, uint16) &= ~1;
|
|
|
|
if (ride->entrances[entranceIndex] == 0xFFFF)
|
|
|
|
RCT2_GLOBAL(0x0138B5CE, uint16) |= 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
RCT2_CALLPROC_X(0x006B5F9D, 0, 0, 0, 0, (int)mapElement, 0, 0);
|
|
|
|
|
2015-01-30 20:20:19 +01:00
|
|
|
trackElement.x = RCT2_GLOBAL(0x0138B584, uint16);
|
|
|
|
trackElement.y = RCT2_GLOBAL(0x0138B586, uint16);
|
|
|
|
trackElement.element = mapElement;
|
|
|
|
if (!track_get_next(&trackElement, &nextTrackElement)) {
|
2014-10-11 14:25:09 +02:00
|
|
|
_rideRatingsState = RIDE_RATINGS_STATE_4;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-01-30 20:20:19 +01:00
|
|
|
x = nextTrackElement.x;
|
|
|
|
y = nextTrackElement.y;
|
|
|
|
z = nextTrackElement.element->base_height * 8;
|
|
|
|
mapElement = nextTrackElement.element;
|
2014-10-11 14:25:09 +02:00
|
|
|
if (x == RCT2_GLOBAL(0x0138B58A, uint16) && y == RCT2_GLOBAL(0x0138B58C, uint16) && z == RCT2_GLOBAL(0x0138B58E, uint16)) {
|
|
|
|
_rideRatingsState = RIDE_RATINGS_STATE_CALCULATE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
RCT2_GLOBAL(0x0138B584, uint16) = x;
|
|
|
|
RCT2_GLOBAL(0x0138B586, uint16) = y;
|
|
|
|
RCT2_GLOBAL(0x0138B588, uint16) = z;
|
|
|
|
RCT2_GLOBAL(0x0138B592, uint8) = mapElement->properties.track.type;
|
|
|
|
}
|
2015-01-22 01:19:05 +01:00
|
|
|
} while (!map_element_is_last_for_tile(mapElement++));
|
2014-10-11 14:25:09 +02:00
|
|
|
|
|
|
|
_rideRatingsState = RIDE_RATINGS_STATE_FIND_NEXT_RIDE;
|
2014-10-11 03:43:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* rct2: 0x006B5E4D
|
|
|
|
*/
|
|
|
|
static void ride_ratings_update_state_3()
|
|
|
|
{
|
2014-10-11 04:28:09 +02:00
|
|
|
rct_ride *ride;
|
|
|
|
|
|
|
|
ride = GET_RIDE(_rideRatingsCurrentRide);
|
|
|
|
if (ride->type == RIDE_TYPE_NULL || ride->status == RIDE_STATUS_CLOSED) {
|
|
|
|
_rideRatingsState = RIDE_RATINGS_STATE_FIND_NEXT_RIDE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ride_ratings_calculate(ride);
|
|
|
|
RCT2_CALLPROC_X(0x00655F64, 0, 0, 0, 0, 0, (int)ride, 0);
|
2015-03-22 16:38:42 +01:00
|
|
|
ride_ratings_calculate_value(ride);
|
2014-10-11 04:28:09 +02:00
|
|
|
|
2014-10-16 03:02:43 +02:00
|
|
|
window_invalidate_by_number(WC_RIDE, _rideRatingsCurrentRide);
|
2014-10-11 04:28:09 +02:00
|
|
|
_rideRatingsState = RIDE_RATINGS_STATE_FIND_NEXT_RIDE;
|
2014-10-11 03:43:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* rct2: 0x006B5BAB
|
|
|
|
*/
|
|
|
|
static void ride_ratings_update_state_4()
|
|
|
|
{
|
2014-10-11 14:25:09 +02:00
|
|
|
_rideRatingsState = RIDE_RATINGS_STATE_5;
|
2014-10-11 03:43:39 +02:00
|
|
|
loc_6B5BB2();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* rct2: 0x006B5D72
|
|
|
|
*/
|
|
|
|
static void ride_ratings_update_state_5()
|
|
|
|
{
|
|
|
|
// sub_6C6402 returns a carry, CALLFUNC doesn't support this
|
|
|
|
// so have to wait for sub_6C6402 to be decompiled
|
|
|
|
RCT2_CALLPROC_EBPSAFE(0x006B5D72);
|
|
|
|
return;
|
|
|
|
|
|
|
|
rct_ride *ride;
|
|
|
|
rct_map_element *mapElement;
|
|
|
|
int x, y, z, trackType;
|
|
|
|
|
|
|
|
ride = GET_RIDE(_rideRatingsCurrentRide);
|
|
|
|
if (ride->type == RIDE_TYPE_NULL || ride->status == RIDE_STATUS_CLOSED) {
|
|
|
|
_rideRatingsState = RIDE_RATINGS_STATE_FIND_NEXT_RIDE;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
x = RCT2_GLOBAL(0x0138B584, uint16) / 32;
|
|
|
|
y = RCT2_GLOBAL(0x0138B586, uint16) / 32;
|
|
|
|
z = RCT2_GLOBAL(0x0138B588, uint16) / 8;
|
|
|
|
|
2015-01-22 01:19:05 +01:00
|
|
|
mapElement = map_get_first_element_at(x, y);
|
2014-10-11 03:43:39 +02:00
|
|
|
trackType = RCT2_GLOBAL(0x0138B592, uint8);
|
|
|
|
|
|
|
|
do {
|
2015-01-22 01:19:05 +01:00
|
|
|
if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_TRACK)
|
2014-10-11 03:43:39 +02:00
|
|
|
continue;
|
|
|
|
if (mapElement->base_height != z)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (trackType == 255 || trackType == mapElement->properties.track.type) {
|
|
|
|
RCT2_CALLPROC_X(0x006B5F9D, 0, 0, 0, 0, (int)mapElement, 0, 0);
|
|
|
|
|
|
|
|
x = RCT2_GLOBAL(0x0138B584, uint16);
|
|
|
|
y = RCT2_GLOBAL(0x0138B586, uint16);
|
2015-04-26 17:09:16 +02:00
|
|
|
if (!sub_6C6402(&mapElement, &x, &y, &z)) {
|
2014-10-11 14:25:09 +02:00
|
|
|
_rideRatingsState = RIDE_RATINGS_STATE_CALCULATE;
|
2014-10-11 03:43:39 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
x >>= 16;
|
|
|
|
y >>= 16;
|
|
|
|
if (x == RCT2_GLOBAL(0x0138B58A, uint16) && y == RCT2_GLOBAL(0x0138B58C, uint16) && z == RCT2_GLOBAL(0x0138B58E, uint16)) {
|
2014-10-11 14:25:09 +02:00
|
|
|
_rideRatingsState = RIDE_RATINGS_STATE_CALCULATE;
|
2014-10-11 03:43:39 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
RCT2_GLOBAL(0x0138B584, uint16) = x;
|
|
|
|
RCT2_GLOBAL(0x0138B586, uint16) = y;
|
|
|
|
RCT2_GLOBAL(0x0138B588, uint16) = z;
|
|
|
|
RCT2_GLOBAL(0x0138B592, uint8) = mapElement->properties.track.type;
|
|
|
|
}
|
2015-01-22 01:19:05 +01:00
|
|
|
} while (!map_element_is_last_for_tile(mapElement++));
|
2014-10-11 03:43:39 +02:00
|
|
|
|
|
|
|
_rideRatingsState = RIDE_RATINGS_STATE_FIND_NEXT_RIDE;
|
2014-10-09 21:31:58 +02:00
|
|
|
}
|
|
|
|
|
2014-10-11 04:28:09 +02:00
|
|
|
static void ride_ratings_calculate(rct_ride *ride)
|
|
|
|
{
|
2014-10-11 14:25:09 +02:00
|
|
|
ride_ratings_calculation calcFunc;
|
|
|
|
|
|
|
|
calcFunc = ride_ratings_calculate_func_table[ride->type];
|
|
|
|
if (calcFunc == NULL) {
|
|
|
|
calcFunc = RCT2_ADDRESS(0x0097E050, ride_ratings_calculation)[ride->type];
|
|
|
|
RCT2_CALLPROC_X((int)calcFunc, 0, 0, 0, 0, 0, (int)ride, 0);
|
|
|
|
} else {
|
|
|
|
calcFunc(ride);
|
|
|
|
}
|
2014-10-11 04:28:09 +02:00
|
|
|
}
|
|
|
|
|
2015-03-22 16:38:42 +01:00
|
|
|
static void ride_ratings_calculate_value(rct_ride *ride)
|
2014-10-11 04:28:09 +02:00
|
|
|
{
|
|
|
|
rct_ride *ride2;
|
|
|
|
int i, otherRidesOfSameType;
|
|
|
|
|
|
|
|
if (ride->excitement == (ride_rating)0xFFFF)
|
|
|
|
return;
|
|
|
|
|
2015-03-22 16:38:42 +01:00
|
|
|
int value =
|
2014-10-11 04:28:09 +02:00
|
|
|
(((ride->excitement * RCT2_GLOBAL(0x0097CD1E + (ride->type * 6), sint16)) * 32) >> 15) +
|
|
|
|
(((ride->intensity * RCT2_GLOBAL(0x0097CD20 + (ride->type * 6), sint16)) * 32) >> 15) +
|
|
|
|
(((ride->nausea * RCT2_GLOBAL(0x0097CD22 + (ride->type * 6), sint16)) * 32) >> 15);
|
|
|
|
|
|
|
|
int monthsOld = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_YEAR, uint16) - ride->build_date;
|
|
|
|
|
|
|
|
// New ride reward
|
|
|
|
if (monthsOld <= 12) {
|
2015-03-22 16:38:42 +01:00
|
|
|
value += 10;
|
2014-10-11 04:28:09 +02:00
|
|
|
if (monthsOld <= 4)
|
2015-03-22 16:38:42 +01:00
|
|
|
value += 20;
|
2014-10-11 04:28:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Old ride penalty
|
2015-03-22 16:38:42 +01:00
|
|
|
if (monthsOld >= 40) value -= value / 4;
|
|
|
|
if (monthsOld >= 64) value -= value / 4;
|
2014-10-11 04:28:09 +02:00
|
|
|
if (monthsOld < 200) {
|
2015-03-22 16:38:42 +01:00
|
|
|
if (monthsOld >= 88) value -= value / 4;
|
|
|
|
if (monthsOld >= 104) value -= value / 4;
|
|
|
|
if (monthsOld >= 120) value -= value / 2;
|
|
|
|
if (monthsOld >= 128) value -= value / 2;
|
2014-10-11 04:28:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Other ride of same type penalty
|
|
|
|
otherRidesOfSameType = 0;
|
|
|
|
FOR_ALL_RIDES(i, ride2) {
|
|
|
|
if (ride2->type == ride->type)
|
|
|
|
otherRidesOfSameType++;
|
|
|
|
}
|
|
|
|
if (otherRidesOfSameType > 1)
|
2015-03-22 16:38:42 +01:00
|
|
|
value -= value / 4;
|
2014-10-11 04:28:09 +02:00
|
|
|
|
2015-03-22 16:38:42 +01:00
|
|
|
ride->value = max(0, value);
|
2014-10-11 04:28:09 +02:00
|
|
|
}
|
|
|
|
|
2014-05-21 18:00:58 +02:00
|
|
|
/**
|
|
|
|
* rct2: sub_65E621
|
|
|
|
*
|
|
|
|
* I think this function computes ride upkeep? Though it is weird that the
|
|
|
|
*
|
|
|
|
* inputs
|
|
|
|
* - edi: ride ptr
|
|
|
|
*/
|
2014-10-11 15:14:10 +02:00
|
|
|
static uint16 ride_compute_upkeep(rct_ride *ride)
|
2014-05-21 18:00:58 +02:00
|
|
|
{
|
2014-05-23 12:09:16 +02:00
|
|
|
// data stored at 0x0057E3A8, incrementing 18 bytes at a time
|
|
|
|
uint16 upkeep = initialUpkeepCosts[ride->type];
|
2014-05-21 18:00:58 +02:00
|
|
|
|
2014-05-23 12:09:16 +02:00
|
|
|
uint16 trackCost = costPerTrackPiece[ride->type];
|
2014-09-05 19:10:30 +02:00
|
|
|
uint8 dl = ride->drops;
|
2014-05-23 12:09:16 +02:00
|
|
|
|
2014-05-21 18:00:58 +02:00
|
|
|
dl = dl >> 6;
|
|
|
|
dl = dl & 3;
|
2014-05-23 12:09:16 +02:00
|
|
|
upkeep += trackCost * dl;
|
2014-05-21 18:00:58 +02:00
|
|
|
|
2015-04-01 07:19:01 +02:00
|
|
|
uint32 totalLength = ride_get_total_length(ride) >> 16;
|
2014-05-21 18:00:58 +02:00
|
|
|
|
2014-05-23 11:26:49 +02:00
|
|
|
// The data originally here was 20's and 0's. The 20's all represented
|
|
|
|
// rides that had tracks. The 0's were fixed rides like crooked house or
|
|
|
|
// bumper cars.
|
|
|
|
// Data source is 0x0097E3AC
|
|
|
|
if (hasRunningTrack[ride->type]) {
|
2014-09-05 19:10:30 +02:00
|
|
|
totalLength *= 20;
|
2014-05-23 11:26:49 +02:00
|
|
|
}
|
2014-09-05 19:10:30 +02:00
|
|
|
upkeep += (uint16)(totalLength >> 10);
|
2014-05-21 18:00:58 +02:00
|
|
|
|
|
|
|
if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) {
|
2014-05-23 10:49:42 +02:00
|
|
|
// The original code read from a table starting at 0x0097E3AE and
|
|
|
|
// incrementing by 0x12 bytes between values. However, all of these
|
|
|
|
// values were 40. I have replaced the table lookup with the constant
|
|
|
|
// 40 in this case.
|
|
|
|
upkeep += 40;
|
2014-05-21 18:00:58 +02:00
|
|
|
}
|
|
|
|
|
2014-05-23 12:09:16 +02:00
|
|
|
// Originally this data was at 0x0097E3B0 and incrementing in 18 byte
|
|
|
|
// offsets. The value here for every ride is 80, except for the reverser,
|
|
|
|
// which is 10
|
|
|
|
uint16 eax;
|
|
|
|
if (ride->type == RIDE_TYPE_REVERSER_ROLLER_COASTER) {
|
|
|
|
eax = 10;
|
|
|
|
} else {
|
|
|
|
eax = 80;
|
|
|
|
}
|
2014-05-21 18:00:58 +02:00
|
|
|
|
|
|
|
// not sure what this value is; it's only written to in one place, where
|
|
|
|
// it's incremented.
|
|
|
|
sint16 dx = RCT2_GLOBAL(0x0138B5CC, sint16);
|
2014-05-22 02:13:53 +02:00
|
|
|
upkeep += eax * dx;
|
2014-05-21 18:00:58 +02:00
|
|
|
|
|
|
|
dx = RCT2_GLOBAL(0x0138B5CA, sint16);
|
2014-05-23 12:09:16 +02:00
|
|
|
// Originally there was a lookup into a table at 0x0097E3B0 and
|
|
|
|
// incrementing in 18 byte offsets. The value here for every ride was 20,
|
|
|
|
// so it's been replaced here by the constant.
|
|
|
|
upkeep += 20 * dx;
|
2014-05-21 18:00:58 +02:00
|
|
|
|
2014-05-22 02:13:53 +02:00
|
|
|
// these seem to be adhoc adjustments to a ride's upkeep/cost, times
|
2014-05-21 18:00:58 +02:00
|
|
|
// various variables set on the ride itself.
|
|
|
|
|
|
|
|
// https://gist.github.com/kevinburke/e19b803cd2769d96c540
|
2014-09-03 20:13:37 +02:00
|
|
|
upkeep += rideUnknownData1[ride->type] * ride->num_vehicles;
|
2014-05-21 18:00:58 +02:00
|
|
|
|
|
|
|
// either set to 3 or 0, extra boosts for some rides including mini golf
|
2014-05-23 13:57:50 +02:00
|
|
|
if (rideUnknownData2[ride->type]) {
|
2014-09-18 03:48:51 +02:00
|
|
|
upkeep += 3 * ride->num_cars_per_train;
|
2014-05-23 13:57:50 +02:00
|
|
|
}
|
2014-05-21 18:00:58 +02:00
|
|
|
|
2014-05-22 02:13:53 +02:00
|
|
|
// slight upkeep boosts for some rides - 5 for mini railroad, 10 for log
|
2014-05-21 18:00:58 +02:00
|
|
|
// flume/rapids, 10 for roller coaster, 28 for giga coaster
|
2014-09-03 20:13:37 +02:00
|
|
|
upkeep += rideUnknownData3[ride->type] * ride->num_stations;
|
2014-05-21 18:00:58 +02:00
|
|
|
|
2014-09-09 15:16:09 +02:00
|
|
|
if (ride->mode == RIDE_MODE_REVERSE_INCLINE_LAUNCHED_SHUTTLE) {
|
2014-05-22 02:13:53 +02:00
|
|
|
upkeep += 30;
|
2015-03-20 17:32:59 +01:00
|
|
|
} else if (ride->mode == RIDE_MODE_POWERED_LAUNCH_PASSTROUGH) {
|
2014-05-22 02:13:53 +02:00
|
|
|
upkeep += 160;
|
2014-05-21 18:00:58 +02:00
|
|
|
} else if (ride->mode == RIDE_MODE_LIM_POWERED_LAUNCH) {
|
2014-05-22 02:13:53 +02:00
|
|
|
upkeep += 320;
|
2015-03-20 17:32:59 +01:00
|
|
|
} else if (ride->mode == RIDE_MODE_POWERED_LAUNCH ||
|
2014-05-21 18:00:58 +02:00
|
|
|
ride->mode == RIDE_MODE_POWERED_LAUNCH_BLOCK_SECTIONED) {
|
2014-05-22 02:13:53 +02:00
|
|
|
upkeep += 220;
|
2014-05-21 18:00:58 +02:00
|
|
|
}
|
|
|
|
|
2014-05-22 14:16:22 +02:00
|
|
|
// multiply by 5/8
|
2014-05-22 02:13:53 +02:00
|
|
|
upkeep = upkeep * 10;
|
|
|
|
upkeep = upkeep >> 4;
|
|
|
|
return upkeep;
|
2014-05-21 16:27:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* rct2: 0x0065E7FB
|
|
|
|
*
|
|
|
|
* inputs
|
|
|
|
* - bx: excitement
|
|
|
|
* - cx: intensity
|
|
|
|
* - bp: nausea
|
|
|
|
* - edi: ride ptr
|
|
|
|
*/
|
2014-10-11 15:14:10 +02:00
|
|
|
static void ride_ratings_apply_adjustments(rct_ride *ride, rating_tuple *ratings)
|
2014-05-21 16:27:31 +02:00
|
|
|
{
|
2014-10-11 15:14:10 +02:00
|
|
|
rct_ride_type *rideEntry;
|
|
|
|
|
|
|
|
rideEntry = gRideTypeList[ride->subtype];
|
2014-05-21 16:27:31 +02:00
|
|
|
|
2014-10-11 15:14:10 +02:00
|
|
|
// Apply ride entry multipliers
|
|
|
|
ratings->excitement += ((ratings->excitement * rideEntry->excitement_multipler) >> 7);
|
|
|
|
ratings->intensity += ((ratings->intensity * rideEntry->intensity_multipler ) >> 7);
|
|
|
|
ratings->nausea += ((ratings->nausea * rideEntry->nausea_multipler ) >> 7);
|
2014-05-21 16:27:31 +02:00
|
|
|
|
|
|
|
// As far as I can tell, this flag detects whether the ride is a roller
|
|
|
|
// coaster, or a log flume or rapids. Everything else it's not set.
|
|
|
|
// more detail: https://gist.github.com/kevinburke/d951e74e678b235eef3e
|
2014-10-11 15:14:10 +02:00
|
|
|
uint16 flags = RCT2_GLOBAL(0x0097D4F2 + ride->type * 8, uint16);
|
|
|
|
if (flags & 0x80) {
|
|
|
|
uint16 totalAirTime = ride->total_air_time;
|
|
|
|
if (rideEntry->var_008 & 0x800) {
|
|
|
|
totalAirTime -= 96;
|
|
|
|
if (totalAirTime >= 0) {
|
|
|
|
ratings->excitement -= totalAirTime / 8;
|
|
|
|
ratings->nausea -= totalAirTime / 16;
|
2014-05-21 16:27:31 +02:00
|
|
|
}
|
|
|
|
} else {
|
2014-10-11 15:14:10 +02:00
|
|
|
ratings->excitement += totalAirTime / 8;
|
|
|
|
ratings->nausea += totalAirTime / 16;
|
2014-05-21 16:27:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-10-11 15:14:10 +02:00
|
|
|
* Lowers excitment, the higher the intensity.
|
|
|
|
* rct2: 0x0065E7A3
|
2014-05-21 16:27:31 +02:00
|
|
|
*/
|
2014-10-11 15:14:10 +02:00
|
|
|
static void ride_ratings_apply_intensity_penalty(rating_tuple *ratings)
|
2014-05-21 16:27:31 +02:00
|
|
|
{
|
2014-10-11 15:14:10 +02:00
|
|
|
static const ride_rating intensityBounds[] = { 1000, 1100, 1200, 1320, 1450 };
|
|
|
|
int i;
|
|
|
|
|
|
|
|
ride_rating excitement = ratings->excitement;
|
|
|
|
for (i = 0; i < countof(intensityBounds); i++)
|
|
|
|
if (ratings->intensity >= intensityBounds[i])
|
|
|
|
excitement -= excitement / 4;
|
|
|
|
ratings->excitement = excitement;
|
2014-05-21 16:27:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-10-11 14:25:09 +02:00
|
|
|
* rct2: 0x00655FD6
|
2014-05-21 16:27:31 +02:00
|
|
|
*/
|
2015-03-22 16:01:01 +01:00
|
|
|
static void set_unreliability_factor(rct_ride *ride)
|
2014-05-21 16:27:31 +02:00
|
|
|
{
|
2015-03-22 16:01:01 +01:00
|
|
|
// The higher the number, the lower the breakdown
|
|
|
|
// possibility. Range is [3, 7]. values are here:
|
|
|
|
// https://gist.github.com/kevinburke/123977c4884ccadbec70. Consider
|
|
|
|
// inlining this per ride
|
2015-04-11 17:59:44 +02:00
|
|
|
uint8 lift_speed_adjustment = RideLiftHillAdjustments[ride->type];
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor += (ride->lift_hill_speed - lift_speed_adjustment) * 2;
|
2014-05-21 16:27:31 +02:00
|
|
|
}
|
2014-10-11 14:25:09 +02:00
|
|
|
|
2014-10-11 19:55:56 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* rct2: 0x0065E277
|
|
|
|
*/
|
|
|
|
static int sub_65E277()
|
|
|
|
{
|
|
|
|
int eax, ebx, ecx, edx, esi, edi, ebp;
|
|
|
|
RCT2_CALLFUNC_X(0x0065E277, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);
|
|
|
|
return ebx;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-06-05 04:10:42 +02:00
|
|
|
* Seems to calculate how much of the track is sheltered in eighths.
|
2014-10-11 19:55:56 +02:00
|
|
|
* rct2: 0x0065E72D
|
|
|
|
*/
|
|
|
|
static int sub_65E72D(rct_ride *ride)
|
|
|
|
{
|
2015-06-05 04:10:42 +02:00
|
|
|
int totalLength = ride_get_total_length(ride);
|
|
|
|
int shelteredLength = ride->sheltered_length;
|
|
|
|
int lengthEighth = totalLength / 8;
|
|
|
|
int lengthCounter = lengthEighth;
|
|
|
|
int numShelteredEighths = 0;
|
|
|
|
for (int i = 0; i < 7; i++) {
|
|
|
|
if (shelteredLength >= lengthCounter) {
|
|
|
|
lengthCounter += lengthEighth;
|
|
|
|
numShelteredEighths++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int dh = numShelteredEighths;
|
|
|
|
rct_ride_type *rideType = GET_RIDE_ENTRY(ride->subtype);
|
|
|
|
if (rideType->var_008 & RIDE_TYPE_FLAG_HAS_DROPS)
|
|
|
|
numShelteredEighths = 7;
|
|
|
|
|
|
|
|
return (dh << 8) | numShelteredEighths;
|
2014-10-11 19:55:56 +02:00
|
|
|
}
|
|
|
|
|
2015-04-01 07:04:23 +02:00
|
|
|
static rating_tuple get_var_10E_rating(rct_ride* ride) {
|
|
|
|
int var_10E_unk_1 = get_var_10E_unk_1(ride);
|
|
|
|
int var_10E_unk_2 = get_var_10E_unk_2(ride);
|
|
|
|
int var_10E_unk_3 = get_var_10E_unk_3(ride);
|
2015-03-30 04:30:47 +02:00
|
|
|
|
2015-04-01 07:04:23 +02:00
|
|
|
int excitement = (var_10E_unk_1 * 0x28000) >> 16;
|
2015-06-03 23:36:27 +02:00
|
|
|
excitement += (var_10E_unk_2 * 0x30000) >> 16;
|
2015-04-01 07:04:23 +02:00
|
|
|
excitement += (var_10E_unk_3 * 63421) >> 16;
|
2015-03-30 04:30:47 +02:00
|
|
|
|
2015-04-01 07:04:23 +02:00
|
|
|
int intensity = (var_10E_unk_1 * 81920) >> 16;
|
|
|
|
intensity += (var_10E_unk_2 * 49152) >> 16;
|
|
|
|
intensity += (var_10E_unk_3 * 21140) >> 16;
|
2015-03-30 04:30:47 +02:00
|
|
|
|
2015-06-03 23:36:27 +02:00
|
|
|
int nausea = (var_10E_unk_1 * 0x50000) >> 16;
|
|
|
|
nausea += (var_10E_unk_2 * 0x32000) >> 16;
|
2015-04-01 07:04:23 +02:00
|
|
|
nausea += (var_10E_unk_3 * 42281) >> 16;
|
2015-03-30 04:30:47 +02:00
|
|
|
|
|
|
|
rating_tuple rating = { excitement, intensity, nausea };
|
|
|
|
return rating;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* rct2: 0x0065DF72
|
|
|
|
*/
|
2015-04-01 07:09:05 +02:00
|
|
|
static rating_tuple get_var_110_rating(rct_ride* ride) {
|
2015-06-02 22:07:46 +02:00
|
|
|
int var_110_unk_1 = get_var_110_unk_1(ride);
|
|
|
|
int var_110_unk_2 = get_var_110_unk_2(ride);
|
|
|
|
int var_110_unk_3 = get_var_110_unk_3(ride);
|
2015-03-30 04:30:47 +02:00
|
|
|
|
2015-06-03 23:36:27 +02:00
|
|
|
int excitement = (var_110_unk_1 * 0x3C000) >> 16;
|
|
|
|
excitement += (var_110_unk_2 * 0x3C000) >> 16;
|
2015-06-02 22:07:46 +02:00
|
|
|
excitement += (var_110_unk_3 * 73992) >> 16;
|
2015-03-30 04:30:47 +02:00
|
|
|
|
2015-06-02 22:07:46 +02:00
|
|
|
int intensity = (var_110_unk_1 * 0x14000) >> 16;
|
|
|
|
intensity += (var_110_unk_2 * 49152) >> 16;
|
|
|
|
intensity += (var_110_unk_3 * 21140) >> 16;
|
2015-03-30 04:30:47 +02:00
|
|
|
|
2015-06-03 23:36:27 +02:00
|
|
|
int nausea = (var_110_unk_1 * 0x50000) >> 16;
|
2015-06-02 22:07:46 +02:00
|
|
|
nausea += (var_110_unk_2 * 0x32000) >> 16;
|
|
|
|
nausea += (var_110_unk_3 * 48623) >> 16;
|
2015-03-30 04:30:47 +02:00
|
|
|
|
|
|
|
rating_tuple rating = { excitement, intensity, nausea };
|
|
|
|
return rating;
|
|
|
|
}
|
|
|
|
|
2014-10-12 00:07:20 +02:00
|
|
|
/**
|
2015-03-30 04:30:47 +02:00
|
|
|
* rct2: 0x0065E047
|
|
|
|
*/
|
2015-04-05 06:57:53 +02:00
|
|
|
static rating_tuple get_var_112_rating(rct_ride *ride) {
|
2015-03-30 04:30:47 +02:00
|
|
|
int al;
|
|
|
|
|
2015-04-05 06:57:53 +02:00
|
|
|
al = get_var_112_unk_1(ride);
|
|
|
|
al = min(al, 4);
|
2015-04-01 07:04:23 +02:00
|
|
|
int excitement = (al * 0x78000) >> 16;
|
2015-03-30 04:30:47 +02:00
|
|
|
|
2015-04-05 06:57:53 +02:00
|
|
|
al = get_var_112_unk_1(ride);
|
|
|
|
al = min(al, 8);
|
2015-04-01 07:04:23 +02:00
|
|
|
int nausea = (al * 0x78000) >> 16;
|
2015-03-30 04:30:47 +02:00
|
|
|
|
2015-04-05 06:57:53 +02:00
|
|
|
al = get_var_112_unk_2(ride);
|
|
|
|
al = min(al, 6);
|
2015-03-30 04:30:47 +02:00
|
|
|
excitement += (al * 273066) >> 16;
|
|
|
|
|
2015-04-05 06:57:53 +02:00
|
|
|
al = get_var_112_unk_3(ride);
|
|
|
|
al = min(al, 6);
|
2015-06-03 23:36:27 +02:00
|
|
|
excitement += (al * 0x3AAAA) >> 16;
|
2015-03-30 04:30:47 +02:00
|
|
|
|
2015-04-05 06:57:53 +02:00
|
|
|
al = get_var_112_unk_4(ride);
|
|
|
|
al = min(al, 7);
|
2015-03-30 04:30:47 +02:00
|
|
|
excitement += (al * 187245) >> 16;
|
|
|
|
|
|
|
|
rating_tuple rating = { excitement, 0, nausea };
|
|
|
|
return rating;
|
|
|
|
}
|
|
|
|
|
2014-10-12 00:07:20 +02:00
|
|
|
/**
|
2015-03-30 04:30:47 +02:00
|
|
|
* rct2: 0x0065E0F2
|
|
|
|
*/
|
|
|
|
static rating_tuple get_inversions_ratings(uint8 inversions) {
|
2015-06-05 04:10:42 +02:00
|
|
|
int excitement = (min(inversions, 6) * 0x1AAAAA) >> 16;
|
|
|
|
int intensity = (inversions * 0x320000) >> 16;
|
2015-06-03 23:36:27 +02:00
|
|
|
int nausea = (inversions * 0x15AAAA) >> 16;
|
2015-03-30 04:30:47 +02:00
|
|
|
|
|
|
|
rating_tuple rating = { excitement, intensity, nausea };
|
|
|
|
return rating;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2014-10-12 00:07:20 +02:00
|
|
|
*
|
2015-03-30 04:30:47 +02:00
|
|
|
*/
|
2015-04-01 05:15:41 +02:00
|
|
|
static rating_tuple get_special_track_elements_rating(uint8 type, rct_ride *ride) {
|
2015-03-30 04:30:47 +02:00
|
|
|
int excitement = 0, intensity = 0, nausea = 0;
|
|
|
|
if (type == RIDE_TYPE_GHOST_TRAIN) {
|
2015-04-01 05:15:41 +02:00
|
|
|
if (ride_has_spinning_tunnel(ride)) {
|
2015-03-30 04:30:47 +02:00
|
|
|
excitement += 40;
|
|
|
|
intensity += 25;
|
|
|
|
nausea += 55;
|
|
|
|
}
|
|
|
|
} else if (type == RIDE_TYPE_LOG_FLUME) {
|
2015-03-31 06:07:06 +02:00
|
|
|
// Reverser for log flume
|
2015-04-01 05:15:41 +02:00
|
|
|
if (ride_has_log_reverser(ride)) {
|
2015-03-30 04:30:47 +02:00
|
|
|
excitement += 48;
|
|
|
|
intensity += 55;
|
|
|
|
nausea += 65;
|
|
|
|
}
|
|
|
|
} else {
|
2015-04-01 05:15:41 +02:00
|
|
|
if (ride_has_water_splash(ride)) {
|
2015-03-30 04:30:47 +02:00
|
|
|
excitement += 50;
|
|
|
|
intensity += 30;
|
|
|
|
nausea += 20;
|
|
|
|
}
|
2015-04-01 05:15:41 +02:00
|
|
|
if (ride_has_waterfall(ride)) {
|
2015-03-30 04:30:47 +02:00
|
|
|
excitement += 55;
|
|
|
|
intensity += 30;
|
|
|
|
}
|
2015-04-01 05:15:41 +02:00
|
|
|
if (ride_has_whirlpool(ride)) {
|
2015-03-30 04:30:47 +02:00
|
|
|
excitement += 35;
|
|
|
|
intensity += 20;
|
|
|
|
nausea += 23;
|
|
|
|
}
|
|
|
|
}
|
2015-04-01 05:15:41 +02:00
|
|
|
uint8 helix_sections = ride_get_helix_sections(ride);
|
|
|
|
int al = min(helix_sections, 9);
|
2015-03-30 04:30:47 +02:00
|
|
|
excitement += (al * 254862) >> 16;
|
|
|
|
|
2015-04-01 05:15:41 +02:00
|
|
|
al = min(helix_sections, 11);
|
2015-03-30 04:30:47 +02:00
|
|
|
intensity += (al * 148945) >> 16;
|
|
|
|
|
2015-04-01 05:15:41 +02:00
|
|
|
al = max(helix_sections - 5, 0);
|
2015-03-30 04:30:47 +02:00
|
|
|
al = min(al, 10);
|
2015-04-01 07:04:23 +02:00
|
|
|
nausea += (al * 0x140000) >> 16;
|
2015-03-30 04:30:47 +02:00
|
|
|
|
|
|
|
rating_tuple rating = { excitement, intensity, nausea };
|
|
|
|
return rating;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-10-12 00:07:20 +02:00
|
|
|
* rct2: 0x0065DDD1
|
|
|
|
*/
|
2014-10-11 23:05:52 +02:00
|
|
|
static rating_tuple sub_65DDD1(rct_ride *ride)
|
|
|
|
{
|
2015-03-30 04:30:47 +02:00
|
|
|
int excitement = 0, intensity = 0, nausea = 0;
|
|
|
|
|
2015-04-01 05:15:41 +02:00
|
|
|
rating_tuple special_track_element_rating = get_special_track_elements_rating(ride->type, ride);
|
2015-03-31 06:07:06 +02:00
|
|
|
excitement += special_track_element_rating.excitement;
|
|
|
|
intensity += special_track_element_rating.intensity;
|
|
|
|
nausea += special_track_element_rating.nausea;
|
2015-03-30 04:30:47 +02:00
|
|
|
|
2015-04-01 07:04:23 +02:00
|
|
|
rating_tuple var_10E_rating = get_var_10E_rating(ride);
|
2015-03-30 04:30:47 +02:00
|
|
|
excitement += var_10E_rating.excitement;
|
|
|
|
intensity += var_10E_rating.intensity;
|
|
|
|
nausea += var_10E_rating.nausea;
|
|
|
|
|
2015-04-01 07:09:05 +02:00
|
|
|
rating_tuple var_110_rating = get_var_110_rating(ride);
|
2015-03-30 04:30:47 +02:00
|
|
|
excitement += var_110_rating.excitement;
|
|
|
|
intensity += var_110_rating.intensity;
|
|
|
|
nausea += var_110_rating.nausea;
|
|
|
|
|
2015-04-05 06:57:53 +02:00
|
|
|
rating_tuple var_112_rating = get_var_112_rating(ride);
|
2015-03-30 04:30:47 +02:00
|
|
|
excitement += var_112_rating.excitement;
|
|
|
|
intensity += var_112_rating.intensity;
|
|
|
|
nausea += var_112_rating.nausea;
|
|
|
|
|
2015-06-05 04:10:42 +02:00
|
|
|
rating_tuple inversions_rating = get_inversions_ratings(ride->inversions & 0x1F);
|
2015-03-30 04:30:47 +02:00
|
|
|
excitement += inversions_rating.excitement;
|
|
|
|
intensity += inversions_rating.intensity;
|
|
|
|
nausea += inversions_rating.nausea;
|
|
|
|
|
|
|
|
rating_tuple rating = { excitement, intensity, nausea };
|
2014-10-11 23:05:52 +02:00
|
|
|
return rating;
|
|
|
|
}
|
|
|
|
|
2014-10-12 00:07:20 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* rct2: 0x0065E1C2
|
|
|
|
*/
|
2014-10-11 23:05:52 +02:00
|
|
|
static rating_tuple sub_65E1C2(rct_ride *ride)
|
|
|
|
{
|
2015-04-11 18:47:06 +02:00
|
|
|
int sheltered_length_shifted = (ride->sheltered_length) >> 16;
|
|
|
|
uint32 eax = min(sheltered_length_shifted, 1000);
|
2015-04-01 07:42:16 +02:00
|
|
|
int excitement = (eax * 9175) >> 16;
|
2014-10-11 23:05:52 +02:00
|
|
|
|
2015-04-11 18:47:06 +02:00
|
|
|
eax = min(sheltered_length_shifted, 2000);
|
2015-04-01 07:42:16 +02:00
|
|
|
int intensity = (eax * 0x2666) >> 16;
|
2014-10-11 23:05:52 +02:00
|
|
|
|
2015-04-11 18:47:06 +02:00
|
|
|
eax = min(sheltered_length_shifted, 1000);
|
2015-04-01 07:42:16 +02:00
|
|
|
int nausea = (eax * 0x4000) >> 16;
|
|
|
|
|
2015-04-11 18:47:06 +02:00
|
|
|
/*eax = (ride->var_11C * 30340) >> 16;*/
|
|
|
|
/*nausea += eax;*/
|
2015-04-01 07:42:16 +02:00
|
|
|
|
2015-04-12 03:38:29 +02:00
|
|
|
if (ride->num_sheltered_sections & 0x40) {
|
2015-04-01 07:42:16 +02:00
|
|
|
excitement += 20;
|
|
|
|
nausea += 15;
|
|
|
|
}
|
|
|
|
|
2015-04-12 03:38:29 +02:00
|
|
|
if (ride->num_sheltered_sections & 0x20) {
|
2015-04-01 07:42:16 +02:00
|
|
|
excitement += 20;
|
|
|
|
nausea += 15;
|
|
|
|
}
|
|
|
|
|
2015-04-12 03:38:29 +02:00
|
|
|
uint8 lowerval = ride->num_sheltered_sections & 0x1F;
|
2015-04-01 07:42:16 +02:00
|
|
|
lowerval = min(lowerval, 11);
|
|
|
|
excitement += (lowerval * 774516) >> 16;
|
|
|
|
|
|
|
|
rating_tuple rating = { excitement, intensity, nausea };
|
2014-10-11 23:05:52 +02:00
|
|
|
return rating;
|
|
|
|
}
|
|
|
|
|
2014-10-12 00:07:20 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* rct2: 0x0065DCDC
|
|
|
|
*/
|
|
|
|
static rating_tuple ride_ratings_get_gforce_ratings(rct_ride *ride)
|
|
|
|
{
|
2014-10-12 00:50:04 +02:00
|
|
|
rating_tuple result;
|
|
|
|
fixed16_2dp gforce;
|
|
|
|
|
|
|
|
result.excitement = 0;
|
|
|
|
result.intensity = 0;
|
|
|
|
result.nausea = 0;
|
|
|
|
|
|
|
|
// Apply maximum positive G force factor
|
|
|
|
result.excitement += (ride->max_positive_vertical_g * 5242) >> 16;
|
|
|
|
result.intensity += (ride->max_positive_vertical_g * 52428) >> 16;
|
|
|
|
result.nausea += (ride->max_positive_vertical_g * 17039) >> 16;
|
|
|
|
|
|
|
|
// Apply maximum negative G force factor
|
|
|
|
gforce = ride->max_negative_vertical_g;
|
|
|
|
result.excitement += (clamp(-FIXED_2DP(2,50), gforce, FIXED_2DP(0,00)) * -15728) >> 16;
|
|
|
|
result.intensity += ((gforce - FIXED_2DP(1,00)) * -52428) >> 16;
|
|
|
|
result.nausea += ((gforce - FIXED_2DP(1,00)) * -14563) >> 16;
|
|
|
|
|
|
|
|
// Apply lateral G force factor
|
|
|
|
result.excitement += (min(FIXED_2DP(1,50), ride->max_lateral_g) * 26214) >> 16;
|
2015-04-01 07:04:23 +02:00
|
|
|
result.intensity += ride->max_lateral_g;
|
2014-10-12 00:50:04 +02:00
|
|
|
result.nausea += (ride->max_lateral_g * 21845) >> 16;
|
|
|
|
|
|
|
|
// Very high lateral G force penalty
|
|
|
|
if (ride->max_lateral_g > FIXED_2DP(2,80)) {
|
|
|
|
result.intensity += FIXED_2DP(3,75);
|
|
|
|
result.nausea += FIXED_2DP(2,00);
|
|
|
|
}
|
|
|
|
if (ride->max_lateral_g > FIXED_2DP(3,10)) {
|
|
|
|
result.excitement /= 2;
|
|
|
|
result.intensity += FIXED_2DP(8,50);
|
|
|
|
result.nausea += FIXED_2DP(4,00);
|
|
|
|
}
|
2014-10-12 00:07:20 +02:00
|
|
|
|
2014-10-12 00:50:04 +02:00
|
|
|
return result;
|
2014-10-12 00:07:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* rct2: 0x0065E139
|
|
|
|
*/
|
|
|
|
static rating_tuple ride_ratings_get_drop_ratings(rct_ride *ride)
|
|
|
|
{
|
2014-10-12 00:50:04 +02:00
|
|
|
rating_tuple result;
|
|
|
|
int drops;
|
2014-10-12 00:07:20 +02:00
|
|
|
|
2014-10-12 00:50:04 +02:00
|
|
|
result.excitement = 0;
|
|
|
|
result.intensity = 0;
|
|
|
|
result.nausea = 0;
|
|
|
|
|
|
|
|
// Apply number of drops factor
|
|
|
|
drops = ride->drops & 0x3F;
|
|
|
|
result.excitement += (min(9, drops) * 728177) >> 16;
|
|
|
|
result.intensity += (drops * 928426) >> 16;
|
|
|
|
result.nausea += (drops * 655360) >> 16;
|
|
|
|
|
|
|
|
// Apply highest drop factor
|
|
|
|
result.excitement += ((ride->highest_drop_height * 2) * 16000) >> 16;
|
|
|
|
result.intensity += ((ride->highest_drop_height * 2) * 32000) >> 16;
|
|
|
|
result.nausea += ((ride->highest_drop_height * 2) * 10240) >> 16;
|
|
|
|
|
|
|
|
return result;
|
2014-10-12 00:07:20 +02:00
|
|
|
}
|
|
|
|
|
2014-10-11 19:18:20 +02:00
|
|
|
/**
|
|
|
|
* Calculates a score based on the surrounding scenery.
|
|
|
|
* rct2: 0x0065E557
|
|
|
|
*/
|
|
|
|
static int ride_ratings_get_scenery_score(rct_ride *ride)
|
|
|
|
{
|
|
|
|
int i, x, y, z, xx, yy, type, numSceneryItems;
|
|
|
|
uint16 stationXY;
|
|
|
|
rct_map_element *mapElement;
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
stationXY = ride->station_starts[i];
|
|
|
|
if (stationXY != 0xFFFF)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (i == 4)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (ride->type == RIDE_TYPE_MAZE)
|
|
|
|
stationXY = ride->entrances[0];
|
|
|
|
|
|
|
|
x = stationXY & 0xFF;
|
|
|
|
y = stationXY >> 8;
|
2015-06-03 23:36:27 +02:00
|
|
|
z = map_element_height(x * 32, y * 32) & 0xFFFF;
|
2014-10-11 19:18:20 +02:00
|
|
|
|
|
|
|
// Check if station is underground, returns a fixed mediocre score since you can't have scenery underground
|
|
|
|
if (z > ride->station_heights[i] * 8)
|
|
|
|
return 40;
|
|
|
|
|
|
|
|
// Count surrounding scenery items
|
|
|
|
numSceneryItems = 0;
|
2015-01-29 18:41:09 +01:00
|
|
|
for (yy = max(y - 5, 0); yy <= y + 5; yy++) {
|
|
|
|
for (xx = max(x - 5, 0); xx <= x + 5; xx++) {
|
2014-10-11 19:18:20 +02:00
|
|
|
// Count scenery items on this tile
|
2015-01-22 01:19:05 +01:00
|
|
|
mapElement = map_get_first_element_at(xx, yy);
|
2014-10-11 19:18:20 +02:00
|
|
|
do {
|
2015-01-22 01:19:05 +01:00
|
|
|
if (mapElement->flags & (1 << 4))
|
2014-10-11 19:18:20 +02:00
|
|
|
continue;
|
|
|
|
|
2015-01-22 01:19:05 +01:00
|
|
|
type = map_element_get_type(mapElement);
|
2014-10-11 19:18:20 +02:00
|
|
|
if (type == MAP_ELEMENT_TYPE_SCENERY || type == MAP_ELEMENT_TYPE_SCENERY_MULTIPLE)
|
|
|
|
numSceneryItems++;
|
2015-01-22 01:19:05 +01:00
|
|
|
} while (!map_element_is_last_for_tile(mapElement++));
|
2014-10-11 19:18:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return min(numSceneryItems, 47) * 5;
|
|
|
|
}
|
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
#pragma region Ride rating calculation helpers
|
|
|
|
|
|
|
|
static void ride_ratings_set(rating_tuple *ratings, int excitement, int intensity, int nausea)
|
|
|
|
{
|
|
|
|
ratings->excitement = excitement;
|
|
|
|
ratings->intensity = intensity;
|
|
|
|
ratings->nausea = nausea;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_length(rating_tuple *ratings, rct_ride *ride, int maxLength, int excitementMultiplier)
|
|
|
|
{
|
|
|
|
ratings->excitement += (min(ride_get_total_length(ride) >> 16, maxLength) * excitementMultiplier) >> 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_synchronisation(rating_tuple *ratings, rct_ride *ride, int excitement, int intensity)
|
|
|
|
{
|
|
|
|
if (ride->depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS) {
|
|
|
|
ratings->excitement += excitement;
|
|
|
|
ratings->intensity += intensity;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_train_length(rating_tuple *ratings, rct_ride *ride, int excitementMultiplier)
|
|
|
|
{
|
|
|
|
ratings->excitement += ((ride->num_cars_per_train - 1) * excitementMultiplier) >> 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_max_speed(rating_tuple *ratings, rct_ride *ride, int excitementMultiplier, int intensityMultiplier, int nauseaMultiplier)
|
|
|
|
{
|
|
|
|
ratings->excitement += ((ride->max_speed >> 16) * excitementMultiplier) >> 16;
|
|
|
|
ratings->intensity += ((ride->max_speed >> 16) * intensityMultiplier) >> 16;
|
|
|
|
ratings->nausea += ((ride->max_speed >> 16) * nauseaMultiplier) >> 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_average_speed(rating_tuple *ratings, rct_ride *ride, int excitementMultiplier, int intensityMultiplier)
|
|
|
|
{
|
|
|
|
ratings->excitement += ((ride->average_speed >> 16) * excitementMultiplier) >> 16;
|
|
|
|
ratings->intensity += ((ride->average_speed >> 16) * intensityMultiplier) >> 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_duration(rating_tuple *ratings, rct_ride *ride, int maxDuration, int excitementMultiplier)
|
|
|
|
{
|
|
|
|
ratings->excitement += (min(ride_get_total_time(ride), maxDuration) * excitementMultiplier) >> 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_gforces(rating_tuple *ratings, rct_ride *ride, int excitementMultiplier, int intensityMultiplier, int nauseaMultiplier)
|
|
|
|
{
|
|
|
|
rating_tuple subRating = ride_ratings_get_gforce_ratings(ride);
|
|
|
|
ratings->excitement += (subRating.excitement * excitementMultiplier) >> 16;
|
|
|
|
ratings->intensity += (subRating.intensity * intensityMultiplier) >> 16;
|
|
|
|
ratings->nausea += (subRating.nausea * nauseaMultiplier) >> 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_65DDD1(rating_tuple *ratings, rct_ride *ride, int excitementMultiplier, int intensityMultiplier, int nauseaMultiplier)
|
|
|
|
{
|
|
|
|
rating_tuple subRating = sub_65DDD1(ride);
|
|
|
|
ratings->excitement += (subRating.excitement * excitementMultiplier) >> 16;
|
|
|
|
ratings->intensity += (subRating.intensity * intensityMultiplier) >> 16;
|
|
|
|
ratings->nausea += (subRating.nausea * nauseaMultiplier) >> 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_drops(rating_tuple *ratings, rct_ride *ride, int excitementMultiplier, int intensityMultiplier, int nauseaMultiplier)
|
|
|
|
{
|
|
|
|
rating_tuple subRating = ride_ratings_get_drop_ratings(ride);
|
|
|
|
ratings->excitement += (subRating.excitement * excitementMultiplier) >> 16;
|
|
|
|
ratings->intensity += (subRating.intensity * intensityMultiplier) >> 16;
|
|
|
|
ratings->nausea += (subRating.nausea * nauseaMultiplier) >> 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_65E1C2(rating_tuple *ratings, rct_ride *ride, int excitementMultiplier, int intensityMultiplier, int nauseaMultiplier)
|
|
|
|
{
|
|
|
|
rating_tuple subRating = sub_65E1C2(ride);
|
|
|
|
ratings->excitement += (subRating.excitement * excitementMultiplier) >> 16;
|
|
|
|
ratings->intensity += (subRating.intensity * intensityMultiplier) >> 16;
|
|
|
|
ratings->nausea += (subRating.nausea * nauseaMultiplier) >> 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_operation_option(rating_tuple *ratings, rct_ride *ride, int excitementMultiplier, int intensityMultiplier, int nauseaMultiplier)
|
|
|
|
{
|
|
|
|
ratings->excitement += (ride->operation_option * excitementMultiplier) >> 16;
|
|
|
|
ratings->intensity += (ride->operation_option * intensityMultiplier) >> 16;
|
|
|
|
ratings->nausea += (ride->operation_option * nauseaMultiplier) >> 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_65E277(rating_tuple *ratings, rct_ride *ride, int excitementMultiplier)
|
|
|
|
{
|
|
|
|
ratings->excitement += (sub_65E277() * excitementMultiplier) >> 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_scenery(rating_tuple *ratings, rct_ride *ride, int excitementMultiplier)
|
|
|
|
{
|
|
|
|
ratings->excitement += (ride_ratings_get_scenery_score(ride) * excitementMultiplier) >> 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_highest_drop_height_penalty(rating_tuple *ratings, rct_ride *ride, int minHighestDropHeight, int excitementPenalty, int intensityPenalty, int nauseaPenalty)
|
|
|
|
{
|
|
|
|
if (ride->highest_drop_height < minHighestDropHeight) {
|
2015-06-05 04:10:42 +02:00
|
|
|
ratings->excitement /= excitementPenalty;
|
|
|
|
ratings->intensity /= intensityPenalty;
|
|
|
|
ratings->nausea /= nauseaPenalty;
|
2015-06-04 23:48:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_max_speed_penalty(rating_tuple *ratings, rct_ride *ride, int minMaxSpeed, int excitementPenalty, int intensityPenalty, int nauseaPenalty)
|
|
|
|
{
|
|
|
|
if (ride->max_speed < minMaxSpeed) {
|
2015-06-05 04:10:42 +02:00
|
|
|
ratings->excitement /= excitementPenalty;
|
|
|
|
ratings->intensity /= intensityPenalty;
|
|
|
|
ratings->nausea /= nauseaPenalty;
|
2015-06-04 23:48:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_num_drops_penalty(rating_tuple *ratings, rct_ride *ride, int minNumDrops, int excitementPenalty, int intensityPenalty, int nauseaPenalty)
|
|
|
|
{
|
|
|
|
if ((ride->drops & 0x3F) < minNumDrops) {
|
2015-06-05 04:10:42 +02:00
|
|
|
ratings->excitement /= excitementPenalty;
|
|
|
|
ratings->intensity /= intensityPenalty;
|
|
|
|
ratings->nausea /= nauseaPenalty;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_max_negative_g_penalty(rating_tuple *ratings, rct_ride *ride, int maxMaxNegativeVerticalG, int excitementPenalty, int intensityPenalty, int nauseaPenalty)
|
|
|
|
{
|
|
|
|
if (ride->max_negative_vertical_g >= maxMaxNegativeVerticalG) {
|
|
|
|
ratings->excitement /= excitementPenalty;
|
|
|
|
ratings->intensity /= intensityPenalty;
|
|
|
|
ratings->nausea /= nauseaPenalty;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_apply_first_length_penalty(rating_tuple *ratings, rct_ride *ride, int minFirstLength, int excitementPenalty, int intensityPenalty, int nauseaPenalty)
|
|
|
|
{
|
|
|
|
if (ride->length[0] < minFirstLength) {
|
|
|
|
ratings->excitement /= excitementPenalty;
|
|
|
|
ratings->intensity /= intensityPenalty;
|
|
|
|
ratings->nausea /= nauseaPenalty;
|
2015-06-04 23:48:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#pragma endregion
|
|
|
|
|
2014-10-11 14:25:09 +02:00
|
|
|
#pragma region Ride rating calculation functions
|
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
static void ride_ratings_calculate_junior_roller_coaster(rct_ride *ride)
|
2015-06-04 03:08:52 +02:00
|
|
|
{
|
2015-06-04 23:48:47 +02:00
|
|
|
rating_tuple ratings;
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
2015-06-04 23:48:47 +02:00
|
|
|
|
|
|
|
ride->unreliability_factor = 13;
|
2015-06-04 03:08:52 +02:00
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(2,40), RIDE_RATING(2,50), RIDE_RATING(1,80));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 6000, 764);
|
|
|
|
ride_ratings_apply_synchronisation(&ratings, ride, RIDE_RATING(0,40), RIDE_RATING(0,05));
|
|
|
|
ride_ratings_apply_train_length(&ratings, ride, 187245);
|
|
|
|
ride_ratings_apply_max_speed(&ratings, ride, 44281, 88562, 35424);
|
|
|
|
ride_ratings_apply_average_speed(&ratings, ride, 291271, 436906);
|
|
|
|
ride_ratings_apply_duration(&ratings, ride, 150, 26214);
|
|
|
|
ride_ratings_apply_gforces(&ratings, ride, 20480, 23831, 49648);
|
|
|
|
ride_ratings_apply_65DDD1(&ratings, ride, 26749, 34767, 45749);
|
|
|
|
ride_ratings_apply_drops(&ratings, ride, 29127, 46811, 49152);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 25700, 30583, 35108);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 20130);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 9760);
|
|
|
|
ride_ratings_apply_highest_drop_height_penalty(&ratings, ride, 6, 2, 2, 2);
|
|
|
|
ride_ratings_apply_max_speed_penalty(&ratings, ride, 0x70000, 2, 2, 2);
|
|
|
|
ride_ratings_apply_num_drops_penalty(&ratings, ride, 1, 2, 2, 2);
|
2015-06-04 03:08:52 +02:00
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
2015-06-04 03:08:52 +02:00
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride->ratings = ratings;
|
2015-06-04 03:08:52 +02:00
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2015-06-04 03:08:52 +02:00
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= sub_65E72D(ride) << 5;
|
|
|
|
}
|
2015-06-04 03:08:52 +02:00
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
static void ride_ratings_calculate_miniature_railway(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
2015-06-04 03:08:52 +02:00
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
2015-06-04 03:08:52 +02:00
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride->unreliability_factor = 11;
|
|
|
|
set_unreliability_factor(ride);
|
2015-06-04 03:08:52 +02:00
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(2,50), RIDE_RATING(0,00), RIDE_RATING(0,00));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 6000, 764);
|
|
|
|
ride_ratings_apply_train_length(&ratings, ride, 140434);
|
|
|
|
ride_ratings_apply_max_speed(&ratings, ride, 44281, 88562, 35424);
|
|
|
|
ride_ratings_apply_average_speed(&ratings, ride, 291271, 436906);
|
|
|
|
ride_ratings_apply_duration(&ratings, ride, 150, 26214);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 4294960871, 6553, 23405);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 8946);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 20915);
|
2015-06-05 04:10:42 +02:00
|
|
|
ride_ratings_apply_first_length_penalty(&ratings, ride, 0xC80000, 2, 2, 2);
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
int edx = sub_65E72D(ride);
|
|
|
|
if (((edx >> 8) & 0xFF) >= 4)
|
|
|
|
ride->excitement /= 4;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= sub_65E72D(ride) << 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_calculate_monorail(rct_ride *ride)
|
|
|
|
{
|
2015-06-04 23:48:47 +02:00
|
|
|
rating_tuple ratings;
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 14;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(2,00), RIDE_RATING(0,00), RIDE_RATING(0,00));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 6000, 764);
|
|
|
|
ride_ratings_apply_train_length(&ratings, ride, 93622);
|
|
|
|
ride_ratings_apply_max_speed(&ratings, ride, 44281, 70849, 35424);
|
|
|
|
ride_ratings_apply_average_speed(&ratings, ride, 291271, 218453);
|
|
|
|
ride_ratings_apply_duration(&ratings, ride, 150, 21845);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 5140, 6553, 18724);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 8946);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 16732);
|
2015-06-05 04:10:42 +02:00
|
|
|
ride_ratings_apply_first_length_penalty(&ratings, ride, 0xAA0000, 2, 2, 2);
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
int edx = sub_65E72D(ride);
|
|
|
|
if (((edx >> 8) & 0xFF) >= 4)
|
|
|
|
ride->excitement /= 4;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= sub_65E72D(ride) << 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_calculate_boat_ride(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 7;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
|
|
|
// NOTE In the original game, the ratings were zeroed before calling set_unreliability_factor which is unusual as rest of
|
|
|
|
// the calculation functions do this before hand. This is because set_unreliability_factor alters the value of
|
|
|
|
// ebx (excitement). This is assumed to be a bug and therefore fixed.
|
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,90), RIDE_RATING(0,80), RIDE_RATING(0,90));
|
2015-06-04 03:08:52 +02:00
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
// Most likely checking if the ride has does not have a circuit
|
2015-06-04 03:08:52 +02:00
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
ratings.excitement += RIDE_RATING(0,20);
|
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 11183);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 22310);
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 0 << 5;
|
|
|
|
}
|
|
|
|
|
2015-06-05 04:10:42 +02:00
|
|
|
static void ride_ratings_calculate_steeplechase(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 14;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(2,70), RIDE_RATING(2,40), RIDE_RATING(1,80));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 6000, 764);
|
|
|
|
ride_ratings_apply_synchronisation(&ratings, ride, RIDE_RATING(0,75), RIDE_RATING(0, 9));
|
|
|
|
ride_ratings_apply_train_length(&ratings, ride, 187245);
|
|
|
|
ride_ratings_apply_max_speed(&ratings, ride, 44281, 88562, 35424);
|
|
|
|
ride_ratings_apply_average_speed(&ratings, ride, 291271, 436906);
|
|
|
|
ride_ratings_apply_duration(&ratings, ride, 150, 26214);
|
|
|
|
ride_ratings_apply_gforces(&ratings, ride, 20480, 20852, 49648);
|
|
|
|
ride_ratings_apply_65DDD1(&ratings, ride, 26749, 34767, 45749);
|
|
|
|
ride_ratings_apply_drops(&ratings, ride, 29127, 46811, 49152);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 25700, 30583, 35108);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 20130);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 9760);
|
|
|
|
ride_ratings_apply_highest_drop_height_penalty(&ratings, ride, 4, 2, 2, 2);
|
|
|
|
ride_ratings_apply_max_speed_penalty(&ratings, ride, 0x80000, 2, 2, 2);
|
|
|
|
ride_ratings_apply_max_negative_g_penalty(&ratings, ride, 50, 2, 2, 2);
|
|
|
|
ride_ratings_apply_first_length_penalty(&ratings, ride, 0xF00000, 2, 2, 2);
|
|
|
|
ride_ratings_apply_num_drops_penalty(&ratings, ride, 2, 2, 2, 2);
|
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= sub_65E72D(ride) << 5;
|
|
|
|
}
|
|
|
|
|
2015-06-04 03:08:52 +02:00
|
|
|
static void ride_ratings_calculate_car_ride(rct_ride *ride)
|
|
|
|
{
|
2015-06-04 23:48:47 +02:00
|
|
|
rating_tuple ratings;
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 12;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(2,00), RIDE_RATING(0,50), RIDE_RATING(0,00));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 6000, 764);
|
|
|
|
ride_ratings_apply_synchronisation(&ratings, ride, RIDE_RATING(0,15), RIDE_RATING(0,00));
|
|
|
|
ride_ratings_apply_train_length(&ratings, ride, 187245);
|
|
|
|
ride_ratings_apply_max_speed(&ratings, ride, 44281, 88562, 35424);
|
|
|
|
ride_ratings_apply_average_speed(&ratings, ride, 291271, 436906);
|
|
|
|
ride_ratings_apply_duration(&ratings, ride, 150, 26214);
|
|
|
|
ride_ratings_apply_65DDD1(&ratings, ride, 14860, 0, 11437);
|
|
|
|
ride_ratings_apply_drops(&ratings, ride, 8738, 0, 0);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 12850, 6553, 4681);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 11183);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 8366);
|
2015-06-05 04:10:42 +02:00
|
|
|
ride_ratings_apply_first_length_penalty(&ratings, ride, 0xC80000, 8, 2, 2);
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= sub_65E72D(ride) << 5;
|
|
|
|
}
|
|
|
|
|
2015-06-02 20:59:55 +02:00
|
|
|
static void ride_ratings_calculate_launched_freefall(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 16;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(2,70), RIDE_RATING(3,00), RIDE_RATING(3,50));
|
2015-06-02 20:59:55 +02:00
|
|
|
|
|
|
|
if (ride->mode == RIDE_MODE_DOWNWARD_LAUNCH) {
|
|
|
|
ratings.excitement += RIDE_RATING(0,30);
|
|
|
|
ratings.intensity += RIDE_RATING(0,65);
|
|
|
|
ratings.nausea += RIDE_RATING(0,45);
|
|
|
|
}
|
|
|
|
|
|
|
|
ratings.excitement += ((ride_get_total_length(ride) >> 16) * 32768) >> 16;
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_apply_operation_option(&ratings, ride, 0, 1355917, 451972);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 20130);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 25098);
|
2015-06-02 20:59:55 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= sub_65E72D(ride) << 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_calculate_observation_tower(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 15;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,50), RIDE_RATING(0,00), RIDE_RATING(0,10));
|
2015-06-02 20:59:55 +02:00
|
|
|
ratings.excitement += ((ride_get_total_length(ride) >> 16) * 45875) >> 16;
|
|
|
|
ratings.nausea += ((ride_get_total_length(ride) >> 16) * 26214) >> 16;
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 20130);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 83662);
|
2015-06-02 20:59:55 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 7 << 5;
|
|
|
|
|
|
|
|
int edx = sub_65E72D(ride);
|
|
|
|
if (((edx >> 8) & 0xFF) >= 5)
|
|
|
|
ride->excitement /= 4;
|
|
|
|
}
|
|
|
|
|
2015-06-05 04:10:42 +02:00
|
|
|
static void ride_ratings_calculate_looping_roller_coaster(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = ride_is_powered_launched(ride) ? 20 : 15;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(3,00), RIDE_RATING(0,50), RIDE_RATING(0,20));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 6000, 764);
|
|
|
|
ride_ratings_apply_synchronisation(&ratings, ride, RIDE_RATING(0,40), RIDE_RATING(0,05));
|
|
|
|
ride_ratings_apply_train_length(&ratings, ride, 187245);
|
|
|
|
ride_ratings_apply_max_speed(&ratings, ride, 44281, 88562, 35424);
|
|
|
|
ride_ratings_apply_average_speed(&ratings, ride, 291271, 436906);
|
|
|
|
ride_ratings_apply_duration(&ratings, ride, 150, 26214);
|
|
|
|
ride_ratings_apply_gforces(&ratings, ride, 24576, 35746, 49648);
|
|
|
|
ride_ratings_apply_65DDD1(&ratings, ride, 26749, 34767, 45749);
|
|
|
|
ride_ratings_apply_drops(&ratings, ride, 29127, 46811, 49152);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 15420, 32768, 35108);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 20130);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 6693);
|
|
|
|
|
|
|
|
if ((ride->inversions & 0x1F) == 0)
|
|
|
|
ride_ratings_apply_highest_drop_height_penalty(&ratings, ride, 14, 2, 2, 2);
|
|
|
|
|
|
|
|
ride_ratings_apply_max_speed_penalty(&ratings, ride, 0xA0000, 2, 2, 2);
|
|
|
|
|
|
|
|
if ((ride->inversions & 0x1F) == 0) {
|
|
|
|
ride_ratings_apply_max_negative_g_penalty(&ratings, ride, FIXED_2DP(0, 10), 2, 2, 2);
|
|
|
|
ride_ratings_apply_num_drops_penalty(&ratings, ride, 2, 2, 2, 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= sub_65E72D(ride) << 5;
|
|
|
|
}
|
|
|
|
|
2014-10-12 00:07:20 +02:00
|
|
|
static void ride_ratings_calculate_mine_train_coaster(rct_ride *ride)
|
|
|
|
{
|
2015-06-04 23:48:47 +02:00
|
|
|
rating_tuple ratings;
|
2014-10-12 00:07:20 +02:00
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 16;
|
|
|
|
set_unreliability_factor(ride);
|
2014-10-12 00:07:20 +02:00
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(2,90), RIDE_RATING(2,30), RIDE_RATING(2,10));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 6000, 764);
|
|
|
|
ride_ratings_apply_synchronisation(&ratings, ride, RIDE_RATING(0,40), RIDE_RATING(0,05));
|
|
|
|
ride_ratings_apply_train_length(&ratings, ride, 187245);
|
|
|
|
ride_ratings_apply_max_speed(&ratings, ride, 44281, 88562, 35424);
|
|
|
|
ride_ratings_apply_average_speed(&ratings, ride, 291271, 436906);
|
|
|
|
ride_ratings_apply_duration(&ratings, ride, 150, 26214);
|
|
|
|
ride_ratings_apply_gforces(&ratings, ride, 40960, 35746, 49648);
|
|
|
|
ride_ratings_apply_65DDD1(&ratings, ride, 29721, 34767, 45749);
|
|
|
|
ride_ratings_apply_drops(&ratings, ride, 29127, 46811, 49152);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 19275, 32768, 35108);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 21472);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 16732);
|
|
|
|
ride_ratings_apply_highest_drop_height_penalty(&ratings, ride, 8, 2, 2, 2);
|
|
|
|
ride_ratings_apply_max_speed_penalty(&ratings, ride, 0xA0000, 2, 2, 2);
|
2015-06-05 04:10:42 +02:00
|
|
|
ride_ratings_apply_max_negative_g_penalty(&ratings, ride, FIXED_2DP(0,10), 2, 2, 2);
|
|
|
|
ride_ratings_apply_first_length_penalty(&ratings, ride, 0x1720000, 2, 2, 2);
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_apply_num_drops_penalty(&ratings, ride, 2, 2, 2, 2);
|
2014-10-12 00:07:20 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-10-12 00:07:20 +02:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= sub_65E72D(ride) << 5;
|
|
|
|
}
|
|
|
|
|
2015-06-04 03:08:52 +02:00
|
|
|
static void ride_ratings_calculate_chairlift(rct_ride *ride)
|
|
|
|
{
|
2015-06-04 23:48:47 +02:00
|
|
|
rating_tuple ratings;
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 14 + (ride->speed * 2);
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,60), RIDE_RATING(0,40), RIDE_RATING(0,50));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 6000, 764);
|
|
|
|
ride_ratings_apply_train_length(&ratings, ride, 187245);
|
|
|
|
ride_ratings_apply_max_speed(&ratings, ride, 44281, 88562, 35424);
|
|
|
|
ride_ratings_apply_average_speed(&ratings, ride, 291271, 436906);
|
|
|
|
ride_ratings_apply_duration(&ratings, ride, 150, 26214);
|
|
|
|
ride_ratings_apply_65DDD1(&ratings, ride, 7430, 3476, 4574);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 4294948021, 21845, 23405);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 11183);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 25098);
|
2015-06-05 04:10:42 +02:00
|
|
|
ride_ratings_apply_first_length_penalty(&ratings, ride, 0x960000, 2, 2, 2);
|
|
|
|
|
2015-06-04 03:08:52 +02:00
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
if (ride->num_stations <= 1) {
|
|
|
|
ratings.excitement = 0;
|
|
|
|
ratings.intensity /= 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
int edx = sub_65E72D(ride);
|
|
|
|
if (((edx >> 8) & 0xFF) >= 4)
|
|
|
|
ride->excitement /= 4;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= edx << 5;
|
|
|
|
}
|
|
|
|
|
2014-10-11 23:05:52 +02:00
|
|
|
static void ride_ratings_calculate_maze(rct_ride *ride)
|
2014-10-11 14:25:09 +02:00
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 8;
|
|
|
|
set_unreliability_factor(ride);
|
2014-10-11 14:25:09 +02:00
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,30), RIDE_RATING(0,50), RIDE_RATING(0,00));
|
2014-10-11 23:05:52 +02:00
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
int size = min(ride->maze_tiles, 100);
|
|
|
|
ratings.excitement += size;
|
|
|
|
ratings.intensity += size * 2;
|
2014-10-11 23:05:52 +02:00
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 22310);
|
2014-10-11 14:25:09 +02:00
|
|
|
|
2014-10-11 15:14:10 +02:00
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
2014-10-11 14:25:09 +02:00
|
|
|
|
2014-10-11 19:18:20 +02:00
|
|
|
ride->ratings = ratings;
|
2014-10-11 14:25:09 +02:00
|
|
|
|
2014-10-11 15:14:10 +02:00
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-10-11 14:25:09 +02:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
2014-10-11 23:05:52 +02:00
|
|
|
ride->inversions |= 0 << 5;
|
2014-10-11 14:25:09 +02:00
|
|
|
}
|
|
|
|
|
2014-11-03 22:24:10 +01:00
|
|
|
static void ride_ratings_calculate_spiral_slide(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 8;
|
|
|
|
set_unreliability_factor(ride);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,50), RIDE_RATING(1,40), RIDE_RATING(0,90));
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
// Unlimited slides boost
|
|
|
|
if (ride->mode == RIDE_MODE_UNLIMITED_RIDES_PER_ADMISSION) {
|
|
|
|
ratings.excitement += RIDE_RATING(0, 40);
|
|
|
|
ratings.intensity += RIDE_RATING(0, 20);
|
|
|
|
ratings.nausea += RIDE_RATING(0, 25);
|
|
|
|
}
|
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 25098);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 2 << 5;
|
|
|
|
}
|
|
|
|
|
2015-06-02 22:07:46 +02:00
|
|
|
static void ride_ratings_calculate_go_karts(rct_ride *ride)
|
|
|
|
{
|
2015-06-04 23:48:47 +02:00
|
|
|
rating_tuple ratings;
|
2015-06-02 22:07:46 +02:00
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 16;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,42), RIDE_RATING(1,73), RIDE_RATING(0,40));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 700, 32768);
|
|
|
|
|
2015-06-02 22:07:46 +02:00
|
|
|
if (ride->mode == RIDE_MODE_RACE && ride->num_vehicles >= 4) {
|
|
|
|
ratings.excitement += RIDE_RATING(1,40);
|
|
|
|
ratings.intensity += RIDE_RATING(0,50);
|
|
|
|
|
|
|
|
int lapsFactor = (ride->num_laps - 1) * 30;
|
|
|
|
ratings.excitement += lapsFactor;
|
|
|
|
ratings.intensity += lapsFactor / 2;
|
|
|
|
}
|
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_apply_65DDD1(&ratings, ride, 4458, 3476, 5718);
|
|
|
|
ride_ratings_apply_drops(&ratings, ride, 8738, 5461, 6553);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 2570, 8738, 2340);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 11183);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 16732);
|
2015-06-02 22:07:46 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
int edx = sub_65E72D(ride);
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= edx << 5;
|
|
|
|
|
|
|
|
if (((edx >> 8) & 0xFF) >= 6)
|
|
|
|
ride->excitement /= 2;
|
|
|
|
}
|
|
|
|
|
2015-06-03 23:36:27 +02:00
|
|
|
static void ride_ratings_calculate_log_flume(rct_ride *ride)
|
|
|
|
{
|
2015-06-04 23:48:47 +02:00
|
|
|
rating_tuple ratings;
|
2015-06-03 23:36:27 +02:00
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 15;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,50), RIDE_RATING(0,55), RIDE_RATING(0,30));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 2000, 7208);
|
|
|
|
ride_ratings_apply_synchronisation(&ratings, ride, RIDE_RATING(0,40), RIDE_RATING(0,05));
|
|
|
|
ride_ratings_apply_max_speed(&ratings, ride, 531372, 655360, 301111);
|
|
|
|
ride_ratings_apply_duration(&ratings, ride, 300, 13107);
|
|
|
|
ride_ratings_apply_65DDD1(&ratings, ride, 22291, 20860, 4574);
|
|
|
|
ride_ratings_apply_drops(&ratings, ride, 69905, 62415, 49152);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 16705, 30583, 35108);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 22367);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 11155);
|
|
|
|
ride_ratings_apply_highest_drop_height_penalty(&ratings, ride, 2, 2, 2, 2);
|
2015-06-03 23:36:27 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= sub_65E72D(ride) << 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_calculate_river_rapids(rct_ride *ride)
|
|
|
|
{
|
2015-06-05 00:52:24 +02:00
|
|
|
rating_tuple ratings;
|
2015-06-03 23:36:27 +02:00
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 16;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,20), RIDE_RATING(0,70), RIDE_RATING(0,50));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 2000, 6225);
|
|
|
|
ride_ratings_apply_synchronisation(&ratings, ride, RIDE_RATING(0,30), RIDE_RATING(0,05));
|
|
|
|
ride_ratings_apply_max_speed(&ratings, ride, 115130, 159411, 106274);
|
|
|
|
ride_ratings_apply_duration(&ratings, ride, 500, 13107);
|
|
|
|
ride_ratings_apply_65DDD1(&ratings, ride, 29721, 22598, 5718);
|
|
|
|
ride_ratings_apply_drops(&ratings, ride, 40777, 46811, 49152);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 16705, 30583, 35108);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 31314);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 13943);
|
|
|
|
ride_ratings_apply_highest_drop_height_penalty(&ratings, ride, 2, 2, 2, 2);
|
2015-06-05 04:10:42 +02:00
|
|
|
ride_ratings_apply_first_length_penalty(&ratings, ride, 0xC80000, 2, 2, 2);
|
2015-06-03 23:36:27 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= sub_65E72D(ride) << 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_calculate_dodgems(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
|
|
|
ride->unreliability_factor = 16;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,30), RIDE_RATING(0,50), RIDE_RATING(0,35));
|
2015-06-03 23:36:27 +02:00
|
|
|
|
|
|
|
if (ride->num_vehicles >= 4)
|
|
|
|
ratings.excitement += RIDE_RATING(0,40);
|
|
|
|
|
|
|
|
ratings.excitement += ride->operation_option;
|
|
|
|
ratings.intensity += ride->operation_option / 2;
|
|
|
|
|
|
|
|
if (ride->num_vehicles >= 4)
|
|
|
|
ratings.excitement += RIDE_RATING(0,40);
|
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 5577);
|
2015-06-03 23:36:27 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 7 << 5;
|
|
|
|
}
|
|
|
|
|
2014-11-03 22:24:10 +01:00
|
|
|
static void ride_ratings_calculate_pirate_ship(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 10;
|
|
|
|
set_unreliability_factor(ride);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,50), RIDE_RATING(1,90), RIDE_RATING(1,41));
|
2014-11-03 22:24:10 +01:00
|
|
|
|
2015-06-02 20:59:55 +02:00
|
|
|
ratings.excitement += ride->operation_option * 5;
|
|
|
|
ratings.intensity += ride->operation_option * 5;
|
|
|
|
ratings.nausea += ride->operation_option * 10;
|
2014-11-03 22:24:10 +01:00
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 16732);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 0 << 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_calculate_inverter_ship(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 16;
|
|
|
|
set_unreliability_factor(ride);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(2,50), RIDE_RATING(2,70), RIDE_RATING(2,74));
|
2014-11-03 22:24:10 +01:00
|
|
|
|
2015-06-02 20:59:55 +02:00
|
|
|
ratings.excitement += ride->operation_option * 11;
|
|
|
|
ratings.intensity += ride->operation_option * 22;
|
|
|
|
ratings.nausea += ride->operation_option * 22;
|
2014-11-03 22:24:10 +01:00
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 11155);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 0 << 5;
|
|
|
|
}
|
|
|
|
|
2014-10-11 15:14:10 +02:00
|
|
|
static void ride_ratings_calculate_food_stall(rct_ride *ride)
|
|
|
|
{
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-10-11 15:14:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_calculate_drink_stall(rct_ride *ride)
|
|
|
|
{
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-10-11 15:14:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_calculate_shop(rct_ride *ride)
|
|
|
|
{
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-10-11 15:14:10 +02:00
|
|
|
}
|
|
|
|
|
2014-10-11 19:18:20 +02:00
|
|
|
static void ride_ratings_calculate_merry_go_round(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 16;
|
|
|
|
set_unreliability_factor(ride);
|
2014-10-11 19:18:20 +02:00
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(0,60), RIDE_RATING(0,15), RIDE_RATING(0,30));
|
|
|
|
|
|
|
|
int rotationsFactor = ride->rotations * 5;
|
|
|
|
ratings.excitement += rotationsFactor;
|
|
|
|
ratings.intensity += rotationsFactor;
|
|
|
|
ratings.nausea += rotationsFactor;
|
|
|
|
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 19521);
|
2014-10-11 19:18:20 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-10-11 19:18:20 +02:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 7 << 5;
|
|
|
|
}
|
|
|
|
|
2014-10-11 15:14:10 +02:00
|
|
|
static void ride_ratings_calculate_information_kiosk(rct_ride *ride)
|
|
|
|
{
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-10-11 15:14:10 +02:00
|
|
|
}
|
|
|
|
|
2015-06-03 23:36:27 +02:00
|
|
|
static void ride_ratings_calculate_toilets(rct_ride *ride)
|
2014-10-11 15:14:10 +02:00
|
|
|
{
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-10-11 15:14:10 +02:00
|
|
|
}
|
|
|
|
|
2014-10-11 23:05:52 +02:00
|
|
|
static void ride_ratings_calculate_ferris_wheel(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 16;
|
|
|
|
set_unreliability_factor(ride);
|
2014-10-11 23:05:52 +02:00
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(0,60), RIDE_RATING(0,25), RIDE_RATING(0,30));
|
|
|
|
|
|
|
|
int rotationsFactor = ride->rotations * 25;
|
|
|
|
ratings.excitement += rotationsFactor;
|
|
|
|
ratings.intensity += rotationsFactor;
|
|
|
|
ratings.nausea += rotationsFactor;
|
|
|
|
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 41831);
|
2014-10-11 23:05:52 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-10-11 23:05:52 +02:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 0 << 5;
|
|
|
|
}
|
|
|
|
|
2014-11-03 22:24:10 +01:00
|
|
|
static void ride_ratings_calculate_motion_simulator(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 21;
|
|
|
|
set_unreliability_factor(ride);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
// Base ratings
|
|
|
|
if (ride->mode == RIDE_MODE_FILM_THRILL_RIDERS) {
|
|
|
|
ratings.excitement = RIDE_RATING(3,25);
|
|
|
|
ratings.intensity = RIDE_RATING(4,10);
|
|
|
|
ratings.nausea = RIDE_RATING(3,30);
|
2015-06-04 13:56:24 +02:00
|
|
|
} else {
|
|
|
|
ratings.excitement = RIDE_RATING(2,90);
|
|
|
|
ratings.intensity = RIDE_RATING(3,50);
|
|
|
|
ratings.nausea = RIDE_RATING(3,00);
|
2014-11-03 22:24:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 7 << 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_calculate_3d_cinema(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 21;
|
|
|
|
set_unreliability_factor(ride);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
// Base ratings
|
|
|
|
switch (ride->mode) {
|
|
|
|
default:
|
|
|
|
case RIDE_MODE_3D_FILM_MOUSE_TAILS:
|
|
|
|
ratings.excitement = RIDE_RATING(3,50);
|
|
|
|
ratings.intensity = RIDE_RATING(2,40);
|
|
|
|
ratings.nausea = RIDE_RATING(1,40);
|
|
|
|
break;
|
|
|
|
case RIDE_MODE_3D_FILM_STORM_CHASERS:
|
|
|
|
ratings.excitement = RIDE_RATING(4,00);
|
|
|
|
ratings.intensity = RIDE_RATING(2,65);
|
|
|
|
ratings.nausea = RIDE_RATING(1,55);
|
|
|
|
break;
|
|
|
|
case RIDE_MODE_3D_FILM_SPACE_RAIDERS:
|
|
|
|
ratings.excitement = RIDE_RATING(4,20);
|
|
|
|
ratings.intensity = RIDE_RATING(2,60);
|
|
|
|
ratings.nausea = RIDE_RATING(1,48);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 7 << 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_calculate_top_spin(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 19;
|
|
|
|
set_unreliability_factor(ride);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
// Base ratings
|
|
|
|
switch (ride->mode) {
|
|
|
|
default:
|
|
|
|
case RIDE_MODE_BEGINNERS:
|
|
|
|
ratings.excitement = RIDE_RATING(2,00);
|
|
|
|
ratings.intensity = RIDE_RATING(4,80);
|
|
|
|
ratings.nausea = RIDE_RATING(5,74);
|
|
|
|
break;
|
|
|
|
case RIDE_MODE_INTENSE:
|
|
|
|
ratings.excitement = RIDE_RATING(3,00);
|
|
|
|
ratings.intensity = RIDE_RATING(5,75);
|
|
|
|
ratings.nausea = RIDE_RATING(6,64);
|
|
|
|
break;
|
|
|
|
case RIDE_MODE_BERSERK:
|
|
|
|
ratings.excitement = RIDE_RATING(3,20);
|
|
|
|
ratings.intensity = RIDE_RATING(6,80);
|
|
|
|
ratings.nausea = RIDE_RATING(7,94);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 11155);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 0 << 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_calculate_space_rings(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 7;
|
|
|
|
set_unreliability_factor(ride);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,50), RIDE_RATING(2,10), RIDE_RATING(6,50));
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 25098);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 0 << 5;
|
|
|
|
}
|
|
|
|
|
2015-06-03 23:36:27 +02:00
|
|
|
static void ride_ratings_calculate_lift(rct_ride *ride)
|
2014-10-11 19:55:56 +02:00
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
int totalLength;
|
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 15;
|
|
|
|
set_unreliability_factor(ride);
|
2014-10-11 19:55:56 +02:00
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,11), RIDE_RATING(0,35), RIDE_RATING(0,30));
|
2014-10-11 19:55:56 +02:00
|
|
|
|
2015-04-01 07:19:01 +02:00
|
|
|
totalLength = ride_get_total_length(ride) >> 16;
|
|
|
|
ratings.excitement += (totalLength * 45875) >> 16;
|
|
|
|
ratings.nausea += (totalLength * 26214) >> 16;
|
2014-10-11 19:55:56 +02:00
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 11183);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 83662);
|
|
|
|
|
2014-10-11 19:55:56 +02:00
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-10-11 19:55:56 +02:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 7 << 5;
|
|
|
|
|
|
|
|
if ((sub_65E72D(ride) >> 8) >= 5)
|
|
|
|
ride->excitement /= 4;
|
|
|
|
}
|
|
|
|
|
2015-06-03 23:36:27 +02:00
|
|
|
static void ride_ratings_calculate_cash_machine(rct_ride *ride)
|
2014-11-03 22:24:10 +01:00
|
|
|
{
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-11-03 22:24:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_calculate_twist(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 16;
|
|
|
|
set_unreliability_factor(ride);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,13), RIDE_RATING(0,97), RIDE_RATING(1,90));
|
2014-11-03 22:24:10 +01:00
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ratings.excitement += ride->rotations * 20;
|
|
|
|
ratings.intensity += ride->rotations * 20;
|
|
|
|
ratings.nausea += ride->rotations * 20;
|
2014-11-03 22:24:10 +01:00
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 13943);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 0 << 5;
|
|
|
|
}
|
|
|
|
|
2014-10-11 23:05:52 +02:00
|
|
|
static void ride_ratings_calculate_haunted_house(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 8;
|
|
|
|
set_unreliability_factor(ride);
|
2014-10-11 23:05:52 +02:00
|
|
|
|
|
|
|
ratings.excitement = RIDE_RATING(3,41);
|
|
|
|
ratings.intensity = RIDE_RATING(1,53);
|
|
|
|
ratings.nausea = RIDE_RATING(0,10);
|
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-10-11 23:05:52 +02:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 0xE0;
|
|
|
|
}
|
|
|
|
|
2015-06-04 03:08:52 +02:00
|
|
|
static void ride_ratings_calculate_splash_boats(rct_ride *ride)
|
|
|
|
{
|
2015-06-05 00:52:24 +02:00
|
|
|
rating_tuple ratings;
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 15;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,46), RIDE_RATING(0,35), RIDE_RATING(0,30));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 2000, 7208);
|
|
|
|
ride_ratings_apply_synchronisation(&ratings, ride, RIDE_RATING(0,40), RIDE_RATING(0,05));
|
|
|
|
ride_ratings_apply_max_speed(&ratings, ride, 797059, 655360, 301111);
|
|
|
|
ride_ratings_apply_duration(&ratings, ride, 500, 13107);
|
|
|
|
ride_ratings_apply_65DDD1(&ratings, ride, 22291, 20860, 4574);
|
|
|
|
ride_ratings_apply_drops(&ratings, ride, 87381, 93622, 62259);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 16705, 30583, 35108);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 22367);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 11155);
|
|
|
|
ride_ratings_apply_highest_drop_height_penalty(&ratings, ride, 6, 2, 2, 2);
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= sub_65E72D(ride) << 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_calculate_mini_helicopters(rct_ride *ride)
|
|
|
|
{
|
2015-06-05 00:52:24 +02:00
|
|
|
rating_tuple ratings;
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 12;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,60), RIDE_RATING(0,40), RIDE_RATING(0,00));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 6000, 764);
|
|
|
|
ride_ratings_apply_synchronisation(&ratings, ride, RIDE_RATING(0,15), RIDE_RATING(0,00));
|
|
|
|
ride_ratings_apply_train_length(&ratings, ride, 187245);
|
|
|
|
ride_ratings_apply_max_speed(&ratings, ride, 44281, 88562, 35424);
|
|
|
|
ride_ratings_apply_average_speed(&ratings, ride, 291271, 436906);
|
|
|
|
ride_ratings_apply_duration(&ratings, ride, 150, 26214);
|
|
|
|
ride_ratings_apply_65DDD1(&ratings, ride, 14860, 0, 4574);
|
|
|
|
ride_ratings_apply_drops(&ratings, ride, 8738, 0, 0);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 12850, 6553, 4681);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 8946);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 8366);
|
2015-06-05 04:10:42 +02:00
|
|
|
ride_ratings_apply_first_length_penalty(&ratings, ride, 0xA00000, 2, 2, 2);
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 6 << 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_calculate_suspended_monorail(rct_ride *ride)
|
|
|
|
{
|
2015-06-05 00:52:24 +02:00
|
|
|
rating_tuple ratings;
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 14;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(2,15), RIDE_RATING(0,23), RIDE_RATING(0, 8));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 6000, 764);
|
|
|
|
ride_ratings_apply_train_length(&ratings, ride, 93622);
|
|
|
|
ride_ratings_apply_max_speed(&ratings, ride, 44281, 70849, 35424);
|
|
|
|
ride_ratings_apply_average_speed(&ratings, ride, 291271, 218453);
|
|
|
|
ride_ratings_apply_duration(&ratings, ride, 150, 21845);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 5140, 6553, 18724);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 12525);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 25098);
|
2015-06-05 04:10:42 +02:00
|
|
|
ride_ratings_apply_first_length_penalty(&ratings, ride, 0xAA0000, 2, 2, 2);
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
int edx = sub_65E72D(ride);
|
|
|
|
if (((edx >> 8) & 0xFF) >= 4)
|
|
|
|
ride->excitement /= 4;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= edx << 5;
|
|
|
|
}
|
|
|
|
|
2014-10-11 23:05:52 +02:00
|
|
|
static void ride_ratings_calculate_mini_golf(rct_ride *ride)
|
|
|
|
{
|
2015-06-05 00:52:24 +02:00
|
|
|
rating_tuple ratings;
|
2014-10-11 23:05:52 +02:00
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 0;
|
|
|
|
set_unreliability_factor(ride);
|
2014-10-11 23:05:52 +02:00
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,50), RIDE_RATING(0,90), RIDE_RATING(0,00));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 6000, 873);
|
|
|
|
ride_ratings_apply_65DDD1(&ratings, ride, 14860, 0, 0);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 5140, 6553, 4681);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 15657);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 27887);
|
2014-10-11 23:05:52 +02:00
|
|
|
|
|
|
|
// Apply golf holes factor
|
2014-10-12 00:07:20 +02:00
|
|
|
ratings.excitement += (ride->holes & 0x1F) * 5;
|
2014-10-11 23:05:52 +02:00
|
|
|
|
|
|
|
// Apply no golf holes penalty
|
|
|
|
if ((ride->inversions & 0x1F) == 0) {
|
|
|
|
ratings.excitement /= 8;
|
|
|
|
ratings.intensity /= 2;
|
|
|
|
ratings.nausea /= 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-10-11 23:05:52 +02:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= sub_65E72D(ride) << 5;
|
|
|
|
}
|
|
|
|
|
2014-10-11 15:14:10 +02:00
|
|
|
static void ride_ratings_calculate_first_aid(rct_ride *ride)
|
2014-10-11 14:25:09 +02:00
|
|
|
{
|
2014-10-11 15:14:10 +02:00
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-10-11 14:25:09 +02:00
|
|
|
}
|
|
|
|
|
2014-11-03 22:24:10 +01:00
|
|
|
static void ride_ratings_calculate_circus_show(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 9;
|
|
|
|
set_unreliability_factor(ride);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ratings.excitement = RIDE_RATING(2,10);
|
|
|
|
ratings.intensity = RIDE_RATING(0,30);
|
|
|
|
ratings.nausea = RIDE_RATING(0,0);
|
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 7 << 5;
|
|
|
|
}
|
|
|
|
|
2015-06-04 03:08:52 +02:00
|
|
|
static void ride_ratings_calculate_ghost_train(rct_ride *ride)
|
|
|
|
{
|
2015-06-05 00:52:24 +02:00
|
|
|
rating_tuple ratings;
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 12;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(2,00), RIDE_RATING(0,20), RIDE_RATING(0,03));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 6000, 764);
|
|
|
|
ride_ratings_apply_synchronisation(&ratings, ride, RIDE_RATING(0,15), RIDE_RATING(0,00));
|
|
|
|
ride_ratings_apply_max_speed(&ratings, ride, 44281, 88562, 35424);
|
|
|
|
ride_ratings_apply_average_speed(&ratings, ride, 291271, 436906);
|
|
|
|
ride_ratings_apply_duration(&ratings, ride, 150, 26214);
|
|
|
|
ride_ratings_apply_65DDD1(&ratings, ride, 14860, 0, 11437);
|
|
|
|
ride_ratings_apply_drops(&ratings, ride, 8738, 0, 0);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 25700, 6553, 4681);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 11183);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 8366);
|
2015-06-05 04:10:42 +02:00
|
|
|
ride_ratings_apply_first_length_penalty(&ratings, ride, 0xB40000, 2, 2, 2);
|
2015-06-04 03:08:52 +02:00
|
|
|
|
2015-06-05 04:10:42 +02:00
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= sub_65E72D(ride) << 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_calculate_wooden_roller_coaster(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 19;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(3,20), RIDE_RATING(2,60), RIDE_RATING(2,00));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 6000, 873);
|
|
|
|
ride_ratings_apply_synchronisation(&ratings, ride, RIDE_RATING(0,40), RIDE_RATING(0,05));
|
|
|
|
ride_ratings_apply_train_length(&ratings, ride, 187245);
|
|
|
|
ride_ratings_apply_max_speed(&ratings, ride, 44281, 88562, 35424);
|
|
|
|
ride_ratings_apply_average_speed(&ratings, ride, 364088, 655360);
|
|
|
|
ride_ratings_apply_duration(&ratings, ride, 150, 26214);
|
|
|
|
ride_ratings_apply_gforces(&ratings, ride, 40960, 34555, 49648);
|
|
|
|
ride_ratings_apply_65DDD1(&ratings, ride, 26749, 43458, 45749);
|
|
|
|
ride_ratings_apply_drops(&ratings, ride, 40777, 46811, 49152);
|
|
|
|
ride_ratings_apply_65E1C2(&ratings, ride, 16705, 30583, 35108);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 22367);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 11155);
|
|
|
|
ride_ratings_apply_highest_drop_height_penalty(&ratings, ride, 12, 2, 2, 2);
|
|
|
|
ride_ratings_apply_max_speed_penalty(&ratings, ride, 0xA0000, 2, 2, 2);
|
|
|
|
ride_ratings_apply_max_negative_g_penalty(&ratings, ride, FIXED_2DP(0,10), 2, 2, 2);
|
|
|
|
ride_ratings_apply_first_length_penalty(&ratings, ride, 0x1720000, 2, 2, 2);
|
|
|
|
ride_ratings_apply_num_drops_penalty(&ratings, ride, 2, 2, 2, 2);
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= sub_65E72D(ride) << 5;
|
|
|
|
}
|
|
|
|
|
2015-06-02 20:59:55 +02:00
|
|
|
static void ride_ratings_calculate_roto_drop(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 24;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(2,80), RIDE_RATING(3,50), RIDE_RATING(3,50));
|
2015-06-02 20:59:55 +02:00
|
|
|
|
|
|
|
int lengthFactor = ((ride_get_total_length(ride) >> 16) * 209715) >> 16;
|
|
|
|
ratings.excitement += lengthFactor;
|
|
|
|
ratings.intensity += lengthFactor * 2;
|
|
|
|
ratings.nausea += lengthFactor * 2;
|
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 11183);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 25098);
|
2015-06-02 20:59:55 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= sub_65E72D(ride) << 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ride_ratings_calculate_flying_saucers(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
|
|
|
ride->unreliability_factor = 32;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
|
|
|
ratings.excitement = RIDE_RATING(2,40);
|
|
|
|
ratings.intensity = RIDE_RATING(0,55);
|
|
|
|
ratings.nausea = RIDE_RATING(0,39);
|
|
|
|
|
|
|
|
if (ride->num_vehicles >= 4)
|
|
|
|
ratings.excitement += RIDE_RATING(0,40);
|
|
|
|
|
|
|
|
ratings.excitement += ride->time_limit;
|
|
|
|
ratings.intensity += ride->time_limit / 2;
|
|
|
|
|
|
|
|
if (ride->num_vehicles >= 4)
|
|
|
|
ratings.excitement += RIDE_RATING(0,40);
|
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 5577);
|
2015-06-02 20:59:55 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 0 << 5;
|
|
|
|
}
|
|
|
|
|
2014-10-11 23:05:52 +02:00
|
|
|
static void ride_ratings_calculate_crooked_house(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 5;
|
|
|
|
set_unreliability_factor(ride);
|
2014-10-11 23:05:52 +02:00
|
|
|
|
|
|
|
ratings.excitement = RIDE_RATING(2,15);
|
|
|
|
ratings.intensity = RIDE_RATING(0,62);
|
|
|
|
ratings.nausea = RIDE_RATING(0,34);
|
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-10-11 23:05:52 +02:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 0xE0;
|
|
|
|
}
|
|
|
|
|
2014-11-03 22:24:10 +01:00
|
|
|
static void ride_ratings_calculate_magic_carpet(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 16;
|
|
|
|
set_unreliability_factor(ride);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(2,45), RIDE_RATING(1,60), RIDE_RATING(2,60));
|
2014-11-03 22:24:10 +01:00
|
|
|
|
2015-06-02 20:59:55 +02:00
|
|
|
ratings.excitement += ride->operation_option * 10;
|
|
|
|
ratings.intensity += ride->operation_option * 20;
|
|
|
|
ratings.nausea += ride->operation_option * 20;
|
2014-11-03 22:24:10 +01:00
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 11155);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 0 << 5;
|
|
|
|
}
|
|
|
|
|
2015-06-04 03:08:52 +02:00
|
|
|
static void ride_ratings_calculate_submarine_ride(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 7;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
|
|
|
// NOTE Fixed bug from original game, see boat ride.
|
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(2,20), RIDE_RATING(1,80), RIDE_RATING(1,40));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 6000, 764);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 11183);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 22310);
|
2015-06-04 03:08:52 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 0 << 5;
|
|
|
|
}
|
|
|
|
|
2015-06-03 23:36:27 +02:00
|
|
|
static void ride_ratings_calculate_river_rafts(rct_ride *ride)
|
|
|
|
{
|
2015-06-05 00:52:24 +02:00
|
|
|
rating_tuple ratings;
|
2015-06-03 23:36:27 +02:00
|
|
|
|
|
|
|
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
|
|
|
return;
|
|
|
|
|
|
|
|
ride->unreliability_factor = 12;
|
|
|
|
set_unreliability_factor(ride);
|
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_set(&ratings, RIDE_RATING(1,45), RIDE_RATING(0,25), RIDE_RATING(0,34));
|
|
|
|
ride_ratings_apply_length(&ratings, ride, 2000, 7208);
|
|
|
|
ride_ratings_apply_synchronisation(&ratings, ride, RIDE_RATING(0,40), RIDE_RATING(0,05));
|
|
|
|
ride_ratings_apply_max_speed(&ratings, ride, 531372, 655360, 301111);
|
|
|
|
ride_ratings_apply_duration(&ratings, ride, 500, 13107);
|
|
|
|
ride_ratings_apply_65DDD1(&ratings, ride, 22291, 20860, 4574);
|
|
|
|
ride_ratings_apply_drops(&ratings, ride, 78643, 93622, 62259);
|
|
|
|
ride_ratings_apply_65E277(&ratings, ride, 13420);
|
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 11155);
|
2015-06-03 23:36:27 +02:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= sub_65E72D(ride) << 5;
|
|
|
|
}
|
|
|
|
|
2014-11-03 22:24:10 +01:00
|
|
|
static void ride_ratings_calculate_enterprise(rct_ride *ride)
|
|
|
|
{
|
|
|
|
rating_tuple ratings;
|
|
|
|
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_TESTED;
|
|
|
|
ride->lifecycle_flags |= RIDE_LIFECYCLE_NO_RAW_STATS;
|
2015-03-22 16:01:01 +01:00
|
|
|
ride->unreliability_factor = 22;
|
|
|
|
set_unreliability_factor(ride);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
// Base ratings
|
|
|
|
ratings.excitement = RIDE_RATING(3,60);
|
|
|
|
ratings.intensity = RIDE_RATING(4,55);
|
|
|
|
ratings.nausea = RIDE_RATING(5,72);
|
|
|
|
|
2015-06-02 20:59:55 +02:00
|
|
|
ratings.excitement += ride->operation_option;
|
|
|
|
ratings.intensity += ride->operation_option * 16;
|
|
|
|
ratings.nausea += ride->operation_option * 16;
|
2014-11-03 22:24:10 +01:00
|
|
|
|
2015-06-05 00:52:24 +02:00
|
|
|
ride_ratings_apply_scenery(&ratings, ride, 19521);
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride_ratings_apply_intensity_penalty(&ratings);
|
|
|
|
ride_ratings_apply_adjustments(ride, &ratings);
|
|
|
|
|
|
|
|
ride->ratings = ratings;
|
|
|
|
|
|
|
|
ride->upkeep_cost = ride_compute_upkeep(ride);
|
2015-03-23 01:28:15 +01:00
|
|
|
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
2014-11-03 22:24:10 +01:00
|
|
|
|
|
|
|
ride->inversions &= 0x1F;
|
|
|
|
ride->inversions |= 3 << 5;
|
|
|
|
}
|
|
|
|
|
2014-10-11 14:25:09 +02:00
|
|
|
#pragma endregion
|
|
|
|
|
|
|
|
#pragma region Ride rating calculation function table
|
|
|
|
|
|
|
|
// rct2: 0x0097E050
|
|
|
|
static const ride_ratings_calculation ride_ratings_calculate_func_table[91] = {
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // SPIRAL_ROLLER_COASTER
|
|
|
|
NULL, // STAND_UP_ROLLER_COASTER
|
|
|
|
NULL, // SUSPENDED_SWINGING_COASTER
|
|
|
|
NULL, // INVERTED_ROLLER_COASTER
|
2015-06-04 23:48:47 +02:00
|
|
|
ride_ratings_calculate_junior_roller_coaster, // JUNIOR_ROLLER_COASTER
|
2015-06-04 03:08:52 +02:00
|
|
|
ride_ratings_calculate_miniature_railway, // MINIATURE_RAILWAY
|
|
|
|
ride_ratings_calculate_monorail, // MONORAIL
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // MINI_SUSPENDED_COASTER
|
2015-06-04 03:08:52 +02:00
|
|
|
ride_ratings_calculate_boat_ride, // BOAT_RIDE
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // WOODEN_WILD_MOUSE
|
2015-06-05 04:10:42 +02:00
|
|
|
ride_ratings_calculate_steeplechase, // STEEPLECHASE
|
2015-06-04 03:08:52 +02:00
|
|
|
ride_ratings_calculate_car_ride, // CAR_RIDE
|
2015-06-02 20:59:55 +02:00
|
|
|
ride_ratings_calculate_launched_freefall, // LAUNCHED_FREEFALL
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // BOBSLEIGH_COASTER
|
2015-06-02 20:59:55 +02:00
|
|
|
ride_ratings_calculate_observation_tower, // OBSERVATION_TOWER
|
2015-06-05 04:10:42 +02:00
|
|
|
ride_ratings_calculate_looping_roller_coaster, // LOOPING_ROLLER_COASTER
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // DINGHY_SLIDE
|
2014-10-12 00:07:20 +02:00
|
|
|
ride_ratings_calculate_mine_train_coaster, // MINE_TRAIN_COASTER
|
2015-06-04 03:08:52 +02:00
|
|
|
ride_ratings_calculate_chairlift, // CHAIRLIFT
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // CORKSCREW_ROLLER_COASTER
|
2014-10-11 23:05:52 +02:00
|
|
|
ride_ratings_calculate_maze, // MAZE
|
2014-11-03 22:24:10 +01:00
|
|
|
ride_ratings_calculate_spiral_slide, // SPIRAL_SLIDE
|
2015-06-02 22:07:46 +02:00
|
|
|
ride_ratings_calculate_go_karts, // GO_KARTS
|
2015-06-03 23:36:27 +02:00
|
|
|
ride_ratings_calculate_log_flume, // LOG_FLUME
|
|
|
|
ride_ratings_calculate_river_rapids, // RIVER_RAPIDS
|
|
|
|
ride_ratings_calculate_dodgems, // DODGEMS
|
2014-11-03 22:24:10 +01:00
|
|
|
ride_ratings_calculate_pirate_ship, // PIRATE_SHIP
|
|
|
|
ride_ratings_calculate_inverter_ship, // SWINGING_INVERTER_SHIP
|
2014-10-11 15:14:10 +02:00
|
|
|
ride_ratings_calculate_food_stall, // FOOD_STALL
|
|
|
|
NULL, // 1D
|
|
|
|
ride_ratings_calculate_drink_stall, // DRINK_STALL
|
|
|
|
NULL, // 1F
|
|
|
|
ride_ratings_calculate_shop, // SHOP
|
2014-10-11 19:18:20 +02:00
|
|
|
ride_ratings_calculate_merry_go_round, // MERRY_GO_ROUND
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // 22
|
|
|
|
ride_ratings_calculate_information_kiosk, // INFORMATION_KIOSK
|
2015-06-03 23:36:27 +02:00
|
|
|
ride_ratings_calculate_toilets, // TOILETS
|
2014-10-11 23:05:52 +02:00
|
|
|
ride_ratings_calculate_ferris_wheel, // FERRIS_WHEEL
|
2014-11-03 22:24:10 +01:00
|
|
|
ride_ratings_calculate_motion_simulator, // MOTION_SIMULATOR
|
|
|
|
ride_ratings_calculate_3d_cinema, // 3D_CINEMA
|
|
|
|
ride_ratings_calculate_top_spin, // TOP_SPIN
|
|
|
|
ride_ratings_calculate_space_rings, // SPACE_RINGS
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // REVERSE_FREEFALL_COASTER
|
2015-06-03 23:36:27 +02:00
|
|
|
ride_ratings_calculate_lift, // LIFT
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // VERTICAL_DROP_ROLLER_COASTER
|
2015-06-03 23:36:27 +02:00
|
|
|
ride_ratings_calculate_cash_machine, // CASH_MACHINE
|
2014-11-03 22:24:10 +01:00
|
|
|
ride_ratings_calculate_twist, // TWIST
|
2014-10-11 23:05:52 +02:00
|
|
|
ride_ratings_calculate_haunted_house, // HAUNTED_HOUSE
|
2014-10-11 15:14:10 +02:00
|
|
|
ride_ratings_calculate_first_aid, // FIRST_AID
|
2014-11-03 22:24:10 +01:00
|
|
|
ride_ratings_calculate_circus_show, // CIRCUS_SHOW
|
2015-06-04 03:08:52 +02:00
|
|
|
ride_ratings_calculate_ghost_train, // GHOST_TRAIN
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // TWISTER_ROLLER_COASTER
|
2015-06-05 04:10:42 +02:00
|
|
|
ride_ratings_calculate_wooden_roller_coaster, // WOODEN_ROLLER_COASTER
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // SIDE_FRICTION_ROLLER_COASTER
|
|
|
|
NULL, // WILD_MOUSE
|
|
|
|
NULL, // MULTI_DIMENSION_ROLLER_COASTER
|
|
|
|
NULL, // 38
|
|
|
|
NULL, // FLYING_ROLLER_COASTER
|
|
|
|
NULL, // 3A
|
|
|
|
NULL, // VIRGINIA_REEL
|
2015-06-04 03:08:52 +02:00
|
|
|
ride_ratings_calculate_splash_boats, // SPLASH_BOATS
|
|
|
|
ride_ratings_calculate_mini_helicopters, // MINI_HELICOPTERS
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // LAY_DOWN_ROLLER_COASTER
|
2015-06-04 03:08:52 +02:00
|
|
|
ride_ratings_calculate_suspended_monorail, // SUSPENDED_MONORAIL
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // 40
|
|
|
|
NULL, // REVERSER_ROLLER_COASTER
|
|
|
|
NULL, // HEARTLINE_TWISTER_COASTER
|
2014-10-11 23:05:52 +02:00
|
|
|
ride_ratings_calculate_mini_golf, // MINI_GOLF
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // GIGA_COASTER
|
2015-06-02 20:59:55 +02:00
|
|
|
ride_ratings_calculate_roto_drop, // ROTO_DROP
|
|
|
|
ride_ratings_calculate_flying_saucers, // FLYING_SAUCERS
|
2014-10-11 15:14:10 +02:00
|
|
|
ride_ratings_calculate_crooked_house, // CROOKED_HOUSE
|
|
|
|
NULL, // MONORAIL_CYCLES
|
|
|
|
NULL, // COMPACT_INVERTED_COASTER
|
|
|
|
NULL, // WATER_COASTER
|
|
|
|
NULL, // AIR_POWERED_VERTICAL_COASTER
|
|
|
|
NULL, // INVERTED_HAIRPIN_COASTER
|
2014-11-03 22:24:10 +01:00
|
|
|
ride_ratings_calculate_magic_carpet, // MAGIC_CARPET
|
2015-06-04 03:08:52 +02:00
|
|
|
ride_ratings_calculate_submarine_ride, // SUBMARINE_RIDE
|
2015-06-03 23:36:27 +02:00
|
|
|
ride_ratings_calculate_river_rafts, // RIVER_RAFTS
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // 50
|
2014-11-03 22:24:10 +01:00
|
|
|
ride_ratings_calculate_enterprise, // ENTERPRISE
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // 52
|
|
|
|
NULL, // 53
|
|
|
|
NULL, // 54
|
|
|
|
NULL, // 55
|
|
|
|
NULL, // INVERTED_IMPULSE_COASTER
|
|
|
|
NULL, // MINI_ROLLER_COASTER
|
|
|
|
NULL, // MINE_RIDE
|
2015-06-03 23:36:27 +02:00
|
|
|
NULL, // 59
|
2014-10-11 15:14:10 +02:00
|
|
|
NULL, // LIM_LAUNCHED_ROLLER_COASTER
|
2014-10-11 14:25:09 +02:00
|
|
|
};
|
|
|
|
|
2015-03-20 17:32:59 +01:00
|
|
|
#pragma endregion
|