[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/races/base.c</h2>
The base object which all races will be inherited from.<p>Written by Pinkfish<p>Started 1992 sometime
<h2>Inherits</h2>
This class inherits the following classes <a href="std.object.c.shtml">/std/object.c</a><h2>Includes</h2>
This class includes the following files <a href="include.bit.h.shtml">/include/bit.h</a> and /include/light.h<h2>Method index</h2>
<ul>
<li><a href="#add_ac">add_ac</a>(string, string, mixed)<br/>
Adds a default ac to the npc for when they fight unarmed.
<li><a href="#add_attack">add_attack</a>(string, int, int *)<br/>
This method adds a default attack to the npc.
<li><a href="#add_bit">add_bit</a>(string, string, mixed *)<br/>
This method adds a bit to the current bit setup.
<li><a href="#add_bit_alias">add_bit_alias</a>(string, string)<br/>
This method adds in an alias for the specified bit name.
<li><a href="#find_limbs">find_limbs</a>()<br/>
This method figures out the current set of limbs on the race.
<li><a href="#modifier">modifier</a>(int)<br/>
This method figures out a modifier for the height based on the base
weight and height.
<li><a href="#query_acs">query_acs</a>()<br/>
The defaults acs for npcs when they are fighting unarmed.
<li><a href="#query_attacks">query_attacks</a>()<br/>
The default attacks for the npc when they are fighting unarmed.
<li><a href="#query_bit">query_bit</a>(string)<br/>
This method returns the bits which are children of the specified bit.
<li><a href="#query_bit_length">query_bit_length</a>(string, int)<br/>
This method returns the length of the specified bit.
<li><a href="#query_bit_width">query_bit_width</a>(string, int)<br/>
This method returns the width of the specified bit.
<li><a href="#query_bits">query_bits</a>()<br/>
This method returns all the bits for the npc.
<li><a href="#query_dark">query_dark</a>(int)<br/>
Determines if the race thinks it is dark or light.
<li><a href="#query_desc">query_desc</a>(object)<br/>
This method returns the current description of the npc.
<li><a href="#query_height">query_height</a>()<br/>
This method returns the base height of the npc type.
<li><a href="#query_length">query_length</a>()<br/>
This method returns the standard length of the race.
<li><a href="#query_limbs">query_limbs</a>()<br/>
This method returns the current limbs of the race.
<li><a href="#query_number_worn">query_number_worn</a>(string)<br/>
This method figures out how many of each sort of thing
can be worn.
<li><a href="#query_possible_bits">query_possible_bits</a>(string)<br/>
This method returns the names of all the possible bits for the
npc.
<li><a href="#query_possible_plural_bits">query_possible_plural_bits</a>(string)<br/>
This method returns the plural names for all the bits.
<li><a href="#query_sight">query_sight</a>()<br/>
Thie method returns the values of the race which determine visibility.
<li><a href="#query_skin">query_skin</a>()<br/>
This method returns the current skin of the race.
<li><a href="#query_stats">query_stats</a>()<br/>
This method queries the default bonus stat values for the race.
<li><a href="#query_width">query_width</a>()<br/>
This method returns the standard width of the race.
<li><a href="#remove_bit">remove_bit</a>(string)<br/>
This method removes a bit from the current bit array
<li><a href="#set_desc">set_desc</a>(string)<br/>
This method sets the description for the npc.
<li><a href="#set_height">set_height</a>(int)<br/>
This method sets the base height of the npc type.
<li><a href="#set_length">set_length</a>(int)<br/>
This method sets the standard length of the race.
<li><a href="#set_sight">set_sight</a>(int *)<br/>
Thie method sets the current sight array for the npc.
<li><a href="#set_skin">set_skin</a>(string)<br/>
This method sets the skin of the race.
<li><a href="#set_stats">set_stats</a>(int *)<br/>
This method sets the current default bonuses of the stats.
<li><a href="#set_width">set_width</a>(int)<br/>
This method sets the standard width of the race.
<li><a href="#start_player">start_player</a>(object)<br/>
This method is called when the npc is first created.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="add_ac">
add_ac</a><pre class="autodocfuncdef">
void add_ac(string ac_name,
            string ac_type,
            mixed ac_amount)
</pre><dd><br />
Adds a default ac to the npc for when they fight unarmed.  Please look
add the armour object for more details on this.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
ac_name - the name of the ac<br />
ac_type - the type of the ac<br />
ac_amount - the damage/roll stuff to take off<br />
<br />
<dd><b>See also:</b>
<br /><a href="#query_acs">query_acs()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="add_attack">
add_attack</a><pre class="autodocfuncdef">
void add_attack(string attack_name,
                int attack_chance,
                int * attack_data)
</pre><dd><br />
This method adds a default attack to the npc.  Please see the
help on the weapons for more details on this.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
attack_name - the name of the attack<br />
attack_chance - the chance of the attack occuring<br />
attack_data - the damage roll for the attack<br />
<br />
<dd><b>See also:</b>
<br /><a href="#query_attacks">query_attacks()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="add_bit">
add_bit</a><pre class="autodocfuncdef">
void add_bit(string bit_short,
             string bit_name,
             mixed * bit_array)
</pre><dd><br />
This method adds a bit to the current bit setup.

bit_array structure is: ({ parent_bit, set_weight(), number_of_bits, 
child_bit, child_bit, .. (as many child bits as there are) })

parent_bit: should be 0 for the corpse as a whole to be the parent, 
            should be "name of parent bit" for the bit being added to be 
              a child of the "name of the parent bit", e.g. a toe in a foot.

set_weight: see help for set_weight

number_of_bits: how many there are in the parent_bit 

child_bit: which child bits this bit has 
<br />
<br /><dl>
<dd><b>Parameters:</b><br />
bit_short - the short of the bit<br />
bit_name - the name of the bit<br />
bit_array - the array of children bits<br />
<br />
<dd><b>See also:</b>
<br /><a href="#query_bits">query_bits()</a> and <a href="#remove_bit">remove_bit()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="add_bit_alias">
add_bit_alias</a><pre class="autodocfuncdef">
void add_bit_alias(string alias,
                   string name)
</pre><dd><br />
This method adds in an alias for the specified bit name.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
alias - the alias of the bit<br />
name - the name of the bit it is aliased to
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="find_limbs">
find_limbs</a><pre class="autodocfuncdef">
void find_limbs()
</pre><dd><br />
This method figures out the current set of limbs on the race.  A creature
is assigned one "limb" for every "hand" found in the body part array.  The
number of limbs is the number of weapons that can be held.<br />
<br /><dl>
<dd><b>See also:</b>
<br /><a href="#query_limbs">query_limbs()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="modifier">
modifier</a><pre class="autodocfuncdef">
int modifier(int number)
</pre><dd><br />
This method figures out a modifier for the height based on the base
weight and height.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
number - the height/weight to modify<br />
<br />
<dd><b>Returns:</b>
<br />the modified heigh/weight
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_acs">
query_acs</a><pre class="autodocfuncdef">
mixed * query_acs()
</pre><dd><br />
The defaults acs for npcs when they are fighting unarmed.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the default acs<br /><br />
<dd><b>See also:</b>
<br /><a href="#add_ac">add_ac()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_attacks">
query_attacks</a><pre class="autodocfuncdef">
mixed * query_attacks()
</pre><dd><br />
The default attacks for the npc when they are fighting unarmed.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the default attacks<br /><br />
<dd><b>See also:</b>
<br /><a href="#add_attack">add_attack()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_bit">
query_bit</a><pre class="autodocfuncdef">
mixed * query_bit(string word)
</pre><dd><br />
This method returns the bits which are children of the specified bit.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
word - the bit to look for the children of<br />
<br />
<dd><b>Returns:</b>
<br />the children bits<br /><br />
<dd><b>See also:</b>
<br /><a href="#add_bit">add_bit()</a>, <a href="#query_bits">query_bits()</a> and <a href="#remove_bit">remove_bit()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_bit_length">
query_bit_length</a><pre class="autodocfuncdef">
int query_bit_length(string word,
                     int length)
</pre><dd><br />
This method returns the length of the specified bit.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
word - the bit to find<br />
<br />
<dd><b>Returns:</b>
<br />the length
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_bit_width">
query_bit_width</a><pre class="autodocfuncdef">
int query_bit_width(string word,
                    int width)
</pre><dd><br />
This method returns the width of the specified bit.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
word - the bit to find<br />
<br />
<dd><b>Returns:</b>
<br />the width
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_bits">
query_bits</a><pre class="autodocfuncdef">
mixed * query_bits()
</pre><dd><br />
This method returns all the bits for the npc.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the complete array of bits<br /><br />
<dd><b>See also:</b>
<br /><a href="#add_bit">add_bit()</a>, <a href="#query_bit">query_bit()</a>, <a href="#query_possible_bits">query_possible_bits()</a>, <a href="#query_all_inedible">query_all_inedible()</a>, <a href="#query_all_unrottable">query_all_unrottable()</a>, <a href="#query_all_pluckable">query_all_pluckable()</a> and <a href="#remove_bit">remove_bit()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_dark">
query_dark</a><pre class="autodocfuncdef">
int query_dark(int light)
</pre><dd><br />
Determines if the race thinks it is dark or light.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />0 for normal, -1 for dark, -2 for pitch dark, 1 for bright,
2 for toobright<br /><br />
<dd><b>See also:</b>
<br /><a href="#set_sight">set_sight()</a> and <a href="#query_sight">query_sight()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_desc">
query_desc</a><pre class="autodocfuncdef">
string query_desc(object thing)
</pre><dd><br />
This method returns the current description of the npc.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
thing - the object which is being described<br />
<br />
<dd><b>Returns:</b>
<br />the description of the npc<br /><br />
<dd><b>See also:</b>
<br /><a href="#query_desc">query_desc()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_height">
query_height</a><pre class="autodocfuncdef">
int query_height()
</pre><dd><br />
This method returns the base height of the npc type.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the current base height<br /><br />
<dd><b>See also:</b>
<br /><a href="#set_height">set_height()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_length">
query_length</a><pre class="autodocfuncdef">
int query_length()
</pre><dd><br />
This method returns the standard length of the race.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the standard length of the race
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_limbs">
query_limbs</a><pre class="autodocfuncdef">
string * query_limbs()
</pre><dd><br />
This method returns the current limbs of the race.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the limbs on the race<br /><br />
<dd><b>See also:</b>
<br /><a href="#find_limbs">find_limbs()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_number_worn">
query_number_worn</a><pre class="autodocfuncdef">
int query_number_worn(string type)
</pre><dd><br />
This method figures out how many of each sort of thing
can be worn.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
type - the type to check for numbers worn<br />
<br />
<dd><b>Returns:</b>
<br />the number of type to worn
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_possible_bits">
query_possible_bits</a><pre class="autodocfuncdef">
string * query_possible_bits(string word)
</pre><dd><br />
This method returns the names of all the possible bits for the
npc.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
word - the bits to look for the children under<br />
<br />
<dd><b>Returns:</b>
<br />the array of possible bit names<br /><br />
<dd><b>See also:</b>
<br /><a href="#add_bit">add_bit()</a>, <a href="#query_bits">query_bits()</a>, <a href="#query_possible_plural_bits">query_possible_plural_bits()</a> and <a href="#remove_bit">remove_bit()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_possible_plural_bits">
query_possible_plural_bits</a><pre class="autodocfuncdef">
string * query_possible_plural_bits(string word)
</pre><dd><br />
This method returns the plural names for all the bits.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
word - the bit to find the children of<br />
<br />
<dd><b>Returns:</b>
<br />the plural names of all the bits<br /><br />
<dd><b>See also:</b>
<br /><a href="#add_bit">add_bit()</a>, <a href="#query_bits">query_bits()</a>, <a href="#query_possible_bits">query_possible_bits()</a> and <a href="#remove_bit">remove_bit()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_sight">
query_sight</a><pre class="autodocfuncdef">
int * query_sight()
</pre><dd><br />
Thie method returns the values of the race which determine visibility.
It returns an array of the format:<br>
<pre>({
   dark
   pitch dark,
   bright light,
   bright
})</pre><br />
<br /><dl>
<dd><b>Returns:</b>
<br />the sight array as detailed above<br /><br />
<dd><b>See also:</b>
<br /><a href="#set_sight">set_sight()</a> and <a href="#query_dark">query_dark()
</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 race.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the current skin of the race<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_stats">
query_stats</a><pre class="autodocfuncdef">
int * query_stats()
</pre><dd><br />
This method queries the default bonus stat values for the race.<br>
<pre>({
  con,
  dex,
  int,
  str,
  wiz
})</pre><br />
<br /><dl>
<dd><b>Returns:</b>
<br />the current stat offsets<br /><br />
<dd><b>See also:</b>
<br /><a href="#set_stats">set_stats()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_width">
query_width</a><pre class="autodocfuncdef">
int query_width()
</pre><dd><br />
This method returns the standard width of the race.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the standard width of the race
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="remove_bit">
remove_bit</a><pre class="autodocfuncdef">
void remove_bit(string word)
</pre><dd><br />
This method removes a bit from the current bit array<br />
<br /><dl>
<dd><b>Parameters:</b><br />
word - the name of the bit to remove<br />
<br />
<dd><b>See also:</b>
<br /><a href="#add_bit">add_bit()</a> and <a href="#query_bits">query_bits()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="set_desc">
set_desc</a><pre class="autodocfuncdef">
void set_desc(string words)
</pre><dd><br />
This method sets the description for the npc.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
words - the description of the npc<br />
<br />
<dd><b>See also:</b>
<br /><a href="#set_desc">set_desc()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="set_height">
set_height</a><pre class="autodocfuncdef">
void set_height(int number)
</pre><dd><br />
This method sets the base height of the npc type.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
number - the new height<br />
<br />
<dd><b>See also:</b>
<br /><a href="#query_height">query_height()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="set_length">
set_length</a><pre class="autodocfuncdef">
void set_length(int length)
</pre><dd><br />
This method sets the standard length of the race.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
length - the standard length
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_sight">
set_sight</a><pre class="autodocfuncdef">
void set_sight(int * numbers)
</pre><dd><br />
Thie method sets the current sight array for the npc.  This sets the
levels at which the race things things are too dark/too bright.<br>
<pre>({
   pitch dark,
   dark,
   bright,
   bright light
})</pre><br />
<br /><dl>
<dd><b>Parameters:</b><br />
numbers - as detailed above<br />
<br />
<dd><b>See also:</b>
<br /><a href="#query_sight">query_sight()</a> and <a href="#query_dark">query_dark()
</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 skin of the race.  This is what is given back
when the npc's corpse is skinned.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
word - the skin of the race<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_stats">
set_stats</a><pre class="autodocfuncdef">
void set_stats(int * numbers)
</pre><dd><br />
This method sets the current default bonuses of the stats.  The parameter
is an array of numbers, with the numbers corresponding to the stats as
shown below.  It is highly inadvisable to set any stat bonus to less than
-6, since in conjunction with the guild stat settings this could combine
to give a negative total for that stat.  Negative stats can cause
permanent unconsciousness.
<pre>({
  con,
  dex,
  int,
  str,
  wis
})</pre><br />
<br /><dl>
<dd><b>Parameters:</b><br />
numbers - sets the default bonuses for the stats<br />
<br />
<dd><b>See also:</b>
<br /><a href="#query_stats">query_stats()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="set_width">
set_width</a><pre class="autodocfuncdef">
void set_width(int width)
</pre><dd><br />
This method sets the standard width of the race.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
width - the standard width
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="start_player">
start_player</a><pre class="autodocfuncdef">
void start_player(object thing)
</pre><dd><br />
This method is called when the npc is first created.  This sets up
the weight/height/stats etc.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
thing - the npc being created
<br />
<br />
<br /></dl>

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

