mirror of https://github.com/OpenRCT2/OpenRCT2.git
improve guest generation with comments
This commit is contained in:
parent
1b3c46c17d
commit
a8182b945b
|
@ -181,7 +181,6 @@
|
|||
#define RCT2_ADDRESS_CURRENT_PARK_RATING 0x01357CB0
|
||||
#define RCT2_ADDRESS_PARK_RATING_HISTORY 0x01357CB2
|
||||
#define RCT2_ADDRESS_GUESTS_IN_PARK_HISTORY 0x01357CD2
|
||||
#define RCT2_ADDRESS_GUEST_GENERATION_PROBABILITY 0x013580EC
|
||||
#define RCT2_ADDRESS_OBJECTIVE_TYPE 0x013580F8
|
||||
#define RCT2_ADDRESS_OBJECTIVE_YEAR 0x013580F9
|
||||
#define RCT2_ADDRESS_OBJECTIVE_CURRENCY 0x013580FC
|
||||
|
|
15
src/park.c
15
src/park.c
|
@ -31,8 +31,19 @@
|
|||
#include "string_ids.h"
|
||||
#include "window.h"
|
||||
|
||||
/**
|
||||
* In a difficult guest generation scenario, no guests will be generated if over this value.
|
||||
*/
|
||||
int _suggestedGuestMaximum;
|
||||
|
||||
/**
|
||||
* Probability out of 65535, of gaining a new guest per game tick.
|
||||
* new guests per second = 40 * (probability / 65535)
|
||||
* With a full park rating, non-overpriced entrance fee, less guests than the suggested maximum and four positive awards,
|
||||
* approximately 1 guest per second can be generated (+60 guests in one minute).
|
||||
*/
|
||||
int _guestGenerationProbability;
|
||||
|
||||
int park_is_award_positive(int type)
|
||||
{
|
||||
// Check if award is negative
|
||||
|
@ -530,7 +541,7 @@ static rct_peep *park_generate_new_guest_due_to_campaign(int campaign)
|
|||
static void park_generate_new_guests()
|
||||
{
|
||||
// Generate a new guest for some probability
|
||||
if ((scenario_rand() & 0xFFFF) < RCT2_GLOBAL(0x013580EC, uint16)) {
|
||||
if ((scenario_rand() & 0xFFFF) < _guestGenerationProbability) {
|
||||
int difficultGeneration = (RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32) & PARK_FLAGS_DIFFICULT_GUEST_GENERATION) != 0;
|
||||
if (!difficultGeneration || _suggestedGuestMaximum + 150 >= RCT2_GLOBAL(RCT2_ADDRESS_GUESTS_IN_PARK, uint16))
|
||||
park_generate_new_guest();
|
||||
|
@ -562,7 +573,7 @@ void park_update()
|
|||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PARK_VALUE, money32) = calculate_park_value();
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_COMPANY_VALUE, money32) = calculate_company_value();
|
||||
window_invalidate_by_id(WC_FINANCES, 0);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GUEST_GENERATION_PROBABILITY, uint16) = park_calculate_guest_generation_probability();
|
||||
_guestGenerationProbability = park_calculate_guest_generation_probability();
|
||||
RCT2_GLOBAL(0x009A9804, uint16) |= 0x10;
|
||||
window_invalidate_by_id(WC_PARK_INFORMATION, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue