[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/pattern_book_inherit.c</h2>
An inherit for pattern books.  The books can be used with various
craft activities to add patterns to things.  This doesn't add any actual 
text to the page and will need to be added to the book with add_read_mess.
Once a pattern has been added to a player's object it cannot be changed,
therefore be extra careful to ensure that there are no typos.
Functions are controlled by the craft tools.  <p>Written by Kaylar
<p>Started June 2005<h2>Method index</h2>
<ul>
<li><a href="#add_pattern">add_pattern</a>(int, string, string *, string, int)<br/>
This function adds a pattern to the book.
<li><a href="#do_tear">do_tear</a>(int)<li><a href="#query_craft_type">query_craft_type</a>()<br/>
This returns the type of craft that the book can be used with.
<li><a href="#query_flexible">query_flexible</a>()<li><a href="#query_pattern_book">query_pattern_book</a>()<br/>
This is always true.
<li><a href="#query_pattern_info">query_pattern_info</a>(int)<br/>
This returns the information associated with the page number.
<li><a href="#query_patterns">query_patterns</a>()<br/>
This returns all patterns associated with this book.
<li><a href="#set_craft_type">set_craft_type</a>(string)<br/>
This function sets the craft type the patterns can be used with.
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="add_pattern">
add_pattern</a><pre class="autodocfuncdef">
void add_pattern(int page_number,
                 string name,
                 string * messages,
                 string difficulty,
                 int times)
</pre><dd><br />
This function adds a pattern to the book.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
page_number - If used as a single sheet of paper the page number
 should be set to 0, if used with a book the number should correspond
 to the page you wish the pattern to appear on.<br />
name - A name for the pattern, this will be seen by the player if the
 pattern is incomplete.<br />
*messages - An array of eight strings describing the pattern.
 Firstly successes from marginal to critical then failures from marginal
 to critical.

 For engraving and embroidery these must be full sentences ending with
 "\n" and starting with something like "It is embroidered/engraved with".
 For those too lazy to write eight different descriptions, just
 write one that could apply to all conditions (still in an array though).

 If you want an adjective or adverb use $adjective$ or $adverb$ respectively
 and $a_adjective$ and $a_adverb$ for the add_a-ised version. $item$ can be
 used for the short of the item.  For embroidery and quilting, $colours$ or
 $a_colours$ can be used to show the colours of the thread. 

 For cutting out appliques, the patterns must be the short of the applique,
 without a preceding "a" or "an". They will become "a/an <your pattern>
 applique". There is no need to use $colours$ or $item$ for appliques.
<br />
difficulty - How hard the pattern is to create, either "easy",
 "medium", "difficult" or "expert".<br />
times - The number of times the pattern needs to be worked on.
 For embroidery and quilting this is the number of threads required
 to complete the pattern (this is what allows players to use a number
 of colours, if more than 4 different colours are used "multicoloured"
 will be used for the colour short).
Set this to 0 for other crafts.<br />
<br />
<dd><b>See also:</b>
<br /><a href="#query_patterns">query_patterns()</a> and <a href="#query_pattern_info">query_pattern_info()
</a><br /><br /><dd><b>Example:</b>
<br/><pre>For embroidery:
 add_pattern( 4, "rose",
   ({ "It is embroidered with a single rose created in $colours$ thread.\n",
     "A beautiful rose created from $colours$ thread has been embroidered "
       "on the $item$.\n",
     "A small but beautiful bunch of $colours$ roses has been delicately "
       "embroidered on the $item$.\n",
     "A lovely bouquet of $colours$ roses has been skillfully embroidered "
       "on it.\n",
     "It has an unattractive rose embroidered on it.\n",
     "A rose is embroidered on it with crooked $colours$ stitches.\n",
     "A mess of $colours$ stitches marr the $item$.\n",
     "It is embroidered with chaotic collection of $colours$ stitches.\n" }),
   "difficult", 3 );
</pre><br/><pre>
For quilting:
 add_pattern( 5, "trailing ivy",
   "It has been quilted all over with a pattern of trailing ivy in "
     "$colours$ thread.\n",
   "A pattern of trailing ivy has been quilted on it in $colours$ "
     "thread.\n",
   "Delicate quilting in a pattern of trailing ivy decorates the "
     "$item$ in $colours$ thread.\n",
   "A beautiful pattern of trailing ivy has been quilted on it in "
     "$colours$ thread.\n",
   "A simple pattern of trailing ivy has been quilted on it in $colours$ "
     "thread.\n",
   "It is quilted with a messy pattern of trailing ivy in $colours$ "
     "thread.\n",
   "A few wobbly $colours$ lines have been quilted on it.\n",
   "A few wobbly $colours$ lines have been quilted on it.\n" }),
 "easy", 3 );
</pre><br/><pre>
For appliqueing:
 add_pattern( 3, "cat",
   ({ "cat", "neatly cut cat", "cute cat", "elegant cat",
      "poorly cut cat", "crooked cat", "ragged cat", "deformed cat" }),
   "difficult", 0 );</pre><br /></dl>

<dt class="autodocfuncname"><a name="do_tear">
do_tear</a><pre class="autodocfuncdef">
int do_tear(int number)
</pre>
<dt class="autodocfuncname"><a name="query_craft_type">
query_craft_type</a><pre class="autodocfuncdef">
string query_craft_type()
</pre><dd><br />
This returns the type of craft that the book can be used with.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />the type of craft.<br /><br />
<dd><b>See also:</b>
<br /><a href="#set_craft_type">set_craft_type()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_flexible">
query_flexible</a><pre class="autodocfuncdef">
int query_flexible()
</pre>
<dt class="autodocfuncname"><a name="query_pattern_book">
query_pattern_book</a><pre class="autodocfuncdef">
int query_pattern_book()
</pre><dd><br />
This is always true.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />1, it is a pattern book.
<br /><br />
<br /></dl>

<dt class="autodocfuncname"><a name="query_pattern_info">
query_pattern_info</a><pre class="autodocfuncdef">
mixed query_pattern_info(int page_number)
</pre><dd><br />
This returns the information associated with the page number.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />a mixed array of pattern information: ({ name, messages,
 difficulty, times })<br /><br />
<dd><b>See also:</b>
<br /><a href="#add_pattern">add_pattern()</a> and <a href="#query_patterns">query_patterns()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="query_patterns">
query_patterns</a><pre class="autodocfuncdef">
mapping query_patterns()
</pre><dd><br />
This returns all patterns associated with this book.<br />
<br /><dl>
<dd><b>Returns:</b>
<br />a mapping of patterns, the key is the page number and the value 
 is a mixed array of pattern information.<br /><br />
<dd><b>See also:</b>
<br /><a href="#add_pattern">add_pattern()</a> and <a href="#query_pattern_info">query_pattern_info()
</a><br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="set_craft_type">
set_craft_type</a><pre class="autodocfuncdef">
void set_craft_type(string craft_type)
</pre><dd><br />
This function sets the craft type the patterns can be used with.
This must be set.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
type - The type of craft the patterns can be used with, such
 as "engraving", "embroidery", etc.<br />
<br />
<dd><b>See also:</b>
<br /><a href="#query_craft_type">query_craft_type()
</a><br /><br /><dd><b>Example:</b>
<br/><pre>set_craft_type( "engraving" );</pre><br /></dl>

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

