22 #ifndef ULTIMA4_MAP_TILE_H 23 #define ULTIMA4_MAP_TILE_H 25 #include "ultima/ultima4/map/direction.h" 26 #include "ultima/ultima4/core/types.h" 27 #include "ultima/ultima4/map/tileset.h" 28 #include "ultima/shared/std/containers.h" 39 #define MASK_SHIP 0x0001 40 #define MASK_HORSE 0x0002 41 #define MASK_BALLOON 0x0004 42 #define MASK_DISPEL 0x0008 43 #define MASK_TALKOVER 0x0010 44 #define MASK_DOOR 0x0020 45 #define MASK_LOCKEDDOOR 0x0040 46 #define MASK_CHEST 0x0080 47 #define MASK_ATTACKOVER 0x0100 48 #define MASK_CANLANDBALLOON 0x0200 49 #define MASK_REPLACEMENT 0x0400 50 #define MASK_WATER_REPLACEMENT 0x0800 51 #define MASK_FOREGROUND 0x1000 52 #define MASK_LIVING_THING 0x2000 56 #define MASK_SWIMABLE 0x0001 57 #define MASK_SAILABLE 0x0002 58 #define MASK_UNFLYABLE 0x0004 59 #define MASK_CREATURE_UNWALKABLE 0x0008 75 TileId getId()
const {
81 int getWidth()
const {
84 int getHeight()
const {
87 int getFrames()
const {
90 int getScale()
const {
101 bool isTiledInDungeon()
const {
102 return _tiledInDungeon;
104 bool isLandForeground()
const {
107 bool isWaterForeground()
const {
108 return _waterForeground;
111 int canWalkOn(Direction d)
const {
112 return DIR_IN_MASK(d, rule->_walkOnDirs);
114 int canWalkOff(Direction d)
const {
115 return DIR_IN_MASK(d, rule->_walkOffDirs);
123 return isWalkable() || isSwimable() || isSailable() || (rule->_mask & MASK_ATTACKOVER);
125 int canLandBalloon()
const {
126 return rule->_mask & MASK_CANLANDBALLOON;
128 int isLivingObject()
const {
129 return rule->_mask & MASK_LIVING_THING;
131 int isReplacement()
const {
132 return rule->_mask & MASK_REPLACEMENT;
134 int isWaterReplacement()
const {
135 return rule->_mask & MASK_WATER_REPLACEMENT;
138 int isWalkable()
const {
139 return rule->_walkOnDirs > 0;
141 bool isCreatureWalkable()
const {
142 return canWalkOn(DIR_ADVANCE) && !(rule->_movementMask & MASK_CREATURE_UNWALKABLE);
144 bool isDungeonWalkable()
const;
145 bool isDungeonFloor()
const;
146 int isSwimable()
const {
147 return rule->_movementMask & MASK_SWIMABLE;
149 int isSailable()
const {
150 return rule->_movementMask & MASK_SAILABLE;
152 bool isWater()
const {
153 return (isSwimable() || isSailable());
155 int isFlyable()
const {
156 return !(rule->_movementMask & MASK_UNFLYABLE);
159 return rule->_mask & MASK_DOOR;
161 int isLockedDoor()
const {
162 return rule->_mask & MASK_LOCKEDDOOR;
164 int isChest()
const {
165 return rule->_mask & MASK_CHEST;
168 return rule->_mask & MASK_SHIP;
170 bool isPirateShip()
const {
171 return _name ==
"pirate_ship";
173 int isHorse()
const {
174 return rule->_mask & MASK_HORSE;
176 int isBalloon()
const {
177 return rule->_mask & MASK_BALLOON;
179 int canDispel()
const {
180 return rule->_mask & MASK_DISPEL;
182 int canTalkOver()
const {
183 return rule->_mask & MASK_TALKOVER;
185 TileSpeed getSpeed()
const {
188 TileEffect getEffect()
const {
189 return rule->_effect;
192 bool isOpaque()
const;
199 Direction directionForFrame(
int frame)
const;
200 int frameForDirection(Direction d)
const;
202 static void resetNextId() {
205 static bool canTalkOverTile(
const Tile *tile) {
206 return tile->canTalkOver() != 0;
208 static bool canAttackOverTile(
const Tile *tile) {
230 bool _waterForeground;
237 bool _tiledInDungeon;
243 static TileId _nextId;
int canAttackOver() const
Definition: tile.h:122
Definition: detection.h:27
void loadProperties(const ConfigElement &conf)
bool isForeground() const
Definition: tileanim.h:197
Definition: movie_decoder.h:32