Source:NetHack 1.4f/hack.h

From NetHackWiki
Jump to: navigation, search

Below is the full text to hack.h from the source code of NetHack 1.4f. To link to a particular line, write [[NetHack 1.4f/hack.h#line123]], for example.

Warning! This is the source code from an old release. For the latest release, see Source code

Screenshots and source code from Hack are used under the CWI license.

1.    /*	SCCS Id: @(#)hack.h	1.4	87/08/08
2.    /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3.    /* hack.h - version 1.0.3 */
4.    
5.    #include "config.h"
6.    
7.    #ifdef __TURBOC__
8.    /* work around the case-insensitivity of the DOS linker */
9.    #define Amonnam Amonnam_
10.   #define Xmonnam Xmonnam_
11.   #define Monnam Monnam_
12.   #define POISONOUS POISONOUS_
13.   #define Doname Doname_
14.   #define Tmp_at Tmp_at_
15.   /* rename the next two functions because they clash with the Turbo C library */
16.   #define getdate getdate_
17.   #define itoa itoa_
18.   #endif
19.   
20.   
21.   #define	Null(type)	((struct type *) 0)
22.   
23.   #include	"objclass.h"
24.   
25.   typedef struct {
26.   	xchar x,y;
27.   } coord;
28.   
29.   extern coord bhitpos;	/* place where thrown weapon falls to the ground */
30.   
31.   #include	"monst.h"	/* uses coord */
32.   #include	"gold.h"
33.   #include	"trap.h"
34.   #include	"obj.h"
35.   #include	"flag.h"
36.   
37.   #define	plur(x)	(((x) == 1) ? "" : "s")
38.   #define min(x,y) ((x) < (y) ? (x) : (y))
39.   
40.   #define	BUFSZ	256	/* for getlin buffers */
41.   #define	PL_NSIZ	32	/* name of player, ghost, shopkeeper */
42.   
43.   #include	"rm.h"
44.   
45.   #define Inhell		(dlevel >= 30)
46.   #define	newstring(x)	(char *) alloc((unsigned)(x))
47.   
48.   #ifdef SPELLS
49.   #include "spell.h"
50.   #define	NO_SPELL	0
51.   #endif
52.   
53.   #define	TELL	1
54.   #define NOTELL	0
55.   
56.   #define ON 1
57.   #define OFF 0
58.   
59.   #include "extern.h"
60.   
61.   #ifdef GENIX
62.   #define DIST	jhndist
63.   /*	genix compiler chokes on DIST macro below - jhn*/
64.   #else
65.   #define DIST(x1,y1,x2,y2)       (((x1)-(x2))*((x1)-(x2)) + ((y1)-(y2))*((y1)-(y2)))
66.   #endif
67.   
68.   #define	PL_CSIZ		20	/* sizeof pl_character */
69.   #ifdef HARD
70.   #define	MAX_CARR_CAP	120	/* so that boulders can be heavier */
71.   #else
72.   #define	MAX_CARR_CAP	500
73.   #endif
74.   #define	MAXLEVEL	40
75.   #define	FAR	(COLNO+2)	/* position outside screen */