ScummVM API documentation
map_monsters.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 ULTIMA2_DATA_MAP_MONSTERS_H
23#define ULTIMA2_DATA_MAP_MONSTERS_H
24
25#include "common/scummsys.h"
26#include "common/serializer.h"
27#include "ultima/ultima2/data/tiles.h"
28
29namespace Ultima {
30namespace Ultima2 {
31namespace Data {
32
33constexpr int MAP_MONSTER_COUNT = 32;
34
41 byte _mapX[MAP_MONSTER_COUNT] = {};
42 byte _mapY[MAP_MONSTER_COUNT] = {};
43 byte _spellHP[MAP_MONSTER_COUNT] = {};
44 byte _type[MAP_MONSTER_COUNT] = {}; // TileId x 4; 0 means the slot is empty
45 byte _glyphTile[MAP_MONSTER_COUNT] = {};
46 byte _offerFlag[MAP_MONSTER_COUNT] = {};
47 byte _tempX[MAP_MONSTER_COUNT] = {};
48 byte _tempY[MAP_MONSTER_COUNT] = {};
49
50 void load(int mapEra, int mapType);
51
52 void synchronize(Common::Serializer &s);
53
54 bool isActive(int slot) const {
55 return _type[slot] != 0;
56 }
57 TileId tileType(int slot) const {
58 return (TileId)(_type[slot] / 4);
59 }
60};
61
62} // namespace Data
63} // namespace Ultima2
64} // namespace Ultima
65
66#endif
Definition: serializer.h:80
Definition: map_monsters.h:40