annotate xrogue/rooms.c @ 201:6fb21004a981

Fix some preprocessor directives. Include process.h in the right place, and use the correct definition of PATH_MAX, when compiling on Windows.
author John "Elwin" Edwards
date Wed, 12 Aug 2015 16:56:19 -0400
parents ce0cf824c192
children f54901b9c39b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
133
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
1 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
2 rooms.c - Draw the nine rooms on the screen
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
3
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
4 XRogue: Expeditions into the Dungeons of Doom
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
5 Copyright (C) 1991 Robert Pietkivitch
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
6 All rights reserved.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
7
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
8 Based on "Advanced Rogue"
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
9 Copyright (C) 1984, 1985 Michael Morgan, Ken Dalka and AT&T
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
10 All rights reserved.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
11
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
12 Based on "Rogue: Exploring the Dungeons of Doom"
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
13 Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
14 All rights reserved.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
15
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
16 See the file LICENSE.TXT for full copyright and licensing information.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
17 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
18
135
ce0cf824c192 xrogue: add missing includes.
John "Elwin" Edwards
parents: 133
diff changeset
19 #include <stdlib.h>
133
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
20 #include <curses.h>
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
21 #include "rogue.h"
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
22
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
23 do_rooms()
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
24 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
25 register int i;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
26 register struct room *rp;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
27 register struct linked_list *item;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
28 register struct thing *tp;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
29 int left_out;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
30 int num_monsters;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
31 int which_monster;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
32 int j;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
33 coord top;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
34 coord bsze;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
35 coord mp;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
36 coord *np;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
37
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
38 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
39 * bsze is the maximum room size
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
40 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
41 bsze.x = cols/3;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
42 bsze.y = (lines-2)/3;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
43 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
44 * Clear things for a new level
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
45 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
46 for (rp = rooms; rp < &rooms[MAXROOMS]; rp++) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
47 rp->r_flags = 0;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
48 _r_free_fire_list(&rp->r_fires);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
49 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
50 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
51 * Put the gone rooms, if any, on the level
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
52 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
53 left_out = rnd(4);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
54 for (i = 0; i < left_out; i++)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
55 rooms[rnd_room()].r_flags |= ISGONE;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
56 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
57 * dig and populate all the rooms on the level
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
58 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
59 for (i = 0, rp = rooms; i < MAXROOMS; rp++, i++)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
60 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
61 bool has_gold=FALSE;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
62
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
63 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
64 * Find upper left corner of box that this room goes in
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
65 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
66 top.x = (i%3)*bsze.x;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
67 top.y = i/3*bsze.y + 1;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
68 if (rp->r_flags & ISGONE)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
69 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
70 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
71 * Place a gone room. Make certain that there is a blank line
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
72 * for passage drawing.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
73 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
74 do
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
75 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
76 rp->r_pos.x = top.x + rnd(bsze.x-2) + 1;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
77 rp->r_pos.y = top.y + rnd(bsze.y-2) + 1;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
78 rp->r_max.x = -cols;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
79 rp->r_max.y = -lines;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
80 } until(rp->r_pos.y > 0 && rp->r_pos.y < lines-2);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
81 continue;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
82 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
83 if (rnd(10) < level-1)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
84 rp->r_flags |= ISDARK;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
85 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
86 * Find a place and size for a random room
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
87 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
88 do
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
89 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
90 rp->r_max.x = rnd(bsze.x - 4) + 4;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
91 rp->r_max.y = rnd(bsze.y - 4) + 4;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
92 rp->r_pos.x = top.x + rnd(bsze.x - rp->r_max.x);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
93 rp->r_pos.y = top.y + rnd(bsze.y - rp->r_max.y);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
94 } until (rp->r_pos.y != 0);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
95
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
96 /* Draw the room */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
97 draw_room(rp);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
98
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
99 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
100 * Put the gold in
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
101 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
102 if (rnd(100) < 55 && level >= cur_max)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
103 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
104 register struct linked_list *item;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
105 register struct object *cur;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
106 coord tp;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
107
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
108 has_gold = TRUE; /* This room has gold in it */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
109
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
110 item = spec_item(GOLD, NULL, NULL, NULL);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
111 cur = OBJPTR(item);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
112
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
113 /* Put the gold into the level list of items */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
114 attach(lvl_obj, item);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
115
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
116 /* Put it somewhere */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
117 rnd_pos(rp, &tp);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
118 mvaddch(tp.y, tp.x, GOLD);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
119 cur->o_pos = tp;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
120 if (roomin(&tp) != rp) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
121 endwin();
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
122 abort();
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
123 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
124 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
125
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
126 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
127 * Put the monster in
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
128 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
129 if (rnd(100) < (has_gold ? 80 : 25) + vlevel/2)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
130 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
131 do
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
132 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
133 rnd_pos(rp, &mp);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
134 } until(mvwinch(stdscr, mp.y, mp.x) == FLOOR);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
135 which_monster = randmonster(FALSE, FALSE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
136 num_monsters = 1;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
137 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
138 * see if we should make a whole bunch
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
139 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
140 for (j=0; j<MAXFLAGS; j++) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
141 if (monsters[which_monster].m_flags[j] == AREMANY)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
142 num_monsters = roll(7,2);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
143 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
144 for (j=0; j<num_monsters; j++) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
145 if ((np = fallpos(&mp, FALSE, 2)) != NULL &&
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
146 mvwinch(stdscr, np->y, np->x) == FLOOR) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
147 item = new_item(sizeof *tp);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
148 tp = THINGPTR(item);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
149 new_monster(item, which_monster, np, FALSE);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
150 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
151 * See if we want to give it a treasure to
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
152 * carry around.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
153 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
154 carry_obj(tp, monsters[tp->t_index].m_carry);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
155 tp->t_no_move = movement(tp);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
156
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
157 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
158 * If it has a fire, mark it
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
159 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
160 if (on(*tp, HASFIRE)) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
161 register struct linked_list *fire_item;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
162
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
163 fire_item = creat_item();
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
164 ldata(fire_item) = (char *) tp;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
165 attach(rp->r_fires, fire_item);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
166 rp->r_flags |= HASFIRE;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
167 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
168 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
169 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
170 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
171 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
172 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
173
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
174 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
175 * Given a room pointer and a pointer to a door, supposedly in that room,
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
176 * return the coordinates of the entrance to the doorway.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
177 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
178
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
179 coord *
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
180 doorway(rp, door)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
181 register struct room *rp;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
182 register coord *door;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
183 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
184 register int misses = 0;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
185 static coord answer;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
186
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
187 /* Do we have decent parameters? */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
188 if (rp == NULL || door == NULL) return(NULL);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
189
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
190 /* Initialize the answer to be the door, then calculate the offset */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
191 answer = *door;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
192
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
193 /* Calculate the x-offset */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
194 if (door->x == rp->r_pos.x) answer.x++;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
195 else if (door->x == rp->r_pos.x + rp->r_max.x - 1) answer.x--;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
196 else misses++;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
197
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
198 /* Calculate the y-offset */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
199 if (door->y == rp->r_pos.y) answer.y++;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
200 else if (door->y == rp->r_pos.y + rp->r_max.y - 1) answer.y--;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
201 else misses++;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
202
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
203 if (misses <= 1) return(&answer);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
204 else return(NULL);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
205 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
206
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
207 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
208 * Draw a box around a room
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
209 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
210
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
211 draw_room(rp)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
212 register struct room *rp;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
213 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
214 register int j, k;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
215
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
216 move(rp->r_pos.y, rp->r_pos.x+1);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
217 vert(rp->r_max.y-2); /* Draw left side */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
218 move(rp->r_pos.y+rp->r_max.y-1, rp->r_pos.x);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
219 horiz(rp->r_max.x); /* Draw bottom */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
220 move(rp->r_pos.y, rp->r_pos.x);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
221 horiz(rp->r_max.x); /* Draw top */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
222 vert(rp->r_max.y-2); /* Draw right side */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
223 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
224 * Put the floor down
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
225 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
226 for (j = 1; j < rp->r_max.y-1; j++)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
227 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
228 move(rp->r_pos.y + j, rp->r_pos.x+1);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
229 for (k = 1; k < rp->r_max.x-1; k++)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
230 addch(FLOOR);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
231 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
232 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
233
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
234 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
235 * horiz:
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
236 * draw a horizontal line
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
237 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
238
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
239 horiz(cnt)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
240 register int cnt;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
241 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
242 while (cnt--)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
243 addch(HORZWALL);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
244 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
245
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
246 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
247 * rnd_pos:
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
248 * pick a random spot in a room
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
249 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
250
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
251 rnd_pos(rp, cp)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
252 register struct room *rp;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
253 register coord *cp;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
254 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
255 cp->x = rp->r_pos.x + rnd(rp->r_max.x-2) + 1;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
256 cp->y = rp->r_pos.y + rnd(rp->r_max.y-2) + 1;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
257 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
258
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
259
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
260
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
261 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
262 * roomin:
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
263 * Find what room some coordinates are in. NULL means they aren't
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
264 * in any room.
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
265 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
266
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
267 struct room *
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
268 roomin(cp)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
269 register coord *cp;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
270 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
271 register struct room *rp;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
272
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
273 for (rp = rooms; rp < &rooms[MAXROOMS]; rp++)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
274 if (inroom(rp, cp))
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
275 return rp;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
276 return NULL;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
277 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
278
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
279 /*
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
280 * vert:
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
281 * draw a vertical line
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
282 */
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
283
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
284 vert(cnt)
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
285 register int cnt;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
286 {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
287 register int x, y;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
288
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
289 getyx(stdscr, y, x);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
290 x--;
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
291 while (cnt--) {
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
292 move(++y, x);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
293 addch(VERTWALL);
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
294 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
295 }
e6179860cb76 Import XRogue 8.0 from the Roguelike Restoration Project (r1490)
John "Elwin" Edwards
parents:
diff changeset
296