[Package Index | Mudlib Index | Effect Index]
See also:
/obj/armour.c and /obj/clothing.c
Written by Pinkfish
.
void add_immune_to(mixed args)This adds a new type of damage that the object is immune to. The parameter can either be a string or an array of strings being the types of damage to be immune to.
inherit "/std/basic/wearable"; void setup() { ... add_immune_to("sharp"); ... } /* setup() */
inherit "/std/basic/wearable"; void setup() { ... add_immune_to("sharp"); ... } /* setup() */
void add_wear_effect(string effect)This method adds a new wear effect to the current wear effect array. These effects will automaticly be added when worn and removed when taken off.
string * query_immune_to()This returns the list of types of damage that the object is immune to.
string query_race()This method queries the race type.
string query_type()This method returns the current type(s) associated with the object. If this method returns a string then there is only one type for this object. If it returns a string then there is more than one type associated with an object. An example of something with more than one type is a skirt, which is a dress and a shirt at the same time.
string * query_wear_effects()This method returns the list of effects to be added to the wearer when it is worn. These effects will automaticly be added when worn and removed when taken off.
mixed * query_wear_remove_func()This method returns the current function associated with wearing and removing the item.
int query_wearable()This method tells us if the object is wearable. In the case of a wearable object it will always return 1.
object query_worn_by()This method returns the person who is currently wearing the object.
void remove_immune_to(mixed args)This method removes a type of damage that the weapon is immune to.
} void remove_wear_remove_func()Unset the wear_remove func.
void set_race(string str)This method sets the race type that can wear this item. Unless the item has specific race requirements just leave this empty.
void set_type(mixed word)This method sets the type(s) which are associated with the item. If the parameter is a string then a single type is associated with the item, if the parameter is an array then a list of types is associated with the object. If any of these types are not legal and error message will be produced.
void set_wear_effects(string * effects)This method sets the list of effects to be added to the wearer when it is worn. These effects will automaticly be added when worn and removed when taken off.
void set_wear_remove_func(mixed file, string func)This method sets the current function associated with wearing and removing the item. The value of this function should be choosen carefully, using an object reference for the name will work but it will not then be able to restored from the save file. The same goes for using function pointers. It is better to use a real file name and a string function name.
The function will be called with two arguments, the first argument will
be 0 if the object is being removed or the object which it is
being worn by if it is non-zero. The second argument will always
be the person who was wearing the item, or is about to wear the
item.
inherit "/std/basic/wearable"; void setup() { ... set_wear_remove_func(base_name(this_object()), "do_fluff"); ... } /* setup() */ void do_fluff(object ob, object player) { if (!ob) { write(capitalize(the_short()) + " is being removed.\n"); } else { write(capitalize(the_short()) + " is being worn.\n"); } } /* do_fluff() */
int set_worn_by(object thing)This method sets the object as being worn by the passed in object. It calls all the various worn functions and sets up or removes all the effects associated with the object.
If the object is alreadying being worn the wear_remove_function will be called with an argument of 0. The method taken_off will be called on the object wearing the object for all the effects associated with this object.
If the object is being set to be worn by someone the the wear_remove function will be called with an argument being the person who is to wear the object. All of the effects associated with the object will be added to the wearer.
This calls the method 'person_removing_item' on the effect when some
one removes the item. This can be used to make sure the effects are
taken off when the item is removed.