xref: /openbsd/games/hunt/huntd/extern.c (revision fc61954a)
1 /*	$OpenBSD: extern.c,v 1.6 2016/08/27 02:06:40 guenther Exp $	*/
2 /*	$NetBSD: extern.c,v 1.2 1997/10/10 16:33:24 lukem Exp $	*/
3 /*
4  * Copyright (c) 1983-2003, Regents of the University of California.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are
9  * met:
10  *
11  * + Redistributions of source code must retain the above copyright
12  *   notice, this list of conditions and the following disclaimer.
13  * + Redistributions in binary form must reproduce the above copyright
14  *   notice, this list of conditions and the following disclaimer in the
15  *   documentation and/or other materials provided with the distribution.
16  * + Neither the name of the University of California, San Francisco nor
17  *   the names of its contributors may be used to endorse or promote
18  *   products derived from this software without specific prior written
19  *   permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #include <sys/select.h>
35 #include "hunt.h"
36 #include "server.h"
37 
38 FLAG	Am_monitor = FALSE;		/* current process is a monitor */
39 
40 char	Buf[BUFSIZ];			/* general scribbling buffer */
41 char	Maze[HEIGHT][WIDTH2];		/* the maze */
42 char	Orig_maze[HEIGHT][WIDTH2];	/* the original maze */
43 
44 fd_set	Fds_mask;			/* mask for the file descriptors */
45 fd_set	Have_inp;			/* which file descriptors have input */
46 int	Nplayer = 0;			/* number of players */
47 int	Num_fds;			/* number of maximum file descriptor */
48 int	Socket;				/* main socket */
49 int	Status;				/* stat socket */
50 int	See_over[NASCII];		/* lookup table for determining whether
51 					 * character represents "transparent"
52 					 * item */
53 
54 BULLET	*Bullets = NULL;		/* linked list of bullets */
55 
56 EXPL	*Expl[EXPLEN];			/* explosion lists */
57 EXPL	*Last_expl;			/* last explosion on Expl[0] */
58 
59 PLAYER	Player[MAXPL];			/* all the players */
60 PLAYER	*End_player = Player;		/* last active player slot */
61 PLAYER	Boot[NBOOTS];			/* all the boots */
62 IDENT	*Scores;			/* score cache */
63 PLAYER	Monitor[MAXMON];		/* all the monitors */
64 PLAYER	*End_monitor = Monitor;		/* last active monitor slot */
65 
66 int	volcano = 0;			/* Explosion size */
67 
68 int	shot_req[MAXBOMB]	= {
69 				BULREQ, GRENREQ, SATREQ,
70 				BOMB7REQ, BOMB9REQ, BOMB11REQ,
71 				BOMB13REQ, BOMB15REQ, BOMB17REQ,
72 				BOMB19REQ, BOMB21REQ,
73 			};
74 int	shot_type[MAXBOMB]	= {
75 				SHOT, GRENADE, SATCHEL,
76 				BOMB, BOMB, BOMB,
77 				BOMB, BOMB, BOMB,
78 				BOMB, BOMB,
79 			};
80 
81 int	slime_req[MAXSLIME]	= {
82 				SLIMEREQ, SSLIMEREQ, SLIME2REQ, SLIME3REQ,
83 			};
84