[ Package Index | Mudlib Index | Effect Index ]

File /std/skills.c

This is the skills handler. It controls all the skills currently in the game and keeps track of their various properties.

Written by Pinkfish


Includes

This class includes the following files /include/language.h and /include/skills.h

Method index

 o is_skill_ignored(string)
This method returns 1 if the skill being asked about should be ignored.
 o query_all_children(string)
This method returns all the children of the specified skill.
 o query_allowed_to_teach(string)
This method checks to see if this particular skill is allowed to be taught to people.
 o query_children(mixed *, string)
This method returns the children of the specified skill chunk.
 o query_immediate_children(string)
This method returns the immediate children of the specified skill.
 o query_no_bonus(string)
This method checks to see if the specified skill has no bonus associated with it.
 o query_only_leaf(string)
This method determines if only leaf skills can be increased in this skill tree.
 o query_only_show_if_non_zero(string)
This method checks to see if the skill should only be shown on the skill list if it is non-zero.
 o query_reg_skills()
This method returns the all of the skills with their children and the number of children in a nice mapping.
 o query_related_skills(string)
This method also returns all the children of a skill.
 o query_skill(string *)
This method attempts to figure out the path of a skill from an array of bits.
 o query_skill_cost(string)
This method returns the cost of the specified skill.
 o query_skill_depth(string *)
This method returns the skill depth for teaching calculations.
 o query_skill_path(string)
This method returns the path to skill.
 o query_skill_stat(string)
This method returns the stats that effect the skill.
 o query_skill_tree(string)
This method returns the skill and all of its parents leading up to it.
 o query_skills()
This method returns the raw unfluffed skill array.

Public Functions

These are functions that everyone can access.

.
 * is_skill_ignored
int is_skill_ignored(string skill)
This method returns 1 if the skill being asked about should be ignored. An ignored skill means that up to this point the fact it is this deep is ignored. For example,if 'crafts' is ignored then 'crafts.smithing' would count as if it was a top level skill.

Parameters:
skill - the skill to check
 * query_all_children
string * query_all_children(string skill)
This method returns all the children of the specified skill. This does a deep children finding exercise, returing all the children as it goes lower and lower into the array.

Parameters:
skill - the skill to get the children of
Returns:
all the children
See also:
query_related_skills()
 * query_allowed_to_teach
int query_allowed_to_teach(string str)
This method checks to see if this particular skill is allowed to be taught to people.

Parameters:
str - the skill to check
Returns:
1 if they are not allowed to teach it, 0 if they are
 * query_children
string * query_children(mixed * arr,
                        string path)
This method returns the children of the specified skill chunk. You need to pass into this array a skill chunk as taken from the skill array. It is recursive and returns all the internal children as well.

Parameters:
arr - the skill chunk
path - the skill bit leading up to this section
Returns:
the children of the skill chunk
 * query_immediate_children
string * query_immediate_children(string skill)
This method returns the immediate children of the specified skill.

Parameters:
skill - the skill to get the children of
Returns:
the immediate children of the skill
 * query_no_bonus
int query_no_bonus(string str)
This method checks to see if the specified skill has no bonus associated with it.

Parameters:
str - the skill to check
Returns:
1 if there is no bonus, 0 if there is a bonus
 * query_only_leaf
int query_only_leaf(string str)
This method determines if only leaf skills can be increased in this skill tree. This is used for the other skill tree, to avoid increasing all the other skills at the same time.

Parameters:
str - the skill tree to check
Returns:
1 if the tree is only leaf, 0 if not
 * query_only_show_if_non_zero
int query_only_show_if_non_zero(string str)
This method checks to see if the skill should only be shown on the skill list if it is non-zero.

Parameters:
str - the skill to check
Returns:
1 if should only show non-zero skills, 0 if show any skill
 * query_reg_skills
mapping query_reg_skills()
This method returns the all of the skills with their children and the number of children in a nice mapping. The key of the mapping is the name of the skill, the value is an array of two elements. The first is an array of all the children and the second is the number of children of the skill.

Returns:
the mapping as described above
 * query_related_skills
string * query_related_skills(string skill)
This method also returns all the children of a skill. It preforms exactly the same action as query_all_children()

Parameters:
skill - the skill to get the children of
Returns:
the children of the skill
 * query_skill
string query_skill(string * bits)
This method attempts to figure out the path of a skill from an array of bits. It verifies that the skill actually exists on the way.

Parameters:
bits - the skill to check
Returns:
the path of the skill
 * query_skill_cost
int query_skill_cost(string skill)
This method returns the cost of the specified skill. This is the the number of children it has.

Parameters:
skill - the skill to check the cost of
Returns:
the costof the skill
 * query_skill_depth
int query_skill_depth(string * skill)
This method returns the skill depth for teaching calculations.

Parameters:
skill - the skill to get the depth of
Returns:
the skill depth
 * query_skill_path
string * query_skill_path(string skill)
This method returns the path to skill. This is essentially the skill name broken up on '.'s and returned as an array.

Returns:
the skill path, or 0 if the skill does not exist
 * query_skill_stat
string query_skill_stat(string skill)
This method returns the stats that effect the skill.

Parameters:
skill - the skill to check
Returns:
the stats that effect the skill
 * query_skill_tree
string * query_skill_tree(string skill)
This method returns the skill and all of its parents leading up to it.

Parameters:
skill - the skill to get the tree of
Returns:
the skill tree of the skill
Example:
query_skill_tree("magic.methods.physical.binding")
Returns: ({
 "magic.methods.physical.binding",
 "magic.methods.physical",
 "magic.methods",
 "magic"
})
 * query_skills
mixed * query_skills()
This method returns the raw unfluffed skill array. This is the same as the skill array defined in /include/skills.h plus the language skills and other dynamic skills added.

Returns:
the skills array
See also:
/include/skills.h

Discworld MUD's distribution world wide web pages.
brought to you by
Cut Me Own Throat Dibbler's Sensational Sausages; buy one while they are hot.
File last modified: Sat, 06 Sep 2003 04:20:41 GMT

Lost? Try Discworld's home page.