39 static int roll_ob(
object *op,
int dir,
object *pusher);
72 int move_ob(
object *op,
int dir,
object *originator) {
126 LOG(
llevDebug,
"move_object: monster has been removed - will not process further\n");
143 for (tmp = op; tmp != NULL; tmp = tmp->
more) {
160 for (pl = op->
inv; pl; pl = pl->
below) {
197 int transfer_ob(
object *op,
int x,
int y,
int randomly,
object *originator) {
209 if (op->
head != NULL)
212 for (tmp = op; tmp != NULL; tmp = tmp->
more)
246 int i, j, k, nrofalt = 0;
247 object *other_teleporter, *tmp;
253 if (user->
head != NULL)
260 for (i = -5; i < 6; i++)
261 for (j = -5; j < 6; j++) {
262 if (i == 0 && j == 0)
267 other_teleporter =
GET_MAP_OB(teleporter->
map, teleporter->
x+i, teleporter->
y+j);
269 while (other_teleporter) {
270 if (other_teleporter->
type == tele_type)
272 other_teleporter = other_teleporter->
above;
274 if (other_teleporter)
275 altern[nrofalt++] = other_teleporter;
283 other_teleporter = altern[RANDOM()%nrofalt];
284 k =
find_free_spot(user, other_teleporter->
map, other_teleporter->
x, other_teleporter->
y, 1, 9);
295 for (k = 1; k < 9; k++) {
306 LOG(
llevError,
"Shop mat %s (%d, %d) is in solid rock?\n", other_teleporter->
name, other_teleporter->
x, other_teleporter->
y);
320 for (tmp = user; tmp != NULL; tmp = tmp->
more) {
327 return (tmp == NULL);
344 if (!
roll_ob(op, dir, pusher)) {
346 "You fail to push the %s.",
347 "You fail to push the %s.",
351 (void)
move_ob(pusher, dir, pusher);
389 for (more = op; more; more = more->
more) {
390 tx = x+more->
x-op->
x;
391 ty = y+more->
y-op->
y;
399 if (tmp->
head == op || tmp == op)
432 static int roll_ob(
object *op,
int dir,
object *pusher) {
470 for (tmp = op; tmp != NULL; tmp = tmp->
more)
492 int push_ob(
object *who,
int dir,
object *pusher) {
496 if (who->
head != NULL)
505 if (who->
more == NULL
550 "You start to attack %s !!",
551 "You start to attack %s !!",
559 "You avoid attacking %s.",
560 "You avoid attacking %s.",
569 "You can't push %s.",
570 "You can't push %s.",
589 "%s tried to push you.",
590 "%s tried to push you.",
607 "You pushed %s back.",
608 "You pushed %s back.",
629 if (op->
x == x && op->
y == y)
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, sint16 x, sint16 y, sint16 *nx, sint16 *ny)
#define WILL_APPLY_EARTHWALL
#define MSG_TYPE_COMMAND_SUCCESS
static int try_fit(object *op, mapstruct *m, int x, int y)
short freearr_x[SIZEOFFREE]
int push_ob(object *who, int dir, object *pusher)
#define OUT_OF_REAL_MAP(M, X, Y)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *new_format, const char *old_format,...)
#define MSG_TYPE_COMMAND_FAILURE
void recursive_roll(object *op, int dir, object *pusher)
short freearr_y[SIZEOFFREE]
void map_newmap_cmd(socket_struct *ns)
int teleport(object *teleporter, uint8 tele_type, object *user)
#define MSG_TYPE_VICTIM_WAS_PUSHED
int move_to(object *op, int x, int y)
void remove_ob(object *op)
void check_earthwalls(object *op, mapstruct *m, int x, int y)
int blocked_link(object *ob, mapstruct *m, int sx, int sy)
#define FLAG_UNAGGRESSIVE
int find_first_free_spot(const object *ob, mapstruct *m, int x, int y)
int compute_path(object *source, object *target, int default_dir)
object * get_owner(object *op)
#define OB_TYPE_MOVE_BLOCK(ob1, type)
mapstruct * get_map_from_coord(mapstruct *m, sint16 *x, sint16 *y)
#define GET_MAP_MOVE_BLOCK(M, X, Y)
#define QUERY_FLAG(xyz, p)
#define CLEAR_FLAG(xyz, p)
int transfer_ob(object *op, int x, int y, int randomly, object *originator)
object * insert_ob_in_map(object *op, mapstruct *m, object *originator, int flag)
void esrv_map_scroll(socket_struct *ns, int dx, int dy)
static const flag_definition flags[]
void check_doors(object *op, mapstruct *m, int x, int y)
#define GET_MAP_FLAGS(M, X, Y)
#define GET_MAP_OB(M, X, Y)
int find_free_spot(const object *ob, mapstruct *m, int x, int y, int start, int stop)
int move_object(object *op, int dir)
#define OB_MOVE_BLOCK(ob1, ob2)
void LOG(LogLevel logLevel, const char *format,...)
void query_name(const object *op, char *buf, size_t size)
int move_ob(object *op, int dir, object *originator)
int random_roll(int min, int max, const object *op, int goodbad)
static int roll_ob(object *op, int dir, object *pusher)