Crossfire Server  1.75.0
lamp.cpp File Reference

Lamps. More...

#include <global.h>
#include <ob_methods.h>
#include <ob_types.h>
#include <sounds.h>
#include <sproto.h>

Go to the source code of this file.

Functions

static void do_turn (object *op, object *who, int aflags, const char *onoff)
 Turn on/off the lamp, based on op's APPLIED status. More...
 
void init_type_lamp (void)
 Initializer for the LAMP object type. More...
 
static method_ret lamp_type_apply (object *lamp, object *applier, int aflags)
 Applies a lamp. More...
 
static void lamp_type_describe (const object *op, const object *observer, int use_media_tags, char *buf, size_t size)
 

Detailed Description

Lamps.

Definition in file lamp.cpp.

Function Documentation

◆ do_turn()

static void do_turn ( object op,
object who,
int  aflags,
const char *  onoff 
)
static

◆ init_type_lamp()

void init_type_lamp ( void  )

Initializer for the LAMP object type.

Definition at line 40 of file lamp.cpp.

References LAMP, lamp_type_apply(), lamp_type_describe(), register_apply(), and register_describe().

Referenced by register_all_ob_types().

◆ lamp_type_apply()

static method_ret lamp_type_apply ( object lamp,
object applier,
int  aflags 
)
static

Applies a lamp.

Parameters
lamplamp to turn on/off.
applierobject attempting to apply the scroll. Should be a player.
aflagsspecial flags (always apply/unapply).
Returns
METHOD_ERROR if lamp can't be applied, METHOD_OK else.

Definition at line 107 of file lamp.cpp.

References AP_NOPRINT, do_turn(), draw_ext_info_format(), FLAG_APPLIED, living::food, living::maxsp, METHOD_ERROR, METHOD_OK, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, MSG_TYPE_APPLY_FAILURE, object::name, NDI_UNIQUE, object::nrof, object_get_player_container(), object_insert_in_ob(), object_split(), QUERY_FLAG, and object::stats.

Referenced by init_type_lamp().

◆ lamp_type_describe()

static void lamp_type_describe ( const object op,
const object observer,
int  use_media_tags,
char *  buf,
size_t  size 
)
static