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

Go to the source code of this file.

Functions

void init_type_mimic (void)
 Initializer for MIMIC type. More...
 
static method_ret mimic_type_apply (object *op, object *applier, int aflags)
 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. More...
 
static const char * object_try_get_value (object *op, const char *key)
 

Function Documentation

◆ init_type_mimic()

void init_type_mimic ( void  )

Initializer for MIMIC type.

Definition at line 43 of file mimic.cpp.

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 ( 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
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 61 of file mimic.cpp.

References living::ac, object::animation, living::dam, mapstruct::difficulty, draw_ext_info, draw_ext_info_format(), object::enemy, object::env, env, living::exp, FABS, object::face, find_animation(), FLAG_ALIVE, FLAG_ANIMATE, FLAG_MONSTER, FREE_AND_COPY, freearr_x, freearr_y, living::hp, object::level, level, object::map, MAX_BUF, living::maxhp, METHOD_OK, METHOD_UNHANDLED, MIMIC, MONSTER, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE, MSG_TYPE_APPLY_SUCCESS, name, Face::name, object::name, NDI_UNIQUE, object_find_free_spot(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_try_get_value(), PLAYER, query_name(), SET_FLAG, SIZEOFFREE, object::speed, object::stats, object::type, and living::wc.

Referenced by init_type_mimic().

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

◆ object_try_get_value()

static const char* object_try_get_value ( object op,
const char *  key 
)
inlinestatic

Definition at line 47 of file mimic.cpp.

References object_get_value().

Referenced by mimic_type_apply().

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