[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /std/weapon_logic.c</h2>
This class has alkl the stuff for anything which can damage something
else, this is included into living and weapons.<p>Written by Pinkfish.
<h2>Includes</h2>
This class includes the following files <a href="include.weapon.h.shtml">/include/weapon.h</a><h2>Method index</h2>
<dl><ul>
<li><a href="#add_attack">add_attack</a>(string, int, int *, string, string, mixed, mixed, mixed)<br/>
This method adds an attack onto the object.
<li><a href="#add_attack_message">add_attack_message</a>(string, string, string *)<br/>
This method adds a special attack message set onto the weapon.
<li><a href="#attack_function">attack_function</a>(string, int, object, object)<li><a href="#calc_attack">calc_attack</a>(int, int)<li><a href="#modify_damage">modify_damage</a>(int, string)<li><a href="#query_attack_data">query_attack_data</a>()<li><a href="#query_attack_message">query_attack_message</a>(string, string)<br/>
This method returns the attack message associated with the
type and name.
<li><a href="#query_attack_names">query_attack_names</a>()<li><a href="#query_attack_types">query_attack_types</a>()<li><a href="#query_special_messages">query_special_messages</a>()<li><a href="#query_weapon_type">query_weapon_type</a>()<br/>
This method attempts to work out what type of weapon this is.
<li><a href="#remove_attack">remove_attack</a>(string)<br/>
This method removes the attack of the given name.
<li><a href="#weapon_attacks">weapon_attacks</a>(int, object)<br/>
This function returns 0 or more attacks for this weapon against the
given target.
</ul><h2>Public Functions</h2>
These are functions that everyone can access.<p>
.<ul><a name="add_attack">
add_attack</a><pre>
varargs int add_attack(string a_name,
                       int chance,
                       int * damage,
                       string type,
                       string skill,
                       mixed func,
                       mixed bogus_1,
                       mixed bogus_2)
</pre></br>
This method adds an attack onto the object.  The name of the attack
must be unique on each object.
<br/><ul>
<li><b>Parameters:</b>
<br/>a_name - attack name
<br/>change - the chance of it occuring
<br/>damage - the damage it will do
<br/>type - the type of the attack
<br/>skill - the skill used by the attack
<br/>func - the special function
<br/>bogus_1 - errrr.
<br/>bogus_2 - frog.
<li><b>See also:</b>
<br/><a href="#remove_attack">remove_attack()
</a></dl>

<ul><a name="add_attack_message">
add_attack_message</a><pre>
void add_attack_message(string name,
                        string type,
                        string * data)
</pre></br>
This method adds a special attack message set onto the weapon.  The type
and name are around this way to correspond
to the parameters to add_attack.
<br/><ul>
<li><b>Parameters:</b>
<br/>name - the name of the attack (0 for none)
<br/>type - the type of attack
<br/>data - the attack data
<li><b>See also:</b>
<br/>/obj/handlers/attack_messages
.c and <a href="#query_special_message">query_special_message()</a><li><b>Example:</b>
<br/><pre>inherit "/obj/weapon";

void setup() {
  ...
  add_attack_message("gumboot", "blunt", ({
    0, "$N gumboot$s at $I with $D",
   20, "$N lightly gumboot$s $I in the $z with $D",
   60, "$N gumboot$s $I in the $z with $D",
 5000, "$N heavily gumboot$s $I in the $z with $D" }));
  ...
} /* setup() */
</pre></dl>

<ul><a name="attack_function">
attack_function</a><pre>
void attack_function(string a_name,
                     int damage,
                     object attack_ob,
                     object attack_by)
</pre>
<ul><a name="calc_attack">
calc_attack</a><pre>
int calc_attack(int number,
                int percent)
</pre>
<ul><a name="modify_damage">
modify_damage</a><pre>
int modify_damage(int damage,
                  string attack_name)
</pre>
<ul><a name="query_attack_data">
query_attack_data</a><pre>
mixed * query_attack_data()
</pre>
<ul><a name="query_attack_message">
query_attack_message</a><pre>
mixed * query_attack_message(string name,
                             string type)
</pre></br>
This method returns the attack message associated with the
type and name.  The type and name are around this way to correspond
to the parameters to add_attack.
<br/><ul>
<li><b>Parameters:</b>
<br/>name - the name of the attack
<br/>type - the type of the attack
<li><b>Returns:</b>
<br/>the attack message array, 0 for none

</dl>

<ul><a name="query_attack_names">
query_attack_names</a><pre>
string * query_attack_names()
</pre>
<ul><a name="query_attack_types">
query_attack_types</a><pre>
string * query_attack_types()
</pre>
<ul><a name="query_special_messages">
query_special_messages</a><pre>
mapping query_special_messages()
</pre>
<ul><a name="query_weapon_type">
query_weapon_type</a><pre>
string query_weapon_type()
</pre></br>
This method attempts to work out what type of weapon this is.
<br/><ul>
<li><b>Returns:</b>
<br/>the weapon type

</dl>

<ul><a name="remove_attack">
remove_attack</a><pre>
void remove_attack(string a_name)
</pre></br>
This method removes the attack of the given name.
<br/><ul>
<li><b>Parameters:</b>
<br/>a_name - the name of the attack to remove
<li><b>See also:</b>
<br/><a href="#add_attack">add_attack()
</a></dl>

<ul><a name="weapon_attacks">
weapon_attacks</a><pre>
mixed * weapon_attacks(int percent,
                       object target)
</pre></br>
This function returns 0 or more attacks for this weapon against the
given target.

<br/><ul>
<li><b>Parameters:</b>
<br/>percent - the attack percentage
<br/>target - who is being hit

<li><b>Returns:</b>
<br/>an array of 0 or more attacks. This array is indexed by the
AT_ macros defined in combat.h

<li><b>See also:</b>
<br/>combat.h
</dl>


[an error occurred while processing this directive]

