22 #ifndef NUVIE_CORE_MAP_H 23 #define NUVIE_CORE_MAP_H 25 #include "ultima/shared/std/string.h" 26 #include "ultima/nuvie/core/obj_manager.h" 39 #define MAP_ORIGINAL_TILE true 42 LT_HitActors = (1 << 0),
43 LT_HitUnpassable = (1 << 1),
44 LT_HitForcedPassable = (1 << 2),
45 LT_HitLocation = (1 << 3),
46 LT_HitObjects = (1 << 4),
47 LT_HitMissileBoundary = (1 << 5)
61 void init(
int x,
int y, uint8 level,
Actor *actorHit,
Obj *objHit) {
96 MapCoord(uint16 nx, uint16 ny, uint16 nz = 0) {
108 uint32 xdistance(
const MapCoord &c2)
const {
109 uint32 dist = abs(c2.x - x);
115 uint32 ydistance(
const MapCoord &c2)
const {
116 return abs(c2.y - y);
119 uint32 distance(
const MapCoord &c2)
const {
120 uint16 dx = xdistance(c2), dy = ydistance(c2);
121 return (dx >= dy ? dx : dy);
124 MapCoord abs_coords(sint16 dx, sint16 dy)
const;
126 bool is_visible()
const;
127 void print_d(DebugLevelType level)
const {
128 DEBUG(1, level,
"%d, %d, %d", x, y, z);
130 void print_h(DebugLevelType level)
const {
131 DEBUG(1, level,
"%x, %x, %x", x, y, z);
133 void print_s(DebugLevelType level)
const {
134 DEBUG(1, level,
"%d, %d", sx, sy);
137 bool operator==(
const MapCoord &c2)
const {
138 return (x == c2.x && y == c2.y && z == c2.z);
140 bool operator!=(
const MapCoord &c2)
const {
141 return (!(*
this == c2));
157 uint16 *roof_surface;
167 Actor *get_actor(uint16 x, uint16 y, uint8 z,
bool inc_surrounding_objs =
true);
170 byte *get_map_data(uint8 level);
171 uint16 *get_roof_data(uint8 level);
172 const Tile *get_tile(uint16 x, uint16 y, uint8 level,
bool original_tile =
false);
173 uint16 get_width(uint8 level)
const;
174 bool is_passable(uint16 x, uint16 y, uint8 level);
175 bool is_water(uint16 x, uint16 y, uint16 level,
bool ignore_objects =
false);
176 bool is_boundary(uint16 x, uint16 y, uint8 level);
177 bool is_missile_boundary(uint16 x, uint16 y, uint8 level,
Obj *excluded_obj =
nullptr);
178 bool is_damaging(uint16 x, uint16 y, uint8 level,
bool ignore_objects =
false);
179 bool can_put_obj(uint16 x, uint16 y, uint8 level);
180 bool actor_at_location(uint16 x, uint16 y, uint8 level,
bool inc_surrounding_objs =
true);
181 uint8 get_impedance(uint16 x, uint16 y, uint8 level,
bool ignore_objects =
false);
182 const Tile *get_dmg_tile(uint16 x, uint16 y, uint8 level);
183 bool is_passable(uint16 x, uint16 y, uint8 level, NuvieDir dir);
184 bool is_passable(uint16 x1, uint16 y1, uint16 x2, uint16 y2, uint8 level);
185 bool is_passable_from_dir(uint16 x, uint16 y, uint8 level, NuvieDir dir);
186 bool has_roof(uint16 x, uint16 y, uint8 level)
const;
187 void set_roof_mode(
bool roofs);
189 const char *look(uint16 x, uint16 y, uint8 level);
191 bool lineTest(
int start_x,
int start_y,
int end_x,
int end_y, uint8 level,
192 uint8 flags,
LineTestResult &Result, uint32 skip = 0,
Obj *excluded_obj =
nullptr,
bool want_screen_space =
false);
194 bool testIntersection(
int x,
int y, uint8 level, uint8 flags,
LineTestResult &Result,
Obj *excluded_obj =
nullptr);
201 void insertSurfaceSuperChunk(
const unsigned char *schunk_ptr,
const unsigned char *chunk_data, uint8 schunk_num);
202 void insertSurfaceChunk(
const unsigned char *chunk, uint16 x, uint16 y);
204 void insertDungeonSuperChunk(
const unsigned char *schunk_ptr,
const unsigned char *chunk_data, uint8 level);
205 void insertDungeonChunk(
const unsigned char *chunk, uint16 x, uint16 y, uint8 level);
Definition: configuration.h:61
Definition: atari-screen.h:60
Definition: tile_manager.h:145
Definition: actor_manager.h:42
Definition: detection.h:27
Definition: obj_manager.h:75
Definition: tile_manager.h:113