ScummVM API documentation
interview.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#ifndef SCUMM_INSANE_MORTIMER_INTERVIEW_H
22#define SCUMM_INSANE_MORTIMER_INTERVIEW_H
23
24#include "common/random.h"
25#include "scumm/insane/mortimer/text.h"
26
27namespace Graphics {
28struct Surface;
29}
30
31namespace Scumm {
32
33// The native interview controller in SHELL 40a884, including its riddle
34// callbacks. Movie requests are consumed by the engine after stopping audio.
36public:
37 enum Effect { kNoEffect, kButtonEffect, kPayoutEffect, kSwitchEffect };
38
39 explicit MortimerInterview(bool isDemo = true);
40 bool loadResources(uint region = 0, bool programmer = false);
41 void setDifficulty(uint difficulty) { _difficulty = difficulty; }
42 void resetRiddle();
43 void resetAttempts();
44 void start(uint species, uint stones, int scene = 10);
45 void rescueAll() { _species = 0x7f; _selected = 0; }
46 void click(const Common::Point &point);
47 void scroll(int direction);
48 void update();
49 void movieFinished();
50 void movieLoaded() { _moviePending = false; }
51 void skip();
52 void draw(Graphics::Surface &screen, const MortimerMovie &movie, byte mouth) const;
53 void drawCursor(Graphics::Surface &screen, const Common::Point &point) const;
54
55 bool needsMovie() const { return _moviePending; }
56 bool playingMovie() const { return !_movieName.empty(); }
57 bool fullScreen() const;
58 bool showDashboard() const { return !fullScreen() || _stage == kPopup; }
59 bool forceSubtitles() const { return _stage == kSong; }
60 bool movieDoubled() const;
61 bool wantsFlight() const { return _stage == kFlyAway; }
62 bool finished() const { return _stage == kFinished; }
63 bool solved() const { return _stage == kCorrect || _stage == kBonus || _stage == kOpenGate || _stage == kFinished; }
64 bool payingBonus() const { return _stage == kBonus; }
65 bool bonusFinished() const { return _stage == kOpenGate || _stage == kFinished; }
66 uint takeBonusStones();
67 bool restartsRegion() const { return _restartRegion; }
68 int sceneId() const;
69 int riddleId() const { return _answer * 10 + _textDifficulty; }
70 bool outOfGuesses() const { return _guesses == 0; }
71 const Common::String &movieName() const { return _movieName; }
72 const Common::String &errorMessage() const { return _error; }
73 const byte *palette(const MortimerMovie &movie) const;
74 uint stones() const { return _stones; }
75 uint species() const { return _species; }
76 int highlightedAnimal() const;
77 Effect takeEffect();
78
79private:
80 enum Stage {
81 kGate, kSong, kPopup, kIdle, kAnswer, kRiddle, kSolve,
82 kNoStones, kPay, kGuess, kCorrect, kBonus, kWrong, kOpenGate,
83 kEnding, kHelp, kFlyAway, kFinished, kCost, kNoAnimals, kTried
84 };
85
86 void enter(Stage stage);
87 void selectAnimal(int animal);
88 int hitControl(const Common::Point &point) const;
89 bool loadText(const char *path, bool riddles);
90 void drawText(Graphics::Surface &screen, const Common::String &text) const;
91 Common::String animalMovie(const char *pattern, int animal) const;
92
94 const bool _isDemo;
95 uint _region, _difficulty, _textDifficulty, _tried;
96 Common::Array<MortimerSprite> _panel, _portraits, _gate, _cursor, _mouth;
97 MortimerFont _font, _captionFont;
98 Common::String _dialogue[7][3], _riddles[7][3], _captions[16];
99 Common::String _movieName, _error;
100 byte _palette[768], _gatePalette[768];
101 Stage _stage;
102 Effect _effect;
103 int _answer, _previousAnswer, _selected, _question, _guess, _lastAction, _textScroll, _guesses;
104 uint _species, _stones, _frame, _switchFrame, _payment, _bonusStones;
105 bool _moviePending, _riddleView, _solving, _help, _helpExplained, _restartRegion, _programmer;
106};
107
108} // End of namespace Scumm
109
110#endif
Definition: array.h:52
Definition: random.h:44
Definition: str.h:59
Definition: text.h:30
Definition: interview.h:35
Definition: movie.h:72
Definition: formatinfo.h:28
Definition: actor.h:30
Definition: rect.h:144
Definition: surface.h:67