server/move.c File Reference

#include <global.h>
#include <sproto.h>

Go to the source code of this file.

Functions

int move_ob (object *op, int dir, object *originator)
int transfer_ob (object *op, int x, int y, int randomly, object *originator, object *trap)
int teleport (object *teleporter, uint8 tele_type, object *user)
void recursive_roll (object *op, int dir, object *pusher)
int try_fit (object *op, int x, int y)
int roll_ob (object *op, int dir, object *pusher)
int push_roll_object (object *op, int dir)
int missile_reflection_adjust (object *op, int flag)

Detailed Description

Handles object moving and pushing.

Definition in file move.c.


Function Documentation

int move_ob ( object op,
int  dir,
object originator 
)

Try to move object in specified direction.

Parameters:
op What to move.
dir Direction to move the object to.
originator Typically the same as op, but can be dfferent if originator is causing op to move (originator is pushing op).
Returns:
0 if the object is not able to move to the desired space, 1 otherwise (in which case we also move the object accordingly). -1 if the object was destroyed in the move process (most likely when hit a deadly trap or something).

Definition at line 43 of file move.c.

int push_roll_object ( object op,
int  dir 
)

Push an object, using the /push command.

Parameters:
op Object pushing.
dir Direction to push.
Returns:
1 if successfully pushed an object, 0 otherwise.

Definition at line 492 of file move.c.

void recursive_roll ( object op,
int  dir,
object pusher 
)

An object is pushed by another which is trying to take its place.

Parameters:
op What is being pushed.
dir Pushing direction.
pusher What is pushing op.

Definition at line 343 of file move.c.

int roll_ob ( object op,
int  dir,
object pusher 
)

An object is being pushed, and may push other objects.

Parameters:
op What is being pushed.
dir Pushing direction.
pusher What is pushing op.
Returns:
0 if the object couldn't move, 1 otherwise.

Definition at line 415 of file move.c.

int teleport ( object teleporter,
uint8  tele_type,
object user 
)

Teleport an item around a nearby random teleporter of specified type.

Parameters:
teleporter The teleporter.
tele_type Teleporter type.
user Object using the teleporter.
Returns:
1 if the object was destroyed, 0 otherwise.

Definition at line 243 of file move.c.

int transfer_ob ( object op,
int  x,
int  y,
int  randomly,
object originator,
object trap 
)

Move an object (even linked objects) to another spot on the same map.

Does nothing if there is no free spot.

Parameters:
op What to move.
x New X coordinate.
y New Y coordinate.
randomly If 1, use find_free_spot() to find the destination, otherwise use find_first_free_spot().
originator What is causing op to move.
trap Trap.
Returns:
1 if the object was destroyed, 0 otherwise.

Definition at line 177 of file move.c.

int try_fit ( object op,
int  x,
int  y 
)

Checks if an objects fits on a specified spot.

This is a new version of blocked, this one handles objects that can be passed through by monsters with the CAN_PASS_THRU defined.

Very new version handles also multipart objects

Parameters:
op What object to fit.
x X position on the map.
y Y position on the map.
Returns:
1 if the object fits, 0 otherwise.

Definition at line 366 of file move.c.


Generated by  doxygen 1.6.2