[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/watch.c</h2>
An inheritable watch object.  This can be used to create pocketwatches or
wristwatches.  They can provide alarms and speak or show the time and day.
<p><b>See also:</b><br>/obj/clock.
<br /><p>Written by ceres<h3>Example 1</h3>
<pre>
inherit "/obj/watch";

void setup() {
  set_name("watch");
  set_main_plural("gold watches");
  set_short("gold watch");
  add_adjective("gold");
  set_long("This is a mechanical gold watch.  The time reads ");
  set_weight(3);
  set_type("bracelet");
  add_property( "shop type", "jewellers" );
  add_property("no recycling", 1);
  set_cond(350);
  set_max_cond(350);
  set_damage_chance(4);
  set_value(14000);
  set_has_alarms(1);
  set_alarm_mess("Beep, beep, beep, Your alarm has gone off!\n");
}
</pre>
<h3>Example 2</h3>
<pre>
inherit "/obj/watch";

setup() {
  set_name("watch");
  set_main_plural("watches");
  set_long("This is one of those wrist watches that is powered by "
           "a chubby-looking imp. This watch basically has fifteen "
           "functions, but as far you are concerned the imp performs "
           "only two functions. One function to tell the time and the "
           "function to apologise for its inefficiency in its other "
           "thirteen functions.\n");
  set_weight( 1 );
  set_type("bracelet");
  add_property("shop type", "jewellers");
  add_property("no recycling", 1);
  set_cond(300);
  set_max_cond(300);
  set_damage_chance(5);
  set_value( 6000 );
  set_pocketwatch(1);
  set_watch_speaker("From inside the watch the chubby-looking imp");

}
</pre>
<h2>Inherits</h2>
This class inherits the following classes <a href="std.basic.close_lock.c.shtml">/std/basic/close_lock.c</a>, <a href="std.basic.wearable.c.shtml">/std/basic/wearable.c</a> and <a href="obj.clock.c.shtml">/obj/clock.c</a><h2>Includes</h2>
This class includes the following files <a href="include.chime.h.shtml">/include/chime.h</a> and <a href="include.am_time.h.shtml">/include/am_time.h</a><h2>Method index</h2>
<ul>
<li><a href="#check_for_alarms">check_for_alarms</a>()<li><a href="#set_alarm_mess">set_alarm_mess</a>(string)<br/>
Sets the message to be displayed when an alarm goes off.
<li><a href="#set_has_alarms">set_has_alarms</a>(int)<br/>
Determines if this watch can do alarms or not.
<li><a href="#set_pocketwatch">set_pocketwatch</a>(int)<br/>
Makes the watch into a pocket watch ie.
<li><a href="#set_silent_alarm">set_silent_alarm</a>(int)<br/>
Sets whether this watch's alarm is silent.
<li><a href="#set_watch_speaker">set_watch_speaker</a>(string)<br/>
Set the message to prefix the spoken time for a speaking watch
(typically imp or demon powered).
</ul>
<h2>Public Functions</h2>
These are functions that everyone can access.<p>
<dl>
<dt class="autodocfuncname"><a name="check_for_alarms">
check_for_alarms</a><pre class="autodocfuncdef">
void check_for_alarms()
</pre>
<dt class="autodocfuncname"><a name="set_alarm_mess">
set_alarm_mess</a><pre class="autodocfuncdef">
void set_alarm_mess(string mess)
</pre><dd><br />
Sets the message to be displayed when an alarm goes off.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
mess - The message to be displayed. The following can be used and
 will be replaced when your message is displayed:
 $poss_short$ - the watch's possessive short (useful if worn and
  if the alarm isn't silent).
 $short$ - the watch's query_short.
 $time$ - the current time in the form returned by query_time_string.
 $alarm$ - the alarm string as set by the player, this can only be used
  if the watch is a spoken watch.<br />
<br />
<dd><b>Example:</b>
<br/><pre> set_watch_speaker( "From inside the watch, a fat blue imp" );
 set_alarm_mess( "It is $time$, this is your $alarm$ alarm!\n" );

 set_silent_alarm( 1 );
 set_alarm_mess( "Your $short$ buzzes almost imperceptibly as an alarm "
   "goes off.\n" );
</pre><br /></dl>

<dt class="autodocfuncname"><a name="set_has_alarms">
set_has_alarms</a><pre class="autodocfuncdef">
void set_has_alarms(int i)
</pre><dd><br />
Determines if this watch can do alarms or not.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
i - 1 for yes, 0 for no.<br />
<br />
<dd><b>See also:</b>
<br />set_alarm_mess
set_silent_alarm
.c<br /><br /><br /></dl>

<dt class="autodocfuncname"><a name="set_pocketwatch">
set_pocketwatch</a><pre class="autodocfuncdef">
void set_pocketwatch(int i)
</pre><dd><br />
Makes the watch into a pocket watch ie. one that can only be read
when it is open.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
i - 1 for yes, 0 for no.
<br />
<br />
<br /></dl>

<dt class="autodocfuncname"><a name="set_silent_alarm">
set_silent_alarm</a><pre class="autodocfuncdef">
void set_silent_alarm(int silent)
</pre><dd><br />
Sets whether this watch's alarm is silent. You still need to set_has_alarms
and set_alarm_mess, the message will only be shown to the player wearing
the watch, and so the watch must be wearable for the silent alarm to work.<br />
<br /><dl>
<dd><b>Parameters:</b><br />
silent - 1 if this watch's alarm is silent.<br />
<br />
<dd><b>Example:</b>
<br/><pre>  set_has_alarms( 1 );
  set_alarm_mess( "You feel a tiny pin prick on your wrist, indicating "
    "that your $short$'s alarm is going off.\n" );
  set_silent_alarm( 1 );
</pre><br /></dl>

<dt class="autodocfuncname"><a name="set_watch_speaker">
set_watch_speaker</a><pre class="autodocfuncdef">
void set_watch_speaker(string mess)
</pre><dd><br />
Set the message to prefix the spoken time for a speaking watch
(typically imp or demon powered).<br />
<br /><dl>
<dd><b>Parameters:</b><br />
mess - The message to prefix the time.
<br />
<br />
<br /></dl>

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

