mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #948 from kevinburke/downtime
Name var_199 as the downtime parameter
This commit is contained in:
commit
8013807f68
|
@ -1359,7 +1359,7 @@ static void ride_breakdown_update(int rideIndex)
|
||||||
ride->var_1A0 +
|
ride->var_1A0 +
|
||||||
ride->var_1A2 +
|
ride->var_1A2 +
|
||||||
ride->var_1A3;
|
ride->var_1A3;
|
||||||
ride->var_199 = min(ax / 2, 100);
|
ride->downtime = min(ax / 2, 100);
|
||||||
|
|
||||||
ride->var_1A3 = ride->var_1A2;
|
ride->var_1A3 = ride->var_1A2;
|
||||||
ride->var_1A2 = ride->var_1A1;
|
ride->var_1A2 = ride->var_1A1;
|
||||||
|
|
|
@ -259,8 +259,8 @@ typedef struct {
|
||||||
// Small constant used to increase the unreliability as the game continues,
|
// Small constant used to increase the unreliability as the game continues,
|
||||||
// making breakdowns more and more likely.
|
// making breakdowns more and more likely.
|
||||||
uint8 unreliability_factor;
|
uint8 unreliability_factor;
|
||||||
// Down time
|
// Range from [0, 100]
|
||||||
uint8 var_199;
|
uint8 downtime; // 0x199
|
||||||
uint8 inspection_interval; // 0x19A
|
uint8 inspection_interval; // 0x19A
|
||||||
uint8 last_inspection; // 0x19B
|
uint8 last_inspection; // 0x19B
|
||||||
uint8 var_19C;
|
uint8 var_19C;
|
||||||
|
|
|
@ -3439,8 +3439,7 @@ static void window_ride_maintenance_paint()
|
||||||
window_ride_maintenance_draw_bar(w, dpi, x + 103, y, max(10, reliability), 14);
|
window_ride_maintenance_draw_bar(w, dpi, x + 103, y, max(10, reliability), 14);
|
||||||
y += 11;
|
y += 11;
|
||||||
|
|
||||||
// Down time
|
downTime = ride->downtime;
|
||||||
downTime = ride->var_199;
|
|
||||||
gfx_draw_string_left(dpi, STR_DOWN_TIME_LABEL_1889, &downTime, 0, x, y);
|
gfx_draw_string_left(dpi, STR_DOWN_TIME_LABEL_1889, &downTime, 0, x, y);
|
||||||
window_ride_maintenance_draw_bar(w, dpi, x + 103, y, downTime, 28);
|
window_ride_maintenance_draw_bar(w, dpi, x + 103, y, downTime, 28);
|
||||||
y += 26;
|
y += 26;
|
||||||
|
|
|
@ -513,7 +513,7 @@ static void window_ride_list_scrollpaint()
|
||||||
case INFORMATION_TYPE_DOWN_TIME:
|
case INFORMATION_TYPE_DOWN_TIME:
|
||||||
// edx = RCT2_GLOBAL(0x009ACFA4 + (ride->var_001 * 4), uint32);
|
// edx = RCT2_GLOBAL(0x009ACFA4 + (ride->var_001 * 4), uint32);
|
||||||
|
|
||||||
RCT2_GLOBAL(0x013CE952 + 2, uint16) = ride->var_199;
|
RCT2_GLOBAL(0x013CE952 + 2, uint16) = ride->downtime;
|
||||||
formatSecondary = STR_DOWN_TIME_LABEL;
|
formatSecondary = STR_DOWN_TIME_LABEL;
|
||||||
break;
|
break;
|
||||||
case INFORMATION_TYPE_GUESTS_FAVOURITE:
|
case INFORMATION_TYPE_GUESTS_FAVOURITE:
|
||||||
|
@ -670,7 +670,7 @@ static void window_ride_list_refresh_list(rct_window *w)
|
||||||
case INFORMATION_TYPE_DOWN_TIME:
|
case INFORMATION_TYPE_DOWN_TIME:
|
||||||
while (--current_list_position >= 0) {
|
while (--current_list_position >= 0) {
|
||||||
otherRide = &g_ride_list[w->list_item_positions[current_list_position]];
|
otherRide = &g_ride_list[w->list_item_positions[current_list_position]];
|
||||||
if (ride->var_199 <= otherRide->var_199)
|
if (ride->downtime <= otherRide->downtime)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
window_bubble_list_item(w, current_list_position);
|
window_bubble_list_item(w, current_list_position);
|
||||||
|
|
|
@ -203,15 +203,13 @@ int calculate_park_rating()
|
||||||
// Rides
|
// Rides
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
short _ax, total_ride_intensity = 0, total_ride_excitement = 0, average_intensity, average_excitement;
|
short total_ride_uptime = 0, total_ride_intensity = 0, total_ride_excitement = 0, average_intensity, average_excitement;
|
||||||
int num_rides, num_exciting_rides = 0;
|
int num_rides, num_exciting_rides = 0;
|
||||||
rct_ride* ride;
|
rct_ride* ride;
|
||||||
|
|
||||||
//
|
|
||||||
_ax = 0;
|
|
||||||
num_rides = 0;
|
num_rides = 0;
|
||||||
FOR_ALL_RIDES(i, ride) {
|
FOR_ALL_RIDES(i, ride) {
|
||||||
_ax += 100 - ride->var_199;
|
total_ride_uptime += 100 - ride->downtime;
|
||||||
|
|
||||||
if (ride->excitement != -1){
|
if (ride->excitement != -1){
|
||||||
total_ride_excitement += ride->excitement / 8;
|
total_ride_excitement += ride->excitement / 8;
|
||||||
|
@ -222,7 +220,7 @@ int calculate_park_rating()
|
||||||
}
|
}
|
||||||
result -= 200;
|
result -= 200;
|
||||||
if (num_rides > 0)
|
if (num_rides > 0)
|
||||||
result += (_ax / num_rides) * 2;
|
result += (total_ride_uptime / num_rides) * 2;
|
||||||
|
|
||||||
result -= 100;
|
result -= 100;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue