[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 /std/basic/desc.c</h2>
The main description handling class.  Keeps track of the longs short
etc.<p>Written by Pinkfish<h2>Inherits</h2>
This class inherits the following classes <a href="std.basic.hide_invis.c.shtml">/std/basic/hide_invis.c</a><h2>Method index</h2>
<dl><ul>
<li><a href="#a_short">a_short</a>(int)<br/>
This method returns the "indeterminate" short.
<li><a href="#long">long</a>(string, int)<br/>
This method returns the current long description.
<li><a href="#one_short">one_short</a>(int)<br/>
This method returns an "out-of-a-group" short.
<li><a href="#poss_short">poss_short</a>(int)<br/>
This method returns the "possessed" short.
<li><a href="#pretty_plural">pretty_plural</a>(object)<br/>
The observer dependant plural.
<li><a href="#pretty_short">pretty_short</a>(object)<br/>
This method does weird stuff.
<li><a href="#query_determinate">query_determinate</a>(object)<br/>
This returns the determinate for the object.
<li><a href="#query_long">query_long</a>(string, int)<br/>
This method returns the unadulterated long description.
<li><a href="#query_long_details">query_long_details</a>(string, int, object)<br/>
This method returns extra details about the object that should be
known above the basic long.
<li><a href="#query_main_plural">query_main_plural</a>()<br/>
This method returns the current value of the main plural.
<li><a href="#query_plural">query_plural</a>(int)<br/>
This method returns the current plural string.
<li><a href="#query_plural_desc">query_plural_desc</a>()<br/>
This method returns the pluralized version of query_short_desc().
<li><a href="#query_short">query_short</a>()<br/>
This method returns the unadulterated short description.
<li><a href="#query_short_desc">query_short_desc</a>()<br/>
This method creates a simple short description for players based on their
stats, gender and guild.
<li><a href="#set_long">set_long</a>(mixed)<br/>
This method sets the long description for the object.
<li><a href="#set_main_plural">set_main_plural</a>(mixed)<br/>
This method sets the main plural for the object.
<li><a href="#set_short">set_short</a>(mixed)<br/>
This method sets the short description for the object.
<li><a href="#short">short</a>(int)<br/>
This method returns the current short description.
<li><a href="#the_poss_short">the_poss_short</a>(int)<br/>
Just like poss_short() but returning a definite article.
<li><a href="#the_short">the_short</a>(int)<br/>
This method returns the "determinate" short.
</ul><h2>Public Functions</h2>
These are functions that everyone can access.<p>
.<ul><a name="a_short">
a_short</a><pre>
varargs string a_short(int flag)
</pre></br>
This method returns the "indeterminate" short.  This function returns a
string that the message system replaces, when messages are printed, by the
determinate of the object and its short as given by pretty_short. The
string should not be stored, since the object to which it refers may
not later exist; it can be processed with convert_message.
<p>
The return of this function needs more processing before the player
sees it.  In general you will not need to worry about this.
<br/><ul>
<li><b>Parameters:</b>
<br/>flag - If this flag is set, do not bring the player out of hiding.
<li><b>See also:</b>
<br/><a href="#set_short">set_short()</a>, <a href="#short">short()</a>, <a href="#the_short">the_short()</a>, <a href="#poss_short">poss_short()</a>, <a href="#one_short">one_short()</a> and <a href="global.events.c.shtml#convert_message">/global/events->convert_message()</a><li><b>Example:</b>
<br/><pre>"a poor beggar"
"the Weasel"
"Detritus"
</pre></dl>

<ul><a name="long">
long</a><pre>
string long(string str,
            int dark)
</pre></br>
This method returns the current long description.  This is
often overriden to display other information.
<br/><ul>
<li><b>Parameters:</b>
<br/>str - the string which matched us
<br/>dark - is it dark when viewing
<li><b>Returns:</b>
<br/>the current long descriptions
<li><b>See also:</b>
<br/><a href="#set_long">set_long()
</a></dl>

<ul><a name="one_short">
one_short</a><pre>
varargs string one_short(int flag)
</pre></br>
This method returns an "out-of-a-group" short.
This function returns a string that the message system replaces, when
messages are printed, by a string dependent on the determinate of
the object and its short as given by pretty_short. If the viewer
is not in the same environment as the object or if the determinate is
defined and is not "a " or "an ", that string is the determinate. If
there is more than one object with the same plural as that object in its
environment, then that string is "one of the "; otherwise the
string is "the ". The output from from one_short should not be
stored, since the object to which it refers may not later exist; it can be
processed with convert_message. One_short is mostly used for
referring to a living object when it performs an action independent
of any previous actions. 
<p>
The return of this function needs more processing before the player
sees it.  In general you will not need to worry about this.
<br/><ul>
<li><b>Parameters:</b>
<br/>flag - If this flag is set, do not bring the player out of hiding.
<li><b>See also:</b>
<br/><a href="#set_short">set_short()</a>, <a href="#short">short()</a>, <a href="#a_short">a_short()</a>, <a href="#the_short">the_short()</a>, <a href="#poss_short">poss_short()</a> and <a href="global.events.c.shtml#convert_message">/global/events->convert_message()</a><li><b>Example:</b>
<br/><pre>"one of the poor beggars"
"the Weasel"
"Detritus"
"One of the sailors falls over"
</pre></dl>

<ul><a name="poss_short">
poss_short</a><pre>
varargs string poss_short(int flag)
</pre></br>
This method returns the "possessed" short.  This function returns a
string that the message system replaces, when messages are printed, by a
string dependent on the possessor of the object and its short as
given by pretty_short. If the object has no environment or is not in a
living object or corpse, that string is the determinate. If the
environment of the object is the viewer of the message, that string
is "your". If the determinate is defined and is not "a " or "an ",
or, if it is not defined or is "a " or "an " but it is the only thing in its
environment with its plural, that string is the possessive of the owner, if
the owner has already been mentioned in constructing a sentence, or the
owner's the_short plus "'s "; otherwise, the string is "one
of the " plus the possessive bit as described in the previous part of
this sentence. Got all that? Good :) The string should not be stored,
since the object to which it refers may not later exist; it can be
processed with convert_message. Poss_short is mostly used for referring
to an object when a person has just used it to do something.
<p>
The return of this function needs more processing before the player
sees it.  In general you will not need to worry about this.
<br/><ul>
<li><b>Parameters:</b>
<br/>flag - If this flag is set, do not bring the player out of hiding.
<li><b>See also:</b>
<br/><a href="#set_short">set_short()</a>, <a href="#short">short()</a>, <a href="#a_short">a_short()</a>, <a href="#the_short">the_short()</a>, <a href="#one_short">one_short()</a> and <a href="global.events.c.shtml#convert_message">/global/events->convert_message()</a><li><b>Example:</b>
<br/><pre>"one of Wombat's knives".
"one of his wands".
"her Wyrm Sword".
"Frenkel twists one of his rings."
</pre></dl>

<ul><a name="pretty_plural">
pretty_plural</a><pre>
varargs string pretty_plural(object thing)
</pre></br>
The observer dependant plural.  It was specifical written to
handle money that needed to be displayed over several lines but
only be one object. The way this was achived was if pretty_plural
returns an array then each of the elements of the array is considered
to be a seperate object and displayed accordingly. 
<br/><ul>
<li><b>Parameters:</b>
<br/>thing - the observer
<li><b>Returns:</b>
<br/>the plural string

<li><b>See also:</b>
<br/><a href="#set_main_plural">set_main_plural()</a> and <a href="obj.money.c.shtml#pretty_plural">/obj/money->pretty_plural()</a></dl>

<ul><a name="pretty_short">
pretty_short</a><pre>
varargs string pretty_short(object thing)
</pre></br>
This method does weird stuff.  Pretty much it just calls the
short() function with the dark parameter...  This should not be
used to generate output.  Use a_short(), the_short(), or
one_short or poss_short() instead.
<br/><ul>
<li><b>Parameters:</b>
<br/>thing - the viewer
<li><b>Returns:</b>
<br/>the string being the short
<li><b>See also:</b>
<br/><a href="#short">short()</a>, <a href="global.player.c.shtml#check_dark">/global/player->check_dark()</a>, <a href="#a_short">a_short()</a>, <a href="#the_short">the_short()</a>, <a href="#poss_short">poss_short()</a> and <a href="#one_short">one_short()
</a></dl>

<ul><a name="query_determinate">
query_determinate</a><pre>
string query_determinate(object thing)
</pre></br>
This returns the determinate for the object.  The determinate is
something like 'the'.  You set the derterminate by setting
the "determinate" property.  The viewer is check to see if
they can see the object as well, if it cannot be seen
"' is returned.
<br/><ul>
<li><b>Parameters:</b>
<br/>thing - the thing to check for visibility

<li><b>See also:</b>
<br/><a href="std.basic.property.c.shtml#add_property">/std/basic/property->add_property()</a><li><b>Example:</b>
<br/><pre>// Set the determinate property
add_property("determinate", "the");</pre></dl>

<ul><a name="query_long">
query_long</a><pre>
varargs mixed query_long(string str,
                         int dark)
</pre></br>
This method returns the unadulterated long description.  The other
long calls might modify the output to display some status information.
<br/><ul>
<li><b>Returns:</b>
<br/>the long description
<li><b>See also:</b>
<br/><a href="#long">long()</a> and <a href="#set_long">set_long()
</a></dl>

<ul><a name="query_long_details">
query_long_details</a><pre>
string query_long_details(string arg,
                          int dark,
                          object looker)
</pre></br>
This method returns extra details about the object that should be
known above the basic long.  This is printed to people who do not
own the object in question (long() is used if you own it).
<br/><ul>
<li><b>Parameters:</b>
<br/>arg - the argument the look was called with
<br/>dark - how dark the place is
<br/>looker - the person looking at the object

</dl>

<ul><a name="query_main_plural">
query_main_plural</a><pre>
mixed query_main_plural()
</pre></br>
This method returns the current value of the main plural.
<br/><ul>
<li><b>Returns:</b>
<br/>the main plural

</dl>

<ul><a name="query_plural">
query_plural</a><pre>
varargs string query_plural(int dark)
</pre></br>
This method returns the current plural string.  This is often overridden
to display extra information about the object, like the short and
long calls.  There is always an exception to a naming scheme :)
<br/><ul>
<li><b>Parameters:</b>
<br/>dark - if it was dark when viewing

<li><b>Returns:</b>
<br/>the plural string
<li><b>See also:</b>
<br/><a href="#set_main_plural">set_main_plural()</a> and <a href="#query_main_plural">query_main_plural()</a></dl>

<ul><a name="query_plural_desc">
query_plural_desc</a><pre>
string query_plural_desc()
</pre></br>
This method returns the pluralized version of query_short_desc(). 
<br/><ul>
<li><b>See also:</b>
<br/><a href="#query_short_desc">query_short_desc()
</a></dl>

<ul><a name="query_short">
query_short</a><pre>
mixed query_short()
</pre></br>
This method returns the unadulterated short description.  The other
short calls might modify the output to display some status information.
<br/><ul>
<li><b>Returns:</b>
<br/>the short description
<li><b>See also:</b>
<br/><a href="#short">short()</a>, <a href="#set_short">set_short()</a>, <a href="#a_short">a_short()</a>, <a href="#the_short">the_short()</a>, <a href="#poss_short">poss_short()</a> and <a href="#one_short">one_short()
</a></dl>

<ul><a name="query_short_desc">
query_short_desc</a><pre>
string query_short_desc()
</pre></br>
This method creates a simple short description for players based on their
stats, gender and guild.


<ul><a name="set_long">
set_long</a><pre>
void set_long(mixed str)
</pre></br>
This method sets the long description for the object.  The long description
is what the player sees with they 'look' at the object.  Please make sure
tht you use sentances in your long description.  Something like
'The red box' is not a sentance.  You can use colour codes in your
long description to make it look cool.
<br/><ul>
<li><b>Parameters:</b>
<br/>str - the long description
<li><b>See also:</b>
<br/>help::look.c, <a href="#long">long()</a>, <a href="#query_long">query_long()</a> and help::colours.c<li><b>Example:</b>
<br/><pre>set_long("Picture perfect and glowing with an internal radience the "
         "Red Rose is simply wonderful.\n");
</pre></dl>

<ul><a name="set_main_plural">
set_main_plural</a><pre>
void set_main_plural(mixed str)
</pre></br>
This method sets the main plural for the object.  The main plural
is like the short description for the pluralised object.  If this
is not set then the short will attempt to be pluralised to
figure it out.
<br/><ul>
<li><b>Parameters:</b>
<br/>str - the main plural
<li><b>See also:</b>
<br/><a href="#efun::pluralize">efun::pluralize()</a>, <a href="#query_plural">query_plural()</a>, <a href="#query_main_plural">query_main_plural()</a>, <a href="#set_short">set_short()</a> and <a href="#add_plural">add_plural()</a><li><b>Example:</b>
<br/><pre>set_main_plural("green wombles");
</pre></dl>

<ul><a name="set_short">
set_short</a><pre>
void set_short(mixed words)
</pre></br>
This method sets the short description for the object.  Be careful
with using function pointers here, as they do not save when
players log out.
<p>
The short description is the description seen in peoples inventorys and
in brief mode when you enter rooms. This should be only a few words
long and should contain a fairly good description of the
object. Colour processing is done on basicly all of discworlds output,
so that will work in the short.
<br/><ul>
<li><b>Parameters:</b>
<br/>words - the short description
<li><b>See also:</b>
<br/><a href="#short">short()</a>, <a href="#query_short">query_short()</a>, <a href="#a_short">a_short()</a>, <a href="#the_short">the_short()</a>, <a href="#poss_short">poss_short()</a> and <a href="#one_short">one_short()
</a><li><b>Example:</b>
<br/><pre>set_short("red rose");</pre></dl>

<ul><a name="short">
short</a><pre>
varargs string short(int dark)
</pre></br>
This method returns the current short description.  This is often
overridden to return status information about the object.
<br/><ul>
<li><b>Parameters:</b>
<br/>dark - if it is dark when viewing

<li><b>Returns:</b>
<br/>the short description string
</dl>

<ul><a name="the_poss_short">
the_poss_short</a><pre>
varargs string the_poss_short(int flag)
</pre></br>
Just like poss_short() but returning a definite article.
<br/><ul>
<li><b>See also:</b>
<br/><a href="#poss_short">poss_short()
</a></dl>

<ul><a name="the_short">
the_short</a><pre>
varargs string the_short(int flag)
</pre></br>
This method returns the "determinate" short.  This function returns a
string that the message system replaces, when messages are printed, by the
determinate of the object (or "the" if the determinate is "a", "an" or
undefined) and its short as given by pretty_short. The string
should not be stored, since the object to which it refers may not later
exist; it can be processed with convert_message.
<p>
The return of this function needs more processing before the player
sees it.  In general you will not need to worry about this.
<br/><ul>
<li><b>Parameters:</b>
<br/>flag - If this flag is set, do not bring the player out of hiding.
<li><b>See also:</b>
<br/><a href="#set_short">set_short()</a>, <a href="#short">short()</a>, <a href="#a_short">a_short()</a>, <a href="#poss_short">poss_short()</a>, <a href="#one_short">one_short()</a> and <a href="global.events.c.shtml#convert_message">/global/events->convert_message()</a><li><b>Example:</b>
<br/><pre>"the poor beggar"
"the Weasel"
"Detritus"
</pre></dl>


[an error occurred while processing this directive]

