ScummVM API documentation
fighter.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#ifndef LASTEXPRESS_FIGHTER_H
23#define LASTEXPRESS_FIGHTER_H
24
25#include "lastexpress/fight/fight.h"
26
27namespace LastExpress {
28
29class LastExpressEngine;
30class CFight;
31
32struct Seq;
33struct Sprite;
34
35class CFighter {
36
37public:
38 CFighter(LastExpressEngine *engine, CFight *fight);
39 virtual ~CFighter();
40
41 virtual void timer();
42 void doAction(int sequenceIndex, int action);
43 void newSeq();
44 bool init(CFighter *opponent);
45 virtual bool actionAvailable(int action);
46 int getAction();
47 int getDodges();
48 int getHitPoints();
49 void setHitPoints(int hitPoints);
50 bool isDead();
51 virtual void send(int action);
52
53protected:
54 LastExpressEngine *_engine = nullptr;
55
56 CFight *_fight = nullptr;
57 CFighter *_opponent = nullptr;
58 Seq *_seqs[10];
59 int _numSeqs = 0;
60 int _currentActionIdx = 0;
61 Seq *_currentSeq = nullptr;
62 Sprite *_currentSprite = nullptr;
63 int _currentSpriteIdx = 0;
64 int _unusedFlag = 0;
65 int _nextMessage = 0;
66 int _nextSequenceIdx = 0;
67 int _hitPoints = 0;
68 int _dodges = 0;
69 int _timer = 0;
70};
71
72// Generic fighters
73
74class CCath : public CFighter {
75public:
76 CCath(LastExpressEngine *engine, CFight *fight) : CFighter(engine, fight) {}
77
78 virtual void timer() override;
79};
80
81class COpponent : public CFighter {
82public:
83 COpponent(LastExpressEngine *engine, CFight *fight) : CFighter(engine, fight) {}
84
85 virtual void timer() override;
86};
87
88
89// First fight: Cath vs Milos
90
91class CCath1 : public CCath {
92public:
93 CCath1(LastExpressEngine *engine, CFight *fight);
94
95 void timer() override;
96 bool actionAvailable(int action) override;
97 void send(int action) override;
98};
99
100class COpponent1 : public COpponent {
101public:
102 COpponent1(LastExpressEngine *engine, CFight *fight);
103
104 void timer() override;
105 void send(int action) override;
106};
107
108
109// Second fight: Cath vs Vesna (when saving Anna)
110
111class CCath2 : public CCath {
112public:
113 CCath2(LastExpressEngine *engine, CFight *fight);
114
115 void send(int action) override;
116};
117
118class COpponent2 : public COpponent {
119public:
120 COpponent2(LastExpressEngine *engine, CFight *fight);
121
122 void timer() override;
123};
124
125
126// Third fight: Cath vs Ivo
127
128class CCath3 : public CCath {
129public:
130 CCath3(LastExpressEngine *engine, CFight *fight);
131
132 void timer() override;
133 bool actionAvailable(int action) override;
134 void send(int action) override;
135};
136
137class COpponent3 : public COpponent {
138public:
139 COpponent3(LastExpressEngine *engine, CFight *fight);
140
141 void timer() override;
142 void send(int action) override;
143};
144
145
146// Fourth fight: Cath vs Salko
147
148class CCath4 : public CCath {
149public:
150 CCath4(LastExpressEngine *engine, CFight *fight);
151
152 void timer() override;
153 bool actionAvailable(int action) override;
154 void send(int action) override;
155};
156
157class COpponent4 : public COpponent {
158public:
159 COpponent4(LastExpressEngine *engine, CFight *fight);
160
161 void timer() override;
162 void send(int action) override;
163};
164
165
166// Fifth fight: Cath vs Vesna (final fight)
167
168class CCath5 : public CCath {
169public:
170 CCath5(LastExpressEngine *engine, CFight *fight);
171
172 void timer() override;
173 bool actionAvailable(int action) override;
174 void send(int action) override;
175};
176
177class COpponent5 : public COpponent {
178public:
179 COpponent5(LastExpressEngine *engine, CFight *fight);
180
181 void timer() override;
182 void send(int action) override;
183};
184
185} // End of namespace LastExpress
186
187#endif // LASTEXPRESS_FIGHTER_H
Definition: fighter.h:91
Definition: fighter.h:111
Definition: fighter.h:128
Definition: fighter.h:148
Definition: fighter.h:168
Definition: fighter.h:74
Definition: fight.h:35
Definition: fighter.h:35
Definition: fighter.h:100
Definition: fighter.h:118
Definition: fighter.h:137
Definition: fighter.h:157
Definition: fighter.h:177
Definition: fighter.h:81
Definition: lastexpress.h:523
Definition: archive.h:29
Definition: lastexpress.h:212
Definition: lastexpress.h:159