ScummVM API documentation
action.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
23#ifndef SNATCHER_ACTION_H
24#define SNATCHER_ACTION_H
25
26#include "common/scummsys.h"
27
28namespace Common {
29
30} // namespace Common
31
32namespace Snatcher {
33
34class ResourcePointer;
35class SnatcherEngine;
37public:
38 ActionSequenceHandler(SnatcherEngine *vm, ResourcePointer *scd, bool palTiming);
40
41 bool run(bool useLightGun);
42 bool resetScore();
43 void setup(uint16 stage);
44 void setDifficulty(uint16 setting);
45
46 struct Result {
47 Result() : hitsTaken(0), shotsFired(0), shotsMissed(0), enemiesShot(0), civiliansShot(0), allCiviliansShot(0), weaponDrawn(0) {}
48 uint8 hitsTaken;
49 uint8 shotsFired;
50 uint8 shotsMissed;
51 uint8 enemiesShot;
52 uint8 civiliansShot;
53 uint8 allCiviliansShot;
54 uint8 weaponDrawn;
55 };
56
57 const Result &getResult() const { return _result; }
58
59 bool canSaveHere() const;
60
61private:
62 void resetVars();
63 void initStage();
64 void handleWeaponDrawAndTargetSelection();
65 void handleShot();
66 void updateEnemies();
67 void updateStage();
68 void enemyAttack();
69 void checkFinished();
70
71 uint16 _stage;
72 int16 _progressMSB;
73 int16 _progressLSB;
74 int16 _weaponState;
75 int16 _enemySpeed;
76 int16 _handleShotPhase;
77 int16 _updateEnemiesPhase;
78 int16 _enemyAttackStatus;
79 int16 _targetField;
80 int16 _hscrollB;
81 int16 _vscrollB;
82 int16 _enemyAppearanceCount;
83 int16 _stage2Temp;
84 int16 _civilianAppearanceCount;
85 int16 _abortFight;
86 int16 _nextEnemyAppearanceTimer;
87 int16 _animNo;
88 int16 _enemyAttackTimer;
89 int16 _shoot_78EE;
90 int16 _counter1;
91 int16 _counter2;
92 int16 _activeEnemies;
93 int16 _attackerId;
94 int16 *_projectileCoords;
95 bool _active;
96
97 SnatcherEngine *_vm;
98 ResourcePointer *_scd;
99 bool _useLightGun;
100 const bool _palTiming;
101
102 Result _result;
103};
104
105} // End of namespace Snatcher
106
107#endif // SNATCHER_ACTION_H
Definition: action.h:36
Definition: resource.h:52
Definition: snatcher.h:50
Definition: algorithm.h:29