NAME simple_weapon.c - a simple weapon INHERITS basic_thing.c (see basic_thing.doc for more info) SETUP FUNCTIONS set_class set_type set_hit_line_object QUERY FUNCTIONS query_wielded query_type query_magic weapon_class SPECIAL PROPERTIES cursed - prevents the weapon from being dropped or unwielded once wielded __default_extra_look - the property __extra_look is only used when the object is wielded, __default_extra_look is used when it isn't two_handed - prevents shields from being worn while wielding the weapon. magical - mages the weapon appear 'magical' no_multi_attack - prevents weapon_hit to be called more than once/heartbeat __remote see below ======================================================================= NAME set_class - set how good the weapon is SYNTAX void set_class(int class); DESCRIPTION Set the weapon_class, see /doc/RULES/weapon.r for a list of acceptable values. ======================================================================= NAME set_type - set type of 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, just ask. ======================================================================= NAME set_hit_line_object - set 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: damage, the damage done defender, the person who are being hit attacker, the person using the weapon 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. ======================================================================= NAME remote object SYNTAX void add_property("__remote",string remote_file_name); 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: mixed remote_weapon_hit(object attacker) called every time someone hits with this weapon, returns extra damage, or "miss". The damage is added to the normal weapon_class, if "miss" is returned, no damage is done. The object 'attacker' is the wielders opponent. int remote_prevent_wield(object weapon) called when someone tries to wield the weapon, write a message and return 1 to prevent weapon from being wielded. void remote_do_wield(object weapon) called when someone wields the weapon. void remote_do_unwield(object weapon, object wielded_by) called when someone unwields the weapon. NOTE 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. =======================================================================
Help topics available:
board.doc | box.doc | door.doc | hidden_door.doc | lib.doc |
remote | sequence.doc | simple_armour.doc | simple_container.doc | simple_weapon.doc |
You are guest number 78 since November 2019.
This file was last modified: June 2000.