Crossfire Server, Trunk
exit.c File Reference
#include "global.h"
#include <string.h>
#include "ob_methods.h"
#include "ob_types.h"
#include "sounds.h"
#include "sproto.h"
+ Include dependency graph for exit.c:

Go to the source code of this file.

Functions

static method_ret exit_type_apply (object *exit, object *op, int autoapply)
 
static method_ret exit_type_move_on (object *trap, object *victim, object *originator)
 
void init_type_exit (void)
 
static int is_legal_2ways_exit (object *op, object *exit)
 

Detailed Description

The implementation of the Exit class of objects.

Definition in file exit.c.

Function Documentation

◆ exit_type_apply()

static method_ret exit_type_apply ( object *  exit,
object *  op,
int  autoapply 
)
static

Handles applying an exit.

Parameters
exitThe exit applied
opThe object applying the exit
autoapplySet this to 1 to automatically apply the sign
Returns
METHOD_OK unless op is not a player, in which case METHOD_ERROR

Definition at line 151 of file exit.c.

References draw_ext_info(), draw_ext_info_format(), enter_exit(), EXIT_PATH, is_legal_2ways_exit(), MAX_BUF, METHOD_ERROR, METHOD_OK, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE, MSG_TYPE_APPLY_SUCCESS, give::name, NDI_NAVY, NDI_UNIQUE, give::op, and query_name().

Referenced by init_type_exit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ exit_type_move_on()

static method_ret exit_type_move_on ( object *  trap,
object *  victim,
object *  originator 
)
static

Move on this Exit object.

Parameters
trapThe Exit we're moving on
victimThe object moving over this one
originatorThe object that caused the move_on event
Returns
METHOD_OK

Definition at line 45 of file exit.c.

References common_post_ob_move_on(), common_pre_ob_move_on(), draw_ext_info(), enter_exit(), EXIT_PATH, METHOD_ERROR, METHOD_OK, MSG_TYPE_APPLY, MSG_TYPE_APPLY_TRAP, NDI_NAVY, and reputation::victim.

Referenced by init_type_exit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_type_exit()

void init_type_exit ( void  )

Initializer for the EXIT object type.

Definition at line 33 of file exit.c.

References exit_type_apply(), exit_type_move_on(), register_apply(), and register_move_on().

Referenced by register_all_ob_types().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_legal_2ways_exit()

static int is_legal_2ways_exit ( object *  op,
object *  exit 
)
static

This fonction return true if the exit is not a 2 ways one or it is 2 ways, valid exit. A valid 2 way exit means:

  • You can come back (there is another exit at the other side)
  • You are
    • the owner of the exit
    • or in the same party as the owner
Note
a owner in a 2 way exit is saved as the owner's name in the field exit->name cause the field exit->owner doesn't survive in the swapping (in fact the whole exit doesn't survive).
Parameters
opplayer to check for.
exitexit object.
Returns
1 if exit is not 2 way, 0 else.

Definition at line 83 of file exit.c.

References EXIT_PATH, EXIT_X, EXIT_Y, first_player, GET_MAP_OB, has_been_loaded(), Settings::localdir, MAP_PLAYER_UNIQUE, pl::next, pl::ob, give::op, ready_map_name(), settings, and Ice::tmp.

Referenced by exit_type_apply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: