xref: /netbsd-src/games/hack/hack.Decl.c (revision b8c355d7896519f66e29cae20b34b99561f6a4cf)
1*b8c355d7Sdholland /*	$NetBSD: hack.Decl.c,v 1.8 2009/06/07 21:04:54 dholland Exp $	*/
23ea4a95cSchristos 
302ded532Smycroft /*
41c7f94e5Sjsm  * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
51c7f94e5Sjsm  * Amsterdam
61c7f94e5Sjsm  * All rights reserved.
71c7f94e5Sjsm  *
81c7f94e5Sjsm  * Redistribution and use in source and binary forms, with or without
91c7f94e5Sjsm  * modification, are permitted provided that the following conditions are
101c7f94e5Sjsm  * met:
111c7f94e5Sjsm  *
121c7f94e5Sjsm  * - Redistributions of source code must retain the above copyright notice,
131c7f94e5Sjsm  * this list of conditions and the following disclaimer.
141c7f94e5Sjsm  *
151c7f94e5Sjsm  * - Redistributions in binary form must reproduce the above copyright
161c7f94e5Sjsm  * notice, this list of conditions and the following disclaimer in the
171c7f94e5Sjsm  * documentation and/or other materials provided with the distribution.
181c7f94e5Sjsm  *
191c7f94e5Sjsm  * - Neither the name of the Stichting Centrum voor Wiskunde en
201c7f94e5Sjsm  * Informatica, nor the names of its contributors may be used to endorse or
211c7f94e5Sjsm  * promote products derived from this software without specific prior
221c7f94e5Sjsm  * written permission.
231c7f94e5Sjsm  *
241c7f94e5Sjsm  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
251c7f94e5Sjsm  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
261c7f94e5Sjsm  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
271c7f94e5Sjsm  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
281c7f94e5Sjsm  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
291c7f94e5Sjsm  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
301c7f94e5Sjsm  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
311c7f94e5Sjsm  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
321c7f94e5Sjsm  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
331c7f94e5Sjsm  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
341c7f94e5Sjsm  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
351c7f94e5Sjsm  */
361c7f94e5Sjsm 
371c7f94e5Sjsm /*
381c7f94e5Sjsm  * Copyright (c) 1982 Jay Fenlason <hack@gnu.org>
391c7f94e5Sjsm  * All rights reserved.
401c7f94e5Sjsm  *
411c7f94e5Sjsm  * Redistribution and use in source and binary forms, with or without
421c7f94e5Sjsm  * modification, are permitted provided that the following conditions
431c7f94e5Sjsm  * are met:
441c7f94e5Sjsm  * 1. Redistributions of source code must retain the above copyright
451c7f94e5Sjsm  *    notice, this list of conditions and the following disclaimer.
461c7f94e5Sjsm  * 2. Redistributions in binary form must reproduce the above copyright
471c7f94e5Sjsm  *    notice, this list of conditions and the following disclaimer in the
481c7f94e5Sjsm  *    documentation and/or other materials provided with the distribution.
491c7f94e5Sjsm  * 3. The name of the author may not be used to endorse or promote products
501c7f94e5Sjsm  *    derived from this software without specific prior written permission.
511c7f94e5Sjsm  *
521c7f94e5Sjsm  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
531c7f94e5Sjsm  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
541c7f94e5Sjsm  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
551c7f94e5Sjsm  * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
561c7f94e5Sjsm  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
571c7f94e5Sjsm  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
581c7f94e5Sjsm  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
591c7f94e5Sjsm  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
601c7f94e5Sjsm  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
611c7f94e5Sjsm  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6202ded532Smycroft  */
6302ded532Smycroft 
643ea4a95cSchristos #include <sys/cdefs.h>
6502ded532Smycroft #ifndef lint
66*b8c355d7Sdholland __RCSID("$NetBSD: hack.Decl.c,v 1.8 2009/06/07 21:04:54 dholland Exp $");
6702ded532Smycroft #endif				/* not lint */
6861f28255Scgd 
6961f28255Scgd #include	"hack.h"
70a7a3b831Sdholland const char      nul[40];	/* contains zeros */
7161f28255Scgd char            plname[PL_NSIZ];/* player name */
723ea4a95cSchristos char            lock[PL_NSIZ + 4] = "1lock";	/* long enough for login name
733ea4a95cSchristos 						 * .99 */
7461f28255Scgd 
7561f28255Scgd boolean         in_mklev, restoring;
7661f28255Scgd 
7761f28255Scgd struct rm       levl[COLNO][ROWNO];	/* level map */
7861f28255Scgd #ifndef QUEST
7961f28255Scgd #include "def.mkroom.h"
8061f28255Scgd struct mkroom   rooms[MAXNROFROOMS + 1];
8161f28255Scgd coord           doors[DOORMAX];
823ea4a95cSchristos #endif	/* QUEST */
8361f28255Scgd struct monst   *fmon = 0;
8461f28255Scgd struct trap    *ftrap = 0;
8561f28255Scgd struct gold    *fgold = 0;
863ea4a95cSchristos struct obj     *fobj = 0, *fcobj = 0, *invent = 0, *uwep = 0, *uarm = 0, *uarm2 = 0,
873ea4a95cSchristos                *uarmh = 0, *uarms = 0, *uarmg = 0, *uright = 0, *uleft = 0,
883ea4a95cSchristos                *uchain = 0, *uball = 0;
8961f28255Scgd struct flag     flags;
9061f28255Scgd struct you      u;
9161f28255Scgd struct monst    youmonst;	/* dummy; used as return value for boomhit */
9261f28255Scgd 
9361f28255Scgd xchar           dlevel = 1;
9461f28255Scgd xchar           xupstair, yupstair, xdnstair, ydnstair;
95*b8c355d7Sdholland const char *save_cm = NULL;
96ab8b6343Sjsm const char *killer, *nomovemsg;
9761f28255Scgd 
9861f28255Scgd long            moves = 1;
9961f28255Scgd long            wailmsg = 0;
10061f28255Scgd 
10161f28255Scgd int             multi = 0;
10261f28255Scgd char            genocided[60];
10361f28255Scgd char            fut_geno[60];
10461f28255Scgd 
10561f28255Scgd xchar           curx, cury;
10661f28255Scgd xchar           seelx, seehx, seely, seehy;	/* corners of lit room */
10761f28255Scgd 
10861f28255Scgd coord           bhitpos;
10961f28255Scgd 
110ab8b6343Sjsm const char      quitchars[] = " \r\n\033";
111