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

Go to the source code of this file.

Functions

void init_type_mimic (void)
 
static method_ret mimic_type_apply (ob_methods *context, object *op, object *applier, int aflags)
 

Function Documentation

◆ init_type_mimic()

void init_type_mimic ( void  )

Initializer for MIMIC type.

Definition at line 42 of file mimic.c.

References MIMIC, mimic_type_apply(), and register_apply().

Referenced by register_all_ob_types().

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

◆ mimic_type_apply()

static method_ret mimic_type_apply ( ob_methods context,
object op,
object applier,
int  aflags 
)
static

Implementation of mimics This should be usable for any item masquerading as a container (or other item, for that matter) that activates when you try to pick it up or apply it.

Handles applying a mimic. It just becomes a monster and gains an animation.

Parameters
contextThe method context
opThe object being applied
applierThe object doing the applying
aflagsSpecial flags
Return values
METHOD_UNHANDLEDIf a non-player tries to open it.
METHOD_OKIf a player does the opening.

Definition at line 56 of file mimic.c.

References obj::animation_id, draw_ext_info(), obj::enemy, obj::face, find_animation(), FLAG_ALIVE, FLAG_ANIMATE, FLAG_MONSTER, FREE_AND_COPY, METHOD_OK, METHOD_UNHANDLED, MONSTER, MSG_TYPE_APPLY, MSG_TYPE_APPLY_SUCCESS, new_face_struct::name, obj::name, NDI_UNIQUE, PLAYER, SET_FLAG, and obj::type.

Referenced by init_type_mimic().

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