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
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (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, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef ACCESS_AMAZON_GAME_H
24 #define ACCESS_AMAZON_GAME_H
25 
26 #include "access/access.h"
27 #include "access/amazon/amazon_logic.h"
28 
29 namespace Access {
30 
31 namespace Amazon {
32 
33 class AmazonEngine;
34 
35 class AmazonEngine : public AccessEngine {
36 private:
37 	byte _tileData[1455];
38 	Common::Array<CellIdent> _chapterCells;
39 
40 	/**
41 	 * Setup variables for the game
42 	 */
43 	void setupGame();
44 
45 	/**
46 	 * Initialize variables found in the config file
47 	 */
48 	void configSelect();
49 
50 	void initVariables();
51 	void initObjects();
52 	void calcIQ();
53 	void helpTitle();
54 	void drawHelpText(const Common::String &msg);
55 	void loadEstablish(int estabIndex);
56 	void doEstablish(int screenId, int estabIndex);
57 
58 protected:
59 	/**
60 	 * Play the game
61 	 */
62 	virtual void playGame();
63 
64 	/**
65 	* Synchronize savegame data
66 	*/
67 	virtual void synchronize(Common::Serializer &s);
68 public:
69 	InactivePlayer _inactive;
70 	bool _charSegSwitch;
71 	byte _help1[366];
72 	byte _help2[366];
73 	byte _help3[366];
74 	byte *_helpTbl[3];
75 
76 	// Fields that are mapped to flags
77 	int &_guardLocation;
78 	int &_guardFind;
79 	int &_helpLevel;
80 	int &_jasMayaFlag;
81 	int &_moreHelp;
82 	int &_flashbackFlag;
83 	int &_riverFlag;
84 	int &_aniOutFlag;
85 	int &_badEnd;
86 	int &_noHints;
87 	int &_aniFlag;
88 	int &_allenFlag;
89 	int &_noSound;
90 
91 	// Saved fields
92 	int _chapter;
93 	int _rawInactiveX;
94 	int _rawInactiveY;
95 	int _inactiveYOff;
96 
97 	// Other game specific fields
98 	Ant *_ant;
99 	Cast *_cast;
100 	Guard *_guard;
101 	Jungle *_jungle;
102 	Opening *_opening;
103 	Plane *_plane;
104 	River *_river;
105 	int _hintLevel;
106 	int _updateChapter;
107 	int _oldTitleChapter;
108 	int _iqValue;
109 public:
110 	AmazonEngine(OSystem *syst, const AccessGameDescription *gameDesc);
111 
112 	virtual ~AmazonEngine();
113 
114 	virtual void dead(int deathId);
115 
116 	/**
117 	* Free the inactive player data
118 	*/
119 	void freeInactivePlayer();
120 
121 	void drawHelp(const Common::String str);
122 
123 	virtual void establish(int esatabIndex, int sub);
124 
125 	void tileScreen();
126 	void updateSummary(int chap);
127 	void establishCenter(int screenId, int esatabIndex);
128 
129 	/**
130 	 * Show the start of a chapter
131 	 */
132 	void startChapter(int chapter);
133 };
134 
135 } // End of namespace Amazon
136 
137 } // End of namespace Access
138 
139 #endif /* ACCESS_ACCESS_H */
140