mirror of https://github.com/OpenRCT2/OpenRCT2.git
Rename fair_value to value
This commit is contained in:
parent
3862a85666
commit
5fc72d354d
|
@ -218,8 +218,7 @@ typedef struct {
|
|||
ride_rating nausea; // 0x144
|
||||
};
|
||||
};
|
||||
// Max price customers will pay before they think the ride is bad value
|
||||
uint16 fair_value; // 0x146
|
||||
uint16 value; // 0x146
|
||||
uint16 var_148;
|
||||
uint8 satisfaction; // 0x14A
|
||||
uint8 satisfaction_time_out; // 0x14B
|
||||
|
@ -666,7 +665,7 @@ enum {
|
|||
#define MAX_RIDES 255
|
||||
|
||||
#define MAX_RIDE_MEASUREMENTS 8
|
||||
#define RIDE_FAIR_VALUE_UNDEFINED 0xFFFF
|
||||
#define RIDE_VALUE_UNDEFINED 0xFFFF
|
||||
#define RIDE_INITIAL_RELIABILITY ((100 << 8) - 1)
|
||||
|
||||
#define STATION_DEPART_FLAG (1 << 7)
|
||||
|
|
|
@ -49,7 +49,7 @@ static void ride_ratings_update_state_4();
|
|||
static void ride_ratings_update_state_5();
|
||||
static void loc_6B5BB2();
|
||||
static void ride_ratings_calculate(rct_ride *ride);
|
||||
static void ride_ratings_fair_value_calculate(rct_ride *ride);
|
||||
static void ride_ratings_calculate_value(rct_ride *ride);
|
||||
|
||||
static int sub_6C6402(rct_map_element *mapElement, int *x, int *y, int *z)
|
||||
{
|
||||
|
@ -283,7 +283,7 @@ static void ride_ratings_update_state_3()
|
|||
|
||||
ride_ratings_calculate(ride);
|
||||
RCT2_CALLPROC_X(0x00655F64, 0, 0, 0, 0, 0, (int)ride, 0);
|
||||
ride_ratings_fair_value_calculate(ride);
|
||||
ride_ratings_calculate_value(ride);
|
||||
|
||||
window_invalidate_by_number(WC_RIDE, _rideRatingsCurrentRide);
|
||||
_rideRatingsState = RIDE_RATINGS_STATE_FIND_NEXT_RIDE;
|
||||
|
@ -372,7 +372,7 @@ static void ride_ratings_calculate(rct_ride *ride)
|
|||
}
|
||||
}
|
||||
|
||||
static void ride_ratings_fair_value_calculate(rct_ride *ride)
|
||||
static void ride_ratings_calculate_value(rct_ride *ride)
|
||||
{
|
||||
rct_ride *ride2;
|
||||
int i, otherRidesOfSameType;
|
||||
|
@ -380,7 +380,7 @@ static void ride_ratings_fair_value_calculate(rct_ride *ride)
|
|||
if (ride->excitement == (ride_rating)0xFFFF)
|
||||
return;
|
||||
|
||||
int fair_value =
|
||||
int value =
|
||||
(((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);
|
||||
|
@ -389,19 +389,19 @@ static void ride_ratings_fair_value_calculate(rct_ride *ride)
|
|||
|
||||
// New ride reward
|
||||
if (monthsOld <= 12) {
|
||||
fair_value += 10;
|
||||
value += 10;
|
||||
if (monthsOld <= 4)
|
||||
fair_value += 20;
|
||||
value += 20;
|
||||
}
|
||||
|
||||
// Old ride penalty
|
||||
if (monthsOld >= 40) fair_value -= fair_value / 4;
|
||||
if (monthsOld >= 64) fair_value -= fair_value / 4;
|
||||
if (monthsOld >= 40) value -= value / 4;
|
||||
if (monthsOld >= 64) value -= value / 4;
|
||||
if (monthsOld < 200) {
|
||||
if (monthsOld >= 88) fair_value -= fair_value / 4;
|
||||
if (monthsOld >= 104) fair_value -= fair_value / 4;
|
||||
if (monthsOld >= 120) fair_value -= fair_value / 2;
|
||||
if (monthsOld >= 128) fair_value -= fair_value / 2;
|
||||
if (monthsOld >= 88) value -= value / 4;
|
||||
if (monthsOld >= 104) value -= value / 4;
|
||||
if (monthsOld >= 120) value -= value / 2;
|
||||
if (monthsOld >= 128) value -= value / 2;
|
||||
}
|
||||
|
||||
// Other ride of same type penalty
|
||||
|
@ -411,9 +411,9 @@ static void ride_ratings_fair_value_calculate(rct_ride *ride)
|
|||
otherRidesOfSameType++;
|
||||
}
|
||||
if (otherRidesOfSameType > 1)
|
||||
fair_value -= fair_value / 4;
|
||||
value -= value / 4;
|
||||
|
||||
ride->fair_value = max(0, fair_value);
|
||||
ride->value = max(0, value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -100,13 +100,13 @@ static void* window_new_campaign_events[] = {
|
|||
uint8 window_new_campaign_rides[MAX_RIDES];
|
||||
uint8 window_new_campaign_shop_items[64];
|
||||
|
||||
int ride_fair_value_compare(const void *a, const void *b)
|
||||
int ride_value_compare(const void *a, const void *b)
|
||||
{
|
||||
rct_ride *rideA, *rideB;
|
||||
|
||||
rideA = GET_RIDE(*((uint8*)a));
|
||||
rideB = GET_RIDE(*((uint8*)b));
|
||||
return rideB->fair_value - rideA->fair_value;
|
||||
return rideB->value - rideA->value;
|
||||
}
|
||||
|
||||
int ride_name_compare(const void *a, const void *b)
|
||||
|
@ -179,7 +179,7 @@ void window_new_campaign_open(sint16 campaignType)
|
|||
|
||||
// Take top 40 most reliable rides
|
||||
if (numApplicableRides > 40) {
|
||||
qsort(window_new_campaign_rides, countof(window_new_campaign_rides), sizeof(uint8), ride_fair_value_compare);
|
||||
qsort(window_new_campaign_rides, countof(window_new_campaign_rides), sizeof(uint8), ride_value_compare);
|
||||
numApplicableRides = 40;
|
||||
}
|
||||
|
||||
|
|
|
@ -276,11 +276,11 @@ money32 calculate_ride_value(rct_ride *ride)
|
|||
{
|
||||
if (ride->type == RIDE_TYPE_NULL)
|
||||
return 0;
|
||||
if (ride->fair_value == RIDE_FAIR_VALUE_UNDEFINED)
|
||||
if (ride->value == RIDE_VALUE_UNDEFINED)
|
||||
return 0;
|
||||
|
||||
// Fair value * (...)
|
||||
return (ride->fair_value * 10) * (
|
||||
return (ride->value * 10) * (
|
||||
ride->var_124 + ride->var_126 + ride->var_128 + ride->var_12A +
|
||||
ride->var_12C + ride->var_12E + ride->age + ride->running_cost +
|
||||
ride->var_134 + ride->var_136 +
|
||||
|
@ -369,8 +369,8 @@ static int park_calculate_guest_generation_probability()
|
|||
suggestedMaxGuests += RCT2_GLOBAL(0x0097D21E + (ride->type * 8), uint8);
|
||||
|
||||
// Add ride value
|
||||
if (ride->fair_value != RIDE_FAIR_VALUE_UNDEFINED) {
|
||||
int rideValue = ride->fair_value - ride->price;
|
||||
if (ride->value != RIDE_VALUE_UNDEFINED) {
|
||||
int rideValue = ride->value - ride->price;
|
||||
if (rideValue > 0)
|
||||
totalRideValue += rideValue * 2;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue