ScummVM API documentation
hypno.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  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (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, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef HYPNO_H
23 #define HYPNO_H
24 
25 #include "common/array.h"
26 #include "common/compression/installshieldv3_archive.h"
27 #include "common/random.h"
28 #include "common/serializer.h"
29 #include "common/str-array.h"
30 #include "common/stream.h"
31 #include "engines/engine.h"
32 #include "graphics/font.h"
33 #include "graphics/fontman.h"
34 #include "graphics/surface.h"
35 #include "video/subtitles.h"
36 
37 #include "hypno/grammar.h"
38 #include "hypno/libfile.h"
39 
40 namespace Image {
41 class ImageDecoder;
42 }
43 
44 struct ADGameDescription;
45 
46 namespace Hypno {
47 
48 // debug channels
49 enum {
50  kHypnoDebugMedia = 1,
51  kHypnoDebugParser,
52  kHypnoDebugArcade,
53  kHypnoDebugScene,
54 };
55 
56 // Player positions
57 
58 enum PlayerPosition {
59  kPlayerTop = 'T',
60  kPlayerBottom = 'B',
61  kPlayerLeft = 'L',
62  kPlayerRight = 'R'
63 };
64 
65 // Common colors
66 enum HypnoColors {
67  kHypnoNoColor = -1,
68  kHypnoColorRed = 250,
69  kHypnoColorGreen = 251,
70  kHypnoColorWhiteOrBlue = 252,
71  kHypnoColorYellow = 253,
72  kHypnoColorBlack = 254,
73  kHypnoColorCyan = 255
74 };
75 
76 // Spider colors
77 enum SpiderColors {
78  kSpiderColorWhite = 248,
79  kSpiderColorBlue = 252,
80 };
81 
82 enum HYPNOActions {
83  kActionNone,
84  kActionSkipIntro,
85  kActionSkipCutscene,
86  kActionPrimaryShoot,
87  kActionSkipLevel,
88  kActionKillPlayer,
89  kActionPause,
90  kActionLeft,
91  kActionDown,
92  kActionRight,
93  kActionUp,
94  kActionYes,
95  kActionNo,
96  kActionDifficultyChump,
97  kActionDifficultyPunk,
98  kActionDifficultyBadass,
99  kActionDifficultExit,
100  kActionRetry,
101  kActionRestart,
102  kActionNewMission,
103  kActionQuit,
104  kActionCredits,
105  kActionSelect,
106 };
107 
108 class HypnoEngine;
109 
110 class CursorCache {
111 private:
112  HypnoEngine *_vm;
113  Common::String _filename;
114  uint32 _frame;
115  byte *_palette;
116  Graphics::Surface *_surface;
117 
118 public:
119  CursorCache(HypnoEngine *vm) : _vm(vm), _filename(""), _frame(0), _palette(nullptr), _surface(nullptr) {}
120 
121  ~CursorCache() {
122  if (_surface) {
123  _surface->free();
124  delete _surface;
125  }
126  free(_palette);
127  }
128 
129  Graphics::Surface *getCursor(const Common::String &cursor, uint32 n, byte **palette);
130 };
131 
132 class HypnoEngine : public Engine {
133 private:
134  Image::ImageDecoder *_image;
135 
136 public:
137  HypnoEngine(OSystem *syst, const ADGameDescription *gd);
138  ~HypnoEngine();
139 
140  const ADGameDescription *_gameDescription;
141  bool isDemo() const;
142  Common::Language _language;
143  Common::Platform _platform;
144  Common::String _variant;
145  bool _cheatsEnabled;
146  bool _infiniteHealthCheat;
147  bool _infiniteAmmoCheat;
148  bool _unlockAllLevels;
149  bool _restoredContentEnabled;
150 
151  Audio::SoundHandle _soundHandle;
152  Common::InstallShieldV3 _installerArchive;
153  Common::List<LibFile*> _archive;
154 
155  Common::Error run() override;
156  Levels _levels;
158  virtual void resetSceneState();
159  bool checkSceneCompleted();
160  bool checkLevelWon();
161  void runLevel(Common::String &name);
162  void runScene(Scene *scene);
163  virtual void runBeforeArcade(ArcadeShooting *arc);
164  virtual void runAfterArcade(ArcadeShooting *arc);
165  void runArcade(ArcadeShooting *arc);
166  // For some menus and hardcoded puzzles
167  virtual void runCode(Code *code);
168  // Level transitions
169  void runTransition(Transition *trans);
170 
171  void restartGame();
172  void clearAreas();
173  void initializePath(const Common::FSNode &gamePath) override;
174  virtual void loadAssets();
175 
176  // Parsing
177  void splitArcadeFile(const Common::String &filename, Common::String &arc, Common::String &list);
178  void parseArcadeShooting(const Common::String &prefix, const Common::String &name, const Common::String &data);
179  SegmentShootsSequence parseShootList(const Common::String &name, const Common::String &data);
180  void loadArcadeLevel(const Common::String &current, const Common::String &nextWin, const Common::String &nextLose, const Common::String &prefix);
181  void loadSceneLevel(const Common::String &current, const Common::String &next, const Common::String &prefix);
182  void loadSceneLevel(const char *buf, const Common::String &name, const Common::String &next, const Common::String &prefix);
183 
184  LibFile *loadLib(const Common::Path &prefix, const Common::Path &filename, bool encrypted);
185 
186  // User input
187  void clickedHotspot(Common::Point);
188  virtual bool hoverHotspot(Common::Point);
189 
190  // Cursors
191  bool cursorPauseMovie(Common::Point);
192  bool cursorExit(Common::Point);
193  bool cursorMask(Common::Point);
194 
195  virtual void loadGame(const Common::String &nextLevel, int score, int puzzleDifficulty, int combatDifficulty);
196  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override { return (isDemo() ? false : true); }
197  bool canSaveAutosaveCurrently() override { return false; }
198  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override { return (isDemo() ? false : true); }
199  Common::String _checkpoint;
200 
201  Video::Subtitles *_subtitles;
202  void adjustSubtitleSize();
203  void loadSubtitles(const Common::Path &path);
204 
205  Common::Path _prefixDir;
206  Common::Path convertPath(const Common::String &);
207  void playVideo(MVideo &video);
208  void skipVideo(MVideo &video);
209 
210  Graphics::Surface *decodeFrame(const Common::String &name, int frame, byte **palette = nullptr);
211  Frames decodeFrames(const Common::String &name);
212  void loadImage(const Common::String &file, int x, int y, bool transparent, bool palette = false, int frameNumber = 0);
213  void drawImage(Graphics::Surface &image, int x, int y, bool transparent);
214  void loadPalette(const Common::String &fname);
215  void loadPalette(const byte *palette, uint32 offset, uint32 size);
216  byte *getPalette(uint32 idx);
217 
218  // Cursors
219  Common::String _defaultCursor;
220  uint32 _defaultCursorIdx;
221  CursorCache *_cursorCache;
222  void disableCursor();
223  void defaultCursor();
224  virtual void changeCursor(const Common::String &cursor, uint32 n, bool centerCursor = false);
225  virtual void changeCursor(const Common::String &cursor);
226  virtual void changeCursor(const Graphics::Surface &entry, byte *palette, bool centerCursor = false);
227 
228  // Actions
229  virtual void runMenu(Hotspots *hs, bool only_menu = false);
230  void runBackground(Background *a);
231  void runOverlay(Overlay *a);
232  void runMice(Mice *a);
233  void runEscape();
234  void runSave(Save *a);
235  void runLoad(Load *a);
236  void runLoadCheckpoint(LoadCheckpoint *a);
237  void runTimer(Timer *a);
238  void runQuit(Quit *a);
239  void runCutscene(Cutscene *a);
240  void runIntro(Intro *a);
241  void runPlay(Play *a);
242  void runSound(Sound *a);
243  void runPalette(Palette *a);
244  void runAmbient(Ambient *a);
245  void runWalN(WalN *a);
246  bool runGlobal(Global *a);
247  void runTalk(Talk *a);
248  void runSwapPointer(SwapPointer *a);
249  void runChangeLevel(ChangeLevel *a);
250  virtual void drawBackToMenu(Hotspot *h);
251 
252  // Screen
253  int _screenW, _screenH;
254  Graphics::PixelFormat _pixelFormat;
255  void changeScreenMode(const Common::String &mode);
256  Graphics::Surface *_compositeSurface;
257  uint32 _transparentColor;
258  Common::Rect screenRect;
259  void updateScreen(MVideo &video);
260  void updateVideo(MVideo &video);
261  void drawScreen();
262 
263  // intros
264  void runIntro(MVideo &video);
265  void runIntros(Videos &videos);
267 
268  // levels
269  Common::String _nextLevel;
270  Common::String _currentLevel;
271  virtual Common::String findNextLevel(const Common::String &level);
272  virtual Common::String findNextLevel(const Transition *trans);
273  uint32 _levelId;
274 
275  // hotspots
276  Hotspots *_nextHotsToAdd;
277  Hotspots *_nextHotsToRemove;
278  HotspotsStack stack;
279 
280  // Movies
281  Videos _nextSequentialVideoToPlay;
282  Videos _nextParallelVideoToPlay;
283  Videos _escapeSequentialVideoToPlay;
284  Videos _videosPlaying;
285  Videos _videosLooping;
286  MVideo *_masks;
287  MVideo *_additionalVideo;
288  const Graphics::Surface *_mask;
289 
290  // Sounds
291  Filename _soundPath;
292  Filename _music;
293  int _musicRate;
294  bool _musicStereo;
295  bool _doNotStopSounds;
296  void playSound(const Filename &filename, uint32 loops, uint32 sampleRate = 22050, bool stereo = false);
297  void stopSound();
298 
299  // Arcade
300  Common::String _arcadeMode;
301  MVideo *_background;
302  Filename _currentPalette;
303  virtual bool availableObjectives();
304  virtual bool checkArcadeObjectives();
305  ArcadeTransitions _transitions;
306  virtual bool checkTransition(ArcadeTransitions &transitions, ArcadeShooting *arc);
307  virtual Common::Point getPlayerPosition(bool needsUpdate);
308  virtual Common::Point computeTargetPosition(const Common::Point &mousePos);
309  virtual int detectTarget(const Common::Point &mousePos);
310  virtual void pressedKey(const int keycode);
311  virtual bool clickedPrimaryShoot(const Common::Point &mousePos);
312  virtual bool clickedSecondaryShoot(const Common::Point &mousePos);
313  virtual void drawShoot(const Common::Point &mousePos);
314  virtual bool shoot(const Common::Point &mousePos, ArcadeShooting *arc, bool secondary);
315  virtual void hitPlayer();
316  virtual void missedTarget(Shoot *s, ArcadeShooting *arc);
317  virtual void missNoTarget(ArcadeShooting *arc);
318  virtual byte *getTargetColor(Common::String name, int levelId);
319  virtual bool checkRButtonUp();
320  virtual void setRButtonUp(const bool val);
321  virtual void disableGameKeymaps();
322  virtual void enableGameKeymaps();
323 
324  // Segments
325  Segments _segments;
326  uint32 _segmentIdx;
327  uint32 _segmentOffset;
328  uint32 _segmentRepetition;
329  uint32 _segmentRepetitionMax;
330  uint32 _segmentShootSequenceOffset;
331  uint32 _segmentShootSequenceMax;
332  ShootSequence _shootSequence;
333  virtual void findNextSegment(ArcadeShooting *arc);
334  virtual void initSegment(ArcadeShooting *arc);
335 
336  ArcadeStats _stats;
337  void resetStatistics();
338  void incLivesUsed();
339  void incShotsFired();
340  void incEnemyHits();
341  void incEnemyTargets();
342  void incTargetsDestroyed();
343  void incTargetsMissed();
344  void incFriendliesEncountered();
345  void incInfoReceived();
346 
347  void incScore(int inc);
348  void incBonus(int inc);
349 
350  uint32 killRatio();
351  uint32 accuracyRatio();
352 
353  Common::String _difficulty;
354  bool _skipLevel;
355  bool _loseLevel;
356  bool _skipDefeatVideo;
357  bool _skipNextVideo;
358 
359  virtual void drawCursorArcade(const Common::Point &mousePos);
360  virtual void drawPlayer();
361  virtual void drawHealth();
362  virtual void drawAmmo();
363  int _health;
364  int _maxHealth;
365 
366  int _ammo;
367  int _maxAmmo;
368 
369  int _score;
370  int _bonus;
371  int _lives;
372 
373  Common::String _healthString;
374  Common::String _scoreString;
375  Common::String _objString;
376  Common::String _targetString;
377  Common::String _directionString;
378  Common::String _enterNameString;
379 
380  Filename _shootSound;
381  Filename _hitSound;
382  Filename _additionalSound;
383  Shoots _shoots;
384  Frames _playerFrames;
385  int _playerFrameIdx;
386  Common::List<int> _playerFrameSeps;
387  int _playerFrameStart;
388  int _playerFrameSep;
389  int _playerFrameEnd;
390 
391  // Objectives
392  uint32 _objIdx;
393  uint32 _objKillsCount[2];
394  uint32 _objMissesCount[2];
395  uint32 _objKillsRequired[2];
396  uint32 _objMissesAllowed[2];
397 
398  // Fonts
399  Common::BitArray _font05;
400  Common::BitArray _font08;
401  virtual void loadFonts(const Common::String &prefix = "");
402  virtual void drawString(const Filename &name, const Common::String &str, int x, int y, int w, uint32 c);
403 
404  // Conversation
405  Actions _conversation;
406  bool _refreshConversation;
407  virtual void showConversation();
408  virtual void endConversation();
409  virtual void rightClickedConversation(const Common::Point &mousePos);
410  virtual void leftClickedConversation(const Common::Point &mousePos);
411  virtual bool hoverConversation(const Common::Point &mousePos);
412  // Credits
413  virtual void showCredits();
414 
415  // Timers
416  int32 _countdown;
417  bool _timerStarted;
418  bool _keepTimerDuringScenes;
419  bool startAlarm(uint32, Common::String *);
420  bool startCountdown(uint32);
421  void removeTimers();
422 
423  // Random
424  Common::RandomSource *_rnd;
425 };
426 
427 struct chapterEntry {
428  int id;
429  int energyPos[2];
430  int scorePos[2];
431  int objectivesPos[2];
432  int ammoPos[2];
433  int ammoOffset;
434  int targetColor;
435 };
436 
437 class WetEngine : public HypnoEngine {
438 public:
439  WetEngine(OSystem *syst, const ADGameDescription *gd);
441  Common::Array<int> _ids;
442  int _lastLevel;
443  Common::String _name;
444 
445  void loadAssets() override;
446  void loadAssetsDemoDisc();
447  void loadAssetsEarlyDemo();
448  void loadAssetsGen4();
449  void loadAssetsPCW();
450  void loadAssetsPCG();
451  void loadAssetsFullGame();
452  void loadAssetsNI();
453 
454  void loadFonts(const Common::String &prefix = "") override;
455  void drawString(const Filename &name, const Common::String &str, int x, int y, int w, uint32 c) override;
456  void changeCursor(const Common::String &cursor) override;
457 
458  void showCredits() override;
459  bool clickedSecondaryShoot(const Common::Point &mousePos) override;
460  void drawShoot(const Common::Point &target) override;
461  void drawPlayer() override;
462  void drawHealth() override;
463  void drawAmmo() override;
464  void hitPlayer() override;
465  void drawCursorArcade(const Common::Point &mousePos) override;
466  Common::Point computeTargetPosition(const Common::Point &mousePos) override;
467  void missedTarget(Shoot *s, ArcadeShooting *arc) override;
468  void missNoTarget(ArcadeShooting *arc) override;
469 
470  void runCode(Code *code) override;
471  Common::String findNextLevel(const Common::String &level) override;
472  Common::String findNextLevel(const Transition *trans) override;
473 
474  // Saves
475  Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
476  Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
477  bool loadProfile(const Common::String &name);
478  void saveProfile(const Common::String &name, int levelId);
479 
480  // Arcade
481  Common::Point getPlayerPosition(bool needsUpdate) override;
482  bool checkTransition(ArcadeTransitions &transitions, ArcadeShooting *arc) override;
483  void pressedKey(const int keycode) override;
484  void runBeforeArcade(ArcadeShooting *arc) override;
485  void runAfterArcade(ArcadeShooting *arc) override;
486  void findNextSegment(ArcadeShooting *arc) override;
487  void initSegment(ArcadeShooting *arc) override;
488  byte *getTargetColor(Common::String name, int levelId) override;
489  bool checkRButtonUp() override;
490  void setRButtonUp(const bool val) override;
491  void disableGameKeymaps() override;
492  void enableGameKeymaps() override;
493 
494 
495  bool hasFeature(EngineFeature f) const override {
496  return (f == kSupportsReturnToLauncher);
497  }
498 
499 private:
500  Common::String getLocalizedString(const Common::String &name);
501  uint16 getNextChar(const Common::String &str, uint32 &c);
502  void drawGlyph(const Common::BitArray &font, int x, int y, int bitoffset, int width, int height, int pitch, uint32 color, bool invert);
503  void drawKoreanChar(uint16 chr, int &curx, int y, uint32 color);
504  void runMainMenu(Code *code);
505  void runLevelMenu(Code *code);
506  void runCheckLives(Code *code);
507  void endCredits(Code *code);
508  void showDemoScore();
509  uint32 findPaletteIndexZones(uint32 id);
510 
511  Common::List<int> _scoreMilestones;
512  void restoreScoreMilestones(int score);
513  bool checkScoreMilestones(int score);
514 
515 
516  Frames _c33PlayerCursor;
517  Common::Point _c33PlayerPosition;
518  Common::List<PlayerPosition> _c33PlayerDirection;
519  bool _c33UseMouse;
520  void generateStaticEffect();
521 
522  Common::BitArray _fontg9a;
523  Common::Array<uint32> _c40SegmentPath;
524  Common::Array<uint32> _c40SegmentNext;
525  int _c40SegmentIdx;
526  int _c40lastTurn;
527  int _c50LeftTurns;
528  int _c50RigthTurns;
529 
530  bool _rButtonUp;
531 };
532 
533 class SpiderEngine : public HypnoEngine {
534 public:
535  SpiderEngine(OSystem *syst, const ADGameDescription *gd);
536  void loadAssets() override;
537  void loadAssetsDemo();
538  void loadAssetsFullGame();
539  void showCredits() override;
540 
541  void drawCursorArcade(const Common::Point &mousePos) override;
542  void drawShoot(const Common::Point &target) override;
543  void drawPlayer() override;
544  void drawHealth() override;
545  void missedTarget(Shoot *s, ArcadeShooting *arc) override;
546  void hitPlayer() override;
547 
548  // Arcade
549  void pressedKey(const int keycode) override;
550  void runBeforeArcade(ArcadeShooting *arc) override;
551  void runAfterArcade(ArcadeShooting *arc) override;
552  void findNextSegment(ArcadeShooting *arc) override;
553  void initSegment(ArcadeShooting *arc) override;
554  byte *getTargetColor(Common::String name, int levelId) override;
555 
556  void drawBackToMenu(Hotspot *h) override;
557  void runCode(Code *code) override;
558  Common::String findNextLevel(const Common::String &level) override;
559  Common::String findNextLevel(const Transition *trans) override;
560 
561  void loadFonts(const Common::String &prefix = "") override;
562  void drawString(const Filename &name, const Common::String &str, int x, int y, int w, uint32 c) override;
563 
564  void showConversation() override;
565  void endConversation() override;
566  void rightClickedConversation(const Common::Point &mousePos) override;
567  void leftClickedConversation(const Common::Point &mousePos) override;
568  bool hoverConversation(const Common::Point &mousePos) override;
569 
570  void loadGame(const Common::String &nextLevel, int score, int puzzleDifficulty, int combatDifficulty) override;
571  Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
572  Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
573  bool canSaveAutosaveCurrently() override {
574  return false; // No hypno engine should perform autosave using the default implementation
575  }
576 
577  bool hasFeature(EngineFeature f) const override {
578  return (f == kSupportsSavingDuringRuntime || f == kSupportsLoadingDuringRuntime || f == kSupportsReturnToLauncher);
579  }
580 
581 private:
582  void runMatrix(Code *code);
583  void addIngredient(Code *code);
584  void checkMixture(Code *code);
585  void runNote(Code *code);
586  void runFusePanel(Code *code);
587  void runRecept(Code *code);
588  void runOffice(Code *code);
589  void runFileCabinet(Code *code);
590  void runLock(Code *code);
591  void runFuseBox(Code *code);
592  void runGiveUp();
593  void showScore(const Common::String &prefix);
594 
595  uint32 _currentPlayerPosition;
596  uint32 _lastPlayerPosition;
597 
598  bool _fuseState[2][10] = {};
599  bool _isFuseRust = true;
600  bool _isFuseUnreadable = false;
601  bool ingredients[7] = {};
602 
603  Common::Rect _h1Area;
604  Common::Rect _h2Area;
605  Common::Rect _h3Area;
606 
607  const Graphics::Font *_font;
608 };
609 
610 class BoyzEngine : public HypnoEngine {
611 public:
612  BoyzEngine(OSystem *syst, const ADGameDescription *gd);
613  ~BoyzEngine();
614  Common::String _name;
615  Common::Array<int> _ids;
616  int _lastLevel;
617  bool _flashbackMode;
618  void loadAssets() override;
619  void runCode(Code *code) override;
620  Common::String findNextLevel(const Common::String &level) override;
621  Common::String findNextLevel(const Transition *trans) override;
622 
623  // Scenes
624  void resetSceneState() override;
625  void runMenu(Hotspots *hs, bool only_menu = false) override;
626  bool hoverHotspot(Common::Point) override;
627 
628  // Arcade
629  void runBeforeArcade(ArcadeShooting *arc) override;
630  void runAfterArcade(ArcadeShooting *arc) override;
631  void pressedKey(const int keycode) override;
632  int detectTarget(const Common::Point &mousePos) override;
633  void drawCursorArcade(const Common::Point &mousePos) override;
634  bool shoot(const Common::Point &mousePos, ArcadeShooting *arc, bool secondary) override;
635  bool clickedSecondaryShoot(const Common::Point &mousePos) override;
636  void showCredits() override;
637  // Stats
638  void showArcadeStats(int territory, const ArcadeStats &data);
639  ArcadeStats _lastStats;
640  ArcadeStats _globalStats;
641 
642  void missedTarget(Shoot *s, ArcadeShooting *arc) override;
643  void drawHealth() override;
644  void drawAmmo() override;
645  void drawShoot(const Common::Point &target) override;
646  void hitPlayer() override;
647  void drawPlayer() override;
648  void findNextSegment(ArcadeShooting *arc) override;
649  void initSegment(ArcadeShooting *arc) override;
650  bool checkTransition(ArcadeTransitions &transitions, ArcadeShooting *arc) override;
651 
652  void drawString(const Filename &name, const Common::String &str, int x, int y, int w, uint32 c) override;
653 
654  // Saves
655  Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
656  Common::Error loadGameStream(Common::SeekableReadStream *stream) override;
657  Common::StringArray listProfiles();
658  bool loadProfile(const Common::String &name);
659  void saveProfile(const Common::String &name, int levelId);
660 
661  private:
662  void renderHighlights(Hotspots *hs);
663  void waitForUserClick(uint32 timeout);
664  int pickABox();
665  int _selectedCorrectBox;
666  char selectDirection();
667 
668  void runMainMenu(Code *code);
669  bool runExitMenu();
670  void runRetryMenu(Code *code);
671  void runCheckC3(Code *code);
672  void runCheckHo(Code *code);
673  void runCheckC5(Code *code);
674  void runAlarmC5(Code *code);
675  void runDifficultyMenu(Code *code);
676  void endCredits(Code *code);
677  int getTerritory(const Common::String &level);
678  Common::String lastLevelTerritory(const Common::String &level);
679  Common::String firstLevelTerritory(const Common::String &level);
680 
681  void loadSceneState(Common::SeekableReadStream *stream);
682  void saveSceneState(Common::WriteStream *stream);
683  void unlockAllLevels();
684 
685  int _previousHealth;
686  Graphics::Surface _healthBar[7];
687  Graphics::Surface _ammoBar[7];
688  Graphics::Surface _portrait[7];
689  Filename _deathDay[7];
690  Filename _deathNight[7];
691 
692  Filename _weaponShootSound[8];
693  Filename _weaponReloadSound[8];
694  Filename _heySound[7];
695  int _weaponMaxAmmo[8];
696 
697  byte *_crosshairsPalette;
698  Graphics::Surface _crosshairsInactive[8];
699  Graphics::Surface _crosshairsActive[8];
700  Graphics::Surface _crosshairsTarget[8];
701  Graphics::Surface _leftArrowPointer;
702  Graphics::Surface _rightArrowPointer;
703  Graphics::Surface _crossPointer;
704 
705  void updateFromScript();
706  bool checkCup(const Common::String &name);
707 
708  Script _currentScript;
709  ScriptMode _currentMode;
710  uint32 _currentActor;
711  uint32 _currentWeapon;
712  Common::Array<Filename> _warningVideosDay;
713  Common::Array<Filename> _warningVideosNight;
714  Common::Array<Filename> _warningAlarmVideos;
715  Filename _warningHostage;
716 
717  Common::Array<Filename> _deathVideo;
718  Common::HashMap<Common::String, bool> _shootsDestroyed;
719 
720  bool hasFeature(EngineFeature f) const override {
721  return (f == kSupportsReturnToLauncher);
722  }
723 };
724 
725 } // End of namespace Hypno
726 
727 #endif
bool canSaveAutosaveCurrently() override
Definition: hypno.h:573
Definition: grammar.h:732
Definition: image_decoder.h:53
Definition: grammar.h:333
Definition: str.h:59
Definition: installshieldv3_archive.h:35
Definition: font.h:83
Definition: hypno.h:610
Definition: surface.h:67
Definition: grammar.h:359
EngineFeature
Definition: engine.h:260
Definition: grammar.h:121
Definition: libfile.h:39
Definition: stream.h:77
Definition: error.h:81
Definition: grammar.h:221
Definition: grammar.h:244
Definition: grammar.h:440
Definition: pixelformat.h:138
Definition: grammar.h:152
Definition: advancedDetector.h:164
Definition: random.h:44
Definition: hypno.h:427
Definition: grammar.h:214
Definition: grammar.h:235
Definition: hypno.h:533
Definition: list.h:44
Definition: rect.h:524
Definition: path.h:52
Definition: grammar.h:707
Definition: stream.h:745
Definition: subtitles.h:77
Definition: grammar.h:228
Definition: mixer.h:49
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: hypno.h:196
Definition: hypno.h:437
Definition: grammar.h:187
Definition: grammar.h:48
Definition: hypno.h:132
Definition: grammar.h:262
Definition: hashmap.h:85
Definition: ustr.h:57
Definition: grammar.h:311
Definition: fs.h:69
Definition: bitarray.h:29
Definition: rect.h:144
Definition: grammar.h:35
Definition: grammar.h:253
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: hypno.h:198
Definition: grammar.h:132
bool hasFeature(EngineFeature f) const override
Definition: hypno.h:495
Definition: grammar.h:600
Definition: grammar.h:745
Definition: grammar.h:141
Definition: grammar.h:277
Definition: grammar.h:207
Definition: grammar.h:104
bool hasFeature(EngineFeature f) const override
Definition: hypno.h:577
Definition: system.h:163
Definition: hypno.h:110
bool canSaveAutosaveCurrently() override
Definition: hypno.h:197
Definition: movie_decoder.h:32
Definition: engine.h:146
Definition: grammar.h:395
Definition: grammar.h:170
Platform
Definition: platform.h:46
Definition: grammar.h:294
Language
Definition: language.h:45