Source:NetHack 3.0.0/decl.c

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to decl.c from the source code of NetHack 3.0.0. To link to a particular line, write [[NetHack 3.0.0/decl.c#line123]], for example.

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

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

1.    /*	SCCS Id: @(#)decl.c	3.0	88/10/25
2.    /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3.    /* NetHack may be freely redistributed.  See license for details. */
4.    
5.    #include	"hack.h"
6.    
7.    int multi = 0;
8.    int warnlevel = 0;		/* used by movemon and dochugw */
9.    int nroom = 0;
10.   int occtime = 0;
11.   
12.   int x_maze_max, y_maze_max;	/* initialized in main, used in mkmaze.c */
13.   
14.   #ifdef REDO
15.   int in_doagain = 0;
16.   #endif
17.   
18.   /*
19.    *	The following integers will be initialized at load time with
20.    *	the level numbers of some "important" things in the game.
21.    */
22.   
23.    int
24.   	medusa_level = 0,	/* level that the medusa lives on */
25.   	bigroom_level = 0,	/* level consisting of a single big room */
26.   #ifdef REINCARNATION
27.   	rogue_level = 0,	/* level near which rogue level gen'd */
28.   #endif
29.   #ifdef ORACLE
30.   	oracle_level = 0,	/* level near which Oracle gen'd */
31.   #endif
32.   #ifdef STRONGHOLD
33.   	stronghold_level = 3,	/* level the castle is on */
34.   	/* Not 0, otherwise they start the game in Hell and burn immediately */
35.   	tower_level = 0,	/* level of the top of Vlad's 3-level tower */
36.   #endif
37.   	wiz_level = 0;		/* level that the wiz lives on */
38.   boolean is_maze_lev = FALSE;    /* if this is a maze level */
39.   
40.   int smeq[MAXNROFROOMS+1] = DUMMY;
41.   int doorindex = 0;
42.   
43.   char *save_cm = 0;
44.   char *killer = 0;
45.   char *nomovemsg = 0;
46.   const char nul[40] = DUMMY;		/* contains zeros */
47.   char plname[PL_NSIZ] = DUMMY;		/* player name */
48.   char pl_character[PL_CSIZ] = DUMMY;
49.   char pl_fruit[PL_FSIZ] = DUMMY;
50.   int current_fruit = 0;
51.   struct fruit *ffruit = 0;
52.   #ifdef STRONGHOLD
53.   char tune[6] = DUMMY;
54.   #  ifdef MUSIC
55.   schar music_heard = 0;
56.   #  endif
57.   #endif
58.   char *occtxt = DUMMY;
59.   const char quitchars[] = " \r\n\033";
60.   const char vowels[] = "aeiouAEIOU";
61.   const char ynchars[] = "yn";
62.   const char ynqchars[] = "ynq";
63.   const char ynaqchars[] = "ynaq";
64.   const char nyaqchars[] = "nyaq";
65.   char *HI = DUMMY, *HE = DUMMY, *AS = DUMMY, *AE = DUMMY, *CD = DUMMY;
66.   	/* set up in termcap.c */
67.   int CO = 0, LI = 0;	/* set up in termcap.c: usually COLNO and ROWNO+3 */
68.   
69.   #ifdef MSDOSCOLOR
70.   char *HI_RED, *HI_YELLOW, *HI_GREEN, *HI_BLUE, *HI_WHITE; /* termcap.c */
71.   #endif
72.   
73.   #ifdef MSDOS
74.   char hackdir[PATHLEN];		/* where rumors, help, record are */
75.   const char *configfile = "NetHack.cnf";	/* read by read_config_file() */
76.   char levels[PATHLEN];		/* where levels are */
77.   #endif /* MSDOS */
78.   #ifdef DGK
79.   char lock[FILENAME];		/* pathname of level files */
80.   char permbones[PATHLEN];	/* where permanent copy of bones go */
81.   int ramdisk = FALSE;		/* whether to copy bones to levels or not */
82.   int saveprompt = TRUE;
83.   const char *alllevels = "levels.*";
84.   const char *allbones = "bones.*";
85.   #else
86.   char lock[PL_NSIZ+4] = "1lock";	/* long enough for login name .99 */
87.   #endif
88.   
89.   int dig_effort = 0;	/* effort expended on current pos */
90.   uchar dig_level = 0;
91.   coord dig_pos = DUMMY;
92.   boolean dig_down = FALSE;
93.   
94.   xchar dlevel = 1;
95.   xchar maxdlevel = 1;
96.   int done_stopprint = 0;
97.   int done_hup = 0;
98.   xchar xupstair = 0, yupstair = 0, xdnstair = 0, ydnstair = 0;
99.   #ifdef STRONGHOLD
100.  xchar xupladder = 0, yupladder = 0, xdnladder = 0, ydnladder = 0;
101.  #endif
102.  xchar curx = 0, cury = 0;
103.  xchar seelx = 0, seehx = 0, seely = 0, seehy = 0; /* corners of lit room */
104.  xchar seelx2 = 0, seehx2 = 0, seely2 = 0, seehy2 = 0; /* corners of lit room */
105.  xchar scrlx = 0, scrhx = 0, scrly = 0, scrhy = 0; /* corners of new scr. area*/
106.  xchar fountsound = 0;
107.  xchar sinksound = 0; /* numbers of other things that make noise */
108.  
109.  boolean in_mklev = FALSE;
110.  boolean	stoned = FALSE;			/* done to monsters hit by 'c' */
111.  boolean	unweapon = FALSE;
112.  #ifdef KOPS
113.  boolean allow_kops = TRUE;
114.  #endif
115.  
116.  coord bhitpos = DUMMY;
117.  coord doors[DOORMAX] = DUMMY;
118.  
119.  struct mkroom rooms[MAXNROFROOMS+1] = DUMMY;
120.  struct rm levl[COLNO][ROWNO] = DUMMY;		/* level map */
121.  struct monst *fmon = 0;
122.  struct trap *ftrap = 0;
123.  struct gold *fgold = 0;
124.  struct monst youmonst = DUMMY;	/* dummy; used as return value for boomhit */
125.  struct flag flags = DUMMY;
126.  struct you u = DUMMY;
127.  
128.  struct obj *fobj = 0, *fcobj = 0, *invent = 0, *uwep = 0, *uarm = 0,
129.  #ifdef SHIRT
130.  	*uarmu = 0,		/* under-wear, so to speak */
131.  #endif
132.  #ifdef POLYSELF
133.  	*uskin = 0,		/* dragon armor, if a dragon */
134.  #endif
135.  	*uarmc = 0, *uarmh = 0, *uarms = 0, *uarmg = 0, *uarmf = 0, *uamul = 0,
136.  	*uright = 0, *uleft = 0, *ublindf = 0, *uchain = 0, *uball = 0;
137.  
138.  const struct symbols defsyms = {
139.      ' ', /* stone */
140.      '|', /* vwall */
141.      '-', /* hwall */
142.      '-', /* tlcorn */
143.      '-', /* trcorn */
144.      '-', /* blcorn */
145.      '-', /* brcorn */
146.      '-', /* crwall */
147.      '-', /* tuwall */
148.      '-', /* tdwall */
149.      '|', /* tlwall */
150.      '|', /* trwall */
151.      '|', /* vbeam */
152.      '-', /* hbeam */
153.      '\\', /* lslant */
154.      '/', /* rslant */
155.      '+', /* door */
156.      '.', /* room */
157.      '#', /* corr */
158.      '<', /* upstair */
159.      '>', /* dnstair */
160.      '^', /* trap */
161.      '"', /* web */
162.      '}', /* pool */
163.      '{', /* fountain */	/* used ifdef FOUNTAINS */
164.      '#', /* sink */	/* used ifdef SINKS */
165.      '\\', /* throne */	/* used ifdef THRONES */
166.      '_', /* altar */	/* used ifdef ALTARS */
167.      '<', /* upladder */	/* used ifdef STRONGHOLD */
168.      '>', /* dnladder */	/* used ifdef STRONGHOLD */
169.      '#', /* dbvwall */	/* used ifdef STRONGHOLD */
170.      '#', /* dbhwall */	/* used ifdef STRONGHOLD */
171.  };
172.  struct symbols showsyms = DUMMY; /* will contain the symbols actually used */
173.  #ifdef REINCARNATION
174.  struct symbols savesyms = DUMMY;
175.  #endif
176.  
177.  #ifdef SPELLS
178.  struct spell spl_book[MAXSPELL + 1] = DUMMY;
179.  #endif
180.  
181.  long moves = 1;
182.  long wailmsg = 0;
183.  
184.  struct obj zeroobj = DUMMY;	/* used to zero all elements of a struct obj */
185.  
186.  struct obj *billobjs = 0;
187.  
188.  const char black[] = "black";
189.  const char amber[] = "amber";
190.  #ifdef THEOLOGY
191.  const char golden[] = "golden";
192.  #endif
193.  const char light_blue[] = "light blue";
194.  const char red[] = "red";
195.  const char green[] = "green";
196.  const char silver[] = "silver";
197.  const char blue[] = "blue";
198.  const char purple[] = "purple";
199.  const char white[] = "white";
200.  
201.  const char nothing_happens[] = "Nothing happens.";
202.  const char thats_enough_tries[] = "That's enough tries!";