[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/new_soul.c

The soul handler for Discworld. Handles the soul definitions and the mangling needed to print the output for the players.

Written by Pinkfish

Includes

This class includes the following files /include/soul.h, /include/obj_parser.h, /include/user_parser.h, /include/playtesters.h and /include/player.h

Method index

Public Functions

These are functions that everyone can access.

add_soul_command
void add_soul_command(string name,
                      mixed data)

Adds in a soul command. Only allows additions from the soul compiler.

Parameters:
name - the name of the soul command
data - the data associated with the soul command

See also:
/obj/handlers/soul_compiler.c


clean_cache
void clean_cache()
command_control
int command_control(string verb,
                    object * obs,
                    string str,
                    string in_dir_match,
                    string * args,
                    string pattern)

The main soul handling bit. This is called by the add_command code when a soul command is matched.

Parameters:
verb - the verb matched
obs - the objects to do the soul command on
in_dir_match - the name which was matched for the peoples names
args - the values of the string and stuff
pattern - the pattern which was matched.

Returns:
1 if the command succeeded, 0 if it failed


delete_soul_command
void delete_soul_command(string name)

Deletes the soul command. This is used to remove soul commands that are no longer used.

Parameters:
name - the soul command name to delete


do_force
void do_force(mixed * arr)

Attempts to do the force on the player.

Parameters:
arr - the args used to force


extract_filenames
string * extract_filenames(string str)
get_name
string get_name(object ob,
                int use_name,
                int type)
get_souls
string * get_souls(string category,
                   int a_r_t_w)

This method gets an array of souls of the desired category.

Parameters:
category - The category of souls. You can choose either sub categories like "happiness_laugh" or full categories like "happiness". A list can be seen with query_soul_categories(). There are a few special categories not listed including "touch", "nice" and "nasty".
a_r_t_w - Set this to 1 if you want the souls to have the "@" in front that they need for an add_respond_to_with, and 0 for just the souls.

Returns:
An array of the souls matching the category.

See also:
query_soul_categories.c, get_words.c and query_word_categories .c

Example:
 string *souls;

 souls = ("/obj/handlers/soul_categories")->get_souls( "laughter", 1 );

 if( sizeof( souls ) ) {
   add_respond_to_with( ({ souls }), "you" }), "'Stop laughing at me!" );
 }

help_list
string help_list()

The list of soul comands in the look at soul function.

Returns:
the list of all the soul commands formated for the screen


help_string
string help_string(string verb)

Returns the help string for the soul command. Creates a nice help message for the passed soul command.

Parameters:
verb - the soul command to get help on

Returns:
the soul command help string


is_soul_in_category
int is_soul_in_category(string soul,
                        string category)

Figures out if the specified soul is in the specified category.

Parameters:
soul - the soul to find the category
category - the category to check in

Returns:
1 if it is in the category, 0 if not


load_it
void load_it()

Loads the previous state of the soul object off the disc.
query_categories_for_soul
string * query_categories_for_soul(string soul)

This returns the categories associated with the specific soul command. It return an empty array if the soul command is not found, or there are no categories associated with it.

Parameters:
soul - the soul to lookup

Returns:
the categories associated with the command


query_main_soul_categories
string * query_main_soul_categories()

This method queries all the categories of souls.

Returns:
An array of all soul categories.

See also:
get_souls .c


query_pcache_size
int query_pcache_size()
query_scache_size
int query_scache_size()
query_soul_command
mixed * query_soul_command(string name)

This returns the arrays that are used by the pattern matcher in the player object. Called from inside add_command interface.

Parameters:
name - the souul command name to find

Returns:
0 if no command found, otherwise an array of patterns

See also:
/global/new_parse->add_command()


query_soul_command_stuff
mixed * query_soul_command_stuff(string str)

Returns the data associated with soul command. Probably not very useful, but useful for debugging.

Parameters:
str - the soul command to get the data for

Returns:
the data associated with the soul command


query_soul_commands
string * query_soul_commands()

The name of all the soul commands.

Returns:
an array containing the names of all the soul commands


query_soul_stats
string query_soul_stats()
query_synonym
string * query_synonym(string cat)

Find the synonyms for this specific synonym category.

Parameters:
cat - the synonym category to look for

Returns:
the synonym categories


query_synonym_categories
string * query_synonym_categories()

This mehod returns the synonyms for the categories.

Returns:
the synonym stuff


save_it
void save_it()

Saves the current state of the soul object.
set_soul_category
void set_soul_category(string soul,
                       string * cats)

Set the categories for the specified soul command.

Parameters:
soul - the soul command the categories are for
categories - the categories of the soul command


test_file
int test_file(string str)
www_string
string www_string(string verb)

Returns a web formatted version of the help string for the soul command.

Parameters:
verb - the soul command to get help on

Returns:
the soul command help string


Protected Functions

These are functions that only objects inheriting the class can access.

query_soul_command_data
mixed * query_soul_command_data(string str)

Used internally to get the soul command data.

Parameters:
str - the soul command to get data for

Returns:
the soul command data

See also:
query_soul_command_stuff()