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_GAME_ENCOUNTER_H
23 #define MM1_GAME_ENCOUNTER_H
24 
25 #include "common/array.h"
26 #include "mm/mm1/data/character.h"
27 #include "mm/mm1/data/monsters.h"
28 #include "mm/mm1/game/game_logic.h"
29 
30 namespace MM {
31 namespace MM1 {
32 namespace Game {
33 
34 #define MAX_COMBAT_MONSTERS 15
35 
36 enum EncounterType {
37  FORCE_SURPRISED = -1, NORMAL_SURPRISED = 0, NORMAL_ENCOUNTER = 1
38 };
39 
40 class Encounter : public GameLogic {
41 private:
42  int _levelOffset = 0;
43  int _maxLevelForImg = 0;
44  int _monsterLevel = 0;
45  int _totalLevels = 0;
46  int _monsterNum = 0;
47  struct MonsterSummary {
48  byte _num;
49  byte _level;
50  MonsterSummary() : _num(0), _level(0) {}
51  MonsterSummary(byte num, byte level) : _num(num), _level(level) {}
52  };
53  Common::Array<MonsterSummary> _monsterSummaries;
54 
55  void randomAdjust();
56  const Monster *getMonster();
57 public:
58  Common::Array<Monster> _monsterList;
59  int _bribeAlignmentCtr = 0, _bribeFleeCtr = 0;
60  int _alignmentsChanged = 0;
61  int _monsterImgNum = 0;
62  int _highestLevel = 0;
63  EncounterType _encounterType = NORMAL_SURPRISED;
64  byte _fleeThreshold = 0;
65  bool _manual = false;
66  int _levelIndex = 0;
67 
68 public:
72  void execute();
73 
77  bool checkSurroundParty() const;
78 
79  void changeCharAlignment(Alignment align);
80 
84  void clearMonsters();
85 
89  void addMonster(byte id, byte level);
90 };
91 
92 } // namespace Game
93 } // namespace MM1
94 } // namespace MM
95 
96 #endif
void addMonster(byte id, byte level)
bool checkSurroundParty() const
Definition: encounter.h:40
Definition: detection.h:27
Definition: game_logic.h:29
Definition: monsters.h:80