[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/workbench_inherit.c</h2> An inherit for players to craft their own simple items from raw materials.  
You'll need to make basic files for the objects they can craft, inheriting 
a standard craftable-item file, and specify the type of workbench and the 
raw material object it uses.<p>Written by Touchstone<p>Started 29.06.05
<h2>Inherits</h2>
This class inherits the following classes <a href="std.object.c.shtml">/std/object.c</a><h2>Includes</h2>
This class includes the following files <a href="include.tasks.h.shtml">/include/tasks.h</a>, <a href="include.money.h.shtml">/include/money.h</a> and /include/shops/bank.h<h2>Method index</h2>
<ul>
<li><a href="#add_type">add_type</a>(string, int, int, string, string)<br/>
Adds one item to the mapping of types the workshop can be used to make.
<li><a href="#add_workshop_sign">add_workshop_sign</a>(string, string, string)<br/>
Automatically generates a comma-separated list of items you can make here 
and puts it into add_sign.
<li><a href="#parse_message">parse_message</a>(string, string, object *)<li><a href="#query_fee">query_fee</a>()<br/>
Check how much we're charging, if at all.
<li><a href="#query_finish_mess">query_finish_mess</a>()<li><a href="#query_material_needed">query_material_needed</a>()<br/>
Check which raw materials the workshop wants.
<li><a href="#query_shop_type">query_shop_type</a>()<br/>
Check what kind of workshop we have.
<li><a href="#query_skill_used">query_skill_used</a>()<br/>
Check which skill we're using.
<li><a href="#query_start_mess">query_start_mess</a>()<li><a href="#query_time_taken">query_time_taken</a>()<br/>
Check how long the process takes.
<li><a href="#query_tm_mess">query_tm_mess</a>()<li><a href="#query_types">query_types</a>()<br/>
Lists the items that the workshop can make.
<li><a href="#remove_type">remove_type</a>(string)<br/>
Removes one item from the mapping of types the workshop can be used to 
make.
<li><a href="#set_fee">set_fee</a>(int, string)<br/>
Set the fee to 0 if you don't want to charge.
<li><a href="#set_finish_mess">set_finish_mess</a>(string)<br/>
Sets the message given when the player finishes making an item.
<li><a href="#set_items_directory">set_items_directory</a>(string)<br/>
Sets the directory which contains the files for each item players can 
craft in your workshop.
<li><a href="#set_material_needed">set_material_needed</a>(string *)<br/>
Sets the raw material objects used.
<li><a href="#set_shop_type">set_shop_type</a>(string, string)<br/>
This sets the kind of workshop, eg.
<li><a href="#set_start_mess">set_start_mess</a>(string)<br/>
Sets the message given when the player starts making an item.
<li><a href="#set_time_taken">set_time_taken</a>(int)<br/>
Set how long it takes to use this process.
<li><a href="#set_tm_mess">set_tm_mess</a>(string)<br/>
Use this to set the message given when the player TMs.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="add_type">
add_type</a><pre class="autodocfuncdef">
varargs void add_type(string str,
                      int i,
                      int number,
                      string filename,
                      string func)
</pre><dd><br />
Adds one item to the mapping of types the workshop can be used to make.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
str - the name of the item as used by the player<br />
i - the difficulty of the item to make<br />
number - the number of raw material items the item takes to make<br />
filename - the name of the file for that item in the items directory<br />
<br />
<dd><b>See also:</b>
<br /><a href="#query_types">query_types()</a> and <a href="#remove_type">remove_type()

</a><br /><br /><dd><b>Example:</b>
<br/><pre>add_type( "corset", 40, 1, "leather_corset" );</pre><br /></dl>

<dt class="autodocfuncname"><a name="add_workshop_sign">
add_workshop_sign</a><pre class="autodocfuncdef">
object add_workshop_sign(string sign_long,
                         string sign_short,
                         string sign_language)
</pre><dd><br />
Automatically generates a comma-separated list of items you can make here 
and puts it into add_sign.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
sign_long - the long description of the workshop sign<br />
sign_short - the shortdescription of the workshop sign<br />
sign_language - the language the sign should be in<br />
<br />
<dd><b>Returns:</b>
<br />the sign object

<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="parse_message">
parse_message</a><pre class="autodocfuncdef">
string parse_message(string mess,
                     string str,
                     object * materials)
</pre>
<dt class="autodocfuncname"><a name="query_fee">
query_fee</a><pre class="autodocfuncdef">
int query_fee()
</pre><dd><br />
Check how much we're charging, if at all.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the fee to charge<br /><br />
<dd><b>See also:</b>
<br /><a href="#set_fee">set_fee()

</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_finish_mess">
query_finish_mess</a><pre class="autodocfuncdef">
string query_finish_mess()
</pre>
<dt class="autodocfuncname"><a name="query_material_needed">
query_material_needed</a><pre class="autodocfuncdef">
string * query_material_needed()
</pre><dd><br />
Check which raw materials the workshop wants.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the array of materials that can be used.<br /><br />
<dd><b>See also:</b>
<br /><a href="#set_material_needed">set_material_needed()

</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_shop_type">
query_shop_type</a><pre class="autodocfuncdef">
string query_shop_type()
</pre><dd><br />
Check what kind of workshop we have.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the type of workshop<br /><br />
<dd><b>See also:</b>
<br /><a href="#set_shop_type">set_shop_type()

</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_skill_used">
query_skill_used</a><pre class="autodocfuncdef">
string query_skill_used()
</pre><dd><br />
Check which skill we're using.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the skill used<br /><br />
<dd><b>See also:</b>
<br /><a href="#set_shop_type">set_shop_type()

</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_start_mess">
query_start_mess</a><pre class="autodocfuncdef">
string query_start_mess()
</pre>
<dt class="autodocfuncname"><a name="query_time_taken">
query_time_taken</a><pre class="autodocfuncdef">
int query_time_taken()
</pre><dd><br />
Check how long the process takes.

<br />

<dt class="autodocfuncname"><a name="query_tm_mess">
query_tm_mess</a><pre class="autodocfuncdef">
string query_tm_mess()
</pre>
<dt class="autodocfuncname"><a name="query_types">
query_types</a><pre class="autodocfuncdef">
mapping query_types()
</pre><dd><br />
Lists the items that the workshop can make.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the mapping of types the workshop can be used to make<br /><br />
<dd><b>See also:</b>
<br /><a href="#add_type">add_type()</a> and <a href="#remove_type">remove_type()

</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="remove_type">
remove_type</a><pre class="autodocfuncdef">
void remove_type(string type)
</pre><dd><br />
Removes one item from the mapping of types the workshop can be used to 
make.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
type - the item to remove<br />
<br />
<dd><b>See also:</b>
<br /><a href="#add_type">add_type()</a> and <a href="#query_types">query_types()

</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="set_fee">
set_fee</a><pre class="autodocfuncdef">
void set_fee(int fee,
             string area)
</pre><dd><br />
Set the fee to 0 if you don't want to charge. <br />
<br /><dl>
<dd><b>Parameters:</b><br />
fee - the fee to charge<br />
area - the money type to use<br />
<br />
<dd><b>See also:</b>
<br /><a href="#query_fee">query_fee()
</a><br /><br /><dd><b>Example:</b>
<br/><pre>set_fee( 400, "Ankh-Morpork" );</pre><br /></dl>

<dt class="autodocfuncname"><a name="set_finish_mess">
set_finish_mess</a><pre class="autodocfuncdef">
void set_finish_mess(string str)
</pre><dd><br />
Sets the message given when the player finishes making an item.
If you put $item in the string you give this function, it will 
be replaced by the name of the item they're making, and $material will 
be replaced by the query_multiple_short() of the raw materials used for 
it.  May be used once.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
str - the message given to the player<br />
<br />
<dd><b>See also:</b>
<br /><a href="#set_tm_mess">set_tm_mess()</a> and <a href="#set_start_mess">set_start_mess()

</a><br /><br /><dd><b>Example:</b>
<br/><pre>set_finish_mess( "You finish making a $ and discard the remaining scraps "
  "of silk.\n" );</pre><br /></dl>

<dt class="autodocfuncname"><a name="set_items_directory">
set_items_directory</a><pre class="autodocfuncdef">
void set_items_directory(string str)
</pre><dd><br />
Sets the directory which contains the files for each item players can 
craft in your workshop.  Needs to be called once and only once.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
str - the directory to use<br />
<br />
<dd><b>Example:</b>
<br/><pre>set_items_directory( ROOMS + "workshop/" );

</pre><br /></dl>

<dt class="autodocfuncname"><a name="set_material_needed">
set_material_needed</a><pre class="autodocfuncdef">
void set_material_needed(string * str)
</pre><dd><br />
Sets the raw material objects used.  It matches against query_name() and 
checks that it has the property (Crafts material) with a value of the 
workshop type.  Needs to be called once and only once.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
str - the names of the item used<br />
<br />
<dd><b>See also:</b>
<br /><a href="#query_material_needed">query_material_needed()

</a><br /><br /><dd><b>Example:</b>
<br/><pre>
set_material_needed( ({ "leather", "velvet" }) );</pre><br /></dl>

<dt class="autodocfuncname"><a name="set_shop_type">
set_shop_type</a><pre class="autodocfuncdef">
void set_shop_type(string type,
                   string skill)
</pre><dd><br />
This sets the kind of workshop, eg. leatherworker or jeweller.
It needs to be identical to the value given the (Crafts material)
property on the raw material item.  Needs to be called once and 
only once.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
type - the shop type<br />
skill - the skill used<br />
<br />
<dd><b>See also:</b>
<br /><a href="#query_shop_type">query_shop_type()</a> and <a href="#query_skill">query_skill()
</a><br /><br /><dd><b>Example:</b>
<br/><pre>set_shop_type( "leatherworker", "crafts.materials.leatherwork" );</pre><br /></dl>

<dt class="autodocfuncname"><a name="set_start_mess">
set_start_mess</a><pre class="autodocfuncdef">
void set_start_mess(string str)
</pre><dd><br />
Sets the message given when the player starts making an item.
If you put $item in the string you give this function, it will 
be replaced by the name of the item they're making, and $material will 
be replaced by the query_multiple_short() of the raw materials used for 
it.  May be used once.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
str - the message given to the player<br />
<br />
<dd><b>See also:</b>
<br /><a href="#set_tm_mess">set_tm_mess()</a> and <a href="#set_finish_mess">set_finish_mess()

</a><br /><br /><dd><b>Example:</b>
<br/><pre>set_start_mess( "You sit down and start cutting out the pattern for a $ "
  "from the silk.\n" );</pre><br /></dl>

<dt class="autodocfuncname"><a name="set_time_taken">
set_time_taken</a><pre class="autodocfuncdef">
void set_time_taken(int t)
</pre><dd><br />
Set how long it takes to use this process.  Set it to a positive number, 
the inherit puts in the required minus sign.
May be used once.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
t - the time to take

<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_tm_mess">
set_tm_mess</a><pre class="autodocfuncdef">
void set_tm_mess(string str)
</pre><dd><br />
Use this to set the message given when the player TMs.  Don't bother 
putting in the colour codes and new line, it will do that for you.
May be used once.

<br />

</dl>
[an error occurred while processing this directive]

