ScummVM API documentation
mars.h
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  * Additional copyright for this file:
8  * Copyright (C) 1995-1997 Presto Studios, Inc.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24 
25 #ifndef PEGASUS_NEIGHBORHOOD_MARS_MARS_H
26 #define PEGASUS_NEIGHBORHOOD_MARS_MARS_H
27 
28 #include "pegasus/neighborhood/neighborhood.h"
29 #include "pegasus/neighborhood/mars/constants.h"
30 #include "pegasus/neighborhood/mars/energybeam.h"
31 #include "pegasus/neighborhood/mars/gravitoncannon.h"
32 #include "pegasus/neighborhood/mars/planetmover.h"
33 #include "pegasus/neighborhood/mars/reactor.h"
34 #include "pegasus/neighborhood/mars/robotship.h"
35 #include "pegasus/neighborhood/mars/shuttleenergymeter.h"
36 #include "pegasus/neighborhood/mars/shuttlehud.h"
37 #include "pegasus/neighborhood/mars/spacejunk.h"
38 #include "pegasus/neighborhood/mars/tractorbeam.h"
39 
40 namespace Pegasus {
41 
42 class CanyonChase;
43 class InventoryItem;
44 class Mars;
45 class TunnelPod;
46 
47 enum MarsTimerCode {
48  kMarsPodCautionDisplayed,
49  kMarsPodCautionDismissed,
50  kMarsCanyonChaseExited,
51  kMarsCanyonChaseFaded,
52  kMarsLaunchTubeReached,
53  kMarsCanyonChaseFinished,
54  kMarsSpaceChaseFinished // Player ran out of time...
55 };
56 
58  Mars *mars;
59  MarsTimerCode event;
60 
61  void fire();
62 };
63 
64 enum ShuttleWeaponSelection {
65  kNoWeapon,
66  kEnergyBeam,
67  kGravitonCannon,
68  kTractorBeam
69 };
70 
71 class Mars : public Neighborhood {
72 friend class CanyonChase;
73 friend class TunnelPod;
74 friend struct MarsTimerEvent;
75 public:
77  ~Mars() override;
78 
79  GameInteraction *makeInteraction(const InteractionID) override;
80  void flushGameState() override;
81 
82  uint16 getDateResID() const override;
83 
84  AirQuality getAirQuality(const RoomID) override;
85 
86  void checkAirMask() override;
87 
88  void showBigExplosion(const Common::Rect &, const DisplayOrder);
89  void showLittleExplosion(const Common::Rect &, const DisplayOrder);
90  void hitByJunk();
91  void decreaseRobotShuttleEnergy(const int, Common::Point impactPoint);
92  void setUpNextDropTime();
93 
94  Common::Path getBriefingMovie() override;
95  Common::Path getEnvScanMovie() override;
96  uint getNumHints() override;
97  Common::Path getHintMovie(uint) override;
98 
99  void shieldOn() override;
100  void shieldOff() override;
101 
102  void checkContinuePoint(const RoomID, const DirectionConstant) override;
103 
104  void setSoundFXLevel(const uint16) override;
105  void setAmbienceLevel(const uint16) override;
106 
107  bool canSolve() override;
108  void doSolve() override;
109 
110  bool inColorMatchingGame();
111 
112 protected:
113  enum {
114  kMarsPrivatePodStorageOpenFlag,
115  kMarsPrivatePodTurnLeftFlag,
116  kMarsPrivatePodTurnRightFlag,
117  kMarsPrivateRobotTiredOfWaitingFlag,
118  kMarsPrivatePlatformZoomedInFlag,
119  kMarsPrivateBombExposedFlag,
120  kMarsPrivateDraggingBombFlag,
121  kMarsPrivateInSpaceChaseFlag,
122  kMarsPrivateGotMapChipFlag,
123  kMarsPrivateGotOpticalChipFlag,
124  kMarsPrivateGotShieldChipFlag,
125  kNumMarsPrivateFlags
126  };
127 
128  void init() override;
129  void start() override;
130  void setUpAIRules() override;
131  void arriveAt(const RoomID, const DirectionConstant) override;
132  void takeItemFromRoom(Item *) override;
133  void dropItemIntoRoom(Item *, Hotspot *) override;
134  void activateHotspots() override;
135  void activateOneHotspot(HotspotInfoTable::Entry &, Hotspot *) override;
136  void clickInHotspot(const Input &, const Hotspot *) override;
137  InputBits getInputFilter() override;
138 
139  TimeValue getViewTime(const RoomID, const DirectionConstant) override;
140  void getZoomEntry(const HotSpotID, ZoomTable::Entry &) override;
141  void findSpotEntry(const RoomID, const DirectionConstant, SpotFlags, SpotTable::Entry &) override;
142  CanOpenDoorReason canOpenDoor(DoorTable::Entry &) override;
143  void openDoor() override;
144  void closeDoorOffScreen(const RoomID, const DirectionConstant) override;
145  void startDoorOpenMovie(const TimeValue, const TimeValue) override;
146  void startExitMovie(const ExitTable::Entry &) override;
147  int16 getStaticCompassAngle(const RoomID, const DirectionConstant) override;
148  void getExitCompassMove(const ExitTable::Entry &, FaderMoveSpec &) override;
149  void getExtraCompassMove(const ExtraTable::Entry &, FaderMoveSpec &) override;
150  void turnTo(const DirectionConstant) override;
151  void startExtraSequence(const ExtraID, const NotificationFlags, const InputBits) override;
152  void receiveNotification(Notification *, const NotificationFlags) override;
153  void doorOpened() override;
154  void startUpFromFinishedTunnelPod();
155  void setUpReactorEnergyDrain();
156  Hotspot *getItemScreenSpot(Item *, DisplayElement *) override;
157  void lockThawed();
158  void robotTiredOfWaiting();
159 
160  void setUpReactorLevel1();
161  void setUpNextReactorLevel();
162  void makeColorSequence();
163  void doUndoOneGuess();
164  void doReactorGuess(int32 guess);
165  void bombExplodesInGame();
166  void didntFindBomb();
167  CanMoveForwardReason canMoveForward(ExitTable::Entry &) override;
168  void cantMoveThatWay(CanMoveForwardReason) override;
169  void moveForward() override;
170  void bumpIntoWall() override;
171  void turnLeft() override;
172  void turnRight() override;
173  void airStageExpired();
174  void loadAmbientLoops() override;
175  void checkAirlockDoors();
176  void pickedUpItem(Item *item) override;
177  void cantOpenDoor(CanOpenDoorReason) override;
178  void launchMaze007Robot();
179  void launchMaze015Robot();
180  void launchMaze101Robot();
181  void launchMaze104Robot();
182  void launchMaze133Robot();
183  void launchMaze136Robot();
184  void launchMaze184Robot();
185  void timerExpired(const uint32) override;
186  void showRobotAtReactor();
187  void spotCompleted() override;
188 
189  void doCanyonChase(void);
190  void startMarsTimer(TimeValue, TimeScale, MarsTimerCode);
191  void marsTimerExpired(MarsTimerEvent &);
192  void throwAwayMarsShuttle();
193  void startUpFromFinishedSpaceChase();
194  void startUpFromSpaceChase();
195  void transportOutFromSpaceChase(bool);
196  void spaceChaseClick(const Input &, const HotSpotID);
197  void updateCursor(const Common::Point, const Hotspot *) override;
198  void playSpaceAmbient();
199 
200  Common::Path getSoundSpotsName() override;
201  Common::Path getNavMovieName() override;
202 
203  Movie _extraMovie;
204  NotificationCallBack _extraMovieCallBack;
205 
206  InventoryItem *_attackingItem;
207  FuseFunction _bombFuse;
208  FuseFunction _noAirFuse;
209  FuseFunction _utilityFuse;
211  uint _reactorStage, _nextGuess;
212  int32 _currentGuess[3];
213  ReactorGuess _guessObject;
214  Picture _undoPict;
215  ReactorHistory _guessHistory;
216  ReactorChoiceHighlight _choiceHighlight;
217 
218  Picture _shuttleInterface1;
219  Picture _shuttleInterface2;
220  Picture _shuttleInterface3;
221  Picture _shuttleInterface4;
222  Movie _canyonChaseMovie;
223  Sound _musicLoop;
224  SoundFader _musicFader;
225 
226  MarsTimerEvent _marsEvent;
227 
228  Movie _leftShuttleMovie;
229  Movie _rightShuttleMovie;
230  Movie _lowerLeftShuttleMovie;
231  Movie _lowerRightShuttleMovie;
232  Movie _centerShuttleMovie;
233  Movie _upperLeftShuttleMovie;
234  Movie _upperRightShuttleMovie;
235  Movie _leftDamageShuttleMovie;
236  Movie _rightDamageShuttleMovie;
237  ShuttleEnergyMeter _shuttleEnergyMeter;
238  Movie _planetMovie;
239  PlanetMover _planetMover;
240  RobotShip _robotShip;
241  ShuttleHUD _shuttleHUD;
242  TractorBeam _tractorBeam;
243  SpaceJunk _junk;
244  EnergyBeam _energyBeam;
245  GravitonCannon _gravitonCannon;
246  Hotspot _energyChoiceSpot;
247  Hotspot _gravitonChoiceSpot;
248  Hotspot _tractorChoiceSpot;
249  Hotspot _shuttleViewSpot;
250  Hotspot _shuttleTransportSpot;
251  ShuttleWeaponSelection _weaponSelection;
252  ScalingMovie _explosions;
253  NotificationCallBack _explosionCallBack;
254 };
255 
256 } // End of namespace Pegasus
257 
258 #endif
Definition: neighborhood.h:111
Definition: door.h:60
Definition: movie.h:40
Definition: planetmover.h:34
Definition: fader.h:35
Definition: energybeam.h:32
Definition: mars.h:71
Definition: reactor.h:79
Definition: timers.h:239
Definition: rect.h:144
Definition: path.h:52
Definition: reactor.h:52
Definition: hotspot.h:85
Definition: movie.h:95
Definition: item.h:294
Definition: spot.h:66
Definition: input.h:322
Definition: zoom.h:49
Definition: tunnelpod.h:35
Definition: spacejunk.h:39
Definition: fader.h:109
Definition: exit.h:49
Definition: reactor.h:34
Definition: gravitoncannon.h:33
Definition: rect.h:45
Definition: mars.h:57
Definition: notification.h:53
Definition: elements.h:43
Definition: interaction.h:37
Definition: timers.h:191
Definition: tractorbeam.h:32
Definition: pegasus.h:70
Definition: robotship.h:35
Definition: shuttleenergymeter.h:44
Definition: hotspotinfo.h:49
Definition: extra.h:49
Definition: sound.h:50
Definition: input.h:410
Definition: ai_action.h:33
Definition: surface.h:125
Definition: inventoryitem.h:39
Definition: canyonchase.h:51
Definition: shuttlehud.h:33