From the NannyMUD documentation
2003-04-19
simple_weapon - A simple weapon.
set_class set_type set_hit_line_object
query_wielded query_type query_magic weapon_class is_weapon in_use
PROPERTY NAME
cursed -DESCRIPTION
This property prevents the weapon from being unwielded or dropped once it has been wielded. The value of the property influences the short description when wielded: _Value_ integer [short desc] (wielded and cursed) "STRING" [short desc] (wielded and STRING) "" [short desc] (wielded) This allows for fine-tuned control of appearance of, for example, guild armours that are not to be removed.PROPERTY NAME
two_handed -DESCRIPTION
This property marks the weapon as being two-handed. The most obvious effect is that the player cannot wear a shield while wielding the weapon.PROPERTY NAME
magical -DESCRIPTION
This marks the weapon as being 'magical'.PROPERTY NAME
no_multi_attack -DESCRIPTION
This prevents weapon_hit() to be called more than once per heartbeat.PROPERTY NAME
__hit_line_object -DESCRIPTION
This property is used to get hit messages from another source than the default /obj/daemon/messd.PROPERTY NAME
__default_extra_look -DESCRIPTION
The property __extra_look is only used when the object is wielded, __default_extra_look is used, when it isn't.PROPERTY NAME
__break_msg -DESCRIPTION
The property should have a string value; this will be used to replace the standard 'CRACK!\nYour weapon broke!\n' used when a high wc weapon breaks.PROPERTY NAME
__remote -DESCRIPTION
See the description of the remote_object, and the remote functions.
FUNCTION
NAME
set_class - Set how good the weapon is.SYNTAX
void set_class(int class)DESCRIPTION
Set the weapon_class. Check the rules to see what the allowed values are.
FUNCTION
NAME
set_type - Set the type of the weapon.SYNTAX
void set_type(string type)DESCRIPTION
Set the type of weapon. Currently these types are available: chop slash pierce crush hand-to-hand fire electricity cold drain acid bite lash These types are implemented by setting the hit_line_object to /obj/daemon/messd, so read that object for more information on what the different types actually do. Other types may appear in the future.
FUNCTION
NAME
is_weapon - Marks this object as a weapon.SYNTAX
int is_weapon()DESCRIPTION
This function returns 1, and by doing so marks the object as being a weapon. This is used for fast checks in the lib, and can be used by the coding wizard for nice discrimination of objects.NOTE
Do not overload this function unless you know what you are doing.NOTE
Do not define this function in your own objects unless you know what you are doing.
FUNCTION
NAME
in_use - Is the weapon in use?SYNTAX
int in_use()DESCRIPTION
This function is a convenience function. It performs two checks: 1/ is the weapon wielded, i.e. query_wielded() returns true, 2/ is the weapon the currebtly used weapon, i.e. does the query_weapon_in_use() in the wielder return true. If both of the above are true, in_use() returns true.
FUNCTION
NAME
set_hit_line_object - Set what object to get hit messages from.SYNTAX
void set_hit_line_object(mixed obj)DESCRIPTION
The function get_hit_lines will be called in the object given to this function every time someone hits something with this weapon. The arguments to get_hit_lines are: 1/ damage, the damage done 2/ defender, the person who are being hit 3/ attacker, the person using the weapon 4/ type, the type of the weapon The function is then supposed to return an array with three messages, the first one goes to the victim, the second to the attacker and the third one to everybody else in that room.
FUNCTION
NAME
get_hit_lines - Get hit descriptions.SYNTAX
string *get_hit_lines(int damage, object defender, object attacker)DESCRIPTION
This function sorts out what object it should be use as the source for the hit-lines. Default is the messd-daemon; you can change that through the use of the function set_hit_line_object.
FUNCTION
NAME
remote_weapon_hit -SYNTAX
mixed remote_weapon_hit(object attacker, object weapon)DESCRIPTION
This function is called for each hit the weapon does. The returned value will be made part of the damage done. If the special value "miss" is returned, the attack does no damage.
FUNCTION
NAME
remote_prevent_wield -SYNTAX
int remote_prevent_wield(object weapon)DESCRIPTION
This function is called when someone tries to wield the weapon. If you return non-zero from it, the wield attempt will fail.
FUNCTION
NAME
remote_prevent_unwield -SYNTAX
int remote_prevent_unwield(object weapon)DESCRIPTION
This function is called when someone tries to unwield the weapon. If you return non-zero, he will not be able to perform the unwield.
FUNCTION
NAME
remote_do_wield -SYNTAX
void remote_do_wield(object weapon)DESCRIPTION
This function is called when someone wields the weapon.
FUNCTION
NAME
remote_do_unwield -SYNTAX
void remote_do_unwield(object weapon, object wielder)DESCRIPTION
This function is called when the weapon is unwielded.
FUNCTION
NAME
remote object -SYNTAX
void add_property("__remote", string remote_file_name);SYNTAX
void add_property("__remote", object remote_object);DESCRIPTION
The remote object is used to add side effect and extra messages to this weapon. The following functions are used in that object: remote_weapon_hit remote_prevent_wield remote_prevent_unwield remote_do_wield remote_do_unwieldNOTE
If the remote_object_file_name is given as a string, the functions are called in the master object. If you want them to be called in a clone, you must give an object.
FUNCTION
NAME
query_wielded - Who is using this weapon?SYNTAX
object query_wielded()DESCRIPTION
This function returns the user of the weapon.
FUNCTION
NAME
weapon_class - What is the weapon's class?SYNTAX
int weapon_class()DESCRIPTION
This function returns the class of the weapon, as set with set_class.
FUNCTION
NAME
query_type - What type of weapon is this?SYNTAX
string query_type()DESCRIPTION
This function returns the weapons type as set with set_type().
FUNCTION
NAME
hit - Hit a victim with the weapon.SYNTAX
int hit(object attacker)DESCRIPTION
THis internal function is used to hit the opponent, keeping track of the effect of remote functions and the property "no_multi_attack".
FUNCTION
NAME
set_wielded_by - Set who is using this weapon.SYNTAX
void set_wielded_by(object user)DESCRIPTION
Using this function, you can set who is using this weapon.
FUNCTION
NAME
un_wield - Make the weaon un-wield.SYNTAX
void un_wield()DESCRIPTION
Using this function, the weapon is marked as not in use. The function handles the property "cursed" and the appropriate remote-functions in the weapon.NOTE
This function will not clean up the data in the wielder. It is possible that you should call 'stop_wielding' in the wielder instead.
FUNCTION
NAME
short - The short description of the weapon.SYNTAX
varargs string short(int flags)DESCRIPTION
This function generates the short description, including the "(wielded)", and "(cursed & wielded)" as appropriate. The flag argument is a bitmask. Different things happen depending on the bits in the flag: flag & 1 : Don't add the 'worn' or 'cursed' texts. More flags might be supported in the future.
FUNCTION
NAME
extra_look - GIve the player an extra look.SYNTAX
string extra_look()DESCRIPTION
The weapon object defiens this function, to be able to handle the property "__default_extra_look".