Atrinik Server 2.5
Functions
server/move.c File Reference
#include <global.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)
int push_ob (object *op, int dir, object *pusher)
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:
opWhat to move.
dirDirection to move the object to.
originatorTypically the same as op, but can be different 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 42 of file move.c.

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

An object is being pushed.

Parameters:
opWhat is being pushed.
dirPushing direction.
pusherWhat is pushing op.
Returns:
0 if the object couldn't be pushed, 1 otherwise.

Definition at line 333 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:
teleporterThe teleporter.
tele_typeTeleporter type.
userObject using the teleporter.
Returns:
1 if the object was destroyed, 0 otherwise.

Definition at line 237 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:
opWhat to move.
xNew X coordinate.
yNew Y coordinate.
randomlyIf 1, use find_free_spot() to find the destination, otherwise use find_first_free_spot().
originatorWhat is causing op to move.
trapTrap.
Returns:
1 if the object was destroyed, 0 otherwise.

Definition at line 176 of file move.c.