[Package Index | Mudlib Index | Effect Index]

File /obj/crafts/pottery/table_inherit.c

An inherit for a pottery table. It can be cloned and the description customised, as well as the glaze colours, quality and the stain patterns that can be created on it. It would be better to create a separate file which inherits this rather than cloning on the fly in a room. If added as a hidden object, the room that contains the table must be set. Once the pot has been decorated its description cannot be changed, so ensure that your details are free of typos.

Written by Kaylar

Started June 2005

Inherits

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

Includes

This class includes the following files /include/tasks.h, /include/crafts/crafts_rewards.h and /include/crafts/pottery.h

Method index

Public Functions

These are functions that everyone can access.

add_pattern
void add_pattern(string key,
                 string name,
                 string * pat_descs,
                 string difficulty,
                 int stains)

This function adds a pattern to the mapping of patterns that can be stained at this table.

Parameters:
key - The key used to add the pattern to the mapping, this must be unique to each pattern. It will be used in the stain command shown to players and should be something sensible.
name - A name for the pattern, this will be seen by the player if the pattern is incomplete.
*pat_descs - An array of eight strings describing the pattern. Firstly successes from marginal to critical then failures from marginal to critical. All eight strings must be included. If you want an adjective, adverb or colours used or the name of the pot shown, use $adjective$, $adverb$, $colours$ or $name$ respectively and $a_adjective$, $a_adverb$ or $a_colours$ for the add_a-ised version. The pattern follows from the long description of the pot and so should have an appropriate lead in. For those too lazy to write eight different descriptions, just write one that could apply to all conditions (still in an array though).
difficulty - How hard the pattern is to create, either "easy", "medium", "difficult" or "expert".
stains - The number of times the pot needs to be stained for the pattern to be complete.

See also:
query_patterns()

Example:
 add_pattern( "cheshire cat", "cat", ({ "It is decorated with a "
   "$adjective$ cat stained in $colours$.", "It is stained with a "
   "$colours$ cat.", "A cheshire cat coloured with $colours$ stain "
   "smiles from a surface of the $name$.", "A grinning cheshire "
   "cat in $colours$ decorates the $name$.", "$a_adjective$ cat has "
   "been stained on it in $colours$.", "A constipated-looking cat "
   "has been stained on the $name$ in $colours$.", "A vaguely cat-shaped "
   "pattern has been created on it in $colours$." "A blob of $colours$ "
   "stain has been applied to the $name$.", "expert", 2 }) );

do_glaze
int do_glaze(object * obs,
             string dir_match,
             string indir_match,
             mixed * args,
             string pattern)
do_sign
int do_sign(object * obs,
            string dir_match,
            string indir_match,
            mixed * args,
            string pattern)
do_stain
int do_stain(object * obs,
             string dir_match,
             string indir_match,
             mixed * args,
             string pattern)
make_pot
void make_pot(int left,
              mixed args)
set_glaze_colours
void set_glaze_colours(string * colours)

This function allows you to set the colours that can be used as a glaze.

Parameters:
colours - The array of colours.

See also:
set_glaze_results() and set_stain_colours()

Example:
 set_glaze_colours ( ({ "azure", "blue", "cyan", "dark blue" }) );

set_glaze_results
void set_glaze_results(string * results)

This function allows you to set the adjectives used to describe the glaze applied to the pot. If an array of arrays is used then a random adjective is chosen. If this is not set then the default adjectives will be used.

Parameters:
results - An array or mixed array of eight adjectives, firstly successes from marginal to critical then failures from marginal to critical.

See also:
set_glaze_colours()

Example:
 set_glaze_results ( ({ "thin", ({ "shiny", "thick" }),
   "bright", ({ "lustrous", "vivid" }), "dull", ({ "uneven", "patchy" }),
   "bumpy", ({ "bubbled", "gritty" }) }) );

set_language
void set_language(string language)

This function sets the language used to label the pots of glaze. It must be a written language.

Parameters:
language - The language.

Example:
 set_language( "morporkian" );

set_room
void set_room(object room_ob)

This sets the room that the table is cloned into, this must be set if you add it as a hidden object. You can do this after the table is cloned by using a call other on the table in the room code.

Parameters:
room_ob - The room object.

Example:
table = clone_object( "/d/your/table" );
table->reset_get();
table->set_room( this_object() );
add_hidden_object( table );

set_stain_colours
void set_stain_colours(string * colours)

This function allows you to set the colours that can be used to stain a pattern

Parameters:
colours - The array of colours.

See also:
add_pattern() and set_glaze_colours()

Example:
 set_stain_colours ( ({ "black", "grey", "white", "silver" }) );