[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/philosophies.c

This handler contains all the information on the philosophies used in philosphical debates.

Written by Deutha

Method index

Public Functions

These are functions that everyone can access.

add_known
void add_known(string person,
               string argument)

This method adds an argument to the specified person.

Parameters:
person - the person to add the argument to
argument - the argument to add to the person

See also:
query_known() and query_all_known()


add_philosophy
void add_philosophy(string name,
                    string type,
                    int bonus,
                    string needed,
                    string effect)

This method adds a philosphy into the current list of philosphies.

Parameters:
name - the name of the philosophy
type - the type of the philosophy
bonus - the bonus of the philosophy
needed - the string describing what you need
effect - the effect of the philosphy

See also:
query_philosophy(), query_philosophy_names() and remove_philosophy()

Example:
add_philosophy("theology", "faith", 50, "the power of your faith",
               "/std/effects/religious/theological_debate");

add_philosophy_argument
void add_philosophy_argument(string name,
                             string argument,
                             mixed args)

This method adds in a philosophy argument to the specified philosophy.

Parameters:
name - the name of the philosophy to add
argument - the name of the argument to add
args - the parameters for the argument

See also:
query_philosophy_argument() and remove_philosophy_argument()


query_all_known
string * query_all_known(string person)

This method returns all the arguments known to the person.

Parameters:
person - the person to get the arguments for

Returns:
the list of all the known arguments

See also:
query_known() and add_known()


query_known
int query_known(string person,
                string argument)

This method checks to see if the person knows the argument.

Parameters:
person - the person to check the argument for
argument - the argument to check to see if it is known

Returns:
1 if it is known, 0 if not.

See also:
add_known() and query_all_known()


query_philosophies
mapping query_philosophies()

This method returns the current set of philosphies available. The mapping consists of the value being the name of the philosphy and the value being an array consisting of 5 elements. You should be using this call for anything except debugging purposes. It would create a bad dependancy otherwise.
name : ({
      [string]  type (i.e. type.points is used),
      [int]     bonus (i.e. bonus in type.points that is needed),
      [string]  what is needed/increased to start,
      [string]  debate effect file name,
      [mapping] arguments
    })


Returns:
a mapping of values

See also:
query_philosophy_names()


query_philosophy
int query_philosophy(string name)

This method determines if the named philosphy exists.

Parameters:
name - the name of the philosphy to test

Returns:
1 if it exists, 0 if it does not

See also:
query_philosophy_names(), add_philosophy() and remove_philosophy()


query_philosophy_all_arguments
mapping query_philosophy_all_arguments(string name)

This method returns the arguments of the philosophy. This returns a mapping containing the argument values. This should not be used except for debuggin purposes.

Parameters:
name - the name of the philosophy to get the arguments for

Returns:
the arguments for the philosophy

See also:
query_philosphy_bonus(), query_philosphy_type(), query_philosphy_needed(), query_philosphy_effect() and query_philosphy_argument()


query_philosophy_argument
mixed query_philosophy_argument(string name,
                                string argument)

This method returns the values for the specific argument in philosophy. The returned array consists of three values, they are ({ skill, something, something }).

Parameters:
name - the name of the philosphy to get the arguments for
argument - the name of the argument to return

Returns:
an array of the arguments values

See also:
query_philosphy_bonus(), query_philosphy_type(), query_philosphy_needed(), query_philosphy_effect(), add_philosphy_argument() and remove_philosphy_argument()


query_philosophy_bonus
int query_philosophy_bonus(string name)

This method returns the bonus of the philosophy. An example of the return value from this is 50.

Parameters:
name - the name of the philosophy to get the bonus of

Returns:
the bonus of the philosophy

See also:
query_philosphy_type(), query_philosphy_effect(), query_philosphy_needed() and query_philosphy_argument()


query_philosophy_effect
string query_philosophy_effect(string name)

This method returns the effect of the philosophy. An example of the return value from this is "/std/effects/religious/theological_debate".

Parameters:
name - the name of the philosophy to get the effect of

Returns:
the effect of the philosophy

See also:
query_philosphy_bonus(), query_philosphy_type(), query_philosphy_needed() and query_philosphy_argument()


query_philosophy_names
string * query_philosophy_names()

This method returns the names of all the current philosophies.

Returns:
an array of strings of the names of philosophies

See also:
query_philosophy(), add_philosophy() and remove_philosophy()


query_philosophy_needed
string query_philosophy_needed(string name)

This method returns the needed string of the philosophy. An example of the return value from this is "the power of your faith".

Parameters:
name - the name of the philosophy to get the needes string for

Returns:
the needed string for the philosophy

See also:
query_philosphy_bonus(), query_philosphy_effect(), query_philosphy_type() and query_philosphy_argument()


query_philosophy_type
string query_philosophy_type(string name)

This method returns the type of the philosophy. An example of the return value from this is "faith".

Parameters:
name - the name of the philosophy to get the type of

Returns:
the type of the philosophy

See also:
query_philosphy_bonus(), query_philosphy_effect(), query_philosphy_needed() and query_philosphy_argument()


remove_known
int remove_known(string person,
                 string argument)

This method removes an argument from the specified person.

Parameters:
person - the person to remove the argument from
argument - the argument to remove from the person

See also:
query_known() and query_all_known()


remove_philosophy
void remove_philosophy(string name)

This method removes the specified philosophy from the current list.

Parameters:
name - the name of the philosphy to remove

See also:
query_philosophy(), query_philosophy_names() and add_philosophy()


remove_philosophy_argument
void remove_philosophy_argument(string name,
                                string argument)

This method removes a specified argument from the philosophy.

Parameters:
name - the name of the philosphy to remove the argument form
argument - the argument name to remove

See also:
add_philosophy_argument() and query_philosoph_argument()


reset_known
int reset_known(string person)

This method resets the argument list for the specified person.

Parameters:
person - the person to remove the argument from

See also:
query_known() and query_all_known()


save_me
void save_me()

This method saves the current state of the object.