mirror of https://github.com/OpenRCT2/OpenRCT2.git
add global macro: gGuestInitialHunger
This commit is contained in:
parent
727a568e32
commit
a819819ff4
|
@ -495,7 +495,7 @@ static int cc_get(const utf8 **argv, int argc)
|
|||
}
|
||||
}
|
||||
else if (strcmp(argv[0], "guest_initial_hunger") == 0) {
|
||||
console_printf("guest_initial_hunger %d%% (%d)", ((255 - RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_HUNGER, uint8)) * 100) / 255, RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_HUNGER, uint8));
|
||||
console_printf("guest_initial_hunger %d%% (%d)", ((255 - gGuestInitialHunger) * 100) / 255, gGuestInitialHunger);
|
||||
}
|
||||
else if (strcmp(argv[0], "guest_initial_thirst") == 0) {
|
||||
console_printf("guest_initial_thirst %d%% (%d)", ((255 - RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_THIRST, uint8)) * 100) / 255, RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_THIRST, uint8));
|
||||
|
@ -622,7 +622,7 @@ static int cc_set(const utf8 **argv, int argc)
|
|||
console_execute_silent("get guest_initial_happiness");
|
||||
}
|
||||
else if (strcmp(argv[0], "guest_initial_hunger") == 0 && invalidArguments(&invalidArgs, int_valid[0])) {
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_HUNGER, uint8) = (clamp(int_val[0], 1, 84) * 255 / 100 - 255) * -1;
|
||||
gGuestInitialHunger = (clamp(int_val[0], 1, 84) * 255 / 100 - 255) * -1;
|
||||
console_execute_silent("get guest_initial_hunger");
|
||||
}
|
||||
else if (strcmp(argv[0], "guest_initial_thirst") == 0 && invalidArguments(&invalidArgs, int_valid[0])) {
|
||||
|
|
|
@ -6126,7 +6126,7 @@ rct_peep *peep_generate(int x, int y, int z)
|
|||
peep->nausea = 0;
|
||||
peep->nausea_growth_rate = 0;
|
||||
|
||||
sint8 hunger = (scenario_rand() & 0x1F) - 15 + RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_HUNGER, uint8);
|
||||
sint8 hunger = (scenario_rand() & 0x1F) - 15 + gGuestInitialHunger;
|
||||
|
||||
peep->hunger = hunger;
|
||||
|
||||
|
|
|
@ -601,6 +601,7 @@ enum {
|
|||
|
||||
#define gGuestInitialCash RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_CASH, money16)
|
||||
#define gGuestInitialHappiness RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_HAPPINESS, uint8)
|
||||
#define gGuestInitialHunger RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_HUNGER, uint8)
|
||||
|
||||
int peep_get_staff_count();
|
||||
int peep_can_be_picked_up(rct_peep* peep);
|
||||
|
|
|
@ -959,7 +959,7 @@ void S4Importer::ImportParkFlags()
|
|||
|
||||
// Initial guest status
|
||||
gGuestInitialCash = _s4.guest_initial_cash;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_HUNGER, uint8) = _s4.guest_initial_hunger;
|
||||
gGuestInitialHunger = _s4.guest_initial_hunger;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_THIRST, uint8) = _s4.guest_initial_thirst;
|
||||
|
||||
// Staff colours
|
||||
|
|
|
@ -769,16 +769,16 @@ static void window_editor_scenario_options_guests_mousedown(int widgetIndex, rct
|
|||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_GUEST_INITIAL_HUNGER_INCREASE:
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_HUNGER, uint8) > 40) {
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_HUNGER, uint8) -= 4;
|
||||
if (gGuestInitialHunger > 40) {
|
||||
gGuestInitialHunger -= 4;
|
||||
} else {
|
||||
window_error_open(3264, STR_NONE);
|
||||
}
|
||||
window_invalidate(w);
|
||||
break;
|
||||
case WIDX_GUEST_INITIAL_HUNGER_DECREASE:
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_HUNGER, uint8) < 250) {
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_HUNGER, uint8) += 4;
|
||||
if (gGuestInitialHunger < 250) {
|
||||
gGuestInitialHunger += 4;
|
||||
} else {
|
||||
window_error_open(3265, STR_NONE);
|
||||
}
|
||||
|
@ -904,7 +904,7 @@ static void window_editor_scenario_options_guests_paint(rct_window *w, rct_drawp
|
|||
// Guest initial hunger value
|
||||
x = w->x + w->widgets[WIDX_GUEST_INITIAL_HUNGER].left + 1;
|
||||
y = w->y + w->widgets[WIDX_GUEST_INITIAL_HUNGER].top;
|
||||
arg = ((255 - RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_HUNGER, uint8)) * 100) / 255;
|
||||
arg = ((255 - gGuestInitialHunger) * 100) / 255;
|
||||
gfx_draw_string_left(dpi, 3247, &arg, 0, x, y);
|
||||
|
||||
// Guest initial thirst label
|
||||
|
|
|
@ -109,7 +109,7 @@ void park_init()
|
|||
|
||||
gGuestInitialCash = MONEY(50,00); // Cash per guest (average)
|
||||
gGuestInitialHappiness = calculate_guest_initial_happiness(50); // 50%
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_HUNGER, uint8) = 200;
|
||||
gGuestInitialHunger = 200;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GUEST_INITIAL_THIRST, uint8) = 200;
|
||||
gScenarioObjectiveType = OBJECTIVE_GUESTS_BY;
|
||||
gScenarioObjectiveYear = 4;
|
||||
|
|
Loading…
Reference in New Issue