[Package Index | Mudlib Index | Effect Index]

File /std/races/base.c

The base object which all races will be inherited from.

Written by Pinkfish

Started 1992 sometime

Inherits

This class inherits the following classes /std/object.c

Includes

This class includes the following files /include/bit.h and /include/light.h

Method index

Public Functions

These are functions that everyone can access.

add_ac
void add_ac(string ac_name,
            string ac_type,
            mixed ac_amount)

Adds a default ac to the npc for when they fight unarmed. Please look add the armour object for more details on this.

Parameters:
ac_name - the name of the ac
ac_type - the type of the ac
ac_amount - the damage/roll stuff to take off

See also:
query_acs()


add_attack
void add_attack(string attack_name,
                int attack_chance,
                int * attack_data)

This method adds a default attack to the npc. Please see the help on the weapons for more details on this.

Parameters:
attack_name - the name of the attack
attack_chance - the chance of the attack occuring
attack_data - the damage roll for the attack

See also:
query_attacks()


add_bit
void add_bit(string bit_short,
             string bit_name,
             mixed * bit_array)

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

Parameters:
bit_short - the short of the bit
bit_name - the name of the bit
bit_array - the array of children bits

See also:
query_bits() and remove_bit()


add_bit_alias
void add_bit_alias(string alias,
                   string name)

This method adds in an alias for the specified bit name.

Parameters:
alias - the alias of the bit
name - the name of the bit it is aliased to


find_limbs
void find_limbs()

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.

See also:
query_limbs()


modifier
int modifier(int number)

This method figures out a modifier for the height based on the base weight and height.

Parameters:
number - the height/weight to modify

Returns:
the modified heigh/weight


query_acs
mixed * query_acs()

The defaults acs for npcs when they are fighting unarmed.

Returns:
the default acs

See also:
add_ac()


query_attacks
mixed * query_attacks()

The default attacks for the npc when they are fighting unarmed.

Returns:
the default attacks

See also:
add_attack()


query_bit
mixed * query_bit(string word)

This method returns the bits which are children of the specified bit.

Parameters:
word - the bit to look for the children of

Returns:
the children bits

See also:
add_bit(), query_bits() and remove_bit()


query_bit_length
int query_bit_length(string word,
                     int length)

This method returns the length of the specified bit.

Parameters:
word - the bit to find

Returns:
the length


query_bit_width
int query_bit_width(string word,
                    int width)

This method returns the width of the specified bit.

Parameters:
word - the bit to find

Returns:
the width


query_bits
mixed * query_bits()

This method returns all the bits for the npc.

Returns:
the complete array of bits

See also:
add_bit(), query_bit(), query_possible_bits(), query_all_inedible(), query_all_unrottable(), query_all_pluckable() and remove_bit()


query_dark
int query_dark(int light)

Determines if the race thinks it is dark or light.

Returns:
0 for normal, -1 for dark, -2 for pitch dark, 1 for bright, 2 for toobright

See also:
set_sight() and query_sight()


query_desc
string query_desc(object thing)

This method returns the current description of the npc.

Parameters:
thing - the object which is being described

Returns:
the description of the npc

See also:
query_desc()


query_height
int query_height()

This method returns the base height of the npc type.

Returns:
the current base height

See also:
set_height()


query_length
int query_length()

This method returns the standard length of the race.

Returns:
the standard length of the race


query_limbs
string * query_limbs()

This method returns the current limbs of the race.

Returns:
the limbs on the race

See also:
find_limbs()


query_number_worn
int query_number_worn(string type)

This method figures out how many of each sort of thing can be worn.

Parameters:
type - the type to check for numbers worn

Returns:
the number of type to worn


query_possible_bits
string * query_possible_bits(string word)

This method returns the names of all the possible bits for the npc.

Parameters:
word - the bits to look for the children under

Returns:
the array of possible bit names

See also:
add_bit(), query_bits(), query_possible_plural_bits() and remove_bit()


query_possible_plural_bits
string * query_possible_plural_bits(string word)

This method returns the plural names for all the bits.

Parameters:
word - the bit to find the children of

Returns:
the plural names of all the bits

See also:
add_bit(), query_bits(), query_possible_bits() and remove_bit()


query_sight
int * query_sight()

Thie method returns the values of the race which determine visibility. It returns an array of the format:
({
   dark
   pitch dark,
   bright light,
   bright
})


Returns:
the sight array as detailed above

See also:
set_sight() and query_dark()


query_skin
string query_skin()

This method returns the current skin of the race.

Returns:
the current skin of the race

See also:
set_skin()


query_stats
int * query_stats()

This method queries the default bonus stat values for the race.
({
  con,
  dex,
  int,
  str,
  wiz
})


Returns:
the current stat offsets

See also:
set_stats()


query_width
int query_width()

This method returns the standard width of the race.

Returns:
the standard width of the race


remove_bit
void remove_bit(string word)

This method removes a bit from the current bit array

Parameters:
word - the name of the bit to remove

See also:
add_bit() and query_bits()


set_desc
void set_desc(string words)

This method sets the description for the npc.

Parameters:
words - the description of the npc

See also:
set_desc()


set_height
void set_height(int number)

This method sets the base height of the npc type.

Parameters:
number - the new height

See also:
query_height()


set_length
void set_length(int length)

This method sets the standard length of the race.

Parameters:
length - the standard length


set_sight
void set_sight(int * numbers)

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.
({
   pitch dark,
   dark,
   bright,
   bright light
})


Parameters:
numbers - as detailed above

See also:
query_sight() and query_dark()


set_skin
void set_skin(string word)

This method sets the skin of the race. This is what is given back when the npc's corpse is skinned.

Parameters:
word - the skin of the race

See also:
query_skin()


set_stats
void set_stats(int * numbers)

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.
({
  con,
  dex,
  int,
  str,
  wis
})


Parameters:
numbers - sets the default bonuses for the stats

See also:
query_stats()


set_width
void set_width(int width)

This method sets the standard width of the race.

Parameters:
width - the standard width


start_player
void start_player(object thing)

This method is called when the npc is first created. This sets up the weight/height/stats etc.

Parameters:
thing - the npc being created