[Package Index | Mudlib Index | Effect Index]

File /std/object.c

The basic object. This pulls together all the bits needed to create a basic object.

See also:
/std/room.c

Written by Pinkfish

Inherits

This class inherits the following classes /std/basic/enchant.c, /std/basic/help_files.c, /std/basic/init.c, /std/basic/extra_look.c, /std/basic/auto_load.c, /std/basic/id.c, /std/basic/identity_hold.c, /std/basic/property.c, /std/basic/effects.c, /std/basic/misc.c, /std/basic/theft_callback.c and /std/basic/read_desc.c

Includes

This class includes the following files /include/cmr.h and /include/move_failures.h

Method index

Public Functions

These are functions that everyone can access.

add_material
void add_material(mixed material)

This method adds a material to the end of the list of current materials. If you would like the material to be added to the beginning of the materials array instead, use set_material(). The first listed material may determine the method used to fix or repair the item.

Parameters:
material - the material to add

See also:
set_material() and /include/materials.h


add_move_callback
int add_move_callback(string tag,
mixed callback)

This function adds a callback to the list to call when move is attempted.

Parameters:
tag - - A tag for the callback, can be used when deleting callbacks.
callback - - Either a function pointer or an array of the form ({ ob, func }) where ob is the path to an object or an actual object reference.

Returns:
1 if the callback was added, 0 otherwise (tag already exists). Note: This is obvious really but worth pointing out: If using a function pointer or an array with an object reference, the callback can only be evaluated if the original object is still valid. If using a path to an object, the object will get loaded if necessary.


clean_up
int clean_up(int inherited)
long
string long(string word,
int dark)

The description of an object when someone looks at it. This handles the extra code for messages, colour and material.

Parameters:
word - the word it was matched on
dark - is it dark from the player's perspecitive

Returns:
the long description


move
varargs int move(mixed dest,
string messin,
string messout)
parse_command_adjectiv_id_list
string * parse_command_adjectiv_id_list()
parse_command_id_list
string * parse_command_id_list()
parse_command_plural_id_list
string * parse_command_plural_id_list()
query_cloned_by
string query_cloned_by()

Who cloned the object. Used for security reasoin to trace who have been cloning up objects for players.

Returns:
the person who cloned the object


query_colour
string query_colour()

The colour of the object.

Returns:
the colour of the objecy


query_material
string query_material()

This gives the primary material of the object, that is, the one listed first in its materials array. The primary material of an object may determine where it is repaired or fixed when damaged.

Returns:
the name of the object's primary material, or 0 if no materials set

See also:
query_materials()


query_materials
string * query_materials()

This returns all of the materials of the object.

Returns:
an array contaning all the object's materials

See also:
query_material()


query_objective
string query_objective()

The objective of the object.

Returns:
always returns "it"


query_possessive
string query_possessive()

The possessive of the object.

Returns:
always returns "its"


query_pronoun
string query_pronoun()

The pronoun of the object.

Returns:
always returns "it"


query_quality
int query_quality()

This method returns the quality of the object. The quality is used in the crafts system, amongst other things.
remove_move_callback
mixed remove_move_callback(string tag)

This function removes a callback from the list to call when a move is attempted.

Parameters:
tag - - The tag of the callback to remove.

Returns:
- The original callback object or 0 if no matching callback exists.


replace_long_dollars
string replace_long_dollars(object player,
string text)

This method replaces any colours of materials in the given string with the appropriate ccolours or materials for this object.

Parameters:
player - the player attempting to check the colour/material.
text - the text to replace

Returns:
a new string with the dollar identities expanded.


reset_materials
void reset_materials()

This resets all of the materials of the object (i.e. empties out its materials array).
set_colour
void set_colour(string word)

Sets the colour of the object.

Parameters:
word - the colour to make the object


set_material
varargs void set_material(mixed word,
int clear_old_materials)

This method adds a material to the front of the list of current materials. Optionally, it can also clear out any existing materials first, although this behaviour is not the default, requiring the second argument to be nonzero. If you would like the material to be added to the end of the materials array instead, use add_material(). The first listed material may determine the method used to fix or repair the item.

Parameters:
word - the material to add
clear_old_materials - 1 to clear out the existing materials, 0 to not

See also:
add_material() and /include/materials.h


set_name
void set_name(string word)

Gives the object a name. Sets the name to the word and makes it the short description and attempts to create the pural short description from it.

Parameters:
name - the name to use


set_player
void set_player(object thing)

Sets the player associated with the object. This is used during the autoload sequence.

Parameters:
thing - the player object we belong to

See also:
/global/auto_load.c


set_quality
void set_quality(int quality)

This method sets the quality of the object. All objects are by default 'normal' quality.

Parameters:
quality - the quality of the object