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