annotate rogue5/misc.c @ 33:f502bf60e6e4

Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
author elwin
date Mon, 24 May 2010 20:10:59 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
1 /*
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
2 * All sorts of miscellaneous routines
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
3 *
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
4 * @(#)misc.c 4.66 (Berkeley) 08/06/83
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
5 *
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
6 * Rogue: Exploring the Dungeons of Doom
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
7 * Copyright (C) 1980-1983, 1985, 1999 Michael Toy, Ken Arnold and Glenn Wichman
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
8 * All rights reserved.
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
9 *
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
10 * See the file LICENSE.TXT for full copyright and licensing information.
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
11 */
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
12
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
13 #include <stdlib.h>
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
14 #include <curses.h>
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
15 #include <string.h>
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
16 #include <ctype.h>
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
17 #include "rogue.h"
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
18
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
19 /*
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
20 * look:
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
21 * A quick glance all around the player
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
22 */
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
23 #undef DEBUG
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
24
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
25
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
26 void
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
27 look(int wakeup)
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
28 {
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
29 int x, y;
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
30 chtype ch;
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
31 THING *tp;
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
32 PLACE *pp;
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
33 struct room *rp;
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
34 int ey, ex;
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
35 int passcount;
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
36 int pfl, *fp, pch;
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
37 int sy, sx, sumhero = 0, diffhero = 0;
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
38 # ifdef DEBUG
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
39 static int done = FALSE;
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
40
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
41 if (done)
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
42 return;
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
43 done = TRUE;
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
44 # endif /* DEBUG */
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
45 passcount = 0;
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
46 rp = proom;
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
47 if (!ce(oldpos, hero))
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
48 {
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents:
diff changeset
49 erase_lamp(&oldpos, oldrp);
f502bf60e6e4 Import Rogue 5.4 from the Roguelike Restoration Project (r1490)
elwin
parents: