Mercurial > hg > early-roguelike
comparison arogue7/rogue.h @ 125:adfa37e67084
Import Advanced Rogue 7.7 from the Roguelike Restoration Project (r1490)
author | John "Elwin" Edwards |
---|---|
date | Fri, 08 May 2015 15:24:40 -0400 |
parents | |
children | c697782a9b37 |
comparison
equal
deleted
inserted
replaced
124:d10fc4a065ac | 125:adfa37e67084 |
---|---|
1 /* | |
2 * rogue.h - Rogue definitions and variable declarations | |
3 * | |
4 * Advanced Rogue | |
5 * Copyright (C) 1984, 1985, 1986 Michael Morgan, Ken Dalka and AT&T | |
6 * All rights reserved. | |
7 * | |
8 * Based on "Rogue: Exploring the Dungeons of Doom" | |
9 * Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman | |
10 * All rights reserved. | |
11 * | |
12 * See the file LICENSE.TXT for full copyright and licensing information. | |
13 */ | |
14 | |
15 /* | |
16 * Rogue definitions and variable declarations | |
17 * | |
18 */ | |
19 | |
20 #define reg register | |
21 #undef lines /* AIX's term.h defines this, causing a conflict */ | |
22 #ifdef BSD | |
23 #undef tolower(c) | |
24 #define _tolower(c) ((c)-'A'+'a') | |
25 extern char tolower(); | |
26 #undef toupper(c) | |
27 #define _toupper(c) ((c)-'a'+'A') | |
28 extern char toupper(); | |
29 #define strchr index | |
30 | |
31 #define exfork vfork /* Better way to do a fork followed by an exec */ | |
32 #else | |
33 #define exfork fork /* Standard fork with no paging available */ | |
34 #endif | |
35 | |
36 /* | |
37 * Maximum number of different things | |
38 */ | |
39 #define MAXDAEMONS 10 | |
40 #define MAXFUSES 20 | |
41 #define MAXROOMS 9 | |
42 #define MAXTHINGS 9 | |
43 #define MAXOBJ 9 | |
44 #define MAXSTATS 72 /* max total of all stats at startup */ | |
45 #define MAXPACK 23 | |
46 #define MAXDOUBLE 14 /* Maximum number of times exppts is doubled */ | |
47 #define MAXCONTENTS 10 | |
48 #define MAXENCHANT 10 /* max number of enchantments on an item */ | |
49 #define MAXTREAS 15 /* number monsters/treasure in treasure room */ | |
50 #define MAXTRAPS 25 | |
51 #define MAXTRPTRY 8 /* attempts/level allowed for setting traps */ | |
52 #define MAXDOORS 4 /* Maximum doors to a room */ | |
53 #define MAXCHANTS 16 /* Maximum number of chants for a druid */ | |
54 #define MAXPRAYERS 18 /* Maximum number of prayers for cleric */ | |
55 #define MAXSPELLS 20 /* Maximum number of spells (for magician) */ | |
56 #define MAXQUILL 13 /* scrolls the Quill of Nagrom can write */ | |
57 #define QUILLCHARGES 160 /* max num of charges in the Quill of Nagrom */ | |
58 #define NUMMONST 125 /* Current number of monsters */ | |
59 #define NUM_CNAMES 17 /* number of names per character level */ | |
60 #define NUMUNIQUE 27 /* number of UNIQUE creatures */ | |
61 #define NLEVMONS 3 /* Number of new monsters per level */ | |
62 #define NUMSCORE 10 /* number of entries in score file */ | |
63 #define HARDER 35 /* at this level start making things harder */ | |
64 #define LINELEN 256 /* characters in a buffer */ | |
65 #define JUG_EMPTY -1 /* signifys that the alchemy jug is empty */ | |
66 #define MAXPURCH (pstats.s_charisma/3) /* # of purchases at post */ | |
67 | |
68 /* Movement penalties */ | |
69 #define BACKPENALTY 3 | |
70 #define SHOTPENALTY 2 /* In line of sight of missile */ | |
71 #define DOORPENALTY 1 /* Moving out of current room */ | |
72 | |
73 /* | |
74 * these defines are used in calls to get_item() to signify what | |
75 * it is we want | |
76 */ | |
77 #define ALL -1 | |
78 #define WEARABLE -2 | |
79 #define CALLABLE -3 | |
80 #define WIELDABLE -4 | |
81 #define USEABLE -5 | |
82 #define IDENTABLE -6 | |
83 #define REMOVABLE -7 | |
84 #define PROTECTABLE -8 | |
85 #define ZAPPABLE -9 | |
86 #define READABLE -10 | |
87 #define QUAFFABLE -11 | |
88 | |
89 /* | |
90 * stuff to do with encumberance | |
91 */ | |
92 #define NORMENCB 1500 /* normal encumberance */ | |
93 #define F_SATIATED 0 /* player's stomach is very full */ | |
94 #define F_OKAY 1 /* have plenty of food in stomach */ | |
95 #define F_HUNGRY 2 /* player is hungry */ | |
96 #define F_WEAK 3 /* weak from lack of food */ | |
97 #define F_FAINT 4 /* fainting from lack of food */ | |
98 | |
99 /* | |
100 * actions a player/monster will take | |
101 */ | |
102 #define A_MOVE 0200 /* normal movement */ | |
103 #define A_FREEZE 0201 /* frozen in place */ | |
104 #define A_ATTACK 0202 /* trying to hit */ | |
105 #define A_SELL 0203 /* trying to sell goods */ | |
106 #define A_NIL 0204 /* not doing anything */ | |
107 #define A_BREATHE 0205 /* breathing */ | |
108 #define A_MISSILE 0206 /* Firing magic missiles */ | |
109 #define A_SONIC 0207 /* Sounding a sonic blast */ | |
110 #define A_SUMMON 0210 /* Summoning help */ | |
111 #define A_USERELIC 0211 /* Monster uses a relic */ | |
112 #define A_SLOW 0212 /* monster slows the player */ | |
113 #define A_ZAP 0213 /* monster shoots a wand */ | |
114 #define A_PICKUP 0214 /* player is picking something up */ | |
115 #define A_USEWAND 0215 /* monster is shooting a wand */ | |
116 #define A_THROW 't' | |
117 #define C_CAST 'C' | |
118 #define C_COUNT '*' | |
119 #define C_DIP 'D' | |
120 #define C_DROP 'd' | |
121 #define C_EAT 'e' | |
122 #define C_PRAY 'p' | |
123 #define C_CHANT 'c' | |
124 #define C_QUAFF 'q' | |
125 #define C_READ 'r' | |
126 #define C_SEARCH 's' | |
127 #define C_SETTRAP '^' | |
128 #define C_TAKEOFF 'T' | |
129 #define C_USE CTRL('U') | |
130 #define C_WEAR 'W' | |
131 #define C_WIELD 'w' | |
132 #define C_ZAP 'z' | |
133 | |
134 /* Possible ways for the hero to move */ | |
135 #define H_TELEPORT 0 | |
136 | |
137 /* | |
138 * return values for get functions | |
139 */ | |
140 #define NORM 0 /* normal exit */ | |
141 #define QUIT 1 /* quit option setting */ | |
142 #define MINUS 2 /* back up one option */ | |
143 | |
144 /* | |
145 * The character types | |
146 */ | |
147 #define C_FIGHTER 0 | |
148 #define C_RANGER 1 | |
149 #define C_PALADIN 2 | |
150 #define C_MAGICIAN 3 | |
151 #define C_CLERIC 4 | |
152 #define C_THIEF 5 | |
153 #define C_ASSASIN 6 | |
154 #define C_DRUID 7 | |
155 #define C_MONK 8 | |
156 #define C_MONSTER 9 | |
157 #define NUM_CHARTYPES 10 | |
158 | |
159 /* | |
160 * define the ability types | |
161 */ | |
162 #define A_INTELLIGENCE 0 | |
163 #define A_STRENGTH 1 | |
164 #define A_WISDOM 2 | |
165 #define A_DEXTERITY 3 | |
166 #define A_CONSTITUTION 4 | |
167 #define A_CHARISMA 5 | |
168 #define NUMABILITIES 6 | |
169 | |
170 /* | |
171 * values for games end | |
172 */ | |
173 #define UPDATE -2 | |
174 #define SCOREIT -1 | |
175 #define KILLED 0 | |
176 #define CHICKEN 1 | |
177 #define WINNER 2 | |
178 | |
179 /* | |
180 * definitions for function step_ok: | |
181 * MONSTOK indicates it is OK to step on a monster -- it | |
182 * is only OK when stepping diagonally AROUND a monster; | |
183 * it is also OK if the stepper is a friendly monster and | |
184 * is in a fighting mood. | |
185 */ | |
186 #define MONSTOK 1 | |
187 #define NOMONST 2 | |
188 #define FIGHTOK 3 | |
189 | |
190 /* | |
191 * used for ring stuff | |
192 */ | |
193 #define LEFT_1 0 | |
194 #define LEFT_2 1 | |
195 #define LEFT_3 2 | |
196 #define LEFT_4 3 | |
197 #define RIGHT_1 4 | |
198 #define RIGHT_2 5 | |
199 #define RIGHT_3 6 | |
200 #define RIGHT_4 7 | |
201 #define NUM_FINGERS 8 | |
202 | |
203 /* | |
204 * used for micellaneous magic (MM) stuff | |
205 */ | |
206 #define WEAR_BOOTS 0 | |
207 #define WEAR_BRACERS 1 | |
208 #define WEAR_CLOAK 2 | |
209 #define WEAR_GAUNTLET 3 | |
210 #define WEAR_JEWEL 4 | |
211 #define WEAR_NECKLACE 5 | |
212 #define NUM_MM 6 | |
213 | |
214 /* | |
215 * All the fun defines | |
216 */ | |
217 #define next(ptr) (*ptr).l_next | |
218 #define prev(ptr) (*ptr).l_prev | |
219 #define ldata(ptr) (*ptr).l_data | |
220 #define inroom(rp, cp) (\ | |
221 (cp)->x <= (rp)->r_pos.x + ((rp)->r_max.x - 1) && (rp)->r_pos.x <= (cp)->x \ | |
222 && (cp)->y <= (rp)->r_pos.y + ((rp)->r_max.y - 1) && (rp)->r_pos.y <= (cp)->y) | |
223 #define winat(y, x) (mvwinch(mw, y, x)==' '?mvwinch(stdscr, y, x):winch(mw)) | |
224 #define debug if (wizard) msg | |
225 #define RN (((seed = seed*11109+13849) & 0x7fff) >> 1) | |
226 #define unc(cp) (cp).y, (cp).x | |
227 #define cmov(xy) move((xy).y, (xy).x) | |
228 #define DISTANCE(y1, x1, y2, x2) ((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1)) | |
229 #define OBJPTR(what) (struct object *)((*what).l_data) | |
230 #define THINGPTR(what) (struct thing *)((*what).l_data) | |
231 #define DOORPTR(what) (coord *)((*what).l_data) | |
232 #define when break;case | |
233 #define otherwise break;default | |
234 #define until(expr) while(!(expr)) | |
235 #define ce(a, b) ((a).x == (b).x && (a).y == (b).y) | |
236 #define draw(window) wrefresh(window) | |
237 #define hero player.t_pos | |
238 #define pstats player.t_stats | |
239 #define max_stats player.maxstats | |
240 #define pack player.t_pack | |
241 #define attach(a, b) _attach(&a, b) | |
242 #define detach(a, b) _detach(&a, b) | |
243 #define o_free_list(a) _o_free_list(&a) | |
244 #define r_free_list(a) _r_free_list(&a) | |
245 #define t_free_list(a) _t_free_list(&a) | |
246 #ifndef max | |
247 #define max(a, b) ((a) > (b) ? (a) : (b)) | |
248 #define min(a, b) ((a) < (b) ? (a) : (b)) | |
249 #endif | |
250 #define on(thing, flag) \ | |
251 (((thing).t_flags[(flag >> FLAGSHIFT) & FLAGINDEX] & flag) != 0) | |
252 #define off(thing, flag) \ | |
253 (((thing).t_flags[(flag >> FLAGSHIFT) & FLAGINDEX] & flag) == 0) | |
254 #define turn_on(thing, flag) \ | |
255 ((thing).t_flags[(flag >> FLAGSHIFT) & FLAGINDEX] |= (flag & ~FLAGMASK)) | |
256 #define turn_off(thing, flag) \ | |
257 ((thing).t_flags[(flag >> FLAGSHIFT) & FLAGINDEX] &= ~flag) | |
258 | |
259 #undef CTRL | |
260 #define CTRL(ch) (ch & 037) | |
261 | |
262 #define ALLOC(x) calloc((unsigned int) x,1) | |
263 #define FREE(x) free((char *) x) | |
264 #define EQSTR(a, b, c) (strncmp(a, b, c) == 0) | |
265 #define EQUAL(a, b) (strcmp(a, b) == 0) | |
266 #define GOLDCALC (rnd(50 + 10 * level) + 2) | |
267 #define ISRING(h, r) (cur_ring[h] != NULL && cur_ring[h]->o_which == r) | |
268 #define ISWEARING(r) (ISRING(LEFT_1, r) || ISRING(LEFT_2, r) ||\ | |
269 ISRING(LEFT_3, r) || ISRING(LEFT_4, r) ||\ | |
270 ISRING(RIGHT_1, r) || ISRING(RIGHT_2, r) ||\ | |
271 ISRING(RIGHT_3, r) || ISRING(RIGHT_4, r)) | |
272 #define newgrp() ++group | |
273 #define o_charges o_ac | |
274 #define o_kind o_ac | |
275 #define ISMULT(type) (type == FOOD) | |
276 #define isrock(ch) ((ch == WALL) || (ch == '-') || (ch == '|') || (ch == SECRETDOOR)) | |
277 #define invisible(monst) \ | |
278 (((on(*monst, ISINVIS) || \ | |
279 (on(*monst, ISSHADOW) && rnd(100) < 90)) && \ | |
280 off(player, CANSEE)) || \ | |
281 (on(*monst, CANSURPRISE) && !ISWEARING(R_ALERT))) | |
282 #define is_stealth(tp) \ | |
283 (rnd(25) < (tp)->t_stats.s_dext || (tp == &player && ISWEARING(R_STEALTH))) | |
284 | |
285 #define has_light(rp) (((rp)->r_flags & HASFIRE) || ISWEARING(R_LIGHT)) | |
286 | |
287 #define mi_wght mi_worth | |
288 #define mi_food mi_curse | |
289 | |
290 /* | |
291 * Ways to die | |
292 */ | |
293 #define D_PETRIFY -1 | |
294 #define D_ARROW -2 | |
295 #define D_DART -3 | |
296 #define D_POISON -4 | |
297 #define D_BOLT -5 | |
298 #define D_SUFFOCATION -6 | |
299 #define D_POTION -7 | |
300 #define D_INFESTATION -8 | |
301 #define D_DROWN -9 | |
302 #define D_ROT -10 | |
303 #define D_CONSTITUTION -11 | |
304 #define D_STRENGTH -12 | |
305 #define D_SIGNAL -13 | |
306 #define D_CHOKE -14 | |
307 #define D_STRANGLE -15 | |
308 #define D_FALL -16 | |
309 #define D_RELIC -17 | |
310 #define D_STARVATION -18 | |
311 #define D_FOOD_CHOKE -19 | |
312 #define D_SCROLL -20 | |
313 #define DEATHNUM 20 /* number of ways to die */ | |
314 | |
315 /* | |
316 * Things that appear on the screens | |
317 */ | |
318 #define WALL ' ' | |
319 #define PASSAGE '#' | |
320 #define DOOR '+' | |
321 #define FLOOR '.' | |
322 #define VPLAYER '@' | |
323 #define IPLAYER '_' | |
324 #define POST '^' | |
325 #define TRAPDOOR '>' | |
326 #define ARROWTRAP '{' | |
327 #define SLEEPTRAP '$' | |
328 #define BEARTRAP '}' | |
329 #define TELTRAP '~' | |
330 #define DARTTRAP '`' | |
331 #define POOL '"' | |
332 #define MAZETRAP '\'' | |
333 #define SECRETDOOR '&' | |
334 #define STAIRS '%' | |
335 #define GOLD '*' | |
336 #define POTION '!' | |
337 #define SCROLL '?' | |
338 #define MAGIC '$' | |
339 #define BMAGIC '>' /* Blessed magic */ | |
340 #define CMAGIC '<' /* Cursed magic */ | |
341 #define FOOD ':' | |
342 #define WEAPON ')' | |
343 #define MISSILE '*' /* Magic Missile */ | |
344 #define ARMOR ']' | |
345 #define MM ';' | |
346 #define RELIC ',' | |
347 #define RING '=' | |
348 #define STICK '/' | |
349 #define FOREST '\\' | |
350 | |
351 /* | |
352 * Various constants | |
353 */ | |
354 #define PASSWD "mTdNfNGDrwAZ." | |
355 #define FIGHTBASE 10 | |
356 #define SPELLTIME ((max(30-pstats.s_lvl,5))) | |
357 #define BEARTIME 17 | |
358 #define CLOAK_TIME (roll(20,20)) | |
359 #define SLEEPTIME 7 | |
360 #define FREEZETIME 11 | |
361 #define PAINTIME (roll(2, 12)) | |
362 #define HEALTIME 30 | |
363 #define CHILLTIME (roll(20, 4)) | |
364 #define SMELLTIME 20 | |
365 #define STONETIME (roll(10,2)) | |
366 #define HASTETIME 11 | |
367 #define SICKTIME 25 | |
368 #define WANDERTIME (max(5, (HARDER*2)-rnd(vlevel))) | |
369 #define BEFORE 1 | |
370 #define AFTER 2 | |
371 #define HUHDURATION (50+rnd(30)) | |
372 #define SEEDURATION 850 | |
373 #define SKILLDURATION (100+rnd(50)) | |
374 #define CLRDURATION 50 | |
375 #define GONETIME 200 | |
376 #define FIRETIME (200+roll(5,5)) | |
377 #define COLDTIME (200+roll(5,5)) | |
378 #define BOLTTIME (200+roll(5,5)) | |
379 #define FLYTIME 300 | |
380 #define DUSTTIME (30+roll(5,10)) | |
381 #define PHASEDURATION 300 | |
382 #define MORETIME 100 | |
383 #define STINKTIME 16 | |
384 #define STOMACHSIZE 1500 | |
385 #define ESCAPE 27 | |
386 #define BOLT_LENGTH 10 | |
387 #define MARKLEN 20 | |
388 #define DAYLENGTH 400 | |
389 #define ALCHEMYTIME (400+rnd(150)) | |
390 | |
391 /* | |
392 * Save against things | |
393 */ | |
394 #define VS_POISON 00 | |
395 #define VS_PARALYZATION 00 | |
396 #define VS_DEATH 00 | |
397 #define VS_PETRIFICATION 01 | |
398 #define VS_WAND 02 | |
399 #define VS_BREATH 03 | |
400 #define VS_MAGIC 04 | |
401 | |
402 /* | |
403 * attributes for treasures in dungeon | |
404 */ | |
405 #define ISCURSED 01 | |
406 #define ISKNOW 02 | |
407 #define ISPOST 04 /* object is in a trading post */ | |
408 #define ISMETAL 010 | |
409 #define ISPROT 020 /* object is protected */ | |
410 #define ISBLESSED 040 | |
411 #define ISPOISON 0100 | |
412 #define ISMISL 020000 | |
413 #define ISMANY 040000 | |
414 /* | |
415 * Various flag bits | |
416 */ | |
417 #define ISDARK 01 | |
418 #define ISGONE 02 | |
419 #define ISTREAS 04 | |
420 #define ISFOUND 010 | |
421 #define ISTHIEFSET 020 | |
422 #define FORCEDARK 040 | |
423 /* | |
424 * 1st set of creature flags (this might include player) | |
425 */ | |
426 #define ISBLIND 0x00000001 | |
427 #define ISINWALL 0x00000002 | |
428 #define ISRUN 0x00000004 | |
429 #define ISFLEE 0x00000008 | |
430 #define ISINVIS 0x00000010 | |
431 #define ISMEAN 0x00000020 | |
432 #define ISGREED 0x00000040 | |
433 #define CANSHOOT 0x00000080 | |
434 #define ISHELD 0x00000100 | |
435 #define ISHUH 0x00000200 | |
436 #define ISREGEN 0x00000400 | |
437 #define CANHUH 0x00000800 | |
438 #define CANSEE 0x00001000 | |
439 #define HASFIRE 0x00002000 | |
440 #define ISSLOW 0x00004000 | |
441 #define ISHASTE 0x00008000 | |
442 #define ISCLEAR 0x00010000 | |
443 #define CANINWALL 0x00020000 | |
444 #define ISDISGUISE 0x00040000 | |
445 #define CANBLINK 0x00080000 | |
446 #define CANSNORE 0x00100000 | |
447 #define HALFDAMAGE 0x00200000 | |
448 #define CANSUCK 0x00400000 | |
449 #define CANRUST 0x00800000 | |
450 #define CANPOISON 0x01000000 | |
451 #define CANDRAIN 0x02000000 | |
452 #define ISUNIQUE 0x04000000 | |
453 #define STEALGOLD 0x08000000 | |
454 /* | |
455 * Second set of flags | |
456 */ | |
457 #define STEALMAGIC 0x10000001 | |
458 #define CANDISEASE 0x10000002 | |
459 #define HASDISEASE 0x10000004 | |
460 #define CANSUFFOCATE 0x10000008 | |
461 #define DIDSUFFOCATE 0x10000010 | |
462 #define BOLTDIVIDE 0x10000020 | |
463 #define BLOWDIVIDE 0x10000040 | |
464 #define NOCOLD 0x10000080 | |
465 #define TOUCHFEAR 0x10000100 | |
466 #define BMAGICHIT 0x10000200 | |
467 #define NOFIRE 0x10000400 | |
468 #define NOBOLT 0x10000800 | |
469 #define CARRYGOLD 0x10001000 | |
470 #define CANITCH 0x10002000 | |
471 #define HASITCH 0x10004000 | |
472 #define DIDDRAIN 0x10008000 | |
473 #define WASTURNED 0x10010000 | |
474 #define CANSELL 0x10020000 | |
475 #define CANBLIND 0x10040000 | |
476 #define NOACID 0x10080000 | |
477 #define NOSLOW 0x10100000 | |
478 #define NOFEAR 0x10200000 | |
479 #define NOSLEEP 0x10400000 | |
480 #define NOPARALYZE 0x10800000 | |
481 #define NOGAS 0x11000000 | |
482 #define CANMISSILE 0x12000000 | |
483 #define CMAGICHIT 0x14000000 | |
484 #define CANPAIN 0x18000000 | |
485 | |
486 /* | |
487 * Third set of flags | |
488 */ | |
489 #define CANSLOW 0x20000001 | |
490 #define CANTUNNEL 0x20000002 | |
491 #define TAKEWISDOM 0x20000004 | |
492 #define NOMETAL 0x20000008 | |
493 #define MAGICHIT 0x20000010 | |
494 #define CANINFEST 0x20000020 | |
495 #define HASINFEST 0x20000040 | |
496 #define NOMOVE 0x20000080 | |
497 #define CANSHRIEK 0x20000100 | |
498 #define CANDRAW 0x20000200 | |
499 #define CANSMELL 0x20000400 | |
500 #define CANPARALYZE 0x20000800 | |
501 #define CANROT 0x20001000 | |
502 #define ISSCAVENGE 0x20002000 | |
503 #define DOROT 0x20004000 | |
504 #define CANSTINK 0x20008000 | |
505 #define HASSTINK 0x20010000 | |
506 #define ISSHADOW 0x20020000 | |
507 #define CANCHILL 0x20040000 | |
508 #define CANHUG 0x20080000 | |
509 #define CANSURPRISE 0x20100000 | |
510 #define CANFRIGHTEN 0x20200000 | |
511 #define CANSUMMON 0x20400000 | |
512 #define TOUCHSTONE 0x20800000 | |
513 #define LOOKSTONE 0x21000000 | |
514 #define CANHOLD 0x22000000 | |
515 #define DIDHOLD 0x24000000 | |
516 #define DOUBLEDRAIN 0x28000000 | |
517 | |
518 /* | |
519 * Fourth set of flags | |
520 */ | |
521 #define CANBRANDOM 0x30000001 /* Types of breath */ | |
522 #define CANBACID 0x30000002 /* acid */ | |
523 #define CANBFIRE 0x30000004 /* Fire */ | |
524 #define CANBCGAS 0x30000008 /* confusion gas */ | |
525 #define CANBBOLT 0x30000010 /* lightning bolt */ | |
526 #define CANBGAS 0x30000020 /* clorine gas */ | |
527 #define CANBICE 0x30000040 /* ice */ | |
528 #define CANBFGAS 0x30000080 /* Fear gas */ | |
529 #define CANBPGAS 0x30000100 /* Paralyze gas */ | |
530 #define CANBSGAS 0x30000200 /* Sleeping gas */ | |
531 #define CANBSLGAS 0x30000400 /* Slow gas */ | |
532 #define CANBREATHE 0x300007ff /* Can it breathe at all? */ | |
533 /* | |
534 * Fifth set of flags | |
535 */ | |
536 #define ISUNDEAD 0x40000001 | |
537 #define CANSONIC 0x40000002 | |
538 #define TURNABLE 0x40000004 | |
539 #define TAKEINTEL 0x40000008 | |
540 #define NOSTAB 0x40000010 | |
541 #define CANDISSOLVE 0x40000020 | |
542 #define ISFLY 0x40000040 /* creature can fly */ | |
543 #define CANTELEPORT 0x40000080 /* creature can teleport */ | |
544 #define CANEXPLODE 0x40000100 /* creature explodes when hit */ | |
545 #define CANDANCE 0x40000200 /* creature can make hero "dance" */ | |
546 #define ISDANCE 0x40000400 /* creature (hero) is dancing */ | |
547 #define CARRYFOOD 0x40000800 | |
548 #define CARRYSCROLL 0x40001000 | |
549 #define CARRYPOTION 0x40002000 | |
550 #define CARRYRING 0x40004000 | |
551 #define CARRYSTICK 0x40008000 | |
552 #define CARRYMISC 0x40010000 | |
553 #define CARRYMDAGGER 0x40020000 /* Dagger of Musty */ | |
554 #define CARRYCLOAK 0x40040000 /* Cloak of Emori */ | |
555 #define CARRYANKH 0x40080000 /* Ankh of Heil */ | |
556 #define CARRYSTAFF 0x40100000 /* Staff of Ming */ | |
557 #define CARRYWAND 0x40200000 /* Wand of Orcus */ | |
558 #define CARRYROD 0x40400000 /* Rod of Asmodeus */ | |
559 #define CARRYYAMULET 0x40800000 /* Amulet of Yendor */ | |
560 #define CARRYMANDOLIN 0x41000000 /* Mandolin of Brian */ | |
561 #define MISSEDDISP 0x42000000 /* Missed Cloak of Displacement */ | |
562 #define CANBSTAB 0x44000000 /* Can backstab */ | |
563 #define ISGUARDIAN 0x48000000 /* Guardian of a treasure room */ | |
564 | |
565 | |
566 #define CARRYHORN 0x50000001 /* Horn of Geryon */ | |
567 #define CARRYMSTAR 0x50000002 /* Morning Star of Hruggek */ | |
568 #define CARRYFLAIL 0x50000004 /* Flail of Yeenoghu */ | |
569 #define CARRYWEAPON 0x50000008 /* A generic weapon */ | |
570 #define CANAGE 0x50000010 /* can age you */ | |
571 #define CARRYDAGGER 0x50000020 /* carry's a dumb old dagger */ | |
572 #define AREMANY 0x50000040 /* they come in droves */ | |
573 #define CARRYEYE 0x50000080 /* has the eye of Vecna */ | |
574 #define HASSUMMONED 0x50000100 /* has already summoned */ | |
575 #define ISSTONE 0x50000200 /* has been turned to stone */ | |
576 #define NODETECT 0x50000400 /* detect monster will not show him */ | |
577 #define NOSTONE 0x50000800 /* creature made its save vrs stone */ | |
578 #define CARRYQUILL 0x50001000 /* has the quill of Nagrom */ | |
579 #define CARRYAXE 0x50002000 /* has the axe of Aklad */ | |
580 #define TOUCHSLOW 0x50004000 /* touch will slow hero */ | |
581 #define WASDISRUPTED 0x50008000 /* creature was disrupted by player */ | |
582 #define CARRYARMOR 0x50010000 /* creature will pick up armor */ | |
583 #define CARRYBAMULET 0x50020000 /* amulet of skoraus stonebones */ | |
584 #define CARRYSURTURRING 0x50040000 /* ring of Surtur */ | |
585 #define ISCHARMED 0x50080000 /* is the monster charmed? */ | |
586 #define ISFRIENDLY 0x50080000 /* monster friendly for any reason? */ | |
587 | |
588 #define ISREADY 0x60000001 | |
589 #define ISDEAD 0x60000002 | |
590 #define ISELSEWHERE 0x60000004 | |
591 | |
592 /* Masks for choosing the right flag */ | |
593 #define FLAGMASK 0xf0000000 | |
594 #define FLAGINDEX 0x0000000f | |
595 #define FLAGSHIFT 28 | |
596 #define MAXFLAGS 25 /* max initial flags per creature */ | |
597 | |
598 /* | |
599 * Mask for cancelling special abilities | |
600 * The flags listed here will be the ones left on after the | |
601 * cancellation takes place | |
602 */ | |
603 #define CANC0MASK ( ISBLIND | ISINWALL | ISRUN | \ | |
604 ISFLEE | ISMEAN | ISGREED | \ | |
605 CANSHOOT | ISHELD | ISHUH | \ | |
606 ISSLOW | ISHASTE | ISCLEAR | \ | |
607 ISUNIQUE ) | |
608 #define CANC1MASK ( HASDISEASE | DIDSUFFOCATE | CARRYGOLD | \ | |
609 HASITCH | CANSELL | DIDDRAIN | \ | |
610 WASTURNED ) | |
611 #define CANC2MASK ( HASINFEST | NOMOVE | ISSCAVENGE | \ | |
612 DOROT | HASSTINK | DIDHOLD ) | |
613 #define CANC3MASK ( CANBREATHE ) | |
614 #define CANC4MASK ( ISUNDEAD | CANSONIC | NOSTAB | \ | |
615 ISFLY | CARRYFOOD | CANEXPLODE | \ | |
616 ISDANCE | CARRYSCROLL | CARRYPOTION | \ | |
617 CARRYRING | CARRYSTICK | CARRYMISC | \ | |
618 CARRYMDAGGER | CARRYCLOAK | CARRYANKH | \ | |
619 CARRYSTAFF | CARRYWAND | CARRYROD | \ | |
620 CARRYYAMULET | CARRYMANDOLIN | ISGUARDIAN ) | |
621 #define CANC5MASK ( CARRYHORN | CARRYMSTAR | CARRYFLAIL | \ | |
622 CARRYEYE | CARRYDAGGER | HASSUMMONED | \ | |
623 AREMANY | CARRYWEAPON | NOSTONE | \ | |
624 CARRYQUILL | CARRYAXE | WASDISRUPTED | \ | |
625 CARRYARMOR | CARRYBAMULET | CARRYSURTURRING ) | |
626 #define CANC6MASK ( 0 ) | |
627 #define CANC7MASK ( 0 ) | |
628 #define CANC8MASK ( 0 ) | |
629 #define CANC9MASK ( 0 ) | |
630 #define CANCAMASK ( 0 ) | |
631 #define CANCBMASK ( 0 ) | |
632 #define CANCCMASK ( 0 ) | |
633 #define CANCDMASK ( 0 ) | |
634 #define CANCEMASK ( 0 ) | |
635 #define CANCFMASK ( 0 ) | |
636 | |
637 /* types of things */ | |
638 #define TYP_POTION 0 | |
639 #define TYP_SCROLL 1 | |
640 #define TYP_FOOD 2 | |
641 #define TYP_WEAPON 3 | |
642 #define TYP_ARMOR 4 | |
643 #define TYP_RING 5 | |
644 #define TYP_STICK 6 | |
645 #define TYP_MM 7 | |
646 #define TYP_RELIC 8 | |
647 #define NUMTHINGS 9 | |
648 /* | |
649 * food types | |
650 */ | |
651 #define E_RATION 0 | |
652 #define E_APPLE 1 | |
653 #define E_BANANA 2 | |
654 #define E_BLUEBERRY 3 | |
655 #define E_CANDLEBERRY 4 | |
656 #define E_CAPRIFIG 5 | |
657 #define E_DEWBERRY 6 | |
658 #define E_ELDERBERRY 7 | |
659 #define E_GOOSEBERRY 8 | |
660 #define E_GUANABANA 9 | |
661 #define E_HAGBERRY 10 | |
662 #define E_JABOTICABA 11 | |
663 #define E_PEACH 12 | |
664 #define E_PITANGA 13 | |
665 #define E_PRICKLEY 14 | |
666 #define E_RAMBUTAN 15 | |
667 #define E_SAPODILLA 16 | |
668 #define E_SOURSOP 17 | |
669 #define E_STRAWBERRY 18 | |
670 #define E_SWEETSOP 19 | |
671 #define E_WHORTLEBERRY 20 | |
672 #define MAXFOODS 21 | |
673 /* | |
674 * Potion types | |
675 */ | |
676 #define P_CLEAR 0 | |
677 #define P_ABIL 1 | |
678 #define P_SEEINVIS 2 | |
679 #define P_HEALING 3 | |
680 #define P_MFIND 4 | |
681 #define P_TFIND 5 | |
682 #define P_RAISE 6 | |
683 #define P_HASTE 7 | |
684 #define P_RESTORE 8 | |
685 #define P_PHASE 9 | |
686 #define P_INVIS 10 | |
687 #define P_FLY 11 | |
688 #define P_FFIND 12 | |
689 #define P_SKILL 13 | |
690 #define P_FIRE 14 | |
691 #define P_COLD 15 | |
692 #define P_LIGHTNING 16 | |
693 #define P_POISON 17 | |
694 #define MAXPOTIONS 18 | |
695 /* | |
696 * Scroll types | |
697 */ | |
698 #define S_CONFUSE 0 | |
699 #define S_MAP 1 | |
700 #define S_LIGHT 2 | |
701 #define S_HOLD 3 | |
702 #define S_SLEEP 4 | |
703 #define S_ALLENCH 5 | |
704 #define S_IDENT 6 | |
705 #define S_SCARE 7 | |
706 #define S_GFIND 8 | |
707 #define S_TELEP 9 | |
708 #define S_CREATE 10 | |
709 #define S_REMOVE 11 | |
710 #define S_PETRIFY 12 | |
711 #define S_GENOCIDE 13 | |
712 #define S_CURING 14 | |
713 #define S_MAKEIT 15 | |
714 #define S_PROTECT 16 | |
715 #define S_FINDTRAPS 17 | |
716 #define S_RUNES 18 | |
717 #define S_CHARM 19 | |
718 #define MAXSCROLLS 20 | |
719 | |
720 /* | |
721 * Weapon types | |
722 */ | |
723 #define MACE 0 /* mace */ | |
724 #define SWORD 1 /* long sword */ | |
725 #define BOW 2 /* short bow */ | |
726 #define ARROW 3 /* arrow */ | |
727 #define DAGGER 4 /* dagger */ | |
728 #define ROCK 5 /* rocks */ | |
729 #define TWOSWORD 6 /* two-handed sword */ | |
730 #define SLING 7 /* sling */ | |
731 #define DART 8 /* darts */ | |
732 #define CROSSBOW 9 /* crossbow */ | |
733 #define BOLT 10 /* crossbow bolt */ | |
734 #define SPEAR 11 /* spear */ | |
735 #define TRIDENT 12 /* trident */ | |
736 #define SPETUM 13 /* spetum */ | |
737 #define BARDICHE 14 /* bardiche */ | |
738 #define PIKE 15 /* pike */ | |
739 #define BASWORD 16 /* bastard sword */ | |
740 #define HALBERD 17 /* halberd */ | |
741 #define BATTLEAXE 18 /* battle axe */ | |
742 #define MAXWEAPONS 19 /* types of weapons */ | |
743 #define NONE 100 /* no weapon */ | |
744 | |
745 /* | |
746 * Armor types | |
747 */ | |
748 #define LEATHER 0 | |
749 #define RING_MAIL 1 | |
750 #define STUDDED_LEATHER 2 | |
751 #define SCALE_MAIL 3 | |
752 #define PADDED_ARMOR 4 | |
753 #define CHAIN_MAIL 5 | |
754 #define SPLINT_MAIL 6 | |
755 #define BANDED_MAIL 7 | |
756 #define PLATE_MAIL 8 | |
757 #define PLATE_ARMOR 9 | |
758 #define MAXARMORS 10 | |
759 | |
760 /* | |
761 * Ring types | |
762 */ | |
763 #define R_PROTECT 0 | |
764 #define R_ADDSTR 1 | |
765 #define R_SUSABILITY 2 | |
766 #define R_SEARCH 3 | |
767 #define R_SEEINVIS 4 | |
768 #define R_ALERT 5 | |
769 #define R_AGGR 6 | |
770 #define R_ADDHIT 7 | |
771 #define R_ADDDAM 8 | |
772 #define R_REGEN 9 | |
773 #define R_DIGEST 10 | |
774 #define R_TELEPORT 11 | |
775 #define R_STEALTH 12 | |
776 #define R_ADDINTEL 13 | |
777 #define R_ADDWISDOM 14 | |
778 #define R_HEALTH 15 | |
779 #define R_CARRY 16 | |
780 #define R_LIGHT 17 | |
781 #define R_DELUSION 18 | |
782 #define R_FEAR 19 | |
783 #define R_HEROISM 20 | |
784 #define R_FIRE 21 | |
785 #define R_WARMTH 22 | |
786 #define R_VAMPREGEN 23 | |
787 #define R_FREEDOM 24 | |
788 #define R_TELCONTROL 25 | |
789 #define MAXRINGS 26 | |
790 | |
791 /* | |
792 * Rod/Wand/Staff types | |
793 */ | |
794 | |
795 #define WS_LIGHT 0 | |
796 #define WS_HIT 1 | |
797 #define WS_ELECT 2 | |
798 #define WS_FIRE 3 | |
799 #define WS_COLD 4 | |
800 #define WS_POLYMORPH 5 | |
801 #define WS_MISSILE 6 | |
802 #define WS_SLOW_M 7 | |
803 #define WS_DRAIN 8 | |
804 #define WS_CHARGE 9 | |
805 #define WS_TELMON 10 | |
806 #define WS_CANCEL 11 | |
807 #define WS_CONFMON 12 | |
808 #define WS_DISINTEGRATE 13 | |
809 #define WS_PETRIFY 14 | |
810 #define WS_PARALYZE 15 | |
811 #define WS_MDEG 16 | |
812 #define WS_CURING 17 | |
813 #define WS_WONDER 18 | |
814 #define WS_FEAR 19 | |
815 #define MAXSTICKS 20 | |
816 | |
817 /* | |
818 * miscellaneous magic items | |
819 */ | |
820 #define MM_JUG 0 | |
821 #define MM_BEAKER 1 | |
822 #define MM_BOOK 2 | |
823 #define MM_ELF_BOOTS 3 | |
824 #define MM_BRACERS 4 | |
825 #define MM_OPEN 5 | |
826 #define MM_HUNGER 6 | |
827 #define MM_DISP 7 | |
828 #define MM_PROTECT 8 | |
829 #define MM_DRUMS 9 | |
830 #define MM_DISAPPEAR 10 | |
831 #define MM_CHOKE 11 | |
832 #define MM_G_DEXTERITY 12 | |
833 #define MM_G_OGRE 13 | |
834 #define MM_JEWEL 14 | |
835 #define MM_KEOGHTOM 15 | |
836 #define MM_R_POWERLESS 16 | |
837 #define MM_FUMBLE 17 | |
838 #define MM_ADAPTION 18 | |
839 #define MM_STRANGLE 19 | |
840 #define MM_DANCE 20 | |
841 #define MM_SKILLS 21 | |
842 #define MAXMM 22 | |
843 | |
844 /* | |
845 * Relic types | |
846 */ | |
847 #define MUSTY_DAGGER 0 | |
848 #define EMORI_CLOAK 1 | |
849 #define HEIL_ANKH 2 | |
850 #define MING_STAFF 3 | |
851 #define ORCUS_WAND 4 | |
852 #define ASMO_ROD 5 | |
853 #define YENDOR_AMULET 6 | |
854 #define BRIAN_MANDOLIN 7 | |
855 #define GERYON_HORN 8 | |
856 #define HRUGGEK_MSTAR 9 | |
857 #define YEENOGHU_FLAIL 10 | |
858 #define EYE_VECNA 11 | |
859 #define AXE_AKLAD 12 | |
860 #define QUILL_NAGROM 13 | |
861 #define STONEBONES_AMULET 14 | |
862 #define SURTUR_RING 15 | |
863 #define MAXRELIC 16 | |
864 | |
865 | |
866 #define LEVEL 600 | |
867 #define vlevel max(level, turns/LEVEL + 1) | |
868 /* | |
869 * Now we define the structures and types | |
870 */ | |
871 /* | |
872 * character types | |
873 */ | |
874 struct character_types { | |
875 char name[40]; /* name of character class */ | |
876 long start_exp; /* starting exp pts for 2nd level */ | |
877 long cap; /* stop doubling here */ | |
878 int hit_pts; /* hit pts gained per level */ | |
879 int base; /* Base to-hit value (AC 10) */ | |
880 int max_lvl; /* Maximum level for changing value */ | |
881 int factor; /* Amount base changes each time */ | |
882 int offset; /* What to offset level */ | |
883 int range; /* Range of levels for each offset */ | |
884 }; | |
885 | |
886 /* | |
887 * level types | |
888 */ | |
889 typedef enum { | |
890 NORMLEV, /* normal level */ | |
891 POSTLEV, /* trading post level */ | |
892 MAZELEV, /* maze level */ | |
893 OUTSIDE, /* outside level */ | |
894 STARTLEV /* beginning of the game */ | |
895 } LEVTYPE; | |
896 | |
897 /* | |
898 * Help list | |
899 */ | |
900 | |
901 struct h_list { | |
902 char h_ch; | |
903 char *h_desc; | |
904 }; | |
905 | |
906 /* | |
907 * Coordinate data type | |
908 */ | |
909 typedef struct { | |
910 int x; | |
911 int y; | |
912 } coord; | |
913 | |
914 /* | |
915 * structure for the ways to die | |
916 */ | |
917 struct death_type { | |
918 int reason; | |
919 char *name; | |
920 }; | |
921 | |
922 | |
923 /* | |
924 * Linked list data type | |
925 */ | |
926 struct linked_list { | |
927 struct linked_list *l_next; | |
928 struct linked_list *l_prev; | |
929 char *l_data; /* Various structure pointers */ | |
930 }; | |
931 | |
932 /* | |
933 * Stuff about magic items | |
934 */ | |
935 | |
936 struct magic_item { | |
937 char *mi_name; | |
938 int mi_prob; | |
939 int mi_worth; | |
940 int mi_curse; | |
941 int mi_bless; | |
942 }; | |
943 | |
944 /* | |
945 * Room structure | |
946 */ | |
947 struct room { | |
948 coord r_pos; /* Upper left corner */ | |
949 coord r_max; /* Size of room */ | |
950 long r_flags; /* Info about the room */ | |
951 struct linked_list *r_fires; /* List of fire creatures in room */ | |
952 struct linked_list *r_exit; /* Linked list of exits */ | |
953 }; | |
954 | |
955 /* | |
956 * Array of all traps on this level | |
957 */ | |
958 | |
959 struct trap { | |
960 char tr_type; /* What kind of trap */ | |
961 char tr_show; /* Where disguised trap looks like */ | |
962 coord tr_pos; /* Where trap is */ | |
963 long tr_flags; /* Info about trap (i.e. ISFOUND) */ | |
964 }; | |
965 | |
966 /* | |
967 * Structure describing a fighting being | |
968 */ | |
969 struct stats { | |
970 short s_str; /* Strength */ | |
971 short s_intel; /* Intelligence */ | |
972 short s_wisdom; /* Wisdom */ | |
973 short s_dext; /* Dexterity */ | |
974 short s_const; /* Constitution */ | |
975 short s_charisma; /* Charisma */ | |
976 unsigned long s_exp; /* Experience */ | |
977 int s_lvladj; /* how much level is adjusted */ | |
978 int s_lvl; /* Level of mastery */ | |
979 int s_arm; /* Armor class */ | |
980 int s_hpt; /* Hit points */ | |
981 int s_pack; /* current weight of his pack */ | |
982 int s_carry; /* max weight he can carry */ | |
983 char s_dmg[30]; /* String describing damage done */ | |
984 }; | |
985 | |
986 /* | |
987 * Structure describing a fighting being (monster at initialization) | |
988 */ | |
989 struct mstats { | |
990 short s_str; /* Strength */ | |
991 short s_dex; /* dexterity */ | |
992 short s_move; /* movement rate */ | |
993 unsigned long s_exp; /* Experience */ | |
994 short s_lvl; /* Level of mastery */ | |
995 short s_arm; /* Armor class */ | |
996 char *s_hpt; /* Hit points */ | |
997 char *s_dmg; /* String describing damage done */ | |
998 }; | |
999 | |
1000 /* | |
1001 * Structure for monsters and player | |
1002 */ | |
1003 struct thing { | |
1004 bool t_wasshot; /* Was character shot last round? */ | |
1005 char t_type; /* What it is */ | |
1006 char t_disguise; /* What mimic looks like */ | |
1007 char t_oldch; /* Character that was where it was */ | |
1008 short t_ctype; /* Character type */ | |
1009 short t_index; /* Index into monster table */ | |
1010 short t_no_move; /* How long the thing can't move */ | |
1011 short t_quiet; /* used in healing */ | |
1012 short t_movement; /* Base movement rate */ | |
1013 short t_action; /* Action we're waiting to do */ | |
1014 short t_artifact; /* base chance of using artifact */ | |
1015 short t_wand; /* base chance of using wands */ | |
1016 short t_summon; /* base chance of summoning */ | |
1017 short t_cast; /* base chance of casting a spell */ | |
1018 short t_breathe; /* base chance to swing at player */ | |
1019 char *t_name; /* name player gave his pet */ | |
1020 coord *t_doorgoal; /* What door are we heading to? */ | |
1021 coord *t_dest; /* Where it is running to */ | |
1022 coord t_pos; /* Position */ | |
1023 coord t_oldpos; /* Last position */ | |
1024 coord t_newpos; /* Where we want to go */ | |
1025 unsigned long t_flags[16]; /* State word */ | |
1026 struct linked_list *t_pack; /* What the thing is carrying */ | |
1027 struct linked_list *t_using; /* What the thing is using */ | |
1028 int t_selection; | |
1029 struct stats t_stats; /* Physical description */ | |
1030 struct stats maxstats; /* maximum(or initial) stats */ | |
1031 int t_reserved; | |
1032 }; | |
1033 | |
1034 /* | |
1035 * Array containing information on all the various types of monsters | |
1036 */ | |
1037 struct monster { | |
1038 char *m_name; /* What to call the monster */ | |
1039 short m_carry; /* Probability of carrying something */ | |
1040 bool m_normal; /* Does monster exist? */ | |
1041 bool m_wander; /* Does monster wander? */ | |
1042 char m_appear; /* What does monster look like? */ | |
1043 char *m_intel; /* Intelligence range */ | |
1044 long m_flags[MAXFLAGS]; /* Things about the monster */ | |
1045 char *m_typesum; /* type of creature can he summon */ | |
1046 short m_numsum; /* how many creatures can he summon */ | |
1047 short m_add_exp; /* Added experience per hit point */ | |
1048 struct mstats m_stats; /* Initial stats */ | |
1049 }; | |
1050 | |
1051 /* | |
1052 * Structure for a thing that the rogue can carry | |
1053 */ | |
1054 | |
1055 struct object { | |
1056 int o_type; /* What kind of object it is */ | |
1057 coord o_pos; /* Where it lives on the screen */ | |
1058 char *o_text; /* What it says if you read it */ | |
1059 char o_launch; /* What you need to launch it */ | |
1060 char o_damage[8]; /* Damage if used like sword */ | |
1061 char o_hurldmg[8]; /* Damage if thrown */ | |
1062 struct linked_list *contents; /* contents of this object */ | |
1063 int o_count; /* Count for plural objects */ | |
1064 int o_which; /* Which object of a type it is */ | |
1065 int o_hplus; /* Plusses to hit */ | |
1066 int o_dplus; /* Plusses to damage */ | |
1067 int o_ac; /* Armor class */ | |
1068 long o_flags; /* Information about objects */ | |
1069 int o_group; /* Group number for this object */ | |
1070 int o_weight; /* weight of this object */ | |
1071 char o_mark[MARKLEN]; /* Mark the specific object */ | |
1072 }; | |
1073 /* | |
1074 * weapon structure | |
1075 */ | |
1076 struct init_weps { | |
1077 char *w_name; /* name of weapon */ | |
1078 char *w_dam; /* hit damage */ | |
1079 char *w_hrl; /* hurl damage */ | |
1080 char w_launch; /* need to launch it */ | |
1081 int w_flags; /* flags */ | |
1082 int w_rate; /* rate of fire */ | |
1083 int w_wght; /* weight of weapon */ | |
1084 int w_worth; /* worth of this weapon */ | |
1085 }; | |
1086 | |
1087 /* | |
1088 * armor structure | |
1089 */ | |
1090 struct init_armor { | |
1091 char *a_name; /* name of armor */ | |
1092 int a_prob; /* chance of getting armor */ | |
1093 int a_class; /* normal armor class */ | |
1094 int a_worth; /* worth of armor */ | |
1095 int a_wght; /* weight of armor */ | |
1096 }; | |
1097 | |
1098 struct spells { | |
1099 short s_which; /* which scroll or potion */ | |
1100 short s_cost; /* cost of casting spell */ | |
1101 short s_type; /* scroll or potion */ | |
1102 int s_flag; /* is the spell blessed/cursed? */ | |
1103 }; | |
1104 | |
1105 struct quill { | |
1106 short s_which; /* which scroll to write */ | |
1107 short s_cost; /* cost of writing it */ | |
1108 }; | |
1109 | |
1110 struct delayed_action { | |
1111 int d_type; | |
1112 int (*d_func)(); | |
1113 union { | |
1114 int arg; | |
1115 void *varg; | |
1116 } d_; | |
1117 int d_time; | |
1118 } ; | |
1119 | |
1120 struct linked_list *find_mons(), *find_obj(), *get_item(), *new_item(), | |
1121 *new_thing(), *wake_monster(), *get_hurl(), | |
1122 *spec_item(), *creat_item(), *wield_weap(); | |
1123 struct room *roomin(); | |
1124 struct trap *trap_at(); | |
1125 | |
1126 /* char *malloc(), *getenv(), *tr_name(), *new(), *sprintf(), */ | |
1127 char *getenv(), *tr_name(), *new(), | |
1128 *vowelstr(), *inv_name(), *strcpy(), *strcat(); | |
1129 char *num(), *ring_num(), *misc_num(), *blesscurse(), *p_kind(), | |
1130 *typ_name(), *prname(), *monster_name(), *weap_name(), *misc_name(); | |
1131 coord *rndmove(), *can_shoot(), *fallpos(), *doorway(), get_coordinates(); | |
1132 short randmonster(), id_monst(), movement(); | |
1133 void quit(int), auto_save(int), bugkill(int), endit(int), tstp(int), | |
1134 byebye(int); | |
1135 int nohaste(), spell_recovery(), | |
1136 doctor(), runners(), swander(), unconfuse(), unsee(), fumble(), | |
1137 unclrhead(), unphase(), noslow(), rollwand(), stomach(), sight(), | |
1138 unstink(), suffocate(), cure_disease(), shoot_bolt(), changeclass(), | |
1139 appear(), dust_appear(), unchoke(), alchemy(), trap_look(), strangle(), | |
1140 ring_teleport(), ring_search(), grab(), dsrpt_player(), quill_charge(), | |
1141 make_sell_pack(), unskill(), findmindex(), nobolt(), nofire(), nocold(), | |
1142 usage_time(), eat_gold(), chant_recovery(), prayer_recovery(), | |
1143 dsrpt_monster(); | |
1144 bool blue_light(), can_blink(), creat_mons(), add_pack(), | |
1145 straight_shot(), maze_view(), lit_room(), getdelta(), save_file(), | |
1146 save_game(), m_use_it(), m_use_pack(), get_dir(), need_dir(); | |
1147 long lseek(), check_level(); | |
1148 void genmonsters(), | |
1149 add_intelligence(), add_strength(), add_wisdom(), add_dexterity(), | |
1150 add_constitution(), add_charisma(), res_intelligence(), res_strength(int), | |
1151 res_wisdom(), res_dexterity(), res_constitution(), res_charisma(); | |
1152 | |
1153 | |
1154 #ifdef CHECKTIME | |
1155 int checkout(); | |
1156 #endif | |
1157 | |
1158 | |
1159 /* | |
1160 * Now all the global variables | |
1161 */ | |
1162 | |
1163 extern struct trap traps[]; | |
1164 extern struct h_list helpstr[]; | |
1165 extern struct h_list wiz_help[]; | |
1166 extern struct character_types char_class[];/* character classes */ | |
1167 extern struct room rooms[]; /* One for each room -- A level */ | |
1168 extern struct room *oldrp; /* Roomin(&oldpos) */ | |
1169 extern struct linked_list *mlist; /* List of monsters on the level */ | |
1170 extern struct linked_list *tlist; /* list of monsters fallen down traps */ | |
1171 extern struct death_type deaths[]; /* all the ways to die */ | |
1172 extern struct thing player; /* The rogue */ | |
1173 extern struct monster monsters[NUMMONST+1]; /* The initial monster states */ | |
1174 extern struct linked_list *lvl_obj; /* List of objects on this level */ | |
1175 extern struct linked_list *monst_dead; /* Indicates monster that got killed */ | |
1176 extern struct object *cur_weapon; /* Which weapon he is weilding */ | |
1177 extern struct object *cur_armor; /* What a well dresssed rogue wears */ | |
1178 extern struct object *cur_ring[]; /* Which rings are being worn */ | |
1179 extern struct object *cur_misc[]; /* which MM's are in use */ | |
1180 extern struct magic_item things[]; /* Chances for each type of item */ | |
1181 extern struct magic_item s_magic[]; /* Names and chances for scrolls */ | |
1182 extern struct magic_item p_magic[]; /* Names and chances for potions */ | |
1183 extern struct magic_item r_magic[]; /* Names and chances for rings */ | |
1184 extern struct magic_item ws_magic[]; /* Names and chances for sticks */ | |
1185 extern struct magic_item m_magic[]; /* Names and chances for MM */ | |
1186 extern struct magic_item rel_magic[]; /* Names and chances for relics */ | |
1187 extern struct magic_item foods[]; /* Names and chances for foods */ | |
1188 extern struct spells magic_spells[]; /* spells for magic users */ | |
1189 extern struct spells cleric_spells[]; /* spells for clerics */ | |
1190 extern struct spells druid_spells[]; /* spells for druids */ | |
1191 extern struct quill quill_scrolls[]; /* scrolls for quill */ | |
1192 extern char *cnames[][17]; /* Character level names */ | |
1193 extern char *abilities[NUMABILITIES]; /* Names of the various abilities */ | |
1194 extern char curpurch[]; /* name of item ready to buy */ | |
1195 extern char PLAYER; /* what the player looks like */ | |
1196 extern char nfloors; /* Number of floors in this dungeon */ | |
1197 extern int cols; /* number of columns on terminal */ | |
1198 extern int lines; /* number of lines in terminal */ | |
1199 extern int char_type; /* what type of character is player */ | |
1200 extern int foodlev; /* how fast he eats food */ | |
1201 extern int level; /* What level rogue is on */ | |
1202 extern int trader; /* number of purchases */ | |
1203 extern int curprice; /* price of an item */ | |
1204 extern int purse; /* How much gold the rogue has */ | |
1205 extern int mpos; /* Where cursor is on top line */ | |
1206 extern int ntraps; /* Number of traps on this level */ | |
1207 extern int inpack; /* Number of things in pack */ | |
1208 extern int total; /* Total dynamic memory bytes */ | |
1209 extern int lastscore; /* Score before this turn */ | |
1210 extern int no_food; /* Number of levels without food */ | |
1211 extern int foods_this_level; /* num of foods this level */ | |
1212 extern int seed; /* Random number seed */ | |
1213 extern int count; /* Number of times to repeat command */ | |
1214 extern int dnum; /* Dungeon number */ | |
1215 extern int max_level; /* Deepest player has gone */ | |
1216 extern int cur_max; /* Deepest player has gone currently */ | |
1217 extern int food_left; /* Amount of food in hero's stomach */ | |
1218 extern int group; /* Current group number */ | |
1219 extern int hungry_state; /* How hungry is he */ | |
1220 extern int infest_dam; /* Damage from parasites */ | |
1221 extern int lost_str; /* Amount of strength lost */ | |
1222 extern int hold_count; /* Number of monsters holding player */ | |
1223 extern int trap_tries; /* Number of attempts to set traps */ | |
1224 extern int chant_time; /* Number of chant points/exp level */ | |
1225 extern int pray_time; /* Number of prayer points/exp level */ | |
1226 extern int spell_power; /* Spell power left at this level */ | |
1227 extern int turns; /* Number of turns player has taken */ | |
1228 extern int quest_item; /* Item hero is looking for */ | |
1229 extern int cur_relic[]; /* Current relics */ | |
1230 extern char take; /* Thing the rogue is taking */ | |
1231 extern char prbuf[]; /* Buffer for sprintfs */ | |
1232 extern char outbuf[]; /* Output buffer for stdout */ | |
1233 extern char runch; /* Direction player is running */ | |
1234 extern char *s_names[]; /* Names of the scrolls */ | |
1235 extern char *p_colors[]; /* Colors of the potions */ | |
1236 extern char *r_stones[]; /* Stone settings of the rings */ | |
1237 extern struct init_weps weaps[]; /* weapons and attributes */ | |
1238 extern struct init_armor armors[]; /* armors and attributes */ | |
1239 extern char *ws_made[]; /* What sticks are made of */ | |
1240 extern char *release; /* Release number of rogue */ | |
1241 extern char whoami[]; /* Name of player */ | |
1242 extern char fruit[]; /* Favorite fruit */ | |
1243 extern char huh[]; /* The last message printed */ | |
1244 extern char *s_guess[]; /* Players guess at what scroll is */ | |
1245 extern char *p_guess[]; /* Players guess at what potion is */ | |
1246 extern char *r_guess[]; /* Players guess at what ring is */ | |
1247 extern char *ws_guess[]; /* Players guess at what wand is */ | |
1248 extern char *m_guess[]; /* Players guess at what MM is */ | |
1249 extern char *ws_type[]; /* Is it a wand or a staff */ | |
1250 extern char file_name[]; /* Save file name */ | |
1251 extern char score_file[]; /* Score file name */ | |
1252 extern char home[]; /* User's home directory */ | |
1253 extern WINDOW *cw; /* Window that the player sees */ | |
1254 extern WINDOW *hw; /* Used for the help command */ | |
1255 extern WINDOW *mw; /* Used to store mosnters */ | |
1256 extern WINDOW *msgw; /* Message window */ | |
1257 extern bool pool_teleport; /* just teleported from a pool */ | |
1258 extern bool inwhgt; /* true if from wghtchk() */ | |
1259 extern bool running; /* True if player is running */ | |
1260 extern bool playing; /* True until he quits */ | |
1261 extern bool wizard; /* True if allows wizard commands */ | |
1262 extern bool after; /* True if we want after daemons */ | |
1263 extern bool notify; /* True if player wants to know */ | |
1264 extern bool fight_flush; /* True if toilet input */ | |
1265 extern bool terse; /* True if we should be short */ | |
1266 extern bool auto_pickup; /* pick up things automatically? */ | |
1267 extern bool menu_overlay; /* use overlay type menu */ | |
1268 extern bool door_stop; /* Stop running when we pass a door */ | |
1269 extern bool jump; /* Show running as series of jumps */ | |
1270 extern bool slow_invent; /* Inventory one line at a time */ | |
1271 extern bool firstmove; /* First move after setting door_stop */ | |
1272 extern bool waswizard; /* Was a wizard sometime */ | |
1273 extern bool askme; /* Ask about unidentified things */ | |
1274 extern bool s_know[]; /* Does he know what a scroll does */ | |
1275 extern bool p_know[]; /* Does he know what a potion does */ | |
1276 extern bool r_know[]; /* Does he know what a ring does */ | |
1277 extern bool ws_know[]; /* Does he know what a stick does */ | |
1278 extern bool m_know[]; /* Does he know what a MM does */ | |
1279 extern bool in_shell; /* True if executing a shell */ | |
1280 extern bool daytime; /* Indicates whether it is daytime */ | |
1281 extern coord oldpos; /* Position before last look() call */ | |
1282 extern coord grid[]; /* used for random pos generation */ | |
1283 extern char *nothing; /* "nothing happens" msg */ | |
1284 extern char *spacemsg; | |
1285 extern char *morestr; | |
1286 extern char *retstr; | |
1287 extern LEVTYPE levtype; | |
1288 extern void (*add_abil[NUMABILITIES])(); /* Functions to change abilities */ | |
1289 extern void (*res_abil[NUMABILITIES])(); /* Functions to change abilities */ | |
1290 extern int cNCOLORS, cNWOOD, cNMETAL, cNSTONES; | |
1291 extern char *rainbow[], *stones[], *wood[], *metal[]; | |
1292 extern int land(), wghtchk(), undance(), cloak_charge(struct object *); | |
1293 extern struct delayed_action d_list[MAXDAEMONS]; | |
1294 extern struct delayed_action f_list[MAXFUSES]; | |
1295 extern int demoncnt, fusecnt, between, chance; | |
1296 #define CCHAR(x) ( (char) (x & A_CHARTEXT) ) | |
1297 extern char *md_gethostname(), *md_getusername(), *md_gethomedir(), *md_getroguedir(), *md_crypt(); |