mirror of https://github.com/OpenRCT2/OpenRCT2.git
add peep_applause
This commit is contained in:
parent
275f66d287
commit
5b568f376c
|
@ -81,6 +81,7 @@
|
|||
<ClCompile Include="..\src\scenario.c" />
|
||||
<ClCompile Include="..\src\scenario_list.c" />
|
||||
<ClCompile Include="..\src\screenshot.c" />
|
||||
<ClCompile Include="..\src\sprite.c" />
|
||||
<ClCompile Include="..\src\string_ids.c" />
|
||||
<ClCompile Include="..\src\title.c" />
|
||||
<ClCompile Include="..\src\track.c" />
|
||||
|
|
|
@ -320,6 +320,9 @@
|
|||
<ClCompile Include="..\src\vehicle.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\sprite.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\openrct2.exe">
|
||||
|
|
45
src/peep.c
45
src/peep.c
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include <windows.h>
|
||||
#include "addresses.h"
|
||||
#include "audio.h"
|
||||
#include "news_item.h"
|
||||
#include "peep.h"
|
||||
#include "rct2.h"
|
||||
|
@ -293,6 +294,50 @@ void peep_update_crowd_noise()
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0069BE9B
|
||||
*/
|
||||
void peep_applause()
|
||||
{
|
||||
uint16 sprite_index;
|
||||
rct_peep* peep;
|
||||
|
||||
// For each guest
|
||||
sprite_index = RCT2_GLOBAL(RCT2_ADDRESS_SPRITES_START_PEEP, uint16);
|
||||
while (sprite_index != 0xFFFF) {
|
||||
peep = &(RCT2_ADDRESS(RCT2_ADDRESS_SPRITE_LIST, rct_sprite)[sprite_index].peep);
|
||||
sprite_index = peep->next;
|
||||
|
||||
if (peep->type != PEEP_TYPE_GUEST)
|
||||
continue;
|
||||
if (peep->var_2A != 0)
|
||||
continue;
|
||||
|
||||
// Release balloon
|
||||
if (peep->item_standard_flags & PEEP_ITEM_BALLOON) {
|
||||
peep->item_standard_flags &= ~PEEP_ITEM_BALLOON;
|
||||
if (peep->x != 0x8000) {
|
||||
create_balloon(peep->x, peep->y, peep->z + 9, peep->balloon_colour);
|
||||
peep->var_45 |= 8;
|
||||
RCT2_CALLPROC_X(0x0069B8CC, 0, 0, 0, 0, (int)peep, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Clap
|
||||
if ((peep->state == PEEP_STATE_WALKING || peep->state == PEEP_STATE_QUEUING) && peep->var_71 >= 254) {
|
||||
peep->var_71 = 26;
|
||||
peep->var_72 = 0;
|
||||
peep->var_70 = 0;
|
||||
RCT2_CALLPROC_X(0x00693B58, 0, 0, 0, 0, (int)peep, 0, 0);
|
||||
RCT2_CALLPROC_X(0x006EC473, 0, 0, 0, 0, (int)peep, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Play applause noise
|
||||
sound_play_panned(44, RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_WIDTH, uint16) / 2);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0069A05D
|
||||
|
|
10
src/peep.h
10
src/peep.h
|
@ -359,7 +359,7 @@ typedef struct {
|
|||
uint8 pad_41[0x2];
|
||||
uint8 intensity; // 0x43
|
||||
uint8 nausea_tolerance; // 0x44
|
||||
uint8 pad_45;
|
||||
uint8 var_45;
|
||||
money16 paid_on_drink; // 0x46
|
||||
uint8 pad_48[0x10];
|
||||
uint32 item_extra_flags; // 0x58
|
||||
|
@ -372,8 +372,13 @@ typedef struct {
|
|||
uint8 current_train; // 0x6A
|
||||
uint8 current_car; // 0x6B
|
||||
uint8 current_seat; // 0x6C
|
||||
uint8 pad_6D[0x09];
|
||||
uint8 pad_6D[3];
|
||||
uint8 var_70;
|
||||
uint8 var_71;
|
||||
uint8 var_72;
|
||||
uint8 pad_73[3];
|
||||
uint8 var_76;
|
||||
uint8 pad_77;
|
||||
uint8 var_78;
|
||||
uint8 pad_79[0x03];
|
||||
uint8 rides_been_on[32]; // 0x7C
|
||||
|
@ -416,6 +421,7 @@ int peep_get_staff_count();
|
|||
void peep_update_all();
|
||||
void peep_problem_warnings_update();
|
||||
void peep_update_crowd_noise();
|
||||
void peep_applause();
|
||||
rct_peep *peep_generate(int x, int y, int z);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -336,7 +336,7 @@ void scenario_success()
|
|||
uint32 current_val = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_COMPANY_VALUE, uint32);
|
||||
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_COMPLETED_COMPANY_VALUE, uint32) = current_val;
|
||||
RCT2_CALLPROC_EBPSAFE(0x0069BE9B); // celebration
|
||||
peep_applause();
|
||||
|
||||
for (i = 0; i < gScenarioListCount; i++) {
|
||||
char *cur_scenario_name = RCT2_ADDRESS(0x135936C, char);
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
/*****************************************************************************
|
||||
* Copyright (c) 2014 Ted John
|
||||
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
|
||||
*
|
||||
* This file is part of OpenRCT2.
|
||||
*
|
||||
* OpenRCT2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "addresses.h"
|
||||
#include "sprite.h"
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006736C7
|
||||
*/
|
||||
void create_balloon(int x, int y, int z, int colour)
|
||||
{
|
||||
RCT2_CALLPROC_X(0x006736C7, x, colour << 8, y, z, 0, 0, 0);
|
||||
}
|
|
@ -59,4 +59,6 @@ typedef union {
|
|||
rct_vehicle vehicle;
|
||||
} rct_sprite;
|
||||
|
||||
void create_balloon(int x, int y, int z, int colour);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue