Crossfire Server, Trunk
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 <stdlib.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 (object *op, object *applier, int aflags)
 
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.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 ( 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.c.

References draw_ext_info(), draw_ext_info_format(), env, FABS, find_animation(), FLAG_ALIVE, FLAG_ANIMATE, FLAG_MONSTER, FREE_AND_COPY, freearr_x, freearr_y, level, MAX_BUF, METHOD_OK, METHOD_UNHANDLED, MIMIC, MONSTER, MSG_TYPE_APPLY, MSG_TYPE_APPLY_FAILURE, MSG_TYPE_APPLY_SUCCESS, give::name, NDI_UNIQUE, object_find_free_spot(), object_insert_in_map_at(), object_insert_in_ob(), object_remove(), object_try_get_value(), give::op, PLAYER, query_name(), SET_FLAG, SIZEOFFREE, obj::type, and nlohmann::detail::void().

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.c.

References castle_read::key, object_get_value(), and give::op.

Referenced by mimic_type_apply().

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