22 #ifndef ALG_GAME_BOUNTYHUNTER_H 23 #define ALG_GAME_BOUNTYHUNTER_H 25 #include "common/hashmap.h" 26 #include "common/rect.h" 28 #include "gui/debugger.h" 31 #include "alg/scene.h" 58 void debug_warpTo(
int val);
62 void registerScriptFunctions();
63 void verifyScriptFunctions();
64 void unregisterScriptFunctions();
65 BHScriptFunctionRect getScriptFunctionRectHit(
Common::String name);
66 BHScriptFunctionScene getScriptFunctionScene(SceneFuncType type,
Common::String name);
70 BHScriptFunctionRectMap _rectHitFuncs;
71 BHScriptFunctionSceneMap _scenePreOps;
72 BHScriptFunctionSceneMap _sceneShowMsg;
73 BHScriptFunctionSceneMap _sceneInsOps;
74 BHScriptFunctionSceneMap _sceneWepDwn;
75 BHScriptFunctionSceneMap _sceneScnScr;
76 BHScriptFunctionSceneMap _sceneNxtFrm;
77 BHScriptFunctionSceneMap _sceneNxtScn;
105 uint16 _randomHarry1[7] = {0x01B9, 0x01B7, 0x01B5, 0x01B3, 0x01AF, 0x01AD, 0};
106 uint16 _randomHarry2[6] = {0x0194, 0x0190, 0x018E, 0x018C, 0};
107 uint16 _randomDan1[5] = {0x0173, 0x0171, 0x016F, 0x016D, 0};
108 uint16 _randomDan1TwoPlayer[6] = {0x0173, 0x0171, 0x016F, 0x016D, 0x016B, 0};
109 uint16 _randomDan2[7] = {0x0165, 0x0163, 0x0161, 0x015F, 0x015D, 0x015B, 0};
110 uint16 _randomLoco1[4] = {0xF7, 0xF5, 0xF3, 0};
111 uint16 _randomLoco2[3] = {0xED, 0xEB, 0};
112 uint16 _randomKid1[4] = {0xBA, 0xB7, 0xB5, 0};
113 uint16 _randomKid2[4] = {0xB1, 0xAE, 0xAC, 0};
115 uint16 *_randomScenes[8] = {_randomHarry1, _randomHarry2, _randomDan1, _randomDan2, _randomLoco1, _randomLoco2, _randomKid1, _randomKid2};
116 const uint8 _randomScenesPicks[8] = {6, 6, 4, 7, 3, 2, 5, 5};
118 const uint8 _subLevelOrder[96] = {0, 1, 2, 4, 0, 0, 0, 1, 3, 4, 0, 0, 0, 2, 3, 4, 0, 0, 0, 1, 2, 3, 4, 0,
119 0, 1, 2, 4, 0, 0, 0, 1, 3, 4, 0, 0, 0, 2, 3, 4, 0, 0, 0, 1, 2, 3, 4, 0,
120 0, 1, 3, 4, 0, 0, 0, 2, 3, 4, 0, 0, 1, 2, 3, 4, 0, 0, 0, 1, 2, 3, 4, 0,
121 0, 1, 2, 3, 4, 0, 0, 1, 2, 3, 4, 0, 0, 1, 2, 3, 4, 0, 0, 1, 2, 3, 4, 0};
122 const uint16 _subLevelSceneIds[20] = {0x01BE, 0x017A, 0x01A2, 0x0198, 0x0183, 0x0178, 0x0167, 0x0159, 0x014B, 0x0147,
123 0xF1, 0xE1, 0xFF, 0xD8, 0xD0, 0x9B, 0xA8, 0x86, 0xBF, 0x74};
125 const uint16 _clueLevels[4] = {0x017A, 0x013B, 0xC2, 0x68};
126 const uint8 _mainLevelMasks[5] = {2, 4, 8, 0x10, 0x80};
127 const uint8 _gunfightCountDown[15] = {5, 4, 3, 3, 3, 4, 3, 3, 2, 1, 3, 2, 2, 2, 1};
130 const uint16 _moneyScenes[4] = {0x017D, 0x013C, 0xC3, 0x69};
131 const uint16 _gunfightScenarios[19] = {0x0116, 0x0118, 0x011B, 0x011D, 0x011F, 0x0121, 0x0123, 0x0125, 0x0127,
132 0x0129, 0x012B, 0x012D, 0x012F, 0x0131, 0x0133, 0x0135, 0x0137, 0x0139, 0};
133 const uint16 _innocentScenarios[5] = {0x0110, 0x010F, 0x010C, 0x010B, 0};
134 const uint16 _deathScenarios[9] = {0x0100, 0x0101, 0x0102, 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0};
135 const uint16 _onePlayerOfTwoDead[2] = {0x0109, 0x010A};
136 const uint16 _allPlayersDead = 0x108;
137 const uint16 _selectOpponentScreen = 0x017B;
139 uint8 _continuesUsed = 0;
140 uint8 _currentLevel = 0;
141 uint16 _currentSubLevelSceneId = 0;
142 uint8 _difficulty = 0;
143 uint32 _firstDrawFrame = 0;
144 int8 _gunfightCount = 0;
145 uint8 _kill3Count = 0;
146 uint32 _lastShotTime = 0;
147 uint8 _levelDoneMask = 0;
148 uint16 _mainWounds = 0;
149 uint8 _numLevelsDone = 0;
150 uint8 _numSubLevelsDone = 0;
151 uint8 _numPlayers = 1;
153 int8 _playerLives[2] = {3, 3};
154 int8 _oldLives[2] = {0, 0};
155 uint8 _playerGun[2] = {1, 1};
156 uint8 _playerShots[2] = {6, 6};
157 uint8 _oldShots[2] = {0, 0};
158 uint32 _playerScore[2] = {0, 0};
159 uint32 _oldScore[2] = {1, 1};
160 uint32 _pointsSinceLastBonus[2] = {0, 0};
161 uint16 _restartScene = 0;
163 uint8 _oldWhichGun = 0xFF;
164 bool _wounded =
false;
166 uint16 *_randomSceneList =
nullptr;
167 uint8 _randomMax = 0;
168 uint16 _randomMask = 0;
169 int16 _randomPicked = 0;
170 uint8 _randomSceneCount = 0;
171 bool _gunfightInitialized =
false;
172 uint16 _gunfightMask = 0;
173 int16 _gunfightPicked = 0;
174 uint8 _gunfightSceneCount = 0;
175 bool _innocentInitialized =
false;
176 uint16 _innocentMask = 0;
177 int16 _innocentPicked = 0;
178 uint8 _innocentSceneCount = 0;
179 bool _deathInitialized =
false;
180 uint16 _deathMask = 0;
181 int16 _deathPicked = 0;
182 uint8 _deathSceneCount = 0;
184 uint8 _iconOrder[4] = {0, 0, 0, 0};
185 uint32 _iconOffset = 0;
186 uint32 _iconCounter = 0;
187 bool _bagAnimToggle =
false;
189 bool _bagActive =
false;
190 uint8 _playerWhoHitBag = 0;
192 bool _bulletsGiven =
false;
193 bool _moneyGiven =
false;
194 bool _shotgunGiven =
false;
195 bool _bagDropped =
false;
198 void updateScreen()
override;
199 uint16 startMyGame();
200 void initGameStatus();
205 void displayLivesLeft(uint8 player);
206 void displayScores(uint8 player);
207 void displayShotsLeft(uint8 player);
215 void setNextScene(uint16 sceneId);
217 void enableVideoFadeIn();
224 void iconHitGeneric(uint8 type);
225 void displayCurrentBag();
226 void moveCurrentBag();
227 uint16 beginLevel(uint8 levelNumber);
228 uint16 randomUnusedInt(uint8 max, uint16 *mask, uint16 exclude);
229 uint16 pickRandomScene(uint16 *sceneList, uint8 max);
230 uint16 pickGunfightScene();
231 uint16 pickInnocentScene();
232 uint16 pickDeathScene();
233 uint16 timeForGunfight();
234 void waitingForShootout(uint32 drawFrame);
237 void rectNewScene(
Rect *rect);
238 void rectShotMenu(
Rect *rect);
239 void rectSave(
Rect *rect);
240 void rectLoad(
Rect *rect);
241 void rectContinue(
Rect *rect);
242 void rectStart(
Rect *rect);
243 void rectExit(
Rect *rect);
244 void rectTogglePlayers(
Rect *rect);
245 void rectHitIconJug(
Rect *rect);
246 void rectHitIconLantern(
Rect *rect);
247 void rectHitIconSkull(
Rect *rect);
248 void rectHitIconWheel(
Rect *rect);
249 void rectHitSelectHarry(
Rect *rect);
250 void rectHitSelectDan(
Rect *rect);
251 void rectHitSelectLoco(
Rect *rect);
252 void rectHitSelectKid(
Rect *rect);
253 void rectHitKillMan(
Rect *rect);
254 void rectHitGiveShotgun(
Rect *rect);
255 void rectHitKill3(
Rect *rect);
256 void rectHitCheckShotgun(
Rect *rect);
257 void rectHitCheater(
Rect *rect);
260 void scenePsoShootout(
Scene *scene);
261 void scenePsoWoundedMain(
Scene *scene);
262 void scenePsoGunfightSetup(
Scene *scene);
263 void scenePsoLoseALife(
Scene *scene);
264 void scenePsoSetupNdRandom1(
Scene *scene);
265 void scenePsoSetCurrentScene(
Scene *scene);
268 void sceneIsoShootout(
Scene *scene);
269 void sceneIsoGivemoney(
Scene *scene);
272 void sceneNxtscnLoseALife(
Scene *scene);
273 void sceneNxtscnContinueGame(
Scene *scene);
274 void sceneNxtscnDidNotContinue(
Scene *scene);
275 void sceneNxtscnKillInnocentMan(
Scene *scene);
276 void sceneNxtscnKillInnocentWoman(
Scene *scene);
277 void sceneNxtscnAfterDie(
Scene *scene);
278 void sceneNxtscnGotoLevelSelect(
Scene *scene);
279 void sceneNxtscnContinueRandom(
Scene *scene);
280 void sceneNxtscnInitRandomHarry1(
Scene *scene);
281 void sceneNxtscnInitRandomHarry2(
Scene *scene);
282 void sceneNxtscnInitRandomDan1(
Scene *scene);
283 void sceneNxtscnInitRandomDan2(
Scene *scene);
284 void sceneNxtscnInitRandomLoco1(
Scene *scene);
285 void sceneNxtscnInitRandomLoco2(
Scene *scene);
286 void sceneNxtscnInitRandomKid1(
Scene *scene);
287 void sceneNxtscnInitRandomKid2(
Scene *scene);
288 void sceneNxtscnNextSubLevel(
Scene *scene);
289 void sceneNxtscnGotoBadGuy(
Scene *scene);
290 void sceneNxtscnAutoSelectLevel(
Scene *scene);
291 void sceneNxtscnSelectScenario(
Scene *scene);
292 void sceneNxtscnFinishScenario(
Scene *scene);
293 void sceneNxtscnGameWon(
Scene *scene);
294 void sceneNxtscnKilledMain(
Scene *scene);
295 void sceneNxtscnWoundedMain(
Scene *scene);
296 void sceneNxtscnEndLevel(
Scene *scene);
297 void sceneNxtscnEndGame(
Scene *scene);
298 void sceneNxtscnDoBreakoutMains(
Scene *scene);
299 void sceneNxtscnDiedRefed(
Scene *scene);
300 void sceneNxtscnGiveShotgun(
Scene *scene);
301 void sceneNxtscnCheck2Players(
Scene *scene);
304 void sceneDefaultWepdwn(
Scene *scene);
307 void sceneDefaultScore(
Scene *scene);
310 void debug_drawZoneRects()
override;
316 bool cmdWarpTo(
int argc,
const char **argv);
317 bool cmdDumpLib(
int argc,
const char **argv);
Definition: savefile.h:54
Definition: debugger.h:41
Definition: game_bountyhunter.h:313
Definition: audiostream.h:212
Definition: game_bountyhunter.h:42
Definition: detection.h:39