mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-20 13:33:02 +01:00
1182
src/peep/peep.c
1182
src/peep/peep.c
File diff suppressed because it is too large
Load Diff
@@ -40,6 +40,7 @@ enum PEEP_TYPE {
|
||||
};
|
||||
|
||||
enum PEEP_THOUGHT_TYPE {
|
||||
PEEP_THOUGHT_TYPE_CANT_AFFORD_0 = 0, // "I can't afford"
|
||||
PEEP_THOUGHT_TYPE_SPENT_MONEY = 1, // "I've spent all my money"
|
||||
PEEP_THOUGHT_TYPE_SICK = 2, // "I feel sick"
|
||||
PEEP_THOUGHT_TYPE_VERY_SICK = 3, // "I feel very sick"
|
||||
@@ -230,6 +231,7 @@ enum PEEP_ACTION_EVENTS {
|
||||
PEEP_ACTION_STAFF_FIX_2 = 16,
|
||||
PEEP_ACTION_STAFF_FIX_GROUND = 17,
|
||||
PEEP_ACTION_STAFF_WATERING = 19,
|
||||
PEEP_ACTION_READ_MAP = 21,
|
||||
PEEP_ACTION_WAVE = 22,
|
||||
PEEP_ACTION_STAFF_EMPTY_BIN = 23,
|
||||
PEEP_ACTION_WAVE_2 = 24,
|
||||
@@ -250,27 +252,27 @@ enum PEEP_FLAGS {
|
||||
|
||||
PEEP_FLAGS_TRACKING = (1 << 3),
|
||||
PEEP_FLAGS_WAVING = (1 << 4), // Makes the peep wave
|
||||
|
||||
PEEP_FLAGS_5 = (1 << 5),
|
||||
PEEP_FLAGS_PHOTO = (1 << 6), // Makes the peep take a picture
|
||||
PEEP_FLAGS_PAINTING = (1 << 7),
|
||||
|
||||
PEEP_FLAGS_PAINTING = (1 << 7),
|
||||
PEEP_FLAGS_WOW = (1 << 8), // Makes a peep WOW2
|
||||
PEEP_FLAGS_LITTER = (1 << 9), // Makes the peep throw litter
|
||||
PEEP_FLAGS_LOST = (1 << 10), // Makes the peep feel lost (animation trigerred)
|
||||
PEEP_FLAGS_HUNGER = (1 << 11), // Makes the peep become hungry quicker
|
||||
PEEP_FLAGS_BATHROOM = (1 << 12), // Makes the peep want to go to the bathroom
|
||||
PEEP_FLAGS_CROWDED = (1 << 13), // The peep will start feeling crowded
|
||||
|
||||
PEEP_FLAGS_HAPPINESS = (1 << 14), // The peep will start increasing happiness
|
||||
PEEP_FLAGS_NAUSEA = (1 << 15), // Makes the peep feel sick (e.g. after an extreme ride)
|
||||
|
||||
PEEP_FLAGS_EATING = (1 << 17), // Reduces hunger
|
||||
PEEP_FLAGS_EXPLODE = (1 << 18),
|
||||
|
||||
PEEP_FLAGS_21 = (1<<21),
|
||||
PEEP_FLAGS_20 = (1 << 20),
|
||||
PEEP_FLAGS_21 = (1 << 21),
|
||||
|
||||
PEEP_FLAGS_JOY = (1 << 23), // Makes the peep jump in joy
|
||||
PEEP_FLAGS_ANGRY = (1 << 24),
|
||||
PEEP_FLAGS_ICE_CREAM = (1 << 25), // Unconfirmed
|
||||
|
||||
PEEP_FLAGS_27 = (1 << 27),
|
||||
PEEP_FLAGS_TWITCH = (1 << 31) // Added for twitch integration
|
||||
};
|
||||
|
||||
@@ -337,6 +339,15 @@ enum PEEP_ITEM {
|
||||
PEEP_ITEM_EMPTY_BOWL_BLUE = (1 << 21)
|
||||
};
|
||||
|
||||
// Flags used by peep->window_invalidate_flags
|
||||
enum {
|
||||
PEEP_INVALIDATE_PEEP_THOUGHTS = 1,
|
||||
PEEP_INVALIDATE_PEEP_STATS = 1 << 1,
|
||||
PEEP_INVALIDATE_PEEP_2 = 1 << 2,
|
||||
PEEP_INVALIDATE_PEEP_INVENTORY = 1 << 3,
|
||||
PEEP_INVALIDATE_STAFF_STATS = 1 << 4,
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
uint8 type; //0
|
||||
uint8 item; //1
|
||||
@@ -401,7 +412,7 @@ typedef struct {
|
||||
uint8 var_42;
|
||||
uint8 intensity; // 0x43
|
||||
uint8 nausea_tolerance; // 0x44
|
||||
uint8 var_45; // Some sort of flags?
|
||||
uint8 window_invalidate_flags; // 0x45
|
||||
money16 paid_on_drink; // 0x46
|
||||
uint8 var_48[16];
|
||||
uint32 item_extra_flags; // 0x58
|
||||
@@ -469,7 +480,10 @@ typedef struct {
|
||||
uint8 pad_D0[0x10];
|
||||
uint8 no_action_frame_no; // 0xE0
|
||||
uint8 var_E1;
|
||||
uint8 var_E2; // 0xE2
|
||||
union{
|
||||
uint8 time_on_ride; // 0xE2
|
||||
uint8 var_E2; // 0xE2
|
||||
};
|
||||
uint8 var_E3;
|
||||
union{
|
||||
money16 paid_to_enter; // 0xE4
|
||||
|
||||
@@ -127,7 +127,7 @@ void game_command_hire_new_staff_member(int* eax, int* ebx, int* ecx, int* edx,
|
||||
move_sprite_to_list((rct_sprite *)newPeep, SPRITE_LINKEDLIST_OFFSET_PEEP);
|
||||
|
||||
newPeep->sprite_identifier = 1;
|
||||
newPeep->var_45 = 0;
|
||||
newPeep->window_invalidate_flags = 0;
|
||||
newPeep->action = PEEP_ACTION_NONE_2;
|
||||
newPeep->var_6D = 0;
|
||||
newPeep->action_sprite_image_offset = 0;
|
||||
|
||||
@@ -1013,7 +1013,7 @@ void ride_remove_peeps(int rideIndex)
|
||||
|
||||
peep->happiness = min(peep->happiness, peep->happiness_growth_rate) / 2;
|
||||
peep->happiness_growth_rate = peep->happiness;
|
||||
peep->var_45 |= 2;
|
||||
peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_STATS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6600,3 +6600,11 @@ void ride_crash(int rideIndex, int vehicleIndex)
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMMON_FORMAT_ARGS + 2, uint32) = ride->name_arguments;
|
||||
news_item_add_to_queue(NEWS_ITEM_RIDE, STR_RIDE_HAS_CRASHED, rideIndex);
|
||||
}
|
||||
|
||||
bool ride_type_is_intamin(int rideType)
|
||||
{
|
||||
return
|
||||
rideType == RIDE_TYPE_HEARTLINE_TWISTER_COASTER ||
|
||||
rideType == RIDE_TYPE_GIGA_COASTER ||
|
||||
rideType == RIDE_TYPE_INVERTED_IMPULSE_COASTER;
|
||||
}
|
||||
|
||||
@@ -213,6 +213,7 @@ typedef struct {
|
||||
union {
|
||||
uint8 inversions; // 0x114 (???X XXXX)
|
||||
uint8 holes; // 0x114 (???X XXXX)
|
||||
uint8 var_114;
|
||||
};
|
||||
uint8 drops; // 0x115 (??XX XXXX)
|
||||
uint8 var_116;
|
||||
@@ -383,7 +384,7 @@ enum {
|
||||
RIDE_LIFECYCLE_BREAKDOWN_PENDING = 1 << 6,
|
||||
RIDE_LIFECYCLE_BROKEN_DOWN = 1 << 7,
|
||||
RIDE_LIFECYCLE_DUE_INSPECTION = 1 << 8,
|
||||
|
||||
RIDE_LIFECYCLE_9 = 1 << 9,
|
||||
RIDE_LIFECYCLE_CRASHED = 1 << 10,
|
||||
RIDE_LIFECYCLE_11 = 1 << 11,
|
||||
RIDE_LIFECYCLE_EVER_BEEN_OPENED = 1 << 12,
|
||||
@@ -971,4 +972,6 @@ void game_command_remove_ride_entrance_or_exit(int *eax, int *ebx, int *ecx, int
|
||||
void sub_6CB945(int rideIndex);
|
||||
void ride_crash(int rideIndex, int vehicleIndex);
|
||||
|
||||
bool ride_type_is_intamin(int rideType);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1277,7 +1277,7 @@ void window_guest_stats_update(rct_window *w)
|
||||
{
|
||||
w->frame_no++;
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
peep->var_45 &= ~(1<<1);
|
||||
peep->window_invalidate_flags &= ~PEEP_INVALIDATE_PEEP_STATS;
|
||||
|
||||
window_invalidate(w);
|
||||
}
|
||||
@@ -1808,8 +1808,8 @@ void window_guest_finance_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
void window_guest_thoughts_resize(rct_window *w)
|
||||
{
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
if (peep->var_45 & 1){
|
||||
peep->var_45 &=~(1 << 0);
|
||||
if (peep->window_invalidate_flags & PEEP_INVALIDATE_PEEP_THOUGHTS){
|
||||
peep->window_invalidate_flags &= ~PEEP_INVALIDATE_PEEP_THOUGHTS;
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
||||
@@ -1902,8 +1902,8 @@ void window_guest_thoughts_paint(rct_window *w, rct_drawpixelinfo *dpi)
|
||||
void window_guest_inventory_resize(rct_window *w)
|
||||
{
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
if (peep->var_45 & (1<<3)){
|
||||
peep->var_45 &= ~(1 << 3);
|
||||
if (peep->window_invalidate_flags & PEEP_INVALIDATE_PEEP_INVENTORY){
|
||||
peep->window_invalidate_flags &= ~PEEP_INVALIDATE_PEEP_INVENTORY;
|
||||
window_invalidate(w);
|
||||
}
|
||||
|
||||
|
||||
@@ -678,8 +678,8 @@ void window_staff_stats_update(rct_window* w)
|
||||
widget_invalidate(w, WIDX_TAB_3);
|
||||
|
||||
rct_peep* peep = GET_PEEP(w->number);
|
||||
if (peep->var_45 & 0x10) {
|
||||
peep->var_45 &= 0xEF;
|
||||
if (peep->window_invalidate_flags & PEEP_INVALIDATE_STAFF_STATS) {
|
||||
peep->window_invalidate_flags &= ~PEEP_INVALIDATE_STAFF_STATS;
|
||||
window_invalidate(w);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ enum {
|
||||
PARK_FLAGS_FORBID_HIGH_CONSTRUCTION = (1 << 5), // below tree height
|
||||
PARK_FLAGS_PREF_LESS_INTENSE_RIDES = (1 << 6),
|
||||
PARK_FLAGS_FORBID_MARKETING_CAMPAIGN = (1 << 7),
|
||||
PARK_FLAGS_8 = (1 << 8),
|
||||
PARK_FLAGS_PREF_MORE_INTENSE_RIDES = (1 << 9),
|
||||
PARK_FLAGS_NO_MONEY = (1 << 11),
|
||||
PARK_FLAGS_DIFFICULT_GUEST_GENERATION = (1 << 12),
|
||||
|
||||
@@ -1038,3 +1038,39 @@ void sub_6738E1(int x, int y, int z)
|
||||
{
|
||||
RCT2_CALLPROC_X(0x006738E1, x, 0, y, z, 0, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0067363D
|
||||
*/
|
||||
void sprite_misc_3_create(int x, int y, int z)
|
||||
{
|
||||
rct_unk_sprite *sprite = (rct_unk_sprite*)create_sprite(2);
|
||||
if (sprite != NULL) {
|
||||
sprite->sprite_width = 44;
|
||||
sprite->sprite_height_negative = 32;
|
||||
sprite->sprite_height_positive = 34;
|
||||
sprite->sprite_identifier = SPRITE_IDENTIFIER_MISC;
|
||||
sprite_move(x, y, z + 4, (rct_sprite*)sprite);
|
||||
sprite->misc_identifier = SPRITE_MISC_3;
|
||||
sprite->var_26 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0067366B
|
||||
*/
|
||||
void sprite_misc_5_create(int x, int y, int z)
|
||||
{
|
||||
rct_unk_sprite *sprite = (rct_unk_sprite*)create_sprite(2);
|
||||
if (sprite != NULL) {
|
||||
sprite->sprite_width = 25;
|
||||
sprite->sprite_height_negative = 85;
|
||||
sprite->sprite_height_positive = 8;
|
||||
sprite->sprite_identifier = SPRITE_IDENTIFIER_MISC;
|
||||
sprite_move(x, y, z + 4, (rct_sprite*)sprite);
|
||||
sprite->misc_identifier = SPRITE_MISC_5;
|
||||
sprite->var_26 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,9 @@ typedef struct {
|
||||
uint8 sprite_direction; //direction of sprite? 0x1e
|
||||
uint8 pad_1F[3]; // 0x1f
|
||||
uint16 name_string_idx; // 0x22
|
||||
uint8 pad_24[7];
|
||||
uint8 pad_24[2];
|
||||
uint16 var_26;
|
||||
uint8 var_28[3];
|
||||
uint8 var_2B;
|
||||
uint8 pad_2C[0x45];
|
||||
uint8 var_71;
|
||||
@@ -260,5 +262,7 @@ void sprite_remove(rct_sprite *sprite);
|
||||
void litter_create(int x, int y, int z, int direction, int type);
|
||||
void sub_6EC53F(rct_sprite *sprite);
|
||||
void sub_6738E1(int x, int y, int z);
|
||||
void sprite_misc_3_create(int x, int y, int z);
|
||||
void sprite_misc_5_create(int x, int y, int z);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user