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 TSAGE_RINGWORLD2_SCENES2_H
24 #define TSAGE_RINGWORLD2_SCENES2_H
25 
26 #include "common/scummsys.h"
27 #include "tsage/converse.h"
28 #include "tsage/events.h"
29 #include "tsage/core.h"
30 #include "tsage/scenes.h"
31 #include "tsage/globals.h"
32 #include "tsage/sound.h"
33 #include "tsage/ringworld2/ringworld2_logic.h"
34 #include "tsage/ringworld2/ringworld2_speakers.h"
35 
36 namespace TsAGE {
37 
38 namespace Ringworld2 {
39 
40 using namespace TsAGE;
41 
42 class Scene2000 : public SceneExt {
43 	class Action1 : public ActionExt {
44 	public:
45 		void signal() override;
46 	};
47 
48 	class WestExit : public SceneExit {
49 	public:
50 		void changeScene() override;
51 	};
52 	class EastExit : public SceneExit {
53 	public:
54 		void changeScene() override;
55 	};
56 	class SouthExit : public SceneExit {
57 	public:
58 		void changeScene() override;
59 	};
60 	class NorthExit : public SceneExit {
61 	public:
62 		void changeScene() override;
63 	};
64 	class DoorExit : public SceneExit {
65 	public:
66 		void changeScene() override;
67 	};
68 public:
69 	bool _exitingFlag;
70 	int _mazePlayerMode;
71 
72 	NamedHotspot _background;
73 	SceneActor _companion;
74 	SceneActor _persons[11];
75 	WestExit _westExit;
76 	EastExit _eastExit;
77 	SouthExit _southExit;
78 	NorthExit _northExit;
79 	DoorExit _doorExit;
80 	Action1 _action1, _action2, _action3, _action4, _action5;
81 	SequenceManager _sequenceManager;
82 
83 	Scene2000();
84 	void postInit(SceneObjectList *OwnerList = NULL) override;
85 	void remove() override;
86 	void signal() override;
87 	void process(Event &event) override;
88 	void synchronize(Serializer &s) override;
89 
90 	void initExits();
91 	void initPlayer();
92 };
93 
94 class Scene2350 : public SceneExt {
95 	class Companion : public SceneActor {
96 		bool startAction(CursorType action, Event &event) override;
97 	};
98 	class Balloon : public SceneActor {
99 		bool startAction(CursorType action, Event &event) override;
100 	};
101 
102 	class ExitUp : public SceneExit {
103 		void changeScene() override;
104 	};
105 	class ExitWest : public SceneExit {
106 		void changeScene() override;
107 	};
108 public:
109 	SpeakerQuinn _quinnSpeaker;
110 	SpeakerPharisha _pharishaSpeaker;
111 	NamedHotspot _background;
112 	SceneActor _person;
113 	Companion _companion;
114 	Balloon _balloon;
115 	Balloon _harness;
116 	ExitUp _exitUp;
117 	ExitWest _exitWest;
118 	SequenceManager _sequenceManager;
119 
120 	void postInit(SceneObjectList *OwnerList = NULL) override;
121 	void remove() override;
122 	void signal() override;
123 };
124 
125 class Scene2400 : public SceneExt {
126 	class WestExit : public SceneExit {
127 		void changeScene() override;
128 	};
129 	class EastExit : public SceneExit {
130 		void changeScene() override;
131 	};
132 public:
133 	WestExit _westExit;
134 	EastExit _eastExit;
135 	SequenceManager _sequenceManager;
136 
137 	void postInit(SceneObjectList *OwnerList = NULL) override;
138 	void signal() override;
139 };
140 
141 class Scene2425 : public SceneExt {
142 	class RopeDest1 : public NamedHotspot {
143 	public:
144 		bool startAction(CursorType action, Event &event) override;
145 	};
146 	class RopeDest2 : public NamedHotspot {
147 	public:
148 		bool startAction(CursorType action, Event &event) override;
149 	};
150 	class Crevasse : public NamedHotspot {
151 	public:
152 		bool startAction(CursorType action, Event &event) override;
153 	};
154 	class Background : public NamedHotspot {
155 	public:
156 		bool startAction(CursorType action, Event &event) override;
157 	};
158 
159 	class Rope : public SceneActor {
160 	public:
161 		bool startAction(CursorType action, Event &event) override;
162 	};
163 	class Pictographs : public SceneActor {
164 	public:
165 		bool startAction(CursorType action, Event &event) override;
166 	};
167 
168 	class SouthEastExit : public SceneExit {
169 	public:
170 		void changeScene() override;
171 	};
172 public:
173 	RopeDest1 _ropeDest1;
174 	RopeDest2 _ropeDest2;
175 	Crevasse _crevasse;
176 	Background _background;
177 	Rope _rope;
178 	Pictographs _pictographs1;
179 	Pictographs _pictographs2;
180 	SouthEastExit _southEastExit;
181 	SequenceManager _sequenceManager;
182 
183 	void postInit(SceneObjectList *OwnerList = NULL) override;
184 	void remove() override;
185 	void signal() override;
186 };
187 
188 class Scene2430 : public SceneExt {
189 	class Companion : public SceneActor {
190 	public:
191 		bool startAction(CursorType action, Event &event) override;
192 	};
193 	class GunPowder : public SceneActor {
194 	public:
195 		bool startAction(CursorType action, Event &event) override;
196 	};
197 	class OilLamp : public SceneActor {
198 	public:
199 		bool startAction(CursorType action, Event &event) override;
200 	};
201 
202 	class SouthExit : public SceneExit {
203 	public:
204 		void changeScene() override;
205 	};
206 public:
207 	NamedHotspot _background;
208 	NamedHotspot _bottles2;
209 	NamedHotspot _furnishings;
210 	NamedHotspot _rug1;
211 	NamedHotspot _mirror;
212 	NamedHotspot _garments;
213 	NamedHotspot _bed;
214 	NamedHotspot _towel;
215 	NamedHotspot _bottles1;
216 	NamedHotspot _post;
217 	NamedHotspot _clothesPile1;
218 	NamedHotspot _clothesPile2;
219 	NamedHotspot _rug2;
220 	Companion _companion;
221 	GunPowder _gunPowder;
222 	OilLamp _oilLamp;
223 	SouthExit _southExit;
224 	SequenceManager _sequenceManager;
225 
226 	void postInit(SceneObjectList *OwnerList = NULL) override;
227 	void signal() override;
228 };
229 
230 class Scene2435 : public SceneExt {
231 	class Companion : public SceneActor {
232 	public:
233 		bool startAction(CursorType action, Event &event) override;
234 	};
235 	class Astor : public SceneActor {
236 	public:
237 		bool startAction(CursorType action, Event &event) override;
238 	};
239 
240 	class SouthExit : public SceneExit {
241 	public:
242 		void changeScene() override;
243 	};
244 public:
245 	SpeakerQuinn2435 _quinnSpeaker;
246 	SpeakerSeeker2435 _seekerSpeaker;
247 	SpeakerPharisha2435 _pharishaSpeaker;
248 	NamedHotspot _background;
249 	NamedHotspot _leftWindow;
250 	NamedHotspot _rightWindow;
251 	Companion _companion;
252 	Astor _astor;
253 	SouthExit _southExit;
254 	SequenceManager _sequenceManager;
255 
256 	void postInit(SceneObjectList *OwnerList = NULL) override;
257 	void remove() override;
258 	void signal() override;
259 };
260 
261 class Scene2440 : public SceneExt {
262 	class Companion : public SceneActor {
263 	public:
264 		bool startAction(CursorType action, Event &event) override;
265 	};
266 	class OilLamp : public SceneActor {
267 	public:
268 		bool startAction(CursorType action, Event &event) override;
269 	};
270 
271 	class SouthEastExit : public SceneExit {
272 	public:
273 		void changeScene() override;
274 	};
275 public:
276 	NamedHotspot _background;
277 	NamedHotspot _garments;
278 	NamedHotspot _bedspread;
279 	NamedHotspot _post;
280 	NamedHotspot _rug;
281 	NamedHotspot _furnishings;
282 	NamedHotspot _bottles;
283 	Companion _companion;
284 	OilLamp _oilLamp;
285 	SouthEastExit _southEastExit;
286 	SequenceManager _sequenceManager;
287 
288 	void postInit(SceneObjectList *OwnerList = NULL) override;
289 	void remove() override;
290 	void signal() override;
291 };
292 
293 class Scene2445 : public SceneExt {
294 public:
295 	SequenceManager _sequenceManager;
296 
297 	void postInit(SceneObjectList *OwnerList = NULL) override;
298 	void signal() override;
299 };
300 
301 class Scene2450 : public SceneExt {
302 	class Parker : public SceneActor {
303 	public:
304 		bool startAction(CursorType action, Event &event) override;
305 	};
306 	class CareTaker : public SceneActor {
307 	public:
308 		bool startAction(CursorType action, Event &event) override;
309 	};
310 
311 	class SouthWestExit : public SceneExit {
312 	public:
313 		void changeScene() override;
314 	};
315 public:
316 	SpeakerQuinn2450 _quinnSpeaker;
317 	SpeakerSeeker2450 _seekerSpeaker;
318 	SpeakerCaretaker2450 _caretakerSpeaker;
319 	NamedHotspot _background;
320 	NamedHotspot _post;
321 	NamedHotspot _bedspread;
322 	SceneActor _companion;
323 	Parker _parker;
324 	CareTaker _careTaker;
325 	SouthWestExit _southWestExit;
326 	SequenceManager _sequenceManager;
327 
328 	void postInit(SceneObjectList *OwnerList = NULL) override;
329 	void remove() override;
330 	void signal() override;
331 };
332 
333 class Scene2455 : public SceneExt {
334 	class Lamp : public SceneActor {
335 	public:
336 		bool startAction(CursorType action, Event &event) override;
337 	};
338 	class Pool : public SceneActor {
339 	public:
340 		bool startAction(CursorType action, Event &event) override;
341 	};
342 	class ScrithKey : public SceneActor {
343 	public:
344 		bool startAction(CursorType action, Event &event) override;
345 	};
346 
347 	class NorthExit : public SceneExit {
348 	public:
349 		void changeScene() override;
350 	};
351 public:
352 	NamedHotspot _background;
353 	Lamp _lamp;
354 	Pool _pool;
355 	ScrithKey _scrithKey;
356 	NorthExit _northExit;
357 	SequenceManager _sequenceManager;
358 
359 	void postInit(SceneObjectList *OwnerList = NULL) override;
360 	void remove() override;
361 	void signal() override;
362 };
363 
364 class Scene2500 : public SceneExt {
365 	class WestExit : public SceneExit {
366 	public:
367 		void changeScene() override;
368 	};
369 public:
370 	SpeakerQuinn _quinnSpeaker;
371 	SpeakerSeeker _seekerSpeaker;
372 	SpeakerMiranda _mirandaSpeaker;
373 	SpeakerWebbster2500 _webbsterSpeaker;
374 	NamedHotspot _background;
375 	SceneActor _companion;
376 	SceneActor _quinn;
377 	SceneActor _ship;
378 	WestExit _westExit;
379 	SequenceManager _sequenceManager;
380 
381 	void postInit(SceneObjectList *OwnerList = NULL) override;
382 	void signal() override;
383 };
384 
385 class Scene2525 : public SceneExt {
386 	class StopCock : public NamedHotspot {
387 	public:
388 		bool startAction(CursorType action, Event &event) override;
389 	};
390 
391 	class GlassDome : public SceneActor {
392 	public:
393 		bool startAction(CursorType action, Event &event) override;
394 	};
395 
396 	class SouthExit : public SceneExit {
397 	public:
398 		void changeScene() override;
399 	};
400 public:
401 	NamedHotspot _background;
402 	NamedHotspot _machine;
403 	NamedHotspot _pipes1;
404 	NamedHotspot _pipes2;
405 	StopCock _stopcock;
406 	SceneActor _companion;
407 	SceneActor _compressor;
408 	GlassDome _glassDome;
409 	SouthExit _southExit;
410 	SequenceManager _sequenceManager;
411 
412 	void postInit(SceneObjectList *OwnerList = NULL) override;
413 	void remove() override;
414 	void signal() override;
415 };
416 
417 class Scene2530 : public SceneExt {
418 	class Flask : public SceneActor {
419 	public:
420 		bool startAction(CursorType action, Event &event) override;
421 	};
422 	class Crank : public SceneActor {
423 	public:
424 		bool startAction(CursorType action, Event &event) override;
425 	};
426 
427 	class SouthExit : public SceneExit {
428 	public:
429 		void changeScene() override;
430 	};
431 public:
432 	NamedHotspot _background;
433 	NamedHotspot _crank2;
434 	NamedHotspot _shelf;
435 	NamedHotspot _item4;
436 	NamedHotspot _rope;
437 	SceneActor _companion;
438 	Flask _flask;
439 	Crank _crank;
440 	SouthExit _southExit;
441 	SequenceManager _sequenceManager;
442 
443 	void postInit(SceneObjectList *OwnerList = NULL) override;
444 	void signal() override;
445 };
446 
447 class Scene2535 : public SceneExt {
448 	class RebreatherTank : public SceneActor {
449 	public:
450 		bool startAction(CursorType action, Event &event) override;
451 	};
452 	class TannerMask : public SceneActor {
453 	public:
454 		bool startAction(CursorType action, Event &event) override;
455 	};
456 
457 	class SouthExit : public SceneExit {
458 	public:
459 		void changeScene() override;
460 	};
461 public:
462 	NamedHotspot _background;
463 	NamedHotspot _roof;
464 	NamedHotspot _skin1;
465 	NamedHotspot _skin2;
466 	NamedHotspot _skin3;
467 	NamedHotspot _skin4;
468 	NamedHotspot _depression;
469 	SceneActor _companion;
470 	SceneActor _rope;
471 	RebreatherTank _rebreatherTank;
472 	TannerMask _tannerMask;
473 	SouthExit _southExit;
474 	SequenceManager _sequenceManager;
475 
476 	void postInit(SceneObjectList *OwnerList = NULL) override;
477 	void signal() override;
478 };
479 
480 class Scene2600 : public SceneExt {
481 public:
482 	SequenceManager _sequenceManager;
483 	PaletteRotation *_rotation;
484 
485 	Scene2600();
486 	void synchronize(Serializer &s) override;
487 	void postInit(SceneObjectList *OwnerList = NULL) override;
488 	void remove() override;
489 	void signal() override;
490 };
491 
492 class Scene2700 : public SceneExt {
493 	class Action1: public Action {
494 	public:
495 		void signal() override;
496 	};
497 	class Action2: public Action {
498 	public:
499 		void signal() override;
500 	};
501 	class Action3: public Action {
502 	public:
503 		void signal() override;
504 	};
505 	class Action4: public Action {
506 	public:
507 		void signal() override;
508 	};
509 
510 	class SouthExit: public SceneArea {
511 	public:
512 		void process(Event &event) override;
513 	};
514 	class EastExit: public SceneArea {
515 	public:
516 		void process(Event &event) override;
517 	};
518 public:
519 	SpeakerQuinn2700 _quinnSpeaker;
520 	SpeakerNej2700 _nejSpeaker;
521 	NamedHotspot _background;
522 	NamedHotspot _ghoulHome1;
523 	NamedHotspot _ghoulHome2;
524 	NamedHotspot _ghoulHome3;
525 	NamedHotspot _ghoulHome4;
526 	NamedHotspot _ghoulHome5;
527 	SceneActor _nej;
528 	SceneActor _ghoulHome6;
529 	SceneActor _ghoulHome7;
530 	SceneActor _ghoulHome8;
531 	SceneActor _ghoulHome9;
532 	Action1 _action1;
533 	Action2 _action2;
534 	Action3 _action3;
535 	Action4 _action4;
536 	SouthExit _southExit;
537 	EastExit _eastExit;
538 	Rect _walkRect1, _walkRect2, _walkRect3;
539 	Rect _walkRect4, _walkRect5, _walkRect6;
540 	SequenceManager _sequenceManager;
541 	int _areaMode, _moveMode, _stripNumber;
542 
543 	Scene2700();
544 	void synchronize(Serializer &s) override;
545 	void postInit(SceneObjectList *OwnerList = NULL) override;
546 	void signal() override;
547 	void process(Event &event) override;
548 };
549 
550 class Scene2750 : public SceneExt {
551 	class Action1: public Action {
552 	public:
553 		void signal() override;
554 	};
555 	class Action2: public Action {
556 	public:
557 		void signal() override;
558 	};
559 	class Action3: public Action {
560 	public:
561 		void signal() override;
562 	};
563 	class Action4: public Action {
564 	public:
565 		void signal() override;
566 	};
567 	class Action5: public Action {
568 	public:
569 		void signal() override;
570 	};
571 	class Action6: public Action {
572 	public:
573 		void signal() override;
574 	};
575 	class Action7: public Action {
576 	public:
577 		void signal() override;
578 	};
579 
580 	class WestExit: public SceneArea {
581 	public:
582 		void process(Event &event) override;
583 	};
584 	class EastExit: public SceneArea {
585 	public:
586 		void process(Event &event) override;
587 	};
588 public:
589 	SpeakerQuinn2750 _quinnSpeaker;
590 	SpeakerNej2750 _nejSpeaker;
591 	NamedHotspot _background;
592 	NamedHotspot _ghoulHome1;
593 	NamedHotspot _ghoulHome2;
594 	NamedHotspot _ghoulHome3;
595 	NamedHotspot _ghoulHome4;
596 	SceneActor _nej;
597 	SceneActor _fire;
598 	SceneActor _bird1;
599 	SceneActor _folliage1;
600 	SceneActor _bird2;
601 	SceneActor _folliage2;
602 	SceneActor _folliage3;
603 	SceneActor _folliage4;
604 	SceneActor _folliage5;
605 	SceneActor _folliage6;
606 	SceneActor _folliage7;
607 	Action1 _action1;
608 	Action2 _action2;
609 	Action3 _action3;
610 	Action4 _action4;
611 	Action5 _action5;
612 	Action6 _action6;
613 	Action7 _action7;
614 	WestExit _westExit;
615 	EastExit _eastExit;
616 	Rect _walkRect1, _walkRect2, _walkRect3;
617 	SequenceManager _sequenceManager;
618 	int _areaMode, _moveMode, _stripNumber;
619 
620 	Scene2750();
621 	void synchronize(Serializer &s) override;
622 	void postInit(SceneObjectList *OwnerList = NULL) override;
623 	void signal() override;
624 	void process(Event &event) override;
625 };
626 
627 class Scene2800 : public SceneExt {
628 	class Outpost : public NamedHotspot {
629 	public:
630 		bool startAction(CursorType action, Event &event) override;
631 	};
632 
633 	class Guard : public SceneActor {
634 		bool startAction(CursorType action, Event &event) override;
635 	};
636 
637 	class Action1: public Action {
638 	public:
639 		void signal() override;
640 	};
641 	class Action2: public Action {
642 		SceneObject _object2;
643 		SceneObject _object3;
644 		SceneObject _object4;
645 	public:
646 		void signal() override;
647 	};
648 public:
649 	SpeakerQuinn2800 _quinnSpeaker;
650 	SpeakerNej2800 _nejSpeaker;
651 	SpeakerGuard2800 _guardSpeaker;
652 	NamedHotspot _background;
653 	Outpost _outpost;
654 	Guard _guard;
655 	SceneActor _nej;
656 	SceneActor _lightBar;
657 	SceneObject _bird;
658 	Action1 _action1;
659 	Action2 _action2;
660 	SequenceManager _sequenceManager;
661 	int _stripNumber;
662 
663 	Scene2800();
664 	void synchronize(Serializer &s) override;
665 	void postInit(SceneObjectList *OwnerList = NULL) override;
666 	void signal() override;
667 };
668 
669 class Scene2900 : public SceneExt {
670 	/* Items */
671 	class Scenery : public NamedHotspot {
672 	public:
673 		bool startAction(CursorType action, Event &event) override;
674 	};
675 	class ControlPanel : public NamedHotspot {
676 	public:
677 		bool startAction(CursorType action, Event &event) override;
678 	};
679 	class Altimeter : public NamedHotspot {
680 	public:
681 		bool startAction(CursorType action, Event &event) override;
682 	};
683 	class KnobLeft : public NamedHotspot {
684 	public:
685 		bool startAction(CursorType action, Event &event) override;
686 	};
687 	class KnobRight : public NamedHotspot {
688 	public:
689 		bool startAction(CursorType action, Event &event) override;
690 	};
691 	class Skip : public NamedHotspot {
692 	public:
693 		bool startAction(CursorType action, Event &event) override;
694 	};
695 
696 	/* Actions */
697 	class Action1: public Action {
698 	public:
699 		void signal() override;
700 	};
701 
702 	/* Miscellaneous */
703 	class Map {
704 	private:
705 		void moveArea(Rect &r, int xAmt, int yAmt);
706 		void moveLine(int xpSrc, int ypSrc, int xpDest, int ypDest, int width);
707 		int adjustRect(Common::Rect &r1, const Common::Rect &r2);
708 		void drawBlock(const byte *data, int xp, int yp, const Rect &r1, const Rect &r2);
709 	public:
710 		int _mapWidth, _mapHeight;
711 		int _resNum;
712 		int _xV, _yV;
713 		Rect _bounds;
714 
715 		Map();
716 		void load(int resNum);
717 		Common::Point setPosition(const Common::Point &pos, bool initialFlag = false);
718 		void synchronize(Serializer &s);
719 		void redraw(Rect *updateRect = NULL);
720 	};
721 public:
722 	SceneObject _leftEdge;
723 	SceneObject _rightEdge;
724 	SceneObject _knob;
725 	SceneObject _altimeterContent;
726 	SceneObject _knobRightContent;
727 	SceneObject _knobLeftContent;
728 	Scenery _scenery;
729 	ControlPanel _controlPanel;
730 	Altimeter _altimeter;
731 	KnobLeft _knobLeft;
732 	KnobRight _knobRight;
733 	Skip _skip;
734 	Action1 _action1;
735 	Map _map;
736 	SceneText _skipText;
737 
738 	bool _controlsActiveChanging;
739 	bool _altitudeChanging;
740 	bool _majorMinorFlag;
741 	int _altitudeMinorChange;
742 	int _altitudeMajorChange;
743 	Common::Point _balloonLocation;
744 	Common::Point _balloonScreenPos;
745 	int _newAltitude;
746 	int _xAmount;
747 	int _xComparison;
748 	int _fadeCounter;
749 	bool _paletteReloadNeeded;
750 
751 	Scene2900();
752 	void synchronize(Serializer &s) override;
753 	void postInit(SceneObjectList *OwnerList = NULL) override;
754 	void remove() override;
755 	void signal() override;
756 	void dispatch() override;
757 	void refreshBackground(int xAmount, int yAmount) override;
758 };
759 
760 } // End of namespace Ringworld2
761 } // End of namespace TsAGE
762 
763 #endif
764