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" 37 #include "hypno/grammar.h" 38 #include "hypno/libfile.h" 41 class SeekableAudioStream;
73 kHypnoColorGreen = 251,
74 kHypnoColorWhiteOrBlue = 252,
75 kHypnoColorYellow = 253,
76 kHypnoColorBlack = 254,
82 kSpiderColorWhite = 248,
83 kSpiderColorBlue = 252,
100 kActionDifficultyChump,
101 kActionDifficultyPunk,
102 kActionDifficultyBadass,
103 kActionDifficultExit,
110 kActionSecondaryShoot,
155 bool _infiniteHealthCheat;
156 bool _infiniteAmmoCheat;
157 bool _unlockAllLevels;
158 bool _restoredContentEnabled;
167 virtual void resetSceneState();
168 bool checkSceneCompleted();
169 bool checkLevelWon();
171 void runScene(
Scene *scene);
176 virtual void runCode(
Code *code);
183 virtual void loadAssets();
204 virtual void loadGame(
const Common::String &nextLevel,
int score,
int puzzleDifficulty,
int combatDifficulty);
212 void adjustSubtitleSize();
217 void playVideo(
MVideo &video);
218 void skipVideo(
MVideo &video);
222 void loadImage(
const Common::String &file,
int x,
int y,
bool transparent,
bool palette =
false,
int frameNumber = 0);
225 void loadPalette(
const byte *palette, uint32 offset, uint32 size);
226 byte *getPalette(uint32 idx);
230 uint32 _defaultCursorIdx;
232 void disableCursor();
233 void defaultCursor();
234 virtual void changeCursor(
const Common::String &cursor, uint32 n,
bool centerCursor =
false);
236 virtual void changeCursor(
const Graphics::Surface &entry, byte *palette,
bool centerCursor =
false);
239 virtual void runMenu(
Hotspots *hs,
bool only_menu =
false);
242 void runMice(
Mice *a);
244 void runSave(
Save *a);
245 void runLoad(
Load *a);
247 void runTimer(
Timer *a);
248 void runQuit(
Quit *a);
250 void runIntro(
Intro *a);
251 void runPlay(
Play *a);
252 void runSound(
Sound *a);
255 void runWalN(
WalN *a);
256 bool runGlobal(
Global *a);
257 void runTalk(
Talk *a);
260 virtual void drawBackToMenu(
Hotspot *h);
263 int _screenW, _screenH;
267 uint32 _transparentColor;
269 void updateScreen(
MVideo &video);
270 void updateVideo(
MVideo &video);
274 void runIntro(
MVideo &video);
275 void runIntros(
Videos &videos);
276 void runIntrosWithSubtitles(
Videos &videos);
292 Videos _nextSequentialVideoToPlay;
293 Videos _nextParallelVideoToPlay;
294 Videos _escapeSequentialVideoToPlay;
304 void playSound(
const Filename &filename, uint32 loops, uint32 sampleRate = 22050,
bool stereo =
false);
305 void playMusic(
const Filename &filename, uint32 sampleRate = 22050,
bool stereo =
false);
308 bool isMusicActive();
314 virtual bool availableObjectives();
315 virtual bool checkArcadeObjectives();
321 virtual void pressedKey(
const int keycode);
322 virtual bool clickedPrimaryShoot(
const Common::Point &mousePos);
323 virtual bool clickedSecondaryShoot(
const Common::Point &mousePos);
325 void setGamepadAimActive(
bool active);
326 bool isGamepadAimActive()
const;
327 bool handleGamepadAimAction(
const int action,
bool pressed);
328 bool handleGamepadAxisAction(
const int action, int16 position);
332 virtual void hitPlayer();
336 virtual bool checkRButtonUp();
337 virtual void setRButtonUp(
const bool val);
338 virtual void disableGameKeymaps();
339 virtual void enableGameKeymaps();
344 uint32 _segmentOffset;
345 uint32 _segmentRepetition;
346 uint32 _segmentRepetitionMax;
347 uint32 _segmentShootSequenceOffset;
348 uint32 _segmentShootSequenceMax;
354 void resetStatistics();
356 void incShotsFired();
358 void incEnemyTargets();
359 void incTargetsDestroyed();
360 void incTargetsMissed();
361 void incFriendliesEncountered();
362 void incInfoReceived();
364 void incScore(
int inc);
365 void incBonus(
int inc);
368 uint32 accuracyRatio();
373 bool _skipDefeatVideo;
378 bool _gamepadAimActive;
379 bool _gamepadAimLeft;
380 bool _gamepadAimDown;
381 bool _gamepadAimRight;
384 virtual void drawCursorArcade(
const Common::Point &mousePos);
385 virtual void drawPlayer();
386 virtual void drawHealth();
387 virtual void drawAmmo();
412 int _playerFrameStart;
418 uint32 _objKillsCount[2];
419 uint32 _objMissesCount[2];
420 uint32 _objKillsRequired[2];
421 uint32 _objMissesAllowed[2];
431 bool _refreshConversation;
432 virtual void showConversation();
433 virtual void endConversation();
434 virtual void rightClickedConversation(
const Common::Point &mousePos);
435 virtual void leftClickedConversation(
const Common::Point &mousePos);
436 virtual bool hoverConversation(
const Common::Point &mousePos);
438 virtual void showCredits();
443 bool _keepTimerDuringScenes;
445 bool startCountdown(uint32);
456 int objectivesPos[2];
471 void loadAssets()
override;
472 void loadAssetsDemoDisc();
473 void loadAssetsEarlyDemo();
474 void loadAssetsGen4();
475 void loadAssetsPCW();
476 void loadAssetsPCG();
477 void loadAssetsFullGame();
484 void showCredits()
override;
485 bool clickedSecondaryShoot(
const Common::Point &mousePos)
override;
487 void drawPlayer()
override;
488 void drawHealth()
override;
489 void drawAmmo()
override;
490 void hitPlayer()
override;
491 void drawCursorArcade(
const Common::Point &mousePos)
override;
496 void runCode(
Code *code)
override;
509 void pressedKey(
const int keycode)
override;
515 bool checkRButtonUp()
override;
516 void setRButtonUp(
const bool val)
override;
517 void disableGameKeymaps()
override;
518 void enableGameKeymaps()
override;
522 return (f == kSupportsReturnToLauncher);
528 void drawGlyph(
const Common::BitArray &font,
int x,
int y,
int bitoffset,
int width,
int height,
int pitch, uint32 color,
bool invert);
529 void drawKoreanChar(uint16 chr,
int &curx,
int y, uint32 color);
531 void runMainMenu(
Code *code);
532 void runLevelMenu(
Code *code);
533 void runCheckLives(
Code *code);
534 void endCredits(
Code *code);
535 void showDemoScore();
536 uint32 findPaletteIndexZones(uint32
id);
539 void restoreScoreMilestones(
int score);
540 bool checkScoreMilestones(
int score);
547 void generateStaticEffect();
564 void loadAssets()
override;
565 void loadAssetsDemo();
566 void loadAssetsFullGame();
567 void showCredits()
override;
569 void drawCursorArcade(
const Common::Point &mousePos)
override;
571 void drawPlayer()
override;
572 void drawHealth()
override;
574 void hitPlayer()
override;
577 void pressedKey(
const int keycode)
override;
584 void drawBackToMenu(
Hotspot *h)
override;
585 void runCode(
Code *code)
override;
592 void showConversation()
override;
593 void endConversation()
override;
594 void rightClickedConversation(
const Common::Point &mousePos)
override;
595 void leftClickedConversation(
const Common::Point &mousePos)
override;
596 bool hoverConversation(
const Common::Point &mousePos)
override;
598 void loadGame(
const Common::String &nextLevel,
int score,
int puzzleDifficulty,
int combatDifficulty)
override;
606 return (f == kSupportsSavingDuringRuntime || f == kSupportsLoadingDuringRuntime || f == kSupportsReturnToLauncher);
610 void runMatrix(
Code *code);
611 void addIngredient(
Code *code);
612 void checkMixture(
Code *code);
613 void runNote(
Code *code);
614 void runFusePanel(
Code *code);
615 void runRecept(
Code *code);
616 void runOffice(
Code *code);
617 void runFileCabinet(
Code *code);
618 void runLock(
Code *code);
619 void runFuseBox(
Code *code);
623 uint32 _currentPlayerPosition;
624 uint32 _lastPlayerPosition;
626 bool _fuseState[2][10] = {};
627 bool _isFuseRust =
true;
628 bool _isFuseUnreadable =
false;
629 bool ingredients[7] = {};
641 static const char *
const kMenuChoiceSound =
"sound/m_choice.raw";
642 static const char *
const kMenuHiliteSound =
"sound/m_hilite.raw";
643 static const char *
const kMenuMusic =
"sound/46-g.raw";
644 static const char *
const kTransitionMusic =
"sound/45.raw";
645 static const char *
const kCreditsMusic =
"sound/42.raw";
655 void loadAssets()
override;
656 void runCode(
Code *code)
override;
661 void resetSceneState()
override;
662 void runMenu(
Hotspots *hs,
bool only_menu =
false)
override;
668 void pressedKey(
const int keycode)
override;
670 void drawCursorArcade(
const Common::Point &mousePos)
override;
672 bool clickedSecondaryShoot(
const Common::Point &mousePos)
override;
673 void showCredits()
override;
675 void showArcadeStats(
int territory,
const ArcadeStats &data);
680 void drawHealth()
override;
681 void drawAmmo()
override;
683 void hitPlayer()
override;
684 void drawPlayer()
override;
700 void renderHighlights(
Hotspots *hs);
701 void waitForUserClick(uint32 timeout);
703 int _selectedCorrectBox;
704 char selectDirection();
706 void runMainMenu(
Code *code);
708 void runRetryMenu(
Code *code);
709 void runCheckC3(
Code *code);
710 void runCheckHo(
Code *code);
711 void runCheckC5(
Code *code);
712 void runAlarmC5(
Code *code);
713 void runDifficultyMenu(
Code *code);
714 void endCredits(
Code *code);
721 void unlockAllLevels();
733 int _weaponMaxAmmo[8];
735 byte *_crosshairsPalette;
743 void updateFromScript();
747 ScriptMode _currentMode;
748 uint32 _currentActor;
749 uint32 _currentWeapon;
759 return (f == kSupportsReturnToLauncher);
bool canSaveAutosaveCurrently() override
Definition: hypno.h:601
Definition: grammar.h:732
Definition: image_decoder.h:53
Definition: grammar.h:333
Definition: installshieldv3_archive.h:35
Definition: grammar.h:359
EngineFeature
Definition: engine.h:282
Definition: grammar.h:121
Definition: grammar.h:221
Definition: grammar.h:244
Definition: grammar.h:440
Definition: grammar.h:152
Definition: advancedDetector.h:164
Definition: grammar.h:214
Definition: grammar.h:235
Definition: grammar.h:707
Definition: audiostream.h:212
Definition: subtitles.h:78
Definition: grammar.h:228
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: hypno.h:205
Definition: grammar.h:187
Definition: grammar.h:262
Definition: grammar.h:311
Definition: bitarray.h:29
Definition: grammar.h:253
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: hypno.h:207
Definition: grammar.h:132
bool hasFeature(EngineFeature f) const override
Definition: hypno.h:521
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:605
bool canSaveAutosaveCurrently() override
Definition: hypno.h:206
Definition: movie_decoder.h:32
Definition: grammar.h:395
Definition: grammar.h:170
Definition: grammar.h:294
Language
Definition: language.h:45