Atrinik Server  4.0
Functions
exit.c File Reference
#include <global.h>
#include <plugin.h>
#include <object.h>
#include <object_methods.h>
#include <exit.h>

Go to the source code of this file.

Functions

static objectexit_find (object *op, bool do_load)
 
static bool exit_activate (object *op, object *applier)
 
static int apply_func (object *op, object *applier, int aflags)
 
static int move_on_func (object *op, object *victim, object *originator, int state)
 
static void process_func (object *op)
 
static int trigger_func (object *op, object *cause, int state)
 
static void insert_map_func (object *op)
 
static void remove_map_func (object *op)
 
 OBJECT_TYPE_INIT_DEFINE (exit)
 
mapstructexit_get_destination (object *op, int *x, int *y, bool do_load)
 

Detailed Description

Handles code related to exits.

Todo:
Somehow allow multi-part objects to pass through exits. The issue is that usually portals lead to a space next to a return portal. This means that when the multi-part object enters a portal, chances are that either its head or its tail will be on top of the return portal, causing it to teleport back to the portal it wanted to enter in the first place...
Author
Alex Tokar

Definition in file exit.c.

Function Documentation

static int apply_func ( object op,
object applier,
int  aflags 
)
static

Applies an object.

Parameters
opThe object to apply.
applierThe object that executes the apply action.
aflagsSpecial (always apply/unapply) flags.

Definition at line 153 of file exit.c.

static bool exit_activate ( object op,
object applier 
)
static

Activate the exit, teleporting the person who applied it to the appropriate destination.

Parameters
opThe exit.
applierWho applied the exit.
Returns
True on success, false on failure.

Definition at line 120 of file exit.c.

static object* exit_find ( object op,
bool  do_load 
)
static

Find an automatically connected exit.

Parameters
opExit to find a connected exit for.
do_loadIf true, will load maps if necessary.
Returns
Connected exit if found, NULL otherwise.

Definition at line 55 of file exit.c.

mapstruct* exit_get_destination ( object op,
int *  x,
int *  y,
bool  do_load 
)

Acquires the specified exit's destination (map and coordinates).

If this function returns NULL, the contents of 'x' and 'y' are undefined.

Parameters
opExit.
[out]xWill contain the destination X coordinate. Can be NULL.
[out]yWill contain the destination Y coordinate. Can be NULL.
do_loadWhether to load maps if necessary.
Returns
Destination map. Can be NULL.

Definition at line 383 of file exit.c.

static void insert_map_func ( object op)
static

Called when an object is inserted on a map.

Parameters
opThe object being inserted.

Definition at line 291 of file exit.c.

static int move_on_func ( object op,
object victim,
object originator,
int  state 
)
static

Triggered when an object moves moves off a square and when object moves onto a square.

Parameters
opThe object that wants to catch this event.
victimThe object moving.
originatorThe object that is the cause of the move.
state1 if the object is moving onto a square, 0 if moving off a square.

Definition at line 234 of file exit.c.

OBJECT_TYPE_INIT_DEFINE ( exit  )

Initialize the exit type object methods.

Definition at line 356 of file exit.c.

static void process_func ( object op)
static

Processes an object, giving it the opportunity to move or react.

Parameters
opThe object to process.

Definition at line 244 of file exit.c.

static void remove_map_func ( object op)
static

Called when an object is removed from map.

Parameters
opThe object being removed.

Definition at line 339 of file exit.c.

static int trigger_func ( object op,
object cause,
int  state 
)
static

An object is triggered by another one.

Parameters
opThe object being triggered.
causeThe object that is the cause of the trigger.
stateTrigger state.

Definition at line 280 of file exit.c.