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

Go to the source code of this file.


void init_type_lighter (void)
static method_ret lighter_type_apply (ob_methods *context, object *lighter, object *applier, int aflags)

Detailed Description

Implementation of the Lighter class of objects.

Definition in file lighter.c.

Function Documentation

◆ init_type_lighter()

void init_type_lighter ( void  )

Initializer for the LIGHTER object type.

Definition at line 32 of file lighter.c.

References LIGHTER, lighter_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:

◆ lighter_type_apply()

static method_ret lighter_type_apply ( ob_methods context,
object lighter,
object applier,
int  aflags 

Attempts to apply a lighter.

Designed primarily to light torches/lanterns/etc. Also burns up burnable material too. First object in the inventory is the selected object to "burn". -b.t.

contextmethod context.
lighterlighter to apply.
applierobject attempting to apply the lighter.
aflagsspecial flags (always apply/unapply).
METHOD_UNHANDLED if the applier is not a player, METHOD_OK else..

Definition at line 54 of file lighter.c.

References AT_FIRE, obj::count, draw_ext_info(), draw_ext_info_format(), find_marked_object(), fix_object(), liv::food, obj::last_eat, MAX_BUF, METHOD_OK, METHOD_UNHANDLED, MSG_TYPE_APPLY, MSG_TYPE_APPLY_ERROR, MSG_TYPE_APPLY_FAILURE, MSG_TYPE_APPLY_SUCCESS, obj::name, NDI_UNIQUE, obj::nrof, object_get_player_container(), object_insert_in_ob(), object_split(), PLAYER, safe_strncpy, save_throw_object(), obj::stats, and obj::type.

Referenced by init_type_lighter().

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