[an error occurred while processing this directive]
[<a href="index.shtml">Package Index</a></code> | <a href="index_std.shtml">Mudlib Index</a></code> | <a href="index_eff.shtml">Effect Index</a></code>]<br><h2>File /obj/crafts/pottery/wheel_inherit.c</h2>
An inherit for a pottery wheel.  It can be cloned and the description
customised, as well as what sorts of pots can be made 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 wheel must be set.  Once the pot has been created
its description cannot be changed, so ensure that your add_pot details
are free of typos.<p>Written by Kaylar
<p>Started June 2005<h2>Inherits</h2>
This class inherits the following classes <a href="std.surface.c.shtml">/std/surface.c</a><h2>Includes</h2>
This class includes the following files <a href="include.tasks.h.shtml">/include/tasks.h</a>, /include/crafts/crafts_rewards.h and /include/crafts/pottery.h<h2>Method index</h2>
<ul>
<li><a href="#add_pot">add_pot</a>(string, string, string, string *, string, int)<br/>
This function adds a pot to the pots that can be made on this wheel.
<li><a href="#do_mould">do_mould</a>(object *, string, string, mixed *, string)<li><a href="#do_throw">do_throw</a>(object *, string, string, mixed *, string)<li><a href="#make_pot">make_pot</a>(int, mixed)<li><a href="#query_in_use">query_in_use</a>()<br/>
Returns whether the wheel is in use (moving).
<li><a href="#query_pots">query_pots</a>()<br/>
Returns a mapping of the pots that can be made on this wheel.
<li><a href="#set_cannot_be_used_reason">set_cannot_be_used_reason</a>(string)<br/>
This function sets the reason given if the wheel cannot be used (useful for
quests and the like).
<li><a href="#set_result_adjectives">set_result_adjectives</a>(mixed *)<br/>
This function allows you to set the adjectives used to describe the pots
created by this wheel based on how well the player passes the skillcheck.
<li><a href="#set_result_adverbs">set_result_adverbs</a>(mixed *)<br/>
This function allows you to set the adverbs that can be used in the long of
a pot to show how well the player passes the skillcheck.
<li><a href="#set_room">set_room</a>(object)<br/>
This sets the room that the wheel is cloned into, this must be set if 
you add it as a hidden object.
<li><a href="#test_add">test_add</a>(object, int)<li><a href="#test_remove">test_remove</a>(object, int, mixed)</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="add_pot">
add_pot</a><pre class="autodocfuncdef">
void add_pot(string key,
             string name,
             string pot_type,
             string * longs,
             string difficulty,
             int use_colour)
</pre><dd><br />
This function adds a pot to the pots that can be made on this wheel.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
key - The key used to add the pot to the mapping, this must be unique
 to each pot.  It will be used in the list of allowable pots and as the
 short description of the pot. (Don't forget that an adjective will also
 be added to the short, so it should suit <adjective> <your pot key> ).<br />
name - The name of the pot, it will be used as the name of the final
 product it should be one word.<br />
pot_type - The type of pot as defined in "/include/crafts/pottery.h"
 Pots that can act as furniture will be automatically more difficult to
 mould.<br />
longs - An array of long descriptions in the order of marginal,
 normal, exceptional, critical successes, marginal and normal failures.
 As exceptional and critical failures result in no pot being created, you
 cannot set a long for them. For those too lazy to write six different
 descriptions, just write one that could apply to all conditions (still in
 an array though).
Note: The long description should be a string without the "\n" on the end.
 If you want an adjective or adverb shown, use $adjective$ or $adverb$
 respectively and $a_adjective$ and $a_adverb$ for the add_a-ised version.
 The adjective will be used in the short whether you use it in the
 long or not.<br />
difficulty - How difficult it is to make the pot, either "easy",
 "medium", "difficult", or "expert".<br />
use_colour - Set this to 1 if you want the colour of the glaze to
 show in the short description before the last word, 2 if you want the
 colour to show before the last two words and 0 if you don't want it in
 the short at all.
 "<adjective> <colour> Djelian vase" would have use_colour set to 2
 "<adjective> traditional <colour> vase" would have use_colour set to 1
 "<adjective> bud vase" would have use_colour set to 0
<br />
<br />
<dd><b>See also:</b>
<br /><a href="#set_result_adjectives">set_result_adjectives()</a> and <a href="#set_result_adverbs">set_result_adverbs()
</a><br /><br /><dd><b>Example:</b>
<br/><pre> add_pot( "pyramid bowl", "bowl", MEDIUM_SQUARE, ({ "This is a vaguely "
   "pyramid-shaped bowl crafted from clay.", "This $adjective$ bowl "
   "is shaped like a pyramid.", "$a_adverb$ hand-made copy of a classic "
   "Klatchian style of bowl.  It looks rather like a pyramid with "
   "the top cut off as the sides rise from its square base obliquely.",
   "This bowl has been so well crafted in a classical Klatchian style "
   "that it looks like a minature pyramid.  One could imagine tiny "
   "sarcophagi entombed within it for all time.", "This $adverb$ crafted "
   "bowl looks somewhat like a distorted pyramid.", "This bowl can "
   "politely be described as \"uninspired\", it can be impolitely "
   "described as many other things." }), "expert", 2 );</pre><br /></dl>

<dt class="autodocfuncname"><a name="do_mould">
do_mould</a><pre class="autodocfuncdef">
int do_mould(object * obs,
             string dir_match,
             string indir_match,
             mixed * args,
             string pattern)
</pre>
<dt class="autodocfuncname"><a name="do_throw">
do_throw</a><pre class="autodocfuncdef">
int do_throw(object * obs,
             string dir_match,
             string indir_match,
             mixed * args,
             string pattern)
</pre>
<dt class="autodocfuncname"><a name="make_pot">
make_pot</a><pre class="autodocfuncdef">
void make_pot(int left,
              mixed args)
</pre>
<dt class="autodocfuncname"><a name="query_in_use">
query_in_use</a><pre class="autodocfuncdef">
int query_in_use()
</pre><dd><br />
Returns whether the wheel is in use (moving).<br />
<br /><dl>
<dd><b>Returns:</b>
<br />1 if the wheel is moving, 0 if not.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_pots">
query_pots</a><pre class="autodocfuncdef">
mapping query_pots()
</pre><dd><br />
Returns a mapping of the pots that can be made on this wheel.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />a mapping of the pots, the key is the label displayed to the player
 in the mould command, the value is an array of the name, pot_type, longs,
 and difficulty.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_cannot_be_used_reason">
set_cannot_be_used_reason</a><pre class="autodocfuncdef">
void set_cannot_be_used_reason(string reason)
</pre><dd><br />
This function sets the reason given if the wheel cannot be used (useful for
quests and the like). For this to work you should also have a function called
cannot_be_used( object player ) which will be passed the player and should
return a 1 if the wheel cannot be used and a 0 if it can.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
reason - The reason.
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_result_adjectives">
set_result_adjectives</a><pre class="autodocfuncdef">
void set_result_adjectives(mixed * adjectives)
</pre><dd><br />
This function allows you to set the adjectives used to describe the pots
created by this wheel based on how well the player passes the skillcheck.
The adjective is used in the short and in the long if you so desire.  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.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
adjectives - An array or mixed array of six adjectives, firstly
 successes from marginal to critical then failures from marginal to normal
 (exceptional and critical failures cause the clay to fly off the wheel).<br />
<br />
<dd><b>See also:</b>
<br /><a href="#set_result_adverbs">set_result_adverbs()</a> and <a href="#add_pot">add_pot()
</a><br /><br /><dd><b>Example:</b>
<br/><pre>
 set_result_adjectives( ({ ({ "simple", "basic" }), ({ "modern", "chic" }),
   ({ "pretty", "elegant" }), ({ "extravagant", "artistic" }), ({ "ugly",
   "unattractive", "lop-sided" }), ({ "bumpy", "uneven", "hideous" }) }) );</pre><br/><pre>
 set_result_adjectives( ({ "plain", "attractive", "classy", "unique",
   ({ "crooked", "uneven" }), ({ "ugly", "distorted" }) }) );</pre><br /></dl>

<dt class="autodocfuncname"><a name="set_result_adverbs">
set_result_adverbs</a><pre class="autodocfuncdef">
void set_result_adverbs(mixed * adverbs)
</pre><dd><br />
This function allows you to set the adverbs that can be used in the long of
a pot to show how well the player passes the skillcheck.  If an
array of arrays is used then a random adverb is chosen.  If this is
not set then the default adverbs will be used.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
adverbs - An array or mixed array of six adverbs, firstly
 successes from marginal to critical then failures from marginal to normal
 (exceptional and critical failures cause the clay to fly off the wheel).<br />
<br />
<dd><b>See also:</b>
<br /><a href="#set_result_adjectives">set_result_adjectives()</a> and <a href="#add_pot">add_pot()
</a><br /><br /><dd><b>Example:</b>
<br/><pre>
 set_result_adverbs( ({ "carefully", "skillfully", "artistically",
   "beautifully", ({ "carelessly", "poorly" }), "ineptly" }) );</pre><br /></dl>

<dt class="autodocfuncname"><a name="set_room">
set_room</a><pre class="autodocfuncdef">
void set_room(object room_ob)
</pre><dd><br />
This sets the room that the wheel is cloned into, this must be set if 
you add it as a hidden object. You can do this after the wheel is cloned
by using a call other on the wheel in the room code.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
room_ob - The room object.<br />
<br />
<dd><b>Example:</b>
<br/><pre>wheel = clone_object( "/d/your/wheel" );
wheel->reset_get();
wheel->set_room( this_object() );
add_hidden_object( wheel );
</pre><br /></dl>

<dt class="autodocfuncname"><a name="test_add">
test_add</a><pre class="autodocfuncdef">
int test_add(object ob,
             int flag)
</pre>
<dt class="autodocfuncname"><a name="test_remove">
test_remove</a><pre class="autodocfuncdef">
int test_remove(object ob,
                int flag,
                mixed dest)
</pre>
</dl>
[an error occurred while processing this directive]

