25 #ifndef PEGASUS_NEIGHBORHOOD_H 26 #define PEGASUS_NEIGHBORHOOD_H 28 #include "common/queue.h" 29 #include "common/str.h" 31 #include "pegasus/fader.h" 32 #include "pegasus/hotspot.h" 33 #include "pegasus/input.h" 34 #include "pegasus/movie.h" 35 #include "pegasus/notification.h" 36 #include "pegasus/sound.h" 37 #include "pegasus/timers.h" 38 #include "pegasus/transition.h" 39 #include "pegasus/util.h" 40 #include "pegasus/neighborhood/door.h" 41 #include "pegasus/neighborhood/exit.h" 42 #include "pegasus/neighborhood/extra.h" 43 #include "pegasus/neighborhood/hotspotinfo.h" 44 #include "pegasus/neighborhood/spot.h" 45 #include "pegasus/neighborhood/turn.h" 46 #include "pegasus/neighborhood/view.h" 47 #include "pegasus/neighborhood/zoom.h" 54 static const NeighborhoodID kCaldoriaID = 0;
55 static const NeighborhoodID kFullTSAID = 1;
56 static const NeighborhoodID kFinalTSAID = 2;
57 static const NeighborhoodID kTinyTSAID = 3;
58 static const NeighborhoodID kPrehistoricID = 4;
59 static const NeighborhoodID kMarsID = 5;
60 static const NeighborhoodID kWSCID = 6;
61 static const NeighborhoodID kNoradAlphaID = 7;
62 static const NeighborhoodID kNoradDeltaID = 8;
65 static const NeighborhoodID kNoradSubChaseID = 1000;
67 static const TimeScale kDefaultLoopFadeScale = kThirtyTicksPerSecond;
68 static const TimeValue kDefaultLoopFadeOut = kHalfSecondPerThirtyTicks;
69 static const TimeValue kDefaultLoopFadeIn = kHalfSecondPerThirtyTicks;
71 enum QueueRequestType {
81 QueueRequestType requestType;
83 TimeValue start, stop;
84 InputBits interruptionFilter;
86 NotificationFlags flags;
104 void callBack()
override;
120 virtual void start();
121 virtual void moveNavTo(
const CoordType,
const CoordType);
122 virtual void checkContinuePoint(
const RoomID,
const DirectionConstant) = 0;
123 void makeContinuePoint();
125 void activateHotspots()
override;
126 void clickInHotspot(
const Input &,
const Hotspot *)
override;
129 virtual CanTurnReason canTurn(TurnDirection turn, DirectionConstant &nextDir);
132 virtual void cantMoveThatWay(CanMoveForwardReason);
133 virtual void cantTurnThatWay(CanTurnReason) {}
134 virtual void cantOpenDoor(CanOpenDoorReason);
135 virtual void arriveAt(
const RoomID room,
const DirectionConstant direction);
136 virtual void turnTo(
const DirectionConstant);
137 virtual void spotCompleted();
138 virtual void doorOpened();
139 virtual void closeDoorOffScreen(
const RoomID,
const DirectionConstant) {}
141 virtual void moveForward();
142 virtual void turn(
const TurnDirection);
143 virtual void turnLeft();
144 virtual void turnRight();
145 virtual void turnUp();
146 virtual void turnDown();
147 virtual void openDoor();
148 virtual void zoomTo(
const Hotspot *);
150 virtual void updateViewFrame();
152 void requestExtraSequence(
const ExtraID,
const NotificationFlags,
const InputBits interruptionFilter);
153 void requestSpotSound(
const TimeValue,
const TimeValue,
const InputBits interruptionFilter,
const NotificationFlags);
154 void playSpotSoundSync(
const TimeValue in,
const TimeValue out);
155 void requestDelay(
const TimeValue,
const TimeScale,
const InputBits interruptionFilter,
const NotificationFlags);
157 Notification *getNeighborhoodNotification() {
return &_neighborhoodNotification; }
160 virtual void startSpotLoop(TimeValue, TimeValue, NotificationFlags = 0);
161 virtual bool actionQueueEmpty() {
return _actionQueue.empty(); }
162 virtual void showViewFrame(TimeValue);
163 virtual void findSpotEntry(
const RoomID room,
const DirectionConstant direction, SpotFlags flags,
SpotTable::Entry &spotEntry);
164 virtual void startExtraSequence(
const ExtraID,
const NotificationFlags,
const InputBits interruptionFilter);
165 bool startExtraSequenceSync(
const ExtraID,
const InputBits);
166 virtual void loopExtraSequence(
const uint32, NotificationFlags = 0);
167 int32 getLastExtra()
const {
return _lastExtra; }
168 virtual void scheduleNavCallBack(NotificationFlags);
170 Movie *getNavMovie() {
return &_navMovie; }
171 bool navMoviePlaying();
173 void setCurrentAlternate(
const AlternateID alt) { _currentAlternate = alt; }
174 AlternateID getCurrentAlternate()
const {
return _currentAlternate; }
176 void setCurrentActivation(
const HotSpotActivationID a) { _currentActivation = a; }
177 HotSpotActivationID getCurrentActivation() {
return _currentActivation; }
179 virtual void playDeathExtra(ExtraID, DeathReason);
180 virtual void die(
const DeathReason);
182 virtual void setSoundFXLevel(
const uint16);
183 virtual void setAmbienceLevel(
const uint16);
185 void forceStridingStop(
const RoomID,
const DirectionConstant,
const AlternateID);
186 void restoreStriding(
const RoomID,
const DirectionConstant,
const AlternateID);
190 Push *getTurnPush() {
return &_turnPush; }
191 Picture *getTurnPushPicture() {
return &_pushIn; }
196 virtual void loadAmbientLoops() {}
198 virtual void flushGameState() {}
202 virtual uint getNumHints();
204 virtual bool canSolve();
206 virtual void cleanUpAfterAIHint(
const Common::Path &) {}
207 virtual void doSolve();
209 virtual bool okayToJump();
211 virtual AirQuality getAirQuality(
const RoomID);
212 virtual void checkAirMask() {}
213 virtual void checkFlashlight() {}
214 virtual void shieldOn() {}
215 virtual void shieldOff() {}
217 virtual void loadLoopSound1(
const Common::Path &,
const uint16 volume = 0x100,
218 const TimeValue fadeOut = kDefaultLoopFadeOut,
const TimeValue fadeIn = kDefaultLoopFadeIn,
219 const TimeScale fadeScale = kDefaultLoopFadeScale);
220 virtual void loadLoopSound2(
const Common::Path &,
const uint16 volume = 0x100,
221 const TimeValue fadeOut = kDefaultLoopFadeOut,
const TimeValue fadeIn = kDefaultLoopFadeIn,
222 const TimeScale fadeScale = kDefaultLoopFadeScale);
223 bool loop1Loaded(
const Common::Path &soundName) {
return _loop1SoundString == soundName; }
224 bool loop2Loaded(
const Common::Path &soundName) {
return _loop2SoundString == soundName; }
228 virtual void takeItemFromRoom(
Item *);
233 virtual void requestDeleteCurrentInteraction() { _doneWithInteraction =
true; }
235 virtual uint16 getDateResID()
const = 0;
237 virtual void showExtraView(uint32);
238 virtual void startExtraLongSequence(
const uint32,
const uint32, NotificationFlags,
const InputBits interruptionFilter);
240 void openCroppedMovie(
const Common::Path &, CoordType, CoordType);
241 void loopCroppedMovie(
const Common::Path &, CoordType, CoordType);
242 void closeCroppedMovie();
243 void playCroppedMovieOnce(
const Common::Path &, CoordType, CoordType,
const InputBits interruptionFilter = kFilterNoInput);
245 void playMovieSegment(
Movie *, TimeValue = 0, TimeValue = 0xffffffff);
247 virtual void recallToTSASuccess();
248 virtual void recallToTSAFailure();
250 virtual void pickedUpItem(
Item *) {}
252 void handleInput(
const Input &,
const Hotspot *)
override;
261 void receiveNotification(
Notification *,
const NotificationFlags)
override;
264 virtual void getExitEntry(
const RoomID room,
const DirectionConstant direction,
ExitTable::Entry &entry);
265 virtual TimeValue getViewTime(
const RoomID room,
const DirectionConstant direction);
266 virtual void getDoorEntry(
const RoomID room,
const DirectionConstant direction,
DoorTable::Entry &doorEntry);
267 virtual DirectionConstant getTurnEntry(
const RoomID room,
const DirectionConstant direction,
const TurnDirection turn);
274 virtual void stopStriding();
275 virtual void checkStriding();
276 virtual bool stillMoveForward();
277 virtual void scheduleStridingCallBack(
const TimeValue, NotificationFlags flags);
279 virtual void startDoorOpenMovie(
const TimeValue,
const TimeValue);
280 virtual void startTurnPush(
const TurnDirection,
const TimeValue,
const DirectionConstant);
281 virtual void playExtraMovie(
const ExtraTable::Entry &,
const NotificationFlags,
const InputBits interruptionFilter);
283 virtual void activateCurrentView(
const RoomID,
const DirectionConstant, SpotFlags);
287 virtual void startSpotOnceOnly(TimeValue, TimeValue);
289 virtual void startMovieSequence(
const TimeValue,
const TimeValue, NotificationFlags,
290 bool loopSequence,
const InputBits interruptionFilter,
const TimeValue strideStop = 0xffffffff);
292 virtual void createNeighborhoodSpots();
294 void resetLastExtra() { _lastExtra = 0xffffffff; }
296 virtual void throwAwayInterface();
299 void popActionQueue();
300 void serviceActionQueue();
301 void requestAction(
const QueueRequestType,
const ExtraID,
const TimeValue,
const TimeValue,
const InputBits,
const NotificationFlags);
303 virtual bool prepareExtraSync(
const ExtraID);
304 virtual bool waitMovieFinish(
Movie *,
const InputBits);
306 InputBits getInputFilter()
override;
309 virtual int16 getStaticCompassAngle(
const RoomID,
const DirectionConstant dir);
314 virtual void setUpAIRules();
315 virtual void setHotspotFlags(
const HotSpotID,
const HotSpotFlags);
316 virtual void setIsItemTaken(
const ItemID);
318 virtual void upButton(
const Input &);
319 virtual void leftButton(
const Input &);
320 virtual void rightButton(
const Input &);
321 virtual void downButton(
const Input &);
323 void initOnePicture(
Picture *,
const Common::Path &, DisplayOrder, CoordType, CoordType,
bool);
324 void initOneMovie(
Movie *,
const Common::Path &, DisplayOrder, CoordType, CoordType,
bool);
326 void reinstateMonocleInterface();
328 virtual void newInteraction(
const InteractionID);
329 void useIdleTime()
override;
330 virtual void bumpIntoWall();
331 virtual void zoomUpOrBump();
333 void scheduleEvent(
const TimeValue,
const TimeScale,
const uint32);
335 virtual void timerExpired(
const uint32) {}
336 bool isEventTimerRunning() {
return _eventTimer.isFuseLit(); }
337 uint32 getTimerEvent() {
return _timerEvent; }
338 void timerFunction();
353 AlternateID _currentAlternate;
354 HotSpotActivationID _currentActivation;
357 DeathReason _extraDeathReason;
379 NeighborhoodActionQueue _actionQueue;
383 InputBits _interruptionFilter;
389 bool _doneWithInteraction;
Definition: transition.h:96
Definition: neighborhood.h:111
Definition: caldoriabomb.h:119
Definition: hotspotinfo.h:39
Definition: neighborhood.h:80
Definition: notification.h:53
Definition: neighborhood.h:98
Definition: elements.h:43
Definition: interaction.h:37
Definition: hotspot.h:119
Definition: hotspotinfo.h:49
Definition: notification.h:83
Definition: ai_action.h:33
Definition: surface.h:125