Difference between revisions of "Source:NetHack 3.4.3/src/pline.c"

From NetHackWiki
Jump to navigation Jump to search
(Automated source code upload)
 
m (moved Source:Pline.c to Source:NetHack 3.4.3/src/pline.c: Moving src to subdirs)
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
__MIXEDSYNTAXHIGHLIGHT__
 +
Below is the full text to src/pline.c from NetHack 3.4.3. To link to a particular line, write [[pline.c#line123|<nowiki>[[pline.c#line123]]</nowiki>]], for example.
 +
 +
== Top of file ==
  
Below is the full text to src/pline.c from NetHack 3.4.3. To link to a particular line, write [[pline.c#line123|<nowiki>[[pline.c#line123]]</nowiki>]], for example.
 
 
  <span id="line1">1.    /* SCCS Id: @(#)pline.c 3.4 1999/11/28 */</span>
 
  <span id="line1">1.    /* SCCS Id: @(#)pline.c 3.4 1999/11/28 */</span>
 
  <span id="line2">2.    /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */</span>
 
  <span id="line2">2.    /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */</span>
Line 49: Line 52:
 
  <span id="line44">44.  #define vpline pline</span>
 
  <span id="line44">44.  #define vpline pline</span>
 
  <span id="line45">45.  </span>
 
  <span id="line45">45.  </span>
 +
 +
== pline ==
 +
 +
pline is the catch-all function that outputs text to the message area. Depending on the [[GUI]] used and how many messages there already are in the message area, NetHack may wait for player to press a key at a <tt>--more--</tt> prompt before showing the message.
 +
 +
pline accepts a string constant and any number of additional values that replace placeholders marked with '%' in the string constant, just like [[wikipedia:printf|printf]] does.
 +
 +
Example:
 +
int count;
 +
for (count = 1; count < 10; count++) {
 +
  pline("%i", count);
 +
}
 +
pline("Hello, player!");
 +
 
  <span id="line46">46.  void</span>
 
  <span id="line46">46.  void</span>
 
  <span id="line47">47.  pline VA_DECL(const char *, line)</span>
 
  <span id="line47">47.  pline VA_DECL(const char *, line)</span>
Line 74: Line 91:
 
  <span id="line69">69.  }</span>
 
  <span id="line69">69.  }</span>
 
  <span id="line70">70.  </span>
 
  <span id="line70">70.  </span>
 +
 +
== Norep ==
 +
 +
<tt>Norep()</tt> is similar to [[#pline|pline()]], but if the same message is repeated after another, it's not shown again.
 +
 +
Example:
 +
int x;
 +
for (x = 0; x < 100; x++) {
 +
  Norep("Whee!");
 +
}
 +
 +
 
  <span id="line71">71.  /*VARARGS1*/</span>
 
  <span id="line71">71.  /*VARARGS1*/</span>
 
  <span id="line72">72.  void</span>
 
  <span id="line72">72.  void</span>
Line 86: Line 115:
 
  <span id="line81">81.  }</span>
 
  <span id="line81">81.  }</span>
 
  <span id="line82">82.  </span>
 
  <span id="line82">82.  </span>
 +
 +
== You_buf ==
 +
 
  <span id="line83">83.  /* work buffer for You(), &c and verbalize() */</span>
 
  <span id="line83">83.  /* work buffer for You(), &c and verbalize() */</span>
 
  <span id="line84">84.  static char *you_buf = 0;</span>
 
  <span id="line84">84.  static char *you_buf = 0;</span>
Line 102: Line 134:
 
  <span id="line97">97.  }</span>
 
  <span id="line97">97.  }</span>
 
  <span id="line98">98.  </span>
 
  <span id="line98">98.  </span>
 +
 +
== free_youbuf ==
 +
 
  <span id="line99">99.  void</span>
 
  <span id="line99">99.  void</span>
 
  <span id="line100">100.  free_youbuf()</span>
 
  <span id="line100">100.  free_youbuf()</span>
Line 109: Line 144:
 
  <span id="line104">104.  }</span>
 
  <span id="line104">104.  }</span>
 
  <span id="line105">105.  </span>
 
  <span id="line105">105.  </span>
 +
 
  <span id="line106">106.  /* `prefix' must be a string literal, not a pointer */</span>
 
  <span id="line106">106.  /* `prefix' must be a string literal, not a pointer */</span>
 
  <span id="line107">107.  #define YouPrefix(pointer,prefix,text) \</span>
 
  <span id="line107">107.  #define YouPrefix(pointer,prefix,text) \</span>
Line 116: Line 152:
 
  <span id="line111">111.  strcat((YouPrefix(pointer, prefix, text), pointer), text)</span>
 
  <span id="line111">111.  strcat((YouPrefix(pointer, prefix, text), pointer), text)</span>
 
  <span id="line112">112.  </span>
 
  <span id="line112">112.  </span>
 +
 +
== You ==
 +
 +
<tt>You()</tt> is similar to [[#pline|pline()]], but the string is prefixed with <tt>"You "</tt>
 +
 +
Example:
 +
You("succeed in opening the tin.");
 +
 
  <span id="line113">113.  /*VARARGS1*/</span>
 
  <span id="line113">113.  /*VARARGS1*/</span>
 
  <span id="line114">114.  void</span>
 
  <span id="line114">114.  void</span>
Line 126: Line 170:
 
  <span id="line121">121.  }</span>
 
  <span id="line121">121.  }</span>
 
  <span id="line122">122.  </span>
 
  <span id="line122">122.  </span>
 +
 +
== Your ==
 +
 +
<tt>Your()</tt> is similar to [[#pline|pline()]], but the string is prefixed with <tt>"Your "</tt>
 +
 +
Example:
 +
Your("wallet is empty.");
 +
 
  <span id="line123">123.  /*VARARGS1*/</span>
 
  <span id="line123">123.  /*VARARGS1*/</span>
 
  <span id="line124">124.  void</span>
 
  <span id="line124">124.  void</span>
Line 136: Line 188:
 
  <span id="line131">131.  }</span>
 
  <span id="line131">131.  }</span>
 
  <span id="line132">132.  </span>
 
  <span id="line132">132.  </span>
 +
 +
== You_feel ==
 +
 +
<tt>You_feel()</tt> is similar to [[#pline|pline()]], but the string is prefixed with <tt>"You feel "</tt>
 +
 +
Example:
 +
You_feel("much better!");
 +
 
  <span id="line133">133.  /*VARARGS1*/</span>
 
  <span id="line133">133.  /*VARARGS1*/</span>
 
  <span id="line134">134.  void</span>
 
  <span id="line134">134.  void</span>
Line 147: Line 207:
 
  <span id="line142">142.  </span>
 
  <span id="line142">142.  </span>
 
  <span id="line143">143.  </span>
 
  <span id="line143">143.  </span>
 +
 +
== You_cant ==
 +
 +
<tt>You_cant()</tt> is similar to [[#pline|pline()]], but the string is prefixed with <tt>"You can't "</tt>
 +
 +
Example:
 +
You_cant("wear that!");
 +
 
  <span id="line144">144.  /*VARARGS1*/</span>
 
  <span id="line144">144.  /*VARARGS1*/</span>
 
  <span id="line145">145.  void</span>
 
  <span id="line145">145.  void</span>
Line 157: Line 225:
 
  <span id="line152">152.  }</span>
 
  <span id="line152">152.  }</span>
 
  <span id="line153">153.  </span>
 
  <span id="line153">153.  </span>
 +
 +
== pline_The ==
 +
 +
<tt>pline_The()</tt> is similar to [[#pline|pline()]], but the string is prefixed with <tt>"The "</tt>
 +
 +
Example:
 +
pline_The("door resists!");
 +
 
  <span id="line154">154.  /*VARARGS1*/</span>
 
  <span id="line154">154.  /*VARARGS1*/</span>
 
  <span id="line155">155.  void</span>
 
  <span id="line155">155.  void</span>
Line 167: Line 243:
 
  <span id="line162">162.  }</span>
 
  <span id="line162">162.  }</span>
 
  <span id="line163">163.  </span>
 
  <span id="line163">163.  </span>
 +
 +
== There ==
 +
 +
<tt>There()</tt> is similar to [[#pline|pline()]], but the string is prefixed with <tt>"There "</tt>
 +
 +
Example:
 +
There("are no seats in here!");
 +
 
  <span id="line164">164.  /*VARARGS1*/</span>
 
  <span id="line164">164.  /*VARARGS1*/</span>
 
  <span id="line165">165.  void</span>
 
  <span id="line165">165.  void</span>
Line 177: Line 261:
 
  <span id="line172">172.  }</span>
 
  <span id="line172">172.  }</span>
 
  <span id="line173">173.  </span>
 
  <span id="line173">173.  </span>
 +
 +
== You_hear ==
 +
 +
<tt>You_hear()</tt> is similar to [[#pline|pline()]], but the string is prefixed with different things depeneding whether the hero is under water, asleep or awake.
 +
 +
Example:
 +
You_hear("crashing rock.");
 +
 
  <span id="line174">174.  /*VARARGS1*/</span>
 
  <span id="line174">174.  /*VARARGS1*/</span>
 
  <span id="line175">175.  void</span>
 
  <span id="line175">175.  void</span>
Line 193: Line 285:
 
  <span id="line188">188.  }</span>
 
  <span id="line188">188.  }</span>
 
  <span id="line189">189.  </span>
 
  <span id="line189">189.  </span>
 +
 +
== verbalize ==
 +
 +
<tt>verbalize()</tt> is similar to [[#pline|pline()]], but the string is prefixed and suffixed with double quotes, making it seem as if something said it. If hero cannot hear, this outputs nothing.
 +
 +
Example:
 +
verbalize("You freed me!");
 +
 
  <span id="line190">190.  /*VARARGS1*/</span>
 
  <span id="line190">190.  /*VARARGS1*/</span>
 
  <span id="line191">191.  void</span>
 
  <span id="line191">191.  void</span>
Line 208: Line 308:
 
  <span id="line203">203.  }</span>
 
  <span id="line203">203.  }</span>
 
  <span id="line204">204.  </span>
 
  <span id="line204">204.  </span>
 +
 +
 +
== raw_printf ==
 +
 +
<tt>raw_printf()</tt> is only used if the [[GUI]] isn't yet initialized, but we still need to tell the player something important. For example, [[config file]] errors are output with this. Accepts the same kind of variable parameters as [[#pline|pline()]].
 +
 
  <span id="line205">205.  /*VARARGS1*/</span>
 
  <span id="line205">205.  /*VARARGS1*/</span>
 
  <span id="line206">206.  /* Note that these declarations rely on knowledge of the internals</span>
 
  <span id="line206">206.  /* Note that these declarations rely on knowledge of the internals</span>
Line 249: Line 355:
 
  <span id="line244">244.  </span>
 
  <span id="line244">244.  </span>
 
  <span id="line245">245.  </span>
 
  <span id="line245">245.  </span>
 +
 +
== impossible ==
 +
 +
<tt>impossible()</tt> is used to tell the player that NetHack thinks something is wrong. This might or might not be bad enough that NetHack will crash. It accepts the same parameters as [[#pline|pline()]].
 +
 
  <span id="line246">246.  /*VARARGS1*/</span>
 
  <span id="line246">246.  /*VARARGS1*/</span>
 
  <span id="line247">247.  void</span>
 
  <span id="line247">247.  void</span>
Line 268: Line 379:
 
  <span id="line263">263.  }</span>
 
  <span id="line263">263.  }</span>
 
  <span id="line264">264.  </span>
 
  <span id="line264">264.  </span>
 +
 +
== align_str ==
 +
 +
<tt>align_str()</tt> takes one parameter, an alignment, and returns a string describing it.
 +
 
  <span id="line265">265.  const char *</span>
 
  <span id="line265">265.  const char *</span>
 
  <span id="line266">266.  align_str(alignment)</span>
 
  <span id="line266">266.  align_str(alignment)</span>
Line 281: Line 397:
 
  <span id="line276">276.  }</span>
 
  <span id="line276">276.  }</span>
 
  <span id="line277">277.  </span>
 
  <span id="line277">277.  </span>
 +
 +
== mstatusline ==
 +
 +
<tt>mstatusline()</tt> takes one parameter, a monster, and shows the player a short status of that monster. This is used when [[wand of probing|probing]] a monster.
 +
 
  <span id="line278">278.  void</span>
 
  <span id="line278">278.  void</span>
 
  <span id="line279">279.  mstatusline(mtmp)</span>
 
  <span id="line279">279.  mstatusline(mtmp)</span>
Line 360: Line 481:
 
  <span id="line355">355.  }</span>
 
  <span id="line355">355.  }</span>
 
  <span id="line356">356.  </span>
 
  <span id="line356">356.  </span>
 +
 +
== ustatusline ==
 +
 +
<tt>ustatusline()</tt> shows the player the hero's status as if he was [[wand of probing|probed]].
 +
 
  <span id="line357">357.  void</span>
 
  <span id="line357">357.  void</span>
 
  <span id="line358">358.  ustatusline()</span>
 
  <span id="line358">358.  ustatusline()</span>
Line 433: Line 559:
 
  <span id="line428">428.  }</span>
 
  <span id="line428">428.  }</span>
 
  <span id="line429">429.  </span>
 
  <span id="line429">429.  </span>
 +
 +
== self_invis_message ==
 +
 +
<tt>self_invis_message()</tt> shows the player a message about the hero's invisibility; this should only be called if the hero just turned invisible.
 +
 
  <span id="line430">430.  void</span>
 
  <span id="line430">430.  void</span>
 
  <span id="line431">431.  self_invis_message()</span>
 
  <span id="line431">431.  self_invis_message()</span>

Latest revision as of 19:23, 31 January 2011

Below is the full text to src/pline.c from NetHack 3.4.3. To link to a particular line, write [[pline.c#line123]], for example.

Top of file

/*	SCCS Id: @(#)pline.c	3.4	1999/11/28	*/
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed.  See license for details. */

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

#define NEED_VARARGS /* Uses ... */	/* comment line for pre-compiled headers */
#include "hack.h"
#include "epri.h"
#ifdef WIZARD
#include "edog.h"
#endif

#ifdef OVLB

static boolean no_repeat = FALSE;

static char *FDECL(You_buf, (int));

/*VARARGS1*/
/* Note that these declarations rely on knowledge of the internals
* of the variable argument handling stuff in "tradstdc.h"
*/

#if defined(USE_STDARG) || defined(USE_VARARGS)
static void FDECL(vpline, (const char *, va_list));

void
pline VA_DECL(const char *, line)
	VA_START(line);
	VA_INIT(line, char *);
	vpline(line, VA_ARGS);
	VA_END();
}

# ifdef USE_STDARG
static void
vpline(const char *line, va_list the_args) {
# else
static void
vpline(line, the_args) const char *line; va_list the_args; {
# endif

#else	/* USE_STDARG | USE_VARARG */

#define vpline pline

pline

pline is the catch-all function that outputs text to the message area. Depending on the GUI used and how many messages there already are in the message area, NetHack may wait for player to press a key at a --more-- prompt before showing the message.

pline accepts a string constant and any number of additional values that replace placeholders marked with '%' in the string constant, just like printf does.

Example:

int count;
for (count = 1; count < 10; count++) {
  pline("%i", count);
}
pline("Hello, player!");
void
pline VA_DECL(const char *, line)
#endif	/* USE_STDARG | USE_VARARG */

	char pbuf[BUFSZ];
/* Do NOT use VA_START and VA_END in here... see above */

	if (!line || !*line) return;
	if (index(line, '%')) {
	    Vsprintf(pbuf,line,VA_ARGS);
	    line = pbuf;
	}
	if (!iflags.window_inited) {
	    raw_print(line);
	    return;
	}
#ifndef MAC
	if (no_repeat && !strcmp(line, toplines))
	    return;
#endif /* MAC */
	if (vision_full_recalc) vision_recalc(0);
	if (u.ux) flush_screen(1);		/* %% */
	putstr(WIN_MESSAGE, 0, line);
}

Norep

Norep() is similar to pline(), but if the same message is repeated after another, it's not shown again.

Example:

int x;
for (x = 0; x < 100; x++) {
  Norep("Whee!");
}


/*VARARGS1*/
void
Norep VA_DECL(const char *, line)
	VA_START(line);
	VA_INIT(line, const char *);
	no_repeat = TRUE;
	vpline(line, VA_ARGS);
	no_repeat = FALSE;
	VA_END();
	return;
}

You_buf

/* work buffer for You(), &c and verbalize() */
static char *you_buf = 0;
static int you_buf_siz = 0;

static char *
You_buf(siz)
int siz;
{
	if (siz > you_buf_siz) {
		if (you_buf) free((genericptr_t) you_buf);
		you_buf_siz = siz + 10;
		you_buf = (char *) alloc((unsigned) you_buf_siz);
	}
	return you_buf;
}

free_youbuf

void
free_youbuf()
{
	if (you_buf) free((genericptr_t) you_buf),  you_buf = (char *)0;
	you_buf_siz = 0;
}
/* `prefix' must be a string literal, not a pointer */
#define YouPrefix(pointer,prefix,text) \
Strcpy((pointer = You_buf((int)(strlen(text) + sizeof prefix))), prefix)

#define YouMessage(pointer,prefix,text) \
strcat((YouPrefix(pointer, prefix, text), pointer), text)

You

You() is similar to pline(), but the string is prefixed with "You "

Example:

You("succeed in opening the tin.");
/*VARARGS1*/
void
You VA_DECL(const char *, line)
	char *tmp;
	VA_START(line);
	VA_INIT(line, const char *);
	vpline(YouMessage(tmp, "You ", line), VA_ARGS);
	VA_END();
}

Your

Your() is similar to pline(), but the string is prefixed with "Your "

Example:

Your("wallet is empty.");
/*VARARGS1*/
void
Your VA_DECL(const char *,line)
	char *tmp;
	VA_START(line);
	VA_INIT(line, const char *);
	vpline(YouMessage(tmp, "Your ", line), VA_ARGS);
	VA_END();
}

You_feel

You_feel() is similar to pline(), but the string is prefixed with "You feel "

Example:

You_feel("much better!");
/*VARARGS1*/
void
You_feel VA_DECL(const char *,line)
	char *tmp;
	VA_START(line);
	VA_INIT(line, const char *);
	vpline(YouMessage(tmp, "You feel ", line), VA_ARGS);
	VA_END();
}

You_cant

You_cant() is similar to pline(), but the string is prefixed with "You can't "

Example:

You_cant("wear that!");
/*VARARGS1*/
void
You_cant VA_DECL(const char *,line)
	char *tmp;
	VA_START(line);
	VA_INIT(line, const char *);
	vpline(YouMessage(tmp, "You can't ", line), VA_ARGS);
	VA_END();
}

pline_The

pline_The() is similar to pline(), but the string is prefixed with "The "

Example:

pline_The("door resists!");
/*VARARGS1*/
void
pline_The VA_DECL(const char *,line)
	char *tmp;
	VA_START(line);
	VA_INIT(line, const char *);
	vpline(YouMessage(tmp, "The ", line), VA_ARGS);
	VA_END();
}

There

There() is similar to pline(), but the string is prefixed with "There "

Example:

There("are no seats in here!");
/*VARARGS1*/
void
There VA_DECL(const char *,line)
	char *tmp;
	VA_START(line);
	VA_INIT(line, const char *);
	vpline(YouMessage(tmp, "There ", line), VA_ARGS);
	VA_END();
}

You_hear

You_hear() is similar to pline(), but the string is prefixed with different things depeneding whether the hero is under water, asleep or awake.

Example:

You_hear("crashing rock.");
/*VARARGS1*/
void
You_hear VA_DECL(const char *,line)
	char *tmp;
	VA_START(line);
	VA_INIT(line, const char *);
	if (Underwater)
		YouPrefix(tmp, "You barely hear ", line);
	else if (u.usleep)
		YouPrefix(tmp, "You dream that you hear ", line);
	else
		YouPrefix(tmp, "You hear ", line);
	vpline(strcat(tmp, line), VA_ARGS);
	VA_END();
}

verbalize

verbalize() is similar to pline(), but the string is prefixed and suffixed with double quotes, making it seem as if something said it. If hero cannot hear, this outputs nothing.

Example:

verbalize("You freed me!");
/*VARARGS1*/
void
verbalize VA_DECL(const char *,line)
	char *tmp;
	if (!flags.soundok) return;
	VA_START(line);
	VA_INIT(line, const char *);
	tmp = You_buf((int)strlen(line) + sizeof "\"\"");
	Strcpy(tmp, "\"");
	Strcat(tmp, line);
	Strcat(tmp, "\"");
	vpline(tmp, VA_ARGS);
	VA_END();
}


raw_printf

raw_printf() is only used if the GUI isn't yet initialized, but we still need to tell the player something important. For example, config file errors are output with this. Accepts the same kind of variable parameters as pline().

/*VARARGS1*/
/* Note that these declarations rely on knowledge of the internals
* of the variable argument handling stuff in "tradstdc.h"
*/

#if defined(USE_STDARG) || defined(USE_VARARGS)
static void FDECL(vraw_printf,(const char *,va_list));

void
raw_printf VA_DECL(const char *, line)
	VA_START(line);
	VA_INIT(line, char *);
	vraw_printf(line, VA_ARGS);
	VA_END();
}

# ifdef USE_STDARG
static void
vraw_printf(const char *line, va_list the_args) {
# else
static void
vraw_printf(line, the_args) const char *line; va_list the_args; {
# endif

#else  /* USE_STDARG | USE_VARARG */

void
raw_printf VA_DECL(const char *, line)
#endif
/* Do NOT use VA_START and VA_END in here... see above */

	if(!index(line, '%'))
	    raw_print(line);
	else {
	    char pbuf[BUFSZ];
	    Vsprintf(pbuf,line,VA_ARGS);
	    raw_print(pbuf);
	}
}

impossible

impossible() is used to tell the player that NetHack thinks something is wrong. This might or might not be bad enough that NetHack will crash. It accepts the same parameters as pline().

/*VARARGS1*/
void
impossible VA_DECL(const char *, s)
	VA_START(s);
	VA_INIT(s, const char *);
	if (program_state.in_impossible)
		panic("impossible called impossible");
	program_state.in_impossible = 1;
	{
	    char pbuf[BUFSZ];
	    Vsprintf(pbuf,s,VA_ARGS);
	    paniclog("impossible", pbuf);
	}
	vpline(s,VA_ARGS);
	pline("Program in disorder - perhaps you'd better #quit.");
	program_state.in_impossible = 0;
	VA_END();
}

align_str

align_str() takes one parameter, an alignment, and returns a string describing it.

const char *
align_str(alignment)
aligntyp alignment;
{
switch ((int)alignment) {
	case A_CHAOTIC: return "chaotic";
	case A_NEUTRAL: return "neutral";
	case A_LAWFUL:	return "lawful";
	case A_NONE:	return "unaligned";
}
return "unknown";
}

mstatusline

mstatusline() takes one parameter, a monster, and shows the player a short status of that monster. This is used when probing a monster.

void
mstatusline(mtmp)
register struct monst *mtmp;
{
	aligntyp alignment;
	char info[BUFSZ], monnambuf[BUFSZ];

	if (mtmp->ispriest || mtmp->data == &mons[PM_ALIGNED_PRIEST]
				|| mtmp->data == &mons[PM_ANGEL])
		alignment = EPRI(mtmp)->shralign;
	else
		alignment = mtmp->data->maligntyp;
	alignment = (alignment > 0) ? A_LAWFUL :
		(alignment < 0) ? A_CHAOTIC :
		A_NEUTRAL;

	info[0] = 0;
	if (mtmp->mtame) {	  Strcat(info, ", tame");
#ifdef WIZARD
	    if (wizard) {
		Sprintf(eos(info), " (%d", mtmp->mtame);
		if (!mtmp->isminion)
		    Sprintf(eos(info), "; hungry %ld; apport %d",
			EDOG(mtmp)->hungrytime, EDOG(mtmp)->apport);
		Strcat(info, ")");
	    }
#endif
	}
	else if (mtmp->mpeaceful) Strcat(info, ", peaceful");
	if (mtmp->meating)	  Strcat(info, ", eating");
	if (mtmp->mcan)		  Strcat(info, ", cancelled");
	if (mtmp->mconf)	  Strcat(info, ", confused");
	if (mtmp->mblinded || !mtmp->mcansee)
				  Strcat(info, ", blind");
	if (mtmp->mstun)	  Strcat(info, ", stunned");
	if (mtmp->msleeping)	  Strcat(info, ", asleep");
#if 0	/* unfortunately mfrozen covers temporary sleep and being busy
	   (donning armor, for instance) as well as paralysis */
	else if (mtmp->mfrozen)	  Strcat(info, ", paralyzed");
#else
	else if (mtmp->mfrozen || !mtmp->mcanmove)
				  Strcat(info, ", can't move");
#endif
				  /* [arbitrary reason why it isn't moving] */
	else if (mtmp->mstrategy & STRAT_WAITMASK)
				  Strcat(info, ", meditating");
	else if (mtmp->mflee)	  Strcat(info, ", scared");
	if (mtmp->mtrapped)	  Strcat(info, ", trapped");
	if (mtmp->mspeed)	  Strcat(info,
					mtmp->mspeed == MFAST ? ", fast" :
					mtmp->mspeed == MSLOW ? ", slow" :
					", ???? speed");
	if (mtmp->mundetected)	  Strcat(info, ", concealed");
	if (mtmp->minvis)	  Strcat(info, ", invisible");
	if (mtmp == u.ustuck)	  Strcat(info,
			(sticks(youmonst.data)) ? ", held by you" :
				u.uswallow ? (is_animal(u.ustuck->data) ?
				", swallowed you" :
				", engulfed you") :
				", holding you");
#ifdef STEED
	if (mtmp == u.usteed)	  Strcat(info, ", carrying you");
#endif

	/* avoid "Status of the invisible newt ..., invisible" */
	/* and unlike a normal mon_nam, use "saddled" even if it has a name */
	Strcpy(monnambuf, x_monnam(mtmp, ARTICLE_THE, (char *)0,
	    (SUPPRESS_IT|SUPPRESS_INVISIBLE), FALSE));

	pline("Status of %s (%s):  Level %d  HP %d(%d)  AC %d%s.",
		monnambuf,
		align_str(alignment),
		mtmp->m_lev,
		mtmp->mhp,
		mtmp->mhpmax,
		find_mac(mtmp),
		info);
}

ustatusline

ustatusline() shows the player the hero's status as if he was probed.

void
ustatusline()
{
	char info[BUFSZ];

	info[0] = '\0';
	if (Sick) {
		Strcat(info, ", dying from");
		if (u.usick_type & SICK_VOMITABLE)
			Strcat(info, " food poisoning");
		if (u.usick_type & SICK_NONVOMITABLE) {
			if (u.usick_type & SICK_VOMITABLE)
				Strcat(info, " and");
			Strcat(info, " illness");
		}
	}
	if (Stoned)		Strcat(info, ", solidifying");
	if (Slimed)		Strcat(info, ", becoming slimy");
	if (Strangled)		Strcat(info, ", being strangled");
	if (Vomiting)		Strcat(info, ", nauseated"); /* !"nauseous" */
	if (Confusion)		Strcat(info, ", confused");
	if (Blind) {
	    Strcat(info, ", blind");
	    if (u.ucreamed) {
		if ((long)u.ucreamed < Blinded || Blindfolded
						|| !haseyes(youmonst.data))
		    Strcat(info, ", cover");
		Strcat(info, "ed by sticky goop");
	    }	/* note: "goop" == "glop"; variation is intentional */
	}
	if (Stunned)		Strcat(info, ", stunned");
#ifdef STEED
	if (!u.usteed)
#endif
	if (Wounded_legs) {
	    const char *what = body_part(LEG);
	    if ((Wounded_legs & BOTH_SIDES) == BOTH_SIDES)
		what = makeplural(what);
				Sprintf(eos(info), ", injured %s", what);
	}
	if (Glib)		Sprintf(eos(info), ", slippery %s",
					makeplural(body_part(HAND)));
	if (u.utrap)		Strcat(info, ", trapped");
	if (Fast)		Strcat(info, Very_fast ?
						", very fast" : ", fast");
	if (u.uundetected)	Strcat(info, ", concealed");
	if (Invis)		Strcat(info, ", invisible");
	if (u.ustuck) {
	    if (sticks(youmonst.data))
		Strcat(info, ", holding ");
	    else
		Strcat(info, ", held by ");
	    Strcat(info, mon_nam(u.ustuck));
	}

	pline("Status of %s (%s%s):  Level %d  HP %d(%d)  AC %d%s.",
		plname,
		    (u.ualign.record >= 20) ? "piously " :
		    (u.ualign.record > 13) ? "devoutly " :
		    (u.ualign.record > 8) ? "fervently " :
		    (u.ualign.record > 3) ? "stridently " :
		    (u.ualign.record == 3) ? "" :
		    (u.ualign.record >= 1) ? "haltingly " :
		    (u.ualign.record == 0) ? "nominally " :
					    "insufficiently ",
		align_str(u.ualign.type),
		Upolyd ? mons[u.umonnum].mlevel : u.ulevel,
		Upolyd ? u.mh : u.uhp,
		Upolyd ? u.mhmax : u.uhpmax,
		u.uac,
		info);
}

self_invis_message

self_invis_message() shows the player a message about the hero's invisibility; this should only be called if the hero just turned invisible.

void
self_invis_message()
{
	pline("%s %s.",
	    Hallucination ? "Far out, man!  You" : "Gee!  All of a sudden, you",
	    See_invisible ? "can see right through yourself" :
		"can't see yourself");
}

#endif /* OVLB */
/*pline.c*/