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
|
/* 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_script.h"
namespace BladeRunner {
void SceneScriptKP07::InitializeScene() {
Setup_Scene_Information(-12.0f, -41.58f, 72.0f, 0);
Game_Flag_Reset(578);
Scene_Exit_Add_2D_Exit(0, 315, 185, 381, 285, 0);
if (Game_Flag_Query(653)) {
if (Game_Flag_Query(kFlagDektoraIsReplicant)
&& Actor_Query_Goal_Number(kActorDektora) < kGoalDektoraGone
) {
Actor_Set_Targetable(kActorDektora, true);
Global_Variable_Increment(kVariableReplicants, 1);
Actor_Put_In_Set(kActorDektora, kSetKP07);
Actor_Set_At_XYZ(kActorDektora, -52.0f, -41.52f, -5.0f, 289);
}
if (Actor_Query_Goal_Number(kActorZuben) < kGoalZubenGone) {
Global_Variable_Increment(kVariableReplicants, 1);
Actor_Set_Targetable(kActorZuben, true);
Actor_Put_In_Set(kActorZuben, kSetKP07);
Actor_Set_At_XYZ(kActorZuben, -26.0f, -41.52f, -135.0f, 0);
}
if (Game_Flag_Query(kFlagIzoIsReplicant)
&& Actor_Query_Goal_Number(kActorIzo) < 599
) {
Global_Variable_Increment(kVariableReplicants, 1);
Actor_Set_Targetable(kActorIzo, true);
Actor_Put_In_Set(kActorIzo, kSetKP07);
Actor_Set_At_XYZ(kActorIzo, -38.0f, -41.52f, -175.0f, 500);
}
if (Game_Flag_Query(kFlagGordoIsReplicant)
&& Actor_Query_Goal_Number(kActorGordo) < kGoalGordoGone
) {
Global_Variable_Increment(kVariableReplicants, 1);
Actor_Set_Targetable(kActorGordo, true);
Actor_Put_In_Set(kActorGordo, kSetKP07);
Actor_Set_At_XYZ(kActorGordo, 61.0f, -41.52f, -3.0f, 921);
}
if (Game_Flag_Query(kFlagLucyIsReplicant)
&& Actor_Query_Goal_Number(kActorLucy) < kGoalLucyGone
) {
Global_Variable_Increment(kVariableReplicants, 1);
Actor_Put_In_Set(kActorLucy, kSetKP07);
Actor_Set_At_XYZ(kActorLucy, 78.0f, -41.52f, -119.0f, 659);
}
if (Actor_Query_Goal_Number(kActorLuther) < 599) {
Global_Variable_Increment(kVariableReplicants, 1);
Actor_Put_In_Set(kActorLuther, kSetKP07);
Actor_Set_At_XYZ(kActorLuther, -47.0f, 0.0f, 151.0f, 531);
}
}
Ambient_Sounds_Add_Looping_Sound(585, 7, 1, 1);
Ambient_Sounds_Add_Looping_Sound(586, 52, 1, 1);
Ambient_Sounds_Add_Looping_Sound(109, 38, 1, 1);
if (Game_Flag_Query(582)) {
Scene_Loop_Set_Default(2);
} else {
Scene_Loop_Set_Default(0);
}
}
void SceneScriptKP07::SceneLoaded() {
if (!Game_Flag_Query(653)) {
Music_Play(19, 25, 0, 0, -1, 1, 0);
}
Obstacle_Object("BUNK_TRAY01", true);
Unobstacle_Object("BUNK_TRAY01", true);
if (Game_Flag_Query(653)) {
Player_Set_Combat_Mode(false);
Scene_Exits_Disable();
}
}
bool SceneScriptKP07::MouseClick(int x, int y) {
return false;
}
bool SceneScriptKP07::ClickedOn3DObject(const char *objectName, bool a2) {
return false;
}
bool SceneScriptKP07::ClickedOnActor(int actorId) {
if (actorId == kActorClovis) {
if (Game_Flag_Query(697) || actorId != kActorClovis || Actor_Query_Goal_Number(kActorClovis) == 599 || Actor_Query_Goal_Number(kActorClovis) == 515) {
return false;
}
if (Game_Flag_Query(653)) {
Actor_Set_Goal_Number(kActorClovis, 516);
} else {
Music_Play(20, 31, 0, 0, -1, 1, 0);
Actor_Set_Goal_Number(kActorClovis, 514);
}
} else {
Actor_Face_Actor(kActorMcCoy, actorId, true);
Actor_Says(kActorMcCoy, 8590, 14);
}
return true;
}
bool SceneScriptKP07::ClickedOnItem(int itemId, bool a2) {
return false;
}
bool SceneScriptKP07::ClickedOnExit(int exitId) {
if (exitId == 0) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -12.0f, -41.58f, 72.0f, 0, 1, false, 0)) {
Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
Ambient_Sounds_Remove_All_Looping_Sounds(1);
Game_Flag_Set(579);
Set_Enter(kSetKP05_KP06, kSceneKP06);
}
return true;
}
return false;
}
bool SceneScriptKP07::ClickedOn2DRegion(int region) {
return false;
}
void SceneScriptKP07::SceneFrameAdvanced(int frame) {
}
void SceneScriptKP07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) {
}
void SceneScriptKP07::PlayerWalkedIn() {
Loop_Actor_Walk_To_XYZ(kActorMcCoy, 9.0f, -41.88f, -81.0f, 0, 0, false, 0);
if (!Game_Flag_Query(658)) {
if (Game_Flag_Query(653)) {
Actor_Face_Actor(kActorMcCoy, kActorClovis, true);
Actor_Says(kActorClovis, 1240, 3);
Actor_Says(kActorMcCoy, 8500, 3);
Actor_Says(kActorClovis, 1250, 3);
if (Actor_Query_Goal_Number(kActorSadik) == 416) {
Actor_Put_In_Set(kActorSadik, kSetKP07);
Global_Variable_Increment(kVariableReplicants, 1);
Actor_Set_At_XYZ(kActorSadik, -12.0f, -41.58f, 72.0f, 0);
Actor_Face_Actor(kActorSadik, kActorClovis, true);
}
} else {
Actor_Face_Actor(kActorMcCoy, kActorClovis, true);
Actor_Says(kActorClovis, 160, 3);
Actor_Retired_Here(kActorClovis, 72, 60, 0, -1);
}
Game_Flag_Set(658);
}
}
void SceneScriptKP07::PlayerWalkedOut() {
Music_Stop(3);
}
void SceneScriptKP07::DialogueQueueFlushed(int a1) {
if (Actor_Query_Goal_Number(kActorClovis) == 515) {
Actor_Set_Targetable(kActorClovis, false);
Actor_Change_Animation_Mode(kActorClovis, 21);
Actor_Retired_Here(kActorClovis, 12, 48, 1, -1);
Actor_Set_Goal_Number(kActorClovis, 599);
}
}
} // End of namespace BladeRunner
|