ScummVM API documentation
combat.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 MM1_VIEWS_COMBAT_H
23 #define MM1_VIEWS_COMBAT_H
24 
25 #include "mm/mm1/game/combat.h"
26 #include "mm/mm1/views/text_view.h"
27 
28 namespace MM {
29 namespace MM1 {
30 namespace Views {
31 
32 class Combat : public TextView, public Game::Combat {
33 private:
34  LineArray _monsterSpellLines;
35  uint _attackableCount = 0;
36  InfoMessage _spellResult;
37  // Combat options that have sub-option selection
38  enum SelectedOption {
39  OPTION_NONE, OPTION_DELAY, OPTION_EXCHANGE,
40  OPTION_FIGHT, OPTION_SHOOT
41  };
42  SelectedOption _option = OPTION_NONE;
43 
47  void setOption(SelectedOption option);
48 
49  void writeOptions();
50  void writeAllOptions();
51  void writeAttackOptions();
52  void writeCastOption();
53  void writeShootOption();
54  void resetBottom();
55 
59  void writeHandicap();
60 
64  void writeStaticContent();
65 
69  void writeRound();
70 
75  void writePartyNumbers();
76 
80  void writeMonsters();
81 
85  void writeMonsterStatus(int monsterNum);
86 
90  void writeDots();
91 
95  void writeParty();
96 
100  void clearPartyArea();
101 
105  void writeDefeat();
106 
110  void highlightNextRound();
111 
115  void writeMonsterEffects();
116 
120  void writeMonsterAction(bool flees);
121 
125  void writeMonsterSpell();
126 
130  void writeMonsterAttack();
131 
135  void writeInfiltration();
136 
140  void writeWaitsForOpening();
141 
145  void writeSpellResult();
146 
150  void checkMonsterSpellDone();
151 
155  void delay();
156 
160  void exchange();
161 
165  void fight();
166 
170  void shoot();
171 
175  void writeCharAttackDamage();
176 
180  void writeCharAttackNoEffect();
181 
185  Common::String getAttackString();
186 
190  void writeMessage();
191 
195  void writeDelaySelect();
196 
200  void writeExchangeSelect();
201 
205  void writeFightSelect();
206 
210  void writeShootSelect();
211 
212 protected:
216  void setMode(Mode newMode) override;
217 
221  void combatDone() override;
222 
223 public:
224  Combat();
225  virtual ~Combat() {}
226 
227  void displaySpellResult(const InfoMessage &msg) override;
228 
233  void disableAttacks();
234 
238  bool msgFocus(const FocusMessage &msg) override;
239 
243  bool msgUnfocus(const UnfocusMessage &msg) override;
244 
248  bool msgGame(const GameMessage &msg) override;
249 
254  void draw() override;
255 
259  void timeout() override;
260 
264  bool msgKeypress(const KeypressMessage &msg) override;
265 
269  bool msgAction(const ActionMessage &msg) override;
270 };
271 
272 } // namespace Views
273 } // namespace MM1
274 } // namespace MM
275 
276 #endif
bool msgFocus(const FocusMessage &msg) override
void combatDone() override
virtual ~Combat()
Definition: combat.h:225
void setMode(Mode newMode) override
Definition: str.h:59
bool msgGame(const GameMessage &msg) override
void timeout() override
Definition: messages.h:56
Definition: text_view.h:35
Definition: messages.h:49
bool msgUnfocus(const UnfocusMessage &msg) override
bool msgKeypress(const KeypressMessage &msg) override
Definition: detection.h:27
Definition: messages.h:48
Definition: messages.h:129
Definition: messages.h:87
Definition: combat.h:36
void draw() override
void displaySpellResult(const InfoMessage &msg) override
Definition: combat.h:32
Definition: messages.h:41
bool msgAction(const ActionMessage &msg) override