ScummVM API documentation
encounter.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_ENH_ENCOUNTER_H
23 #define MM1_VIEWS_ENH_ENCOUNTER_H
24 
25 #include "mm/mm1/views_enh/yes_no.h"
26 #include "mm/shared/xeen/sprites.h"
27 #include "mm/mm1/events.h"
28 
29 namespace MM {
30 namespace MM1 {
31 namespace ViewsEnh {
32 
33 class Encounter : public YesNo {
34 private:
35  enum Mode {
36  ALERT, SURPRISED_BY_MONSTERS, SURPRISED_MONSTERS,
37  ENCOUNTER_OPTIONS, NOWHERE_TO_RUN, SURROUNDED,
38  SURRENDER_FAILED, NO_RESPONSE, BRIBE, NOT_ENOUGH,
39  COMBAT, BATTLE
40  };
41  Mode _mode = ALERT;
42  enum BribeType { BRIBE_GOLD, BRIBE_GEMS, BRIBE_FOOD };
43  BribeType _bribeType = BRIBE_GOLD;
44  Common::String _bribeTypeStr;
45  Shared::Xeen::SpriteResource _btnSprites;
46 
50  void setMode(Mode newMode);
51 
55  void setDisplayArea(bool largeArea);
56 
60  void encounterEnded();
61 
65  void attack();
66 
70  void bribe();
71 
75  void retreat();
76 
80  void surrender();
81 
85  void flee();
86 
91  void decreaseAlignments();
92 
97  void increaseAlignments();
98 public:
99  Encounter();
100  virtual ~Encounter() {}
101 
105  bool msgFocus(const FocusMessage &msg) override;
106 
111  void draw() override;
112 
116  void timeout() override;
117 
121  bool msgKeypress(const KeypressMessage &msg) override;
122 };
123 
124 } // namespace ViewsEnh
125 } // namespace MM1
126 } // namespace MM
127 
128 #endif
Definition: str.h:59
Definition: sprites.h:52
Definition: encounter.h:33
Definition: messages.h:56
bool msgFocus(const FocusMessage &msg) override
Definition: yes_no.h:40
Definition: detection.h:27
bool msgKeypress(const KeypressMessage &msg) override
Definition: messages.h:41