Crossfire Server, Trunk  R20513
Functions
creator.c File Reference

The implementation of creator objects. More...

#include <global.h>
#include <ob_methods.h>
#include <ob_types.h>
#include <sounds.h>
#include <sproto.h>
Include dependency graph for creator.c:

Go to the source code of this file.

Functions

static method_ret creator_type_process (ob_methods *context, object *op)
 Processes a creator. More...
 
static method_ret creator_type_trigger (ob_methods *context, object *op, object *cause, int state)
 A creator is triggered. More...
 
void init_type_creator (void)
 Initializer for the creator object type. More...
 
static void move_creator (object *creator)
 Move function for creator objects. More...
 

Detailed Description

The implementation of creator objects.

Definition in file creator.c.

Function Documentation

static method_ret creator_type_process ( ob_methods context,
object op 
)
static

Processes a creator.

Parameters
contextThe method context
opThe teleporter to process
Return values
METHOD_OK

Definition at line 125 of file creator.c.

References METHOD_OK, and move_creator().

Referenced by init_type_creator().

Here is the call graph for this function:

Here is the caller graph for this function:

static method_ret creator_type_trigger ( ob_methods context,
object op,
object cause,
int  state 
)
static

A creator is triggered.

Parameters
contextIgnored.
opThe object being triggered
causeIgnored.
stateIgnored.
Return values
METHOD_OK

Definition at line 138 of file creator.c.

References METHOD_OK, and move_creator().

Referenced by init_type_creator().

Here is the call graph for this function:

Here is the caller graph for this function:

void init_type_creator ( void  )

Initializer for the creator object type.

Definition at line 40 of file creator.c.

References CREATOR, creator_type_process(), creator_type_trigger(), register_process(), and register_trigger().

Referenced by register_all_ob_types().

Here is the call graph for this function:

Here is the caller graph for this function:

static void move_creator ( object creator)
static

Move function for creator objects.

It has the creator object create it's other_arch right on top of it. connected: what will trigger it

  • hp: how many times it may create before stopping
  • lifesave: if set, it'll never disappear but will go on creating everytime it's triggered
  • other_arch: the object to create

Note this can create large objects, however, in that case, it has to make sure that there is in fact space for the object. It should really do this for small objects also, but there is more concern with large objects, most notably a part being placed outside of the map which would cause the server to crash

Parameters
creatorcreator to move.

Definition at line 64 of file creator.c.

References obj::arch, CLEAR_FLAG, fix_generated_item(), FLAG_FREED, FLAG_IS_A_TEMPLATE, FLAG_LIFESAVE, FOR_BELOW_FINISH, FOR_BELOW_PREPARE, FREE_AND_CLEAR_STR, FREE_AND_COPY, GT_MINIMAL, liv::hp, obj::inv, obj::level, llevError, LOG(), obj::map, archt::more, obj::name, ob_blocked(), object_create_arch(), object_create_clone(), object_free_drop_inventory(), object_insert_in_map_at(), object_unset_flag_inv(), obj::other_arch, mapdef::path, QUERY_FLAG, rndm(), obj::slaying, obj::stats, obj::title, obj::x, and obj::y.

Referenced by creator_type_process(), and creator_type_trigger().

Here is the call graph for this function:

Here is the caller graph for this function: