summaryrefslogtreecommitdiffstats
path: root/rogue/room.c
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1997-10-12 11:45:01 +0000
committerlukem <lukem@NetBSD.org>1997-10-12 11:45:01 +0000
commita0041450da452d421fa15f352d533a000c2e7921 (patch)
tree500a4c4a314b36a49f50552293c66aa268eb59f2 /rogue/room.c
parent8d2dd1244517d9cf4b4e1fd9a4914c5496e8dfac (diff)
downloadbsdgames-darwin-a0041450da452d421fa15f352d533a000c2e7921.tar.gz
bsdgames-darwin-a0041450da452d421fa15f352d533a000c2e7921.tar.zst
bsdgames-darwin-a0041450da452d421fa15f352d533a000c2e7921.zip
WARNSify (not an insignificant task...)
Diffstat (limited to 'rogue/room.c')
-rw-r--r--rogue/room.c73
1 files changed, 48 insertions, 25 deletions
diff --git a/rogue/room.c b/rogue/room.c
index 88cd0e36..9aec0e74 100644
--- a/rogue/room.c
+++ b/rogue/room.c
@@ -1,4 +1,4 @@
-/* $NetBSD: room.c,v 1.3 1995/04/22 10:28:17 cgd Exp $ */
+/* $NetBSD: room.c,v 1.4 1997/10/12 11:45:56 lukem Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -36,11 +36,12 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)room.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: room.c,v 1.3 1995/04/22 10:28:17 cgd Exp $";
+__RCSID("$NetBSD: room.c,v 1.4 1997/10/12 11:45:56 lukem Exp $");
#endif
#endif /* not lint */
@@ -61,10 +62,6 @@ static char rcsid[] = "$NetBSD: room.c,v 1.3 1995/04/22 10:28:17 cgd Exp $";
room rooms[MAXROOMS];
boolean rooms_visited[MAXROOMS];
-extern short blind;
-extern boolean detect_monster, jump, passgo, no_skull, ask_quit;
-extern char *nick_name, *fruit, *save_file, *press_space;
-
#define NOPTS 7
struct option {
@@ -103,8 +100,9 @@ struct option {
}
};
+void
light_up_room(rn)
-int rn;
+ int rn;
{
short i, j;
@@ -116,7 +114,8 @@ int rn;
if (dungeon[i][j] & MONSTER) {
object *monster;
- if (monster = object_at(&level_monsters, i, j)) {
+ if ((monster = object_at(
+ &level_monsters, i, j)) != NULL) {
dungeon[monster->row][monster->col] &= (~MONSTER);
monster->trail_char =
get_dungeon_char(monster->row, monster->col);
@@ -130,6 +129,7 @@ int rn;
}
}
+void
light_passage(row, col)
{
short i, j, i_end, j_end;
@@ -149,8 +149,9 @@ light_passage(row, col)
}
}
+void
darken_room(rn)
-short rn;
+ short rn;
{
short i, j;
@@ -173,10 +174,11 @@ short rn;
}
}
+char
get_dungeon_char(row, col)
-register row, col;
+ short row, col;
{
- register unsigned short mask = dungeon[row][col];
+ unsigned short mask = dungeon[row][col];
if (mask & MONSTER) {
return(gmc_row_col(row, col));
@@ -221,8 +223,9 @@ register row, col;
return(' ');
}
+char
get_mask_char(mask)
-register unsigned short mask;
+ unsigned short mask;
{
switch(mask) {
case SCROL:
@@ -248,9 +251,10 @@ register unsigned short mask;
}
}
+void
gr_row_col(row, col, mask)
-short *row, *col;
-unsigned short mask;
+ short *row, *col;
+ unsigned short mask;
{
short rn;
short r, c;
@@ -269,6 +273,7 @@ unsigned short mask;
*col = c;
}
+short
gr_room()
{
short i;
@@ -280,13 +285,16 @@ gr_room()
return(i);
}
+short
party_objects(rn)
+ int rn;
{
short i, j, nf = 0;
object *obj;
short n, N, row, col;
boolean found;
+ row = col = 0;
N = ((rooms[rn].bottom_row - rooms[rn].top_row) - 1) *
((rooms[rn].right_col - rooms[rn].left_col) - 1);
n = get_rand(5, 10);
@@ -312,8 +320,9 @@ party_objects(rn)
return(nf);
}
+short
get_room_number(row, col)
-register row, col;
+ int row, col;
{
short i;
@@ -326,10 +335,12 @@ register row, col;
return(NO_ROOM);
}
+boolean
is_all_connected()
{
short i, starting_room;
+ starting_room = 0;
for (i = 0; i < MAXROOMS; i++) {
rooms_visited[i] = 0;
if (rooms[i].is_room & (R_ROOM | R_MAZE)) {
@@ -347,8 +358,9 @@ is_all_connected()
return(1);
}
+void
visit_rooms(rn)
-int rn;
+ int rn;
{
short i;
short oth_rn;
@@ -363,6 +375,7 @@ int rn;
}
}
+void
draw_magic_map()
{
short i, j, ch, och;
@@ -399,8 +412,11 @@ draw_magic_map()
if (s & MONSTER) {
object *monster;
- if (monster = object_at(&level_monsters, i, j)) {
- monster->trail_char = ch;
+ if ((monster = object_at(
+ &level_monsters, i, j))
+ != NULL) {
+ monster->trail_char =
+ ch;
}
}
}
@@ -409,10 +425,11 @@ draw_magic_map()
}
}
+void
dr_course(monster, entering, row, col)
-object *monster;
-boolean entering;
-short row, col;
+ object *monster;
+ boolean entering;
+ short row, col;
{
short i, j, k, rn;
short r, rr;
@@ -483,8 +500,9 @@ short row, col;
}
}
+boolean
get_oth_room(rn, row, col)
-short rn, *row, *col;
+ short rn, *row, *col;
{
short d = -1;
@@ -505,6 +523,7 @@ short rn, *row, *col;
return(0);
}
+void
edit_opts()
{
char save[NOPTS+1][DCOLS];
@@ -603,8 +622,9 @@ CH:
}
}
+void
opt_show(i)
-int i;
+ int i;
{
char *s;
struct option *opt = &options[i];
@@ -619,8 +639,9 @@ int i;
addstr(s);
}
+void
opt_erase(i)
-int i;
+ int i;
{
struct option *opt = &options[i];
@@ -628,12 +649,14 @@ int i;
clrtoeol();
}
+void
opt_go(i)
-int i;
+ int i;
{
move(i, strlen(options[i].prompt));
}
+void
do_shell()
{
#ifdef UNIX