[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/living/armour.c</h2>
This file contains all the armour related code for the living
objects.<p>Written by Pinkfish
<h2>Inherits</h2>
This class inherits the following classes /std/armour_logic.c<h2>Includes</h2>
This class includes the following files /include/race.h, /include/armour.h, /include/function.h and /include/clothing.h<h2>Method index</h2>
<ul>
<li><a href="#clear_armours">clear_armours</a>()<br/>
This method will make sure all the armours are unworn by the living
object.
<li><a href="#equivalent_armour_types">equivalent_armour_types</a>(mixed, string)<br/>
This method checks to see if the two armour types are
equivilant or not.
<li><a href="#query_ac">query_ac</a>(string, int, string)<br/>
This function returns the amount of damage that can be blocked
by the armour on a specified zone.
<li><a href="#query_arcane_shields">query_arcane_shields</a>()<li><a href="#query_armour_callbacks">query_armour_callbacks</a>()<br/>
Query all the callback data.
<li><a href="#query_armours">query_armours</a>()<br/>
This method returns all the armours that the is currently being
worn.
<li><a href="#query_skin">query_skin</a>()<br/>
This method returns the current skin of the living object.
<li><a href="#query_stopped">query_stopped</a>()<br/>
This returns the object which stopped the blow.
<li><a href="#query_type_coverage">query_type_coverage</a>(string, int)<br/>
 This method determines whether or not a particular "type"
 of item is being worn by the living object upon which 
 it is called.
<li><a href="#query_wearing">query_wearing</a>()<br/>
This method returns all the objects you are currently wearing.
<li><a href="#register_armour_callback">register_armour_callback</a>(int, mixed, mixed)<br/>
Register a callback for magical protection.
<li><a href="#remove_armour">remove_armour</a>(object)<br/>
This method will remove the armour from the living object.
<li><a href="#remove_armour_callback">remove_armour_callback</a>(int, int)<br/>
Remove a registered callback, used when the protection ends.
<li><a href="#set_skin">set_skin</a>(string)<br/>
This method sets the current skin of the living object.
<li><a href="#set_stopped">set_stopped</a>(mixed)<br/>
This method sets the object which stops the call.
<li><a href="#update_armour_callback">update_armour_callback</a>(int, int, mixed)<br/>
Update the data for an armour callback.
<li><a href="#wear_armour">wear_armour</a>(object, int)<br/>
This is the method used to get the living object to wear a piece of
armour or clothing.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="clear_armours">
clear_armours</a><pre class="autodocfuncdef">
void clear_armours()
</pre><dd><br />
This method will make sure all the armours are unworn by the living
object.<br />
<br /><dl>
<dd><b>See also:</b>
<br /><a href="#query_wearing">query_wearing()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_ac">
query_ac</a><pre class="autodocfuncdef">
varargs int query_ac(string type,
int amount,
string zone)
</pre><dd><br />
This function returns the amount of damage that can be blocked
by the armour on a specified zone.  It automatically
damages the armour, and sets the stopped object to be the
the object (piece of armour) that stopped the blow.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
type - The type of damage, eg: "sharp", "blunt", "pierce".<br />
amount - The amount of damage that is being done.<br />
zone - The zone which the damage is being done through, eg: "head".<br />
<br />
<dd><b>Returns:</b>
<br />The amount of damage that will be blocked.<br /><br />
<dd><b>See also:</b>
<br /><a href="#query_wearing">query_wearing()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_arcane_shields">
query_arcane_shields</a><pre class="autodocfuncdef">
string * query_arcane_shields()
</pre>
<dt class="autodocfuncname"><a name="query_armour_callbacks">
query_armour_callbacks</a><pre class="autodocfuncdef">
mixed * query_armour_callbacks()
</pre><dd><br />
Query all the callback data. This should typically only be used for
debugging purposes.
<br />

<dt class="autodocfuncname"><a name="query_armours">
query_armours</a><pre class="autodocfuncdef">
object * query_armours()
</pre><dd><br />
This method returns all the armours that the is currently being
worn.  This will always return the same value as query_wearing()<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the array of armours
<br /><br />
<dd><b>See also:</b>
<br /><a href="#query_wearing">query_wearing()</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_skin">
query_skin</a><pre class="autodocfuncdef">
string query_skin()
</pre><dd><br />
This method returns the current skin of the living object.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the skin of the object<br /><br />
<dd><b>See also:</b>
<br /><a href="#set_skin">set_skin()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_stopped">
query_stopped</a><pre class="autodocfuncdef">
mixed query_stopped()
</pre><dd><br />
This returns the object which stopped the blow.  This is only valid
inside and after a query_ac() call.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the object which stopped the call
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_type_coverage">
query_type_coverage</a><pre class="autodocfuncdef">
int query_type_coverage(string type,
int protective)
</pre><dd><br />
 This method determines whether or not a particular "type"
 of item is being worn by the living object upon which 
 it is called.
 @param type the type of worn object being queried
 @param protective Optional flag to determine whether a matching
 item provides any protection.
 
 @return 0 if no matching item is worn, 1 if a match is worn,
 2 if protective flag is set, there is a matched item, and it
 provides protection.
<br />

<dt class="autodocfuncname"><a name="query_wearing">
query_wearing</a><pre class="autodocfuncdef">
object * query_wearing()
</pre><dd><br />
This method returns all the objects you are currently wearing.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the current array of worn objects the array of worn stuff<br /><br />
<dd><b>See also:</b>
<br /><a href="#query_armours">query_armours()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="register_armour_callback">
register_armour_callback</a><pre class="autodocfuncdef">
int register_armour_callback(int level,
mixed callback,
mixed data)
</pre><dd><br />
Register a callback for magical protection.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
level - How close the protection is to the skin.<br />
callback - The object & function to be called.<br />
data - Any extra data to be passed.<br />
<br />
<dd><b>Returns:</b>
<br />an ID to identify this callback.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="remove_armour">
remove_armour</a><pre class="autodocfuncdef">
int remove_armour(object thing)
</pre><dd><br />
This method will remove the armour from the living object.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
thing - the armour to remove<br />
<br />
<dd><b>Returns:</b>
<br />1 if was unsuccessful and 0 if it was successful<br /><br />
<dd><b>See also:</b>
<br /><a href="#wear_armour">wear_armour()</a>, <a href="#query_armours">query_armours()</a> and <a href="#query_wearing">query_wearing()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="remove_armour_callback">
remove_armour_callback</a><pre class="autodocfuncdef">
int remove_armour_callback(int level,
int id)
</pre><dd><br />
Remove a registered callback, used when the protection ends.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
level - The level of the callback<br />
id - The callbacks ID.
<br />
<br />
<dd><b>See also:</b>
<br /><a href="#register_armour_callback">register_armour_callback()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="set_skin">
set_skin</a><pre class="autodocfuncdef">
void set_skin(string word)
</pre><dd><br />
This method sets the current skin of the living object.  This can
be done by the race object and by specific spells or effects.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
word - the new skin type<br />
<br />
<dd><b>See also:</b>
<br /><a href="#query_skin">query_skin()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="set_stopped">
set_stopped</a><pre class="autodocfuncdef">
void set_stopped(mixed arg)
</pre><dd><br />
This method sets the object which stops the call.  This should be
used to do weird stuff.  I have no idea what it should be used for
at all and I am just rambling.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
arg - the new value of the stopped object
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="update_armour_callback">
update_armour_callback</a><pre class="autodocfuncdef">
int update_armour_callback(int level,
int id,
mixed data)
</pre><dd><br />
Update the data for an armour callback.
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
level - The level of the callback<br />
id - The callbacks ID.<br />
data - The new data.
<br />
<br />
<dd><b>See also:</b>
<br /><a href="#register_armour_callback">register_armour_callback()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="wear_armour">
wear_armour</a><pre class="autodocfuncdef">
string wear_armour(object armour,
int doing_hold)
</pre><dd><br />
This is the method used to get the living object to wear a piece of
armour or clothing.  This is called from inside the armour or clothing
code itself.  It will call the function set_worn_by() on the
armour or clothing and if this returns a non-zero result then it
will add it into the current list of worn types.  Assuming the
type of the armour fits into the allowed list.  It will also
call the functon hold_item on the object if it is required to be
held as well (ie: shield).<br />
<br /><dl>
<dd><b>Parameters:</b><br />
armour - the armour to wear<br />
doing_hold - if this is called by the hold command<br />
<br />
<dd><b>Returns:</b>
<br />the failure message, or 0 if ok<br /><br />
<dd><b>See also:</b>
<br /><a href="#remove_armour">remove_armour()</a>, <a href="#query_armours">query_armours()</a> and <a href="#query_wearing">query_wearing()
</a><br /><br /><br /></dl>

</dl>
<h2>Protected Functions</h2>
These are functions that only objects inheriting the class can access.<p>
<dl>
<dt class="autodocfuncname"><a name="equivalent_armour_types">
equivalent_armour_types</a><pre class="autodocfuncdef">
int equivalent_armour_types(mixed comp,
string type)
</pre><dd><br />
This method checks to see if the two armour types are
equivilant or not.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
comp - the first type<br />
type - the second type
<br />
<br />
<br /></dl>

</dl>
[an error occurred while processing this directive]

