]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - hunt/include/hunt_common.h
1 /* $NetBSD: hunt_common.h,v 1.4 2014/03/30 05:30:28 dholland Exp $ */
4 * Copyright (c) 1983-2003, Regents of the University of California.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
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
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.
36 * There is no particular significance to the numbers assigned
37 * to Test_port. They're just random numbers greater than the
38 * range reserved for privileged sockets.
42 #define SOCK_FAMILY AF_INET
43 #define TEST_PORT (('h' << 8) | 't')
45 #define SOCK_FAMILY AF_UNIX
46 #define AF_UNIX_HACK /* 4.2 hack; leaves files around */
50 * Preprocessor define dependencies
52 #if defined(VOLCANO) && !defined(OOZE)
55 #if defined(BOOTS) && !defined(FLY)
58 #if !defined(REFLECT) && !defined(RANDOM)
62 /* decrement version number for each change in startup protocol */
63 #define HUNT_VERSION -1
65 #define ADDCH ('a' | 0200)
66 #define MOVE ('m' | 0200)
67 #define REFRESH ('r' | 0200)
68 #define CLRTOEOL ('c' | 0200)
69 #define ENDWIN ('e' | 0200)
70 #define CLEAR ('C' | 0200)
71 #define REDRAW ('R' | 0200)
72 #define LAST_PLAYER ('l' | 0200)
73 #define BELL ('b' | 0200)
74 #define READY ('g' | 0200)
77 * Choose MAXPL and MAXMON carefully. The screen is assumed to be
78 * 23 lines high and will only tolerate (MAXPL == 17 && MAXMON == 0)
79 * or (MAXPL + MAXMON <= 16).
88 #define WIRE_NAMELEN 20
89 #define MSGLEN SCREEN_WIDTH
95 #define WIDTH2 64 /* Next power of 2 >= WIDTH (for fast access) */
98 #define DBOUND (HEIGHT - 1)
100 #define RBOUND (WIDTH - 1)
102 #define SCREEN_HEIGHT 24
103 #define SCREEN_WIDTH 80
104 #define SCREEN_WIDTH2 128 /* Next power of 2 >= SCREEN_WIDTH */
106 #define STAT_LABEL_COL 60
107 #define STAT_VALUE_COL 74
108 #define STAT_NAME_COL 61
109 #define STAT_SCAN_COL (STAT_NAME_COL + 5)
110 #define STAT_AMMO_ROW 0
111 #define STAT_GUN_ROW 1
112 #define STAT_DAM_ROW 2
113 #define STAT_KILL_ROW 3
114 #define STAT_PLAY_ROW 5
116 #define STAT_MON_ROW (STAT_PLAY_ROW + MAXPL + 1)
118 #define STAT_NAME_LEN 18
150 #define BOOT_PAIR 'B'
160 #define isplayer(c) (c == LEFTS || c == RIGHT ||\
161 c == ABOVE || c == BELOW || c == FLYER)
163 #define isplayer(c) (c == LEFTS || c == RIGHT ||\
164 c == ABOVE || c == BELOW)
173 #define CTRL(x) ((x) & 037)
175 #define BULSPD 5 /* bullets movement speed */
188 #define BOMB11REQ 121
189 #define BOMB13REQ 169
190 #define BOMB15REQ 225
191 #define BOMB17REQ 289
192 #define BOMB19REQ 361
193 #define BOMB21REQ 441
196 #define MINDSHOT 2 /* At least a satchel bomb */
200 #define SLIME_FACTOR 3
213 #define SCANLEN (Nplayer * 20)
228 #define _scan_char(pp) (((pp)->p_scan < 0) ? ' ' : '*')
229 #define _cloak_char(pp) (((pp)->p_cloak < 0) ? _scan_char(pp) : '+')
230 #define stat_char(pp) (((pp)->p_flying < 0) ? _cloak_char(pp) : FLYER)
232 #define _scan_char(pp) (((pp)->p_scan < 0) ? ' ' : '*')
233 #define stat_char(pp) (((pp)->p_cloak < 0) ? _scan_char(pp) : '+')
237 typedef struct sockaddr_in SOCKET
;
239 typedef struct sockaddr_un SOCKET
;