Atrinik Server  4.0
Functions | Variables
item.c File Reference
#include <global.h>
#include <player.h>
#include <object.h>

Go to the source code of this file.

Functions

StringBuffer * object_get_material (const object *op, const object *caller, StringBuffer *sb)
 
char * object_get_material_s (const object *op, const object *caller)
 
StringBuffer * object_get_title (const object *op, const object *caller, StringBuffer *sb)
 
char * object_get_title_s (const object *op, const object *caller)
 
StringBuffer * object_get_name (const object *op, const object *caller, StringBuffer *sb)
 
char * object_get_name_s (const object *op, const object *caller)
 
StringBuffer * object_get_short_name (const object *op, const object *caller, StringBuffer *sb)
 
char * object_get_short_name_s (const object *op, const object *caller)
 
StringBuffer * object_get_material_name (const object *op, const object *caller, StringBuffer *sb)
 
char * object_get_material_name_s (const object *op, const object *caller)
 
StringBuffer * object_get_base_name (const object *op, const object *caller, StringBuffer *sb)
 
char * object_get_base_name_s (const object *op, const object *caller)
 
StringBuffer * object_get_description_terrain (const object *op, const object *caller, StringBuffer *sb)
 
char * object_get_description_terrain_s (const object *op, const object *caller)
 
StringBuffer * object_get_description_attacks (const object *op, const object *caller, StringBuffer *sb)
 
char * object_get_description_attacks_s (const object *op, const object *caller)
 
StringBuffer * object_get_description_protections (const object *op, const object *caller, StringBuffer *sb)
 
char * object_get_description_protections_s (const object *op, const object *caller)
 
StringBuffer * object_get_description_path (const object *op, const object *caller, const uint32_t path, const char *name, StringBuffer *sb)
 
char * object_get_description_path_s (const object *op, const object *caller, const uint32_t path, const char *name)
 
StringBuffer * object_get_description (const object *op, const object *caller, StringBuffer *sb)
 
char * object_get_description_s (const object *op, const object *caller)
 
StringBuffer * object_get_name_description (const object *op, const object *caller, StringBuffer *sb)
 
char * object_get_name_description_s (const object *op, const object *caller)
 
bool need_identify (const object *op)
 
void identify (object *op)
 
void set_trapped_flag (object *op)
 

Variables

static char numbers [21][20]
 

Detailed Description

Item related functions

Definition in file item.c.

Function Documentation

void identify ( object op)

Identify an object. Basically sets FLAG_IDENTIFIED on the object along with other things.

Parameters
opObject to identify.

Definition at line 1364 of file item.c.

bool need_identify ( const object op)

Checks if given object should need identification.

Parameters
opObject to check.
Returns
True if this object needs identification, false otherwise.

Definition at line 1315 of file item.c.

StringBuffer* object_get_base_name ( const object op,
const object caller,
StringBuffer *  sb 
)

Like object_get_name(), but neither object count nor object status information is included.

Parameters
opObject to get the name of.
callerObject calling this. Can be NULL.
sbStringBuffer instance to append to. If NULL, a new instance will be created.
Returns
StringBuffer instance that contains the object name.

Definition at line 513 of file item.c.

char* object_get_base_name_s ( const object op,
const object caller 
)

Wrapper for object_get_base_name() that returns a string.

Parameters
opObject to get the base name of.
callerObject calling this. Can be NULL.
Returns
String containing the base object name. Must be freed.

Definition at line 534 of file item.c.

StringBuffer* object_get_description ( const object op,
const object caller,
StringBuffer *  sb 
)

Builds a description of the given object.

If the object is a monster, lots of information about its abilities will be generated.

If it is an item, lots of information about which abilities will be gained about its use will be generated.

If it is a player, generates the current abilities of the player, which are usually gained by the items applied.

Parameters
opObject that should be described.
callerObject calling this. Can be NULL.
sbStringBuffer instance to append to. If NULL, a new instance will be created.
Returns
StringBuffer instance that contains the description.

Definition at line 839 of file item.c.

StringBuffer* object_get_description_attacks ( const object op,
const object caller,
StringBuffer *  sb 
)

Builds a description of the object's attack types.

Parameters
opObject's attack types to describe.
callerObject calling this. Can be NULL.
sbStringBuffer instance to append to. If NULL, a new instance will be created.
Returns
StringBuffer instance that contains the object attack types.

Definition at line 634 of file item.c.

char* object_get_description_attacks_s ( const object op,
const object caller 
)

Wrapper for object_get_description_attacks() that returns a string.

Parameters
opObject's attacks to describe.
callerObject calling this. Can be NULL.
Returns
String containing the attacks description. Must be freed.

Definition at line 678 of file item.c.

StringBuffer* object_get_description_path ( const object op,
const object caller,
const uint32_t  path,
const char *  name,
StringBuffer *  sb 
)

Builds a description of the object's spell path.

Parameters
opObject's spell path to describe.
callerObject calling this. Can be NULL.
pathThe spell path flags.
nameName of the spell path.
sbStringBuffer instance to append to. If NULL, a new instance will be created.
Returns
StringBuffer instance that contains the spell path description.

Definition at line 763 of file item.c.

char* object_get_description_path_s ( const object op,
const object caller,
const uint32_t  path,
const char *  name 
)

Wrapper for object_get_description_path() that returns a string.

Parameters
opObject's path to describe.
callerObject calling this. Can be NULL.
pathThe spell path flags.
nameName of the spell path.
Returns
String containing the path description. Must be freed.

Definition at line 811 of file item.c.

StringBuffer* object_get_description_protections ( const object op,
const object caller,
StringBuffer *  sb 
)

Builds a description of the object's protections.

Parameters
opObject's protections to describe.
callerObject calling this. Can be NULL.
sbStringBuffer instance to append to. If NULL, a new instance will be created.
Returns
StringBuffer instance that contains the object protections.

Definition at line 696 of file item.c.

char* object_get_description_protections_s ( const object op,
const object caller 
)

Wrapper for object_get_description_protections() that returns a string.

Parameters
opObject's protections to describe.
callerObject calling this. Can be NULL.
Returns
String containing the protections description. Must be freed.

Definition at line 740 of file item.c.

char* object_get_description_s ( const object op,
const object caller 
)

Wrapper for object_get_description() that returns a string.

Parameters
opObject to describe.
callerObject calling this. Can be NULL.
Returns
String containing the description. Must be freed.

Definition at line 1222 of file item.c.

StringBuffer* object_get_description_terrain ( const object op,
const object caller,
StringBuffer *  sb 
)

Builds a description of the object's terrain flags.

Parameters
opObject's terrain to describe.
callerObject calling this. Can be NULL.
sbStringBuffer instance to append to. If NULL, a new instance will be created.
Returns
StringBuffer instance that contains the object terrain.

Definition at line 551 of file item.c.

char* object_get_description_terrain_s ( const object op,
const object caller 
)

Wrapper for object_get_description_terrain() that returns a string.

Parameters
opObject's terrain to describe.
callerObject calling this. Can be NULL.
Returns
String containing the terrain description. Must be freed.

Definition at line 616 of file item.c.

StringBuffer* object_get_material ( const object op,
const object caller,
StringBuffer *  sb 
)

Builds a textual representation of the object's material (if applicable).

Parameters
opObject to get the material of.
callerObject calling this. Can be NULL.
sbStringBuffer instance to append to. If NULL, a new instance will be created.
Returns
StringBuffer instance that contains the object material.

Definition at line 71 of file item.c.

StringBuffer* object_get_material_name ( const object op,
const object caller,
StringBuffer *  sb 
)

Builds an object's name, but only includes the name, title (if any) and material information (if any).

Parameters
opObject to get the name of.
callerObject calling this. Can be NULL.
sbStringBuffer instance to append to. If NULL, a new instance will be created.
Returns
StringBuffer instance that contains the object name.

Definition at line 471 of file item.c.

char* object_get_material_name_s ( const object op,
const object caller 
)

Wrapper for object_get_material_name() that returns a string.

Parameters
opObject to get the material name of.
callerObject calling this. Can be NULL.
Returns
String containing the material object name. Must be freed.

Definition at line 495 of file item.c.

char* object_get_material_s ( const object op,
const object caller 
)

Wrapper for object_get_material() that returns a string.

Parameters
opObject to get the material of.
callerObject calling this. Can be NULL.
Returns
String containing the object material. Must be freed.

Definition at line 107 of file item.c.

StringBuffer* object_get_name ( const object op,
const object caller,
StringBuffer *  sb 
)

Builds a verbose textual representation of the name of the given object.

Parameters
opObject to get the name of.
callerObject calling this. Can be NULL.
sbStringBuffer instance to append to. If NULL, a new instance will be created.
Returns
StringBuffer instance that contains the object name.

Definition at line 299 of file item.c.

StringBuffer* object_get_name_description ( const object op,
const object caller,
StringBuffer *  sb 
)

Get object's name using object_get_name(), along with its description (if any).

Parameters
tmpObject to get description of.
callerCaller.
sbStringBuffer instance to append to. If NULL, a new instance will be created.
Returns
StringBuffer instance that contains the description.

Definition at line 1240 of file item.c.

char* object_get_name_description_s ( const object op,
const object caller 
)

Wrapper for object_get_name_description() that returns a string.

Parameters
opObject to describe.
callerObject calling this. Can be NULL.
Returns
String containing the object's name and its description. Must be freed.

Definition at line 1303 of file item.c.

char* object_get_name_s ( const object op,
const object caller 
)

Wrapper for object_get_name() that returns a string.

Parameters
opObject to get the name of.
callerObject calling this. Can be NULL.
Returns
String containing the object name. Must be freed.

Definition at line 398 of file item.c.

StringBuffer* object_get_short_name ( const object op,
const object caller,
StringBuffer *  sb 
)

Like object_get_name(), but object status information (eg, worn/cursed/etc) is not included.

Parameters
opObject to get the name of.
callerObject calling this. Can be NULL.
sbStringBuffer instance to append to. If NULL, a new instance will be created.
Returns
StringBuffer instance that contains the object name.

Definition at line 416 of file item.c.

char* object_get_short_name_s ( const object op,
const object caller 
)

Wrapper for object_get_short_name() that returns a string.

Parameters
opObject to get the short name of.
callerObject calling this. Can be NULL.
Returns
String containing the short object name. Must be freed.

Definition at line 453 of file item.c.

StringBuffer* object_get_title ( const object op,
const object caller,
StringBuffer *  sb 
)

Builds a textual representation of the object's title (if applicable).

Parameters
opObject to get the title of.
callerObject calling this. Can be NULL.
sbStringBuffer instance to append to. If NULL, a new instance will be created.
Returns
StringBuffer instance that contains the object title.

Definition at line 124 of file item.c.

char* object_get_title_s ( const object op,
const object caller 
)

Wrapper for object_get_title() that returns a string.

Parameters
opObject to get the title of.
callerObject calling this. Can be NULL.
Returns
String containing the object title. Must be freed.

Definition at line 282 of file item.c.

void set_trapped_flag ( object op)

Check if an object marked with FLAG_IS_TRAPPED still has a known trap in it.

Parameters
opThe object to check.

Definition at line 1386 of file item.c.

Variable Documentation

char numbers[21][20]
static
Initial value:
= {
"",
"",
"two ",
"three ",
"four ",
"five ",
"six ",
"seven ",
"eight ",
"nine ",
"ten ",
"eleven ",
"twelve ",
"thirteen ",
"fourteen ",
"fifteen ",
"sixteen ",
"seventeen ",
"eighteen ",
"nineteen ",
"twenty "
}

Word representations of numbers used by get_number()

Definition at line 35 of file item.c.