1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef BLADERUNNER_SCRIPT_SCENE_H
24 #define BLADERUNNER_SCRIPT_SCENE_H
25 
26 #include "bladerunner/script/script.h"
27 
28 namespace BladeRunner {
29 
30 class BladeRunnerEngine;
31 
32 class SceneScriptBase : public ScriptBase {
33 public:
SceneScriptBase(BladeRunnerEngine * vm)34 	SceneScriptBase(BladeRunnerEngine *vm) : ScriptBase(vm) {}
35 
36 	virtual void InitializeScene() = 0;
37 	virtual void SceneLoaded() = 0;
38 	virtual bool MouseClick(int x, int y) = 0;
39 	virtual bool ClickedOn3DObject(const char *objectName, bool combatMode) = 0;
40 	virtual bool ClickedOnActor(int actorId) = 0;
41 	virtual bool ClickedOnItem(int itemId, bool combatMode) = 0;
42 	virtual bool ClickedOnExit(int exitId) = 0;
43 	virtual bool ClickedOn2DRegion(int region) = 0;
44 	virtual void SceneFrameAdvanced(int frame) = 0;
45 	virtual void ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) = 0;
46 	virtual void PlayerWalkedIn() = 0;
47 	virtual void PlayerWalkedOut() = 0;
48 	virtual void DialogueQueueFlushed(int a1) = 0;
49 };
50 
51 #define DECLARE_SCRIPT(name) \
52 class SceneScript##name : public SceneScriptBase { \
53 public: \
54 	SceneScript##name(BladeRunnerEngine *vm) \
55 		: SceneScriptBase(vm) \
56 	{} \
57 	void InitializeScene(); \
58 	void SceneLoaded(); \
59 	bool MouseClick(int x, int y); \
60 	bool ClickedOn3DObject(const char *objectName, bool combatMode); \
61 	bool ClickedOnActor(int actorId); \
62 	bool ClickedOnItem(int itemId, bool combatMode); \
63 	bool ClickedOnExit(int exitId); \
64 	bool ClickedOn2DRegion(int region); \
65 	void SceneFrameAdvanced(int frame); \
66 	void ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet); \
67 	void PlayerWalkedIn(); \
68 	void PlayerWalkedOut(); \
69 	void DialogueQueueFlushed(int a1); \
70 private:
71 #define END_SCRIPT };
72 
73 DECLARE_SCRIPT(AR01)
74 	void dialogueWithFishDealerBuyGoldfish();
75 END_SCRIPT
76 
77 DECLARE_SCRIPT(AR02)
78 	void dialogueWithInsectDealer1();
79 	void dialogueWithInsectDealerBuyBracelet();
80 	void dialogueWithInsectDealerBuySlug();
81 	void dialogueWithHassan();
82 	void dialogueWithHassanBuySnake();
83 END_SCRIPT
84 
85 DECLARE_SCRIPT(BB01)
86 END_SCRIPT
87 
88 DECLARE_SCRIPT(BB02)
89 END_SCRIPT
90 
91 DECLARE_SCRIPT(BB03)
92 END_SCRIPT
93 
94 DECLARE_SCRIPT(BB04)
95 END_SCRIPT
96 
97 DECLARE_SCRIPT(BB05)
98 END_SCRIPT
99 
100 DECLARE_SCRIPT(BB06)
101 END_SCRIPT
102 
103 DECLARE_SCRIPT(BB07)
104 END_SCRIPT
105 
106 DECLARE_SCRIPT(BB08)
107 END_SCRIPT
108 
109 DECLARE_SCRIPT(BB09)
110 END_SCRIPT
111 
112 DECLARE_SCRIPT(BB10)
113 END_SCRIPT
114 
115 DECLARE_SCRIPT(BB11)
116 END_SCRIPT
117 
118 DECLARE_SCRIPT(BB12)
119 END_SCRIPT
120 
121 DECLARE_SCRIPT(BB51)
122 END_SCRIPT
123 
124 DECLARE_SCRIPT(CT01)
125 	void dialogueWithHowieLee();
126 END_SCRIPT
127 
128 DECLARE_SCRIPT(CT02)
129 	void dialogueWithZuben();
130 END_SCRIPT
131 
132 DECLARE_SCRIPT(CT03)
133 END_SCRIPT
134 
135 DECLARE_SCRIPT(CT04)
136 	void dialogueWithHomeless();
137 END_SCRIPT
138 
139 DECLARE_SCRIPT(CT05)
140 END_SCRIPT
141 
142 DECLARE_SCRIPT(CT06)
143 END_SCRIPT
144 
145 DECLARE_SCRIPT(CT07)
146 END_SCRIPT
147 
148 DECLARE_SCRIPT(CT08)
149 END_SCRIPT
150 
151 DECLARE_SCRIPT(CT09)
152 END_SCRIPT
153 
154 DECLARE_SCRIPT(CT10)
155 	void checkCabinet();
156 END_SCRIPT
157 
158 DECLARE_SCRIPT(CT11)
159 END_SCRIPT
160 
161 DECLARE_SCRIPT(CT12)
162 END_SCRIPT
163 
164 DECLARE_SCRIPT(CT51)
165 END_SCRIPT
166 
167 DECLARE_SCRIPT(DR01)
168 END_SCRIPT
169 
170 DECLARE_SCRIPT(DR02)
171 END_SCRIPT
172 
173 DECLARE_SCRIPT(DR03)
174 	void dialogueWithChew();
175 END_SCRIPT
176 
177 DECLARE_SCRIPT(DR04)
178 	bool farEnoughFromExplosion();
179 END_SCRIPT
180 
181 DECLARE_SCRIPT(DR05)
182 END_SCRIPT
183 
184 DECLARE_SCRIPT(DR06)
185 END_SCRIPT
186 
187 DECLARE_SCRIPT(HC01)
188 	void dialogueWithIzo();
189 	void takePhotoAndRunAway();
190 END_SCRIPT
191 
192 DECLARE_SCRIPT(HC02)
193 END_SCRIPT
194 
195 DECLARE_SCRIPT(HC03)
196 END_SCRIPT
197 
198 DECLARE_SCRIPT(HC04)
199 	void dialogueWithIsabella();
200 END_SCRIPT
201 
202 DECLARE_SCRIPT(HF01)
203 	void dialogueWithMiaAndMurray();
204 	void talkWithDektora();
205 	void talkWithLucy();
206 END_SCRIPT
207 
208 DECLARE_SCRIPT(HF02)
209 END_SCRIPT
210 
211 DECLARE_SCRIPT(HF03)
212 	void dialogueWithLucy();
213 END_SCRIPT
214 
215 DECLARE_SCRIPT(HF04)
216 END_SCRIPT
217 
218 DECLARE_SCRIPT(HF05)
219 	void talkWithCrazyLegs1();
220 	void talkWithCrazyLegs2();
221 	void dialogueWithCrazylegs1();
222 	void dialogueWithCrazylegs2();
223 	void talkWithCrazylegs3(int actorId);
224 	void talkWithDektora();
225 	void talkWithLucy();
226 	void policeAttack();
227 	void addAmbientSounds();
228 	int getAffectionTowardsActor();
229 	int getCompanionActor();
230 END_SCRIPT
231 
232 DECLARE_SCRIPT(HF06)
233 	void steelInterruption();
234 	void addAmbientSounds();
235 END_SCRIPT
236 
237 DECLARE_SCRIPT(HF07)
238 	int getAffectionTowardsActor();
239 END_SCRIPT
240 
241 DECLARE_SCRIPT(KP01)
242 END_SCRIPT
243 
244 DECLARE_SCRIPT(KP02)
245 END_SCRIPT
246 
247 DECLARE_SCRIPT(KP03)
248 	void saveSteele();
249 END_SCRIPT
250 
251 DECLARE_SCRIPT(KP04)
252 END_SCRIPT
253 
254 DECLARE_SCRIPT(KP05)
255 END_SCRIPT
256 
257 DECLARE_SCRIPT(KP06)
258 END_SCRIPT
259 
260 DECLARE_SCRIPT(KP07)
261 END_SCRIPT
262 
263 DECLARE_SCRIPT(MA01)
264 END_SCRIPT
265 
266 DECLARE_SCRIPT(MA02)
267 	void talkWithRajif();
268 	bool isPhoneRinging();
269 	void selectNextTvNews();
270 END_SCRIPT
271 
272 //MA03 does not exists
273 
274 DECLARE_SCRIPT(MA04)
275 	bool isPhoneRinging();
276 	bool isPhoneMessageWaiting();
277 	void phoneCallWithDektora();
278 	void phoneCallWithLucy();
279 	void phoneCallWithSteele();
280 	void phoneCallWithClovis();
281 	void turnOnTV();
282 	void sleep();
283 END_SCRIPT
284 
285 DECLARE_SCRIPT(MA05)
286 	bool isPhoneRinging();
287 END_SCRIPT
288 
289 DECLARE_SCRIPT(MA06)
290 	bool isElevatorOnDifferentFloor();
291 	void activateElevator();
292 END_SCRIPT
293 
294 DECLARE_SCRIPT(MA07)
295 END_SCRIPT
296 
297 DECLARE_SCRIPT(MA08)
298 END_SCRIPT
299 
300 DECLARE_SCRIPT(NR01)
301 END_SCRIPT
302 
303 DECLARE_SCRIPT(NR02)
304 	void playNextMusic();
305 END_SCRIPT
306 
307 DECLARE_SCRIPT(NR03)
308 	void rotateActorOnTable(int frame);
309 	void playNextMusic();
310 END_SCRIPT
311 
312 DECLARE_SCRIPT(NR04)
313 	void dialogueWithEarlyQ();
314 	void druggedEffect(int frame);
315 	void playNextMusic();
316 END_SCRIPT
317 
318 DECLARE_SCRIPT(NR05)
319 	void rotateActorOnTable(int frame);
320 	void talkToBartender();
321 	void talkToEarlyQ();
322 	void rotateActorOnGround(int actorId);
323 	void playNextMusic();
324 END_SCRIPT
325 
326 DECLARE_SCRIPT(NR06)
327 	void playNextMusic();
328 END_SCRIPT
329 
330 DECLARE_SCRIPT(NR07)
331 	void dektoraRunAway();
332 	void callHolloway();
333 	void clickedOnVase();
334 	void talkAboutBelt1();
335 	void talkAboutBelt2();
336 	void talkAboutVoightKampff();
337 	void talkAboutSteele();
338 	void talkAboutMoonbus();
339 	void talkAboutBlackSedan();
340 	void talkAboutScorpions();
341 END_SCRIPT
342 
343 DECLARE_SCRIPT(NR08)
344 	void playNextMusic();
345 END_SCRIPT
346 
347 DECLARE_SCRIPT(NR09)
348 	void playNextMusic();
349 END_SCRIPT
350 
351 DECLARE_SCRIPT(NR10)
352 END_SCRIPT
353 
354 DECLARE_SCRIPT(NR11)
355 	void actorSweepArea(int actorId, signed int frame);
356 	void untargetEverything();
357 END_SCRIPT
358 
359 DECLARE_SCRIPT(PS01)
360 END_SCRIPT
361 
362 DECLARE_SCRIPT(PS02)
363 	void activateElevator();
364 END_SCRIPT
365 
366 DECLARE_SCRIPT(PS03)
367 END_SCRIPT
368 
369 DECLARE_SCRIPT(PS04)
370 	void dialogueWithGuzza();
371 END_SCRIPT
372 
373 DECLARE_SCRIPT(PS05)
374 	void selectNextTvNews();
375 	void turnOnTV();
376 END_SCRIPT
377 
378 DECLARE_SCRIPT(PS06)
379 END_SCRIPT
380 
381 DECLARE_SCRIPT(PS07)
382 END_SCRIPT
383 
384 // PS08 does not exits
385 
386 DECLARE_SCRIPT(PS09)
387 	void dialogueWithGrigorian();
388 END_SCRIPT
389 
390 DECLARE_SCRIPT(PS10)
391 	void removeTargets();
392 	public:
393 	static int getPoliceMazePS10TargetCount();
394 END_SCRIPT
395 
396 DECLARE_SCRIPT(PS11)
397 	void removeTargets();
398 	public:
399 	static int getPoliceMazePS11TargetCount();
400 END_SCRIPT
401 
402 DECLARE_SCRIPT(PS12)
403 	void removeTargets();
404 	public:
405 	static int getPoliceMazePS12TargetCount();
406 END_SCRIPT
407 
408 DECLARE_SCRIPT(PS13)
409 	void removeTargets();
410 	public:
411 	static int getPoliceMazePS13TargetCount();
412 END_SCRIPT
413 
414 DECLARE_SCRIPT(PS14)
415 END_SCRIPT
416 
417 DECLARE_SCRIPT(PS15)
418 END_SCRIPT
419 
420 DECLARE_SCRIPT(RC01)
421 	void interrogateCrowd();
422 	void walkToCenter();
423 END_SCRIPT
424 
425 DECLARE_SCRIPT(RC02)
426 	void dialogueWithRunciter();
427 END_SCRIPT
428 
429 DECLARE_SCRIPT(RC03)
430 	void talkWithSteele();
431 END_SCRIPT
432 
433 DECLARE_SCRIPT(RC04)
434 	void dialogueWithBulletBob();
435 END_SCRIPT
436 
437 DECLARE_SCRIPT(RC51)
438 END_SCRIPT
439 
440 DECLARE_SCRIPT(TB02)
441 	void dialogueWithTyrellGuard();
442 	void dialogueWithSteele();
443 END_SCRIPT
444 
445 DECLARE_SCRIPT(TB03)
446 END_SCRIPT
447 
448 DECLARE_SCRIPT(TB05)
449 END_SCRIPT
450 
451 DECLARE_SCRIPT(TB06)
452 END_SCRIPT
453 
454 DECLARE_SCRIPT(TB07)
455 	void McCoyTalkWithRachaelAndTyrell();
456 END_SCRIPT
457 
458 DECLARE_SCRIPT(UG01)
459 END_SCRIPT
460 
461 DECLARE_SCRIPT(UG02)
462 	bool walkToCenter();
463 END_SCRIPT
464 
465 DECLARE_SCRIPT(UG03)
466 END_SCRIPT
467 
468 DECLARE_SCRIPT(UG04)
469 END_SCRIPT
470 
471 DECLARE_SCRIPT(UG05)
472 	int getAffectionTowardsActor();
473 	void endGame();
474 END_SCRIPT
475 
476 DECLARE_SCRIPT(UG06)
477 END_SCRIPT
478 
479 DECLARE_SCRIPT(UG07)
480 END_SCRIPT
481 
482 DECLARE_SCRIPT(UG08)
483 END_SCRIPT
484 
485 DECLARE_SCRIPT(UG09)
486 END_SCRIPT
487 
488 DECLARE_SCRIPT(UG10)
489 END_SCRIPT
490 
491 // UG11 does not exists
492 
493 DECLARE_SCRIPT(UG12)
494 END_SCRIPT
495 
496 DECLARE_SCRIPT(UG13)
497 	void talkAboutGuzza();
498 	void dialogueWithHomeless1();
499 	void dialogueWithHomeless2();
500 END_SCRIPT
501 
502 DECLARE_SCRIPT(UG14)
503 END_SCRIPT
504 
505 DECLARE_SCRIPT(UG15)
506 END_SCRIPT
507 
508 DECLARE_SCRIPT(UG16)
509 	void dialogueWithLuther();
510 END_SCRIPT
511 
512 DECLARE_SCRIPT(UG17)
513 END_SCRIPT
514 
515 DECLARE_SCRIPT(UG18)
516 	void talkWithGuzza();
517 	void talkWithClovis();
518 END_SCRIPT
519 
DECLARE_SCRIPT(UG19)520 DECLARE_SCRIPT(UG19)
521 END_SCRIPT
522 
523 #undef DECLARE_SCRIPT
524 #undef END_SCRIPT
525 
526 class SceneScript {
527 protected:
528 	BladeRunnerEngine *_vm;
529 	int                _inScriptCounter;
530 	SceneScriptBase   *_currentScript;
531 
532 public:
533 	int _mouseX;
534 	int _mouseY;
535 
536 	SceneScript(BladeRunnerEngine *vm);
537 	~SceneScript();
538 
539 	bool open(const Common::String &name);
540 
541 	void initializeScene();
542 	void sceneLoaded();
543 	bool mouseClick(int x, int y);
544 	bool clickedOn3DObject(const char *objectName, bool combatMode);
545 	bool clickedOnActor(int actorId);
546 	bool clickedOnItem(int itemId, bool combatMode);
547 	bool clickedOnExit(int exitId);
548 	bool clickedOn2DRegion(int region);
549 	void sceneFrameAdvanced(int frame);
550 	void actorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet);
551 	void playerWalkedIn();
552 	void playerWalkedOut();
553 	void dialogueQueueFlushed(int a1);
554 	bool isInsideScript() const { return _inScriptCounter > 0; }
555 };
556 
557 } // End of namespace BladeRunner
558 
559 #endif
560