mirror of https://github.com/OpenRCT2/OpenRCT2.git
implement balloon_press and duck_press
This commit is contained in:
parent
10484ec17a
commit
aacd6b9db0
|
@ -132,7 +132,16 @@ int viewport_interaction_left_click(int x, int y)
|
|||
window_guest_open(info.peep);
|
||||
break;
|
||||
case SPRITE_IDENTIFIER_MISC:
|
||||
balloon_pop(info.sprite);
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint8) == 0) {
|
||||
switch (info.sprite->unknown.misc_identifier) {
|
||||
case SPRITE_MISC_BALLOON:
|
||||
balloon_press(&info.sprite->balloon);
|
||||
break;
|
||||
case SPRITE_MISC_DUCK:
|
||||
duck_press(&info.sprite->duck);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
|
|
|
@ -48,6 +48,13 @@ void create_balloon(int x, int y, int z, int colour, uint8 bl)
|
|||
}
|
||||
}
|
||||
|
||||
void balloon_pop(rct_balloon *balloon)
|
||||
{
|
||||
balloon->popped = 1;
|
||||
balloon->var_26 = 0;
|
||||
sound_play_panned(SOUND_BALLOON_POP, 0x8001, balloon->x, balloon->y, balloon->z);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct: 0x0067342C
|
||||
|
@ -75,19 +82,30 @@ void balloon_update(rct_balloon *balloon)
|
|||
if (balloon->z < maxZ)
|
||||
return;
|
||||
|
||||
balloon->popped = 1;
|
||||
balloon->var_26 = 0;
|
||||
|
||||
sound_play_panned(SOUND_BALLOON_POP, 0x8001, balloon->x, balloon->y, balloon->z);
|
||||
balloon_pop(balloon);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006E88D7
|
||||
* rct2: 0x006E88ED
|
||||
*/
|
||||
void balloon_pop(rct_sprite *sprite)
|
||||
void balloon_press(rct_balloon *balloon)
|
||||
{
|
||||
RCT2_CALLPROC_X(0x006E88D7, 0, 0, 0, (int)sprite, 0, 0, 0);
|
||||
if (balloon->popped == 1)
|
||||
return;
|
||||
|
||||
uint32 random = scenario_rand();
|
||||
if ((balloon->var_0A & 7) || (random & 0xFFFF) < 0x2000) {
|
||||
balloon_pop(balloon);
|
||||
return;
|
||||
}
|
||||
|
||||
sprite_move(
|
||||
balloon->x + ((random & 0x80000000) ? -6 : 6),
|
||||
balloon->y,
|
||||
balloon->z,
|
||||
(rct_sprite*)balloon
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -140,6 +158,15 @@ void duck_update(rct_duck *duck)
|
|||
RCT2_CALLPROC_X(0x006740E8, 0, 0, 0, 0, (int)duck, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct: 0x006E895D
|
||||
*/
|
||||
void duck_press(rct_duck *duck)
|
||||
{
|
||||
sound_play_panned(SOUND_QUACK, 0x8001, duck->x, duck->y, duck->z);
|
||||
}
|
||||
|
||||
static const rct_xy16 _moneyEffectMoveOffset[] = {
|
||||
{ 1, -1 },
|
||||
{ 1, 1 },
|
||||
|
|
|
@ -100,7 +100,8 @@ typedef struct {
|
|||
uint16 previous; // 0x06
|
||||
uint8 linked_list_type_offset; // 0x08 Valid values are SPRITE_LINKEDLIST_OFFSET_...
|
||||
uint8 var_09; // 0x09
|
||||
uint8 pad_0A[0x4];
|
||||
uint16 var_0A;
|
||||
uint8 pad_0C[0x2];
|
||||
sint16 x; // 0x0E
|
||||
sint16 y; // 0x10
|
||||
sint16 z; // 0x12
|
||||
|
@ -127,7 +128,10 @@ typedef struct {
|
|||
uint16 previous; // 0x06
|
||||
uint8 linked_list_type_offset; // 0x08 Valid values are SPRITE_LINKEDLIST_OFFSET_...
|
||||
uint8 var_09; // 0x09
|
||||
uint8 pad_0A[0xA];
|
||||
uint8 pad_0A[0x4];
|
||||
sint16 x; // 0x0E
|
||||
sint16 y; // 0x10
|
||||
sint16 z; // 0x12
|
||||
uint8 var_14; // 0x14
|
||||
uint8 var_15; // 0x15
|
||||
uint8 pad_16[0x8];
|
||||
|
@ -226,14 +230,15 @@ enum {
|
|||
extern rct_sprite* g_sprite_list;
|
||||
|
||||
void create_balloon(int x, int y, int z, int colour, uint8 bl);
|
||||
void balloon_press(rct_balloon *balloon);
|
||||
void create_duck(int targetX, int targetY);
|
||||
void duck_press(rct_duck *duck);
|
||||
rct_sprite *create_sprite(uint8 bl);
|
||||
void reset_sprite_list();
|
||||
void reset_0x69EBE4();
|
||||
void move_sprite_to_list(rct_sprite *sprite, uint8 cl);
|
||||
void sprite_misc_update_all();
|
||||
void sprite_move(int x, int y, int z, rct_sprite* sprite);
|
||||
void balloon_pop(rct_sprite *sprite);
|
||||
void invalidate_sprite(rct_sprite *sprite);
|
||||
void sprite_remove(rct_sprite *sprite);
|
||||
|
||||
|
|
Loading…
Reference in New Issue