1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
|
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program 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 2
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "bladerunner/script/scene.h"
namespace BladeRunner {
void SceneScriptDR04::InitializeScene() {
if (Game_Flag_Query(515)) {
Setup_Scene_Information(0.0f, 0.0f, 0.0f, 0);
} else if (Game_Flag_Query(10)) {
Setup_Scene_Information(-711.0f, -0.04f, 70.0f, 472);
} else if (Game_Flag_Query(229)) {
Setup_Scene_Information(-1067.0f, 7.18f, 421.0f, 125);
} else if (Game_Flag_Query(231)) {
Setup_Scene_Information(-897.75f, 134.45f, 569.75f, 512);
} else {
Setup_Scene_Information(-810.0f, -0.04f, 242.0f, 125);
}
Scene_Exit_Add_2D_Exit(0, 589, 0, 639, 479, 1);
Scene_Exit_Add_2D_Exit(1, 443, 264, 488, 353, 0);
Scene_Exit_Add_2D_Exit(2, 222, 110, 269, 207, 0);
Ambient_Sounds_Remove_All_Non_Looping_Sounds(0);
Ambient_Sounds_Add_Looping_Sound(54, 50, 1, 1);
Ambient_Sounds_Add_Looping_Sound(288, 55, -100, 1);
Ambient_Sounds_Add_Looping_Sound(217, 28, -100, 100);
Ambient_Sounds_Add_Speech_Sound(60, 0, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
Ambient_Sounds_Add_Speech_Sound(60, 20, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
Ambient_Sounds_Add_Speech_Sound(60, 40, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
Ambient_Sounds_Add_Speech_Sound(60, 50, 10, 260, 17, 24, -100, 100, -101, -101, 1, 1);
Ambient_Sounds_Add_Sound(67, 40, 180, 16, 25, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(66, 40, 180, 16, 25, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(378, 5, 80, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(379, 5, 80, 50, 100, 0, 0, -101, -101, 0, 0);
Ambient_Sounds_Add_Sound(380, 5, 80, 50, 100, 0, 0, -101, -101, 0, 0);
if (Game_Flag_Query(272)) {
Scene_Loop_Set_Default(1);
} else {
Scene_Loop_Set_Default(4);
}
if (Game_Flag_Query(10)) {
if (Game_Flag_Query(272)) {
Scene_Loop_Start_Special(0, 0, 0);
} else {
Scene_Loop_Start_Special(0, 3, 0);
}
}
}
void SceneScriptDR04::SceneLoaded() {
Obstacle_Object("TRASH CAN WITH FIRE", true);
Obstacle_Object("V2PYLON02", true);
Obstacle_Object("V2PYLON04", true);
Obstacle_Object("U2 CHEWDOOR", true);
Obstacle_Object("MMTRASHCAN", true);
Obstacle_Object("PARKMETR02", true);
Obstacle_Object("TRANSFORMER 01", true);
Obstacle_Object("TRANSFORMER 02", true);
Obstacle_Object("PARKMETR01", true);
Obstacle_Object("Z2ENTRYDR", true);
Obstacle_Object("Z2DR2", true);
Unclickable_Object("PARKMETR01");
Unclickable_Object("Z2ENTRYDR");
Unclickable_Object("Z2DR2");
}
bool SceneScriptDR04::MouseClick(int x, int y) {
return false;
}
bool SceneScriptDR04::ClickedOn3DObject(const char *objectName, bool a2) {
return false;
}
bool SceneScriptDR04::ClickedOnActor(int actorId) {
if (actorId == 35 && !Player_Query_Combat_Mode()) {
if (Actor_Query_Goal_Number(kActorMoraji) != 21) {
if (Actor_Query_Goal_Number(kActorMoraji) == 23) {
if (!Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorMoraji, 36, 1, false)) {
Actor_Set_Goal_Number(kActorOfficerGrayford, 106);
return true;
}
}
return false;
}
if (!Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 109, 0, 1, true)) {
Actor_Face_Actor(kActorMcCoy, kActorMoraji, true);
Actor_Says(kActorMcCoy, 945, 13);
Actor_Says(kActorMoraji, 0, 3);
Actor_Says(kActorMoraji, 10, 3);
Actor_Says(kActorMcCoy, 950, 13);
Actor_Says(kActorMoraji, 20, 3);
Actor_Says(kActorMoraji, 30, 3);
Actor_Says(kActorMcCoy, 955, 13);
Actor_Says_With_Pause(kActorMoraji, 40, 0, 3);
Actor_Says(kActorMoraji, 50, 3);
Actor_Clue_Acquire(kActorMcCoy, kClueMorajiInterview, 1, kActorMoraji);
Actor_Set_Goal_Number(kActorMoraji, 22);
Actor_Set_Goal_Number(kActorOfficerGrayford, 101);
return true;
}
return false;
}
return false;
}
bool SceneScriptDR04::ClickedOnItem(int itemId, bool a2) {
return false;
}
bool SceneScriptDR04::ClickedOnExit(int exitId) {
if (Actor_Query_Goal_Number(kActorMoraji) == 21) {
Actor_Force_Stop_Walking(kActorMcCoy);
Actor_Set_Goal_Number(kActorMoraji, 22);
Actor_Set_Goal_Number(kActorOfficerGrayford, 101);
return true;
}
if (exitId == 0) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -761.0f, -0.04f, 97.0f, 0, 1, false, 0)) {
Async_Actor_Walk_To_XYZ(kActorMcCoy, -683.0f, -0.04f, 43.0f, 0, false);
Game_Flag_Set(11);
Set_Enter(7, 25);
}
return true;
}
if (exitId == 1) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -1067.0f, 7.18f, 421.0f, 0, 1, false, 0)) {
Game_Flag_Set(232);
Game_Flag_Set(228);
Set_Enter(35, 29);
}
return true;
}
if (exitId == 2) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -851.0f, 6.98f, 560.0f, 0, 1, false, 0)) {
Footstep_Sound_Override_On(3);
Actor_Set_Immunity_To_Obstacles(kActorMcCoy, true);
Actor_Face_Heading(kActorMcCoy, 512, false);
Loop_Actor_Travel_Stairs(kActorMcCoy, 7, 1, 0);
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -899.0f, 71.64f, 647.0f, 0, 0, false, 0);
Actor_Face_Heading(kActorMcCoy, 0, false);
Loop_Actor_Travel_Stairs(kActorMcCoy, 7, 1, 0);
Actor_Set_Immunity_To_Obstacles(kActorMcCoy, false);
Footstep_Sound_Override_Off();
Game_Flag_Set(230);
Set_Enter(36, 30);
}
return true;
}
return true; //bug?
}
bool SceneScriptDR04::ClickedOn2DRegion(int region) {
return false;
}
bool SceneScriptDR04::sub_401160() {
float x, y, z;
Actor_Query_XYZ(kActorMcCoy, &x, &y, &z);
return (x + 1089.94f) * (x + 1089.94f) + (z - 443.49f) * (z - 443.49f) >= (360.0f * 360.0f);
}
void SceneScriptDR04::SceneFrameAdvanced(int frame) {
if (Game_Flag_Query(515)) {
Game_Flag_Reset(515);
Game_Flag_Reset(271);
Scene_Loop_Set_Default(1);
Scene_Loop_Start_Special(2, 6, 1);
Music_Stop(4);
Actor_Set_Goal_Number(kActorMoraji, 99);
} else {
if (Game_Flag_Query(271)) {
Game_Flag_Reset(271);
Game_Flag_Set(272);
Scene_Loop_Set_Default(1);
Scene_Loop_Start_Special(2, 6, 1);
Item_Remove_From_World(78);
}
switch (frame) {
case 193:
Sound_Play(301, 100, 0, 100, 50);
Actor_Set_Goal_Number(kActorMoraji, 30);
Player_Loses_Control();
Actor_Force_Stop_Walking(kActorMcCoy);
if (sub_401160()) {
if (Player_Query_Combat_Mode()) {
Actor_Change_Animation_Mode(kActorMcCoy, 22);
} else {
Actor_Change_Animation_Mode(kActorMcCoy, 21);
}
} else {
Sound_Play_Speech_Line(kActorMcCoy, 9905, 100, 0, 99);
Actor_Change_Animation_Mode(kActorMcCoy, 48);
Actor_Retired_Here(kActorMcCoy, 6, 6, 1, -1);
}
Player_Gains_Control();
break;
case 235:
if (Actor_Query_Goal_Number(kActorMoraji) != 20 && Actor_Query_Goal_Number(kActorMoraji) != 21 && Actor_Query_Goal_Number(kActorMoraji) != 99) {
Actor_Set_Goal_Number(kActorOfficerGrayford, 101);
}
Scene_Exits_Enable();
break;
case 237:
Overlay_Play("DR04OVER", 0, 1, 1, 0);
break;
}
}
}
void SceneScriptDR04::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) {
}
void SceneScriptDR04::PlayerWalkedIn() {
if (Game_Flag_Query(515)) {
Player_Loses_Control();
Delay(4000);
Actor_Retired_Here(kActorMcCoy, 6, 6, 1, -1);
} else {
if (Game_Flag_Query(269) && !Game_Flag_Query(272)) {
Scene_Exits_Disable();
}
if (Game_Flag_Query(231)) {
Footstep_Sound_Override_On(3);
Actor_Set_Immunity_To_Obstacles(kActorMcCoy, true);
Actor_Face_Heading(kActorMcCoy, 512, false);
Loop_Actor_Travel_Stairs(kActorMcCoy, 7, 0, 0);
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -851.0f, 71.64f, 647.0f, 0, 0, false, 0);
Actor_Face_Heading(kActorMcCoy, 0, false);
Loop_Actor_Travel_Stairs(kActorMcCoy, 7, 0, 0);
Loop_Actor_Walk_To_XYZ(kActorMcCoy, -774.85f, 7.18f, 386.67001f, 0, 0, false, 0);
Actor_Set_Immunity_To_Obstacles(kActorMcCoy, false);
Footstep_Sound_Override_Off();
}
}
Game_Flag_Reset(10);
Game_Flag_Reset(229);
Game_Flag_Reset(231);
}
void SceneScriptDR04::PlayerWalkedOut() {
Music_Stop(2);
Ambient_Sounds_Remove_All_Non_Looping_Sounds(1);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
}
void SceneScriptDR04::DialogueQueueFlushed(int a1) {
}
} // End of namespace BladeRunner
|