1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 03:23:15 +01:00

Use balloon for create_balloon

This commit is contained in:
Ted John
2017-03-10 17:52:06 +00:00
parent dfc140158e
commit 8148c86f6b
3 changed files with 11 additions and 19 deletions

View File

@@ -1719,23 +1719,15 @@ void peep_update_sprite_type(rct_peep* peep)
peep->sprite_type == PEEP_SPRITE_TYPE_BALLOON &&
(scenario_rand() & 0xFFFF) <= 327
) {
uint8 bl = 0;
if (
(scenario_rand() & 0xFFFF) <= 13107 &&
peep->x != SPRITE_LOCATION_NULL
) {
bl = 1;
audio_play_sound_at_location(SOUND_BALLOON_POP, peep->x, peep->y, peep->z);
}
bool isBalloonPopped = false;
if (peep->x != SPRITE_LOCATION_NULL) {
create_balloon(peep->x, peep->y, peep->z + 9, peep->balloon_colour, bl);
if ((scenario_rand() & 0xFFFF) <= 13107) {
isBalloonPopped = true;
audio_play_sound_at_location(SOUND_BALLOON_POP, peep->x, peep->y, peep->z);
}
create_balloon(peep->x, peep->y, peep->z + 9, peep->balloon_colour, isBalloonPopped);
}
peep->item_standard_flags &= ~PEEP_ITEM_BALLOON;
peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_INVENTORY;
}
@@ -2105,7 +2097,7 @@ static void peep_update_falling(rct_peep* peep){
peep->item_standard_flags &= ~PEEP_ITEM_BALLOON;
if (peep->sprite_type == PEEP_SPRITE_TYPE_BALLOON && peep->x != MAP_LOCATION_NULL) {
create_balloon(peep->x, peep->y, height, peep->balloon_colour, 0);
create_balloon(peep->x, peep->y, height, peep->balloon_colour, false);
peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_INVENTORY;
peep_update_sprite_type(peep);
}
@@ -6987,7 +6979,7 @@ void peep_applause()
if (peep->item_standard_flags & PEEP_ITEM_BALLOON) {
peep->item_standard_flags &= ~PEEP_ITEM_BALLOON;
if (peep->x != MAP_LOCATION_NULL) {
create_balloon(peep->x, peep->y, peep->z + 9, peep->balloon_colour, 0);
create_balloon(peep->x, peep->y, peep->z + 9, peep->balloon_colour, false);
peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_INVENTORY;
peep_update_sprite_type(peep);
}

View File

@@ -95,7 +95,7 @@ void rct_balloon::Pop()
extern "C"
{
void create_balloon(sint32 x, sint32 y, sint32 z, sint32 colour, uint8 bl)
void create_balloon(sint32 x, sint32 y, sint32 z, sint32 colour, bool isPopped)
{
rct_sprite* sprite = create_sprite(2);
if (sprite != nullptr)
@@ -108,7 +108,7 @@ extern "C"
sprite->balloon.misc_identifier = SPRITE_MISC_BALLOON;
sprite->balloon.frame = 0;
sprite->balloon.colour = colour;
sprite->balloon.popped = bl;
sprite->balloon.popped = (isPopped ? 1 : 0);
}
}

View File

@@ -428,7 +428,7 @@ void sprite_position_tween_reset();
///////////////////////////////////////////////////////////////
// Balloon
///////////////////////////////////////////////////////////////
void create_balloon(sint32 x, sint32 y, sint32 z, sint32 colour, uint8 bl);
void create_balloon(sint32 x, sint32 y, sint32 z, sint32 colour, bool isPopped);
void balloon_update(rct_balloon *balloon);
void game_command_balloon_press(sint32* eax, sint32* ebx, sint32* ecx, sint32* edx, sint32* esi, sint32* edi, sint32* ebp);