ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
darkmoon.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 #ifdef ENABLE_EOB
23 
24 #ifndef KYRA_EOB2_H
25 #define KYRA_EOB2_H
26 
27 #include "kyra/engine/eobcommon.h"
28 
29 namespace Kyra {
30 
31 class DarkmoonSequenceHelper;
32 
33 struct DarkMoonAnimCommand {
34  uint8 command;
35  uint8 obj;
36  int16 x1;
37  uint8 y1;
38  uint8 delay;
39  uint8 pal;
40  uint8 x2;
41  uint8 y2;
42  uint8 w;
43  uint8 h;
44 };
45 
46 class DarkMoonEngine : public EoBCoreEngine {
47 friend class GUI_EoB;
48 friend class DarkmoonSequenceHelper;
49 public:
50  DarkMoonEngine(OSystem *system, const GameFlags &flags);
51  ~DarkMoonEngine() override;
52 
53 private:
54  // Init
55  Common::Error init() override;
56  void initStaticResource();
57  void initSpells() override;
58  void loadItemsAndDecorationsShapes() override;
59 
60  // Main Menu
61  int mainMenu() override;
62  int mainMenuLoop();
63  void townsUtilitiesMenu();
64 
65  int _menuChoiceInit;
66 
67  // Main loop
68  void startupNew() override;
69  void startupLoad() override;
70 
71  // Intro/Outro
72  void seq_playIntro();
73  void seq_playFinale() override;
74  void seq_playCredits(DarkmoonSequenceHelper *sq, const uint8 *data, int sd, int backupPage, int tempPage, int speed);
75 
76  // Ingame sequence
77  void seq_nightmare();
78  void seq_kheldran();
79  void seq_dranDragonTransformation();
80 
81  const int8 *_dreamSteps;
82  const char *const *_kheldranStrings;
83 
84  // characters
85  void drawNpcScene(int npcIndex) override;
86  void runNpcDialogue(int npcIndex) override;
87 
88  const uint8 *_npcShpData;
89  const char *const *_npcStrings[2];
90 
91  // items
92  void updateUsedCharacterHandItem(int charIndex, int slot) override;
93 
94  // Monsters
95  void loadMonsterShapes(const char *filename, int monsterIndex, bool hasDecorations, int encodeTableIndex) override;
96  uint8 *loadFMTownsShape(Common::SeekableReadStream *stream);
97  void generateMonsterPalettes(const char *file, int16 monsterIndex) override;
98  void loadMonsterDecoration(Common::SeekableReadStream *stream, int16 monsterIndex) override;
99  const uint8 *loadMonsterProperties(const uint8 *data) override;
100  void replaceMonster(int unit, uint16 block, int d, int dir, int type, int shpIndex, int mode, int h2, int randItem, int fixedItem) override;
101  bool killMonsterExtra(EoBMonsterInPlay *m) override;
102 
103  // Level
104  void loadVcnData(const char *file, const uint8 *cgaMapping) override;
105  void loadDoorShapes(int doorType1, int shapeId1, int doorType2, int shapeId2) override {}
106  const uint8 *loadDoorShapes(const char *filename, int doorIndex, const uint8 *shapeDefs) override;
107  void drawDoorIntern(int type, int, int x, int y, int w, int wall, int mDim, int16, int16) override;
108 
109  const uint8 *_dscDoorType5Offs;
110 
111  // Magic
112  void turnUndeadAutoHit() override;
113 
114  // Fight
115  static const uint8 _monsterAcHitChanceTbl1[];
116  static const uint8 _monsterAcHitChanceTbl2[];
117 
118  // Rest party
119  void restParty_npc() override;
120  bool restParty_extraAbortCondition() override;
121 
122  // Sound
123  void snd_playLevelScore() override;
124  void snd_loadAmigaSounds(int level, int sub) override;
125  void snd_updateLevelScore() override;
126 
127  const char *const *_amigaSoundFiles2;
128  const char *const *_amigaSoundMapExtra;
129  const int8 *_amigaSoundIndex1;
130  const uint8 *_amigaSoundIndex2;
131  const uint8 *_amigaSoundPatch;
132  int _amigaSoundPatchSize;
133 
134  int _amigaCurSoundIndex;
135 
136  // misc
137  void useHorn(int charIndex, int weaponSlot) override;
138  bool checkPartyStatusExtra() override;
139  void drawLightningColumn() override;
140  int resurrectionSelectDialogue() override;
141  int charSelectDialogue() override;
142  void characterLevelGain(int charIndex) override;
143 
144  const KyraRpgGUISettings *guiSettings() const override;
145 
146  const char *const *_hornStrings;
147  const uint8 *_hornSounds;
148 
149  const char *const *_utilMenuStrings;
150 
151  static const KyraRpgGUISettings _guiSettingsDOS;
152  static const KyraRpgGUISettings _guiSettingsDOS_ZH;
153  static const KyraRpgGUISettings _guiSettingsFMTowns;
154  static const KyraRpgGUISettings _guiSettingsPC98;
155  static const KyraRpgGUISettings _guiSettingsAmiga;
156  static const uint8 _egaDefaultPalette[];
157 
158  static const uint16 _dlgButtonPosX_ZH[17];
159  static const uint8 _dlgButtonPosY_ZH[17];
160 };
161 
162 } // End of namespace Kyra
163 
164 #endif
165 
166 #endif // ENABLE_EOB
Definition: error.h:84
Definition: stream.h:745
Definition: detection.h:27
Definition: system.h:161