UMoria  5.5.2
 全て データ構造 ファイル 関数 変数 型定義 マクロ定義
constant.h
説明を見る。
1 /* source/constant.h: global constants used by Moria
2 
3  Copyright (c) 1989-92 James E. Wilson, Robert A. Koeneke
4 
5  This software may be copied and distributed for educational, research, and
6  not for profit purposes provided that this copyright and statement are
7  included in all such copies. */
8 
9 /*Note to the Wizard: - RAK - */
10 /* Tweaking these constants can *GREATLY* change the game. */
11 /* Two years of constant tuning have generated these */
12 /* values. Minor adjustments are encouraged, but you must */
13 /* be very careful not to unbalance the game. Moria was */
14 /* meant to be challenging, not a give away. Many */
15 /* adjustments can cause the game to act strangely, or even*/
16 /* cause errors. */
17 
18 /*Addendum: - JEW -
19  I have greatly expanded the number of defined constants. However, if
20  you change anything below, without understanding EXACTLY how the game
21  uses the number, the program may stop working correctly. Modify the
22  constants at your own risk. */
23 
24 #define CONSTANT_H_INCLUDED
25 #ifndef CONFIG_H_INCLUDED
26 Constant.h should always be included after config.h, because it uses
27 some of the system defines set up there.
28 #endif
29 
30 /* Current version number of Moria */
31 #define CUR_VERSION_MAJ 5 /* version 5.5 */
32 #define CUR_VERSION_MIN 5
33 #define PATCH_LEVEL 0
34 
35 #ifndef TRUE
36 #define TRUE 1
37 #endif
38 #ifndef FALSE
39 #define FALSE 0
40 #endif
41 
42 #define MAX_UCHAR 255
43 #define MAX_SHORT 32767 /* maximum short/long signed ints */
44 #define MAX_LONG 0x7FFFFFFFL
45 
46 /* Changing values below this line may be hazardous to your health! */
47 
48 /* message line location */
49 #define MSG_LINE 0
50 
51 /* number of messages to save in a buffer */
52 #define MAX_SAVE_MSG 22 /* How many messages to save -CJS- */
53 
54 /* Dungeon size parameters */
55 #define MAX_HEIGHT 66 /* Multiple of 11; >= 22 */
56 #define MAX_WIDTH 198 /* Multiple of 33; >= 66 */
57 #define SCREEN_HEIGHT 22
58 #define SCREEN_WIDTH 66
59 #define QUART_HEIGHT (SCREEN_HEIGHT / 4)
60 #define QUART_WIDTH (SCREEN_WIDTH / 4)
61 
62 /* Dungeon generation values */
63 /* Note: The entire design of dungeon can be changed by only */
64 /* slight adjustments here. */
65 #define DUN_TUN_RND 9 /* 1/Chance of Random direction */
66 #define DUN_TUN_CHG 70 /* Chance of changing direction (99 max) */
67 #define DUN_TUN_CON 15 /* Chance of extra tunneling */
68 #define DUN_ROO_MEA 32 /* Mean of # of rooms, standard dev2 */
69 #define DUN_TUN_PEN 25 /* % chance of room doors */
70 #define DUN_TUN_JCT 15 /* % chance of doors at tunnel junctions */
71 #define DUN_STR_DEN 5 /* Density of streamers */
72 #define DUN_STR_RNG 2 /* Width of streamers */
73 #define DUN_STR_MAG 3 /* Number of magma streamers */
74 #define DUN_STR_MC 90 /* 1/x chance of treasure per magma */
75 #define DUN_STR_QUA 2 /* Number of quartz streamers */
76 #define DUN_STR_QC 40 /* 1/x chance of treasure per quartz */
77 #define DUN_UNUSUAL 300 /* Level/x chance of unusual room */
78 
79 /* Store constants */
80 #define MAX_OWNERS 18 /* Number of owners to choose from */
81 #define MAX_STORES 6 /* Number of different stores */
82 #define STORE_INVEN_MAX 24 /* Max number of discrete objs in inven */
83 #define STORE_CHOICES 26 /* NUMBER of items to choose stock from */
84 #define STORE_MAX_INVEN 18 /* Max diff objs in stock for auto buy */
85 #define STORE_MIN_INVEN 10 /* Min diff objs in stock for auto sell */
86 #define STORE_TURN_AROUND 9 /* Amount of buying and selling normally */
87 #define COST_ADJ 100 /* Adjust prices for buying and selling */
88 
89 /* Treasure constants */
90 #define INVEN_ARRAY_SIZE 34 /* Size of inventory array(Do not change)*/
91 #define MAX_OBJ_LEVEL 50 /* Maximum level of magic in dungeon */
92 #define OBJ_GREAT 12 /* 1/n Chance of item being a Great Item */
93 /* Note that the following constants are all related, if you change one,
94  you must also change all succeeding ones. Also, player_init[] and
95  store_choice[] may also have to be changed. */
96 #define MAX_OBJECTS 420 /* Number of objects for universe */
97 #define MAX_DUNGEON_OBJ 344 /* Number of dungeon objects */
98 #define OBJ_OPEN_DOOR 367
99 #define OBJ_CLOSED_DOOR 368
100 #define OBJ_SECRET_DOOR 369
101 #define OBJ_UP_STAIR 370
102 #define OBJ_DOWN_STAIR 371
103 #define OBJ_STORE_DOOR 372
104 #define OBJ_TRAP_LIST 378
105 #define OBJ_RUBBLE 396
106 #define OBJ_MUSH 397
107 #define OBJ_SCARE_MON 398
108 #define OBJ_GOLD_LIST 399
109 #define OBJ_NOTHING 417
110 #define OBJ_RUINED_CHEST 418
111 #define OBJ_WIZARD 419
112 #define OBJECT_IDENT_SIZE 448 /* 7*64, see object_offset() in desc.c,
113  could be MAX_OBJECTS o_o() rewritten */
114 #define MAX_GOLD 18 /* Number of different types of gold */
115 /* with MAX_TALLOC 150, it is possible to get compacting objects during
116  level generation, although it is extremely rare */
117 #define MAX_TALLOC 175 /* Max objects per level */
118 #define MIN_TRIX 1 /* Minimum t_list index used */
119 #define TREAS_ROOM_ALLOC 7 /* Amount of objects for rooms */
120 #define TREAS_ANY_ALLOC 2 /* Amount of objects for corridors */
121 #define TREAS_GOLD_ALLOC 2 /* Amount of gold (and gems) */
122 
123 /* Magic Treasure Generation constants */
124 /* Note: Number of special objects, and degree of enchantments */
125 /* can be adjusted here. */
126 #define OBJ_STD_ADJ 125 /* Adjust STD per level * 100 */
127 #define OBJ_STD_MIN 7 /* Minimum STD */
128 #define OBJ_TOWN_LEVEL 7 /* Town object generation level */
129 #define OBJ_BASE_MAGIC 15 /* Base amount of magic */
130 #define OBJ_BASE_MAX 70 /* Max amount of magic */
131 #define OBJ_DIV_SPECIAL 6 /* magic_chance/# special magic */
132 #define OBJ_DIV_CURSED 13 /* 10*magic_chance/# cursed items */
133 
134 /* Constants describing limits of certain objects */
135 #define OBJ_LAMP_MAX 15000 /* Maximum amount that lamp can be filled*/
136 #define OBJ_BOLT_RANGE 18 /* Maximum range of bolts and balls */
137 #define OBJ_RUNE_PROT 3000 /* Rune of protection resistance */
138 
139 /* Creature constants */
140 #define MAX_CREATURES 279 /* Number of creatures defined for univ */
141 #define N_MONS_ATTS 215 /* Number of monster attack types. */
142 /* with MAX_MALLOC 101, it is possible to get compacting monsters messages
143  while breeding/cloning monsters */
144 #define MAX_MALLOC 125 /* Max that can be allocated */
145 #define MAX_MALLOC_CHANCE 160 /* 1/x chance of new monster each round */
146 #define MAX_MONS_LEVEL 40 /* Maximum level of creatures */
147 #define MAX_SIGHT 20 /* Maximum dis a creature can be seen */
148 #define MAX_SPELL_DIS 20 /* Maximum dis creat. spell can be cast */
149 #define MAX_MON_MULT 75 /* Maximum reproductions on a level */
150 #define MON_MULT_ADJ 7 /* High value slows multiplication */
151 #define MON_NASTY 50 /* 1/x chance of high level creat */
152 #define MIN_MALLOC_LEVEL 14 /* Minimum number of monsters/level */
153 #define MIN_MALLOC_TD 4 /* Number of people on town level (day) */
154 #define MIN_MALLOC_TN 8 /* Number of people on town level (night)*/
155 #define WIN_MON_TOT 2 /* Total number of "win" creatures */
156 #define WIN_MON_APPEAR 50 /* Level where winning creatures begin */
157 #define MON_SUMMON_ADJ 2 /* Adjust level of summoned creatures */
158 #define MON_DRAIN_LIFE 2 /* Percent of player exp drained per hit */
159 #define MAX_MON_NATTACK 4 /* Max num attacks (used in mons memory) -CJS-*/
160 #define MIN_MONIX 2 /* Minimum index in m_list (1 = py, 0 = no mon)*/
161 
162 /* Trap constants */
163 #define MAX_TRAP 18 /* Number of defined traps */
164 
165 #define SCARE_MONSTER 99
166 
167 /* Descriptive constants */
168 #define MAX_COLORS 49 /* Used with potions */
169 #define MAX_MUSH 22 /* Used with mushrooms */
170 #define MAX_WOODS 25 /* Used with staffs */
171 #define MAX_METALS 25 /* Used with wands */
172 #define MAX_ROCKS 32 /* Used with rings */
173 #define MAX_AMULETS 11 /* Used with amulets */
174 #define MAX_TITLES 45 /* Used with scrolls */
175 #define MAX_SYLLABLES 153 /* Used with scrolls */
176 
177 /* Player constants */
178 #define MAX_PLAYER_LEVEL 40 /* Maximum possible character level */
179 #define MAX_EXP 9999999L /* Maximum amount of experience -CJS- */
180 #define MAX_RACES 8 /* Number of defined races */
181 #define MAX_CLASS 6 /* Number of defined classes */
182 #define USE_DEVICE 3 /* x> Harder devices x< Easier devices */
183 #define MAX_BACKGROUND 128 /* Number of types of histories for univ */
184 #define PLAYER_FOOD_FULL 10000/* Getting full */
185 #define PLAYER_FOOD_MAX 15000/* Maximum food value, beyond is wasted */
186 #define PLAYER_FOOD_FAINT 300/* Character begins fainting */
187 #define PLAYER_FOOD_WEAK 1000/* Warn player that he is getting very low*/
188 #define PLAYER_FOOD_ALERT 2000/* Warn player that he is getting low */
189 #define PLAYER_REGEN_FAINT 33 /* Regen factor*2^16 when fainting */
190 #define PLAYER_REGEN_WEAK 98 /* Regen factor*2^16 when weak */
191 #define PLAYER_REGEN_NORMAL 197 /* Regen factor*2^16 when full */
192 #define PLAYER_REGEN_HPBASE 1442 /* Min amount hp regen*2^16 */
193 #define PLAYER_REGEN_MNBASE 524 /* Min amount mana regen*2^16 */
194 #define PLAYER_WEIGHT_CAP 130 /* "#"*(1/10 pounds) per strength point */
195 #define PLAYER_EXIT_PAUSE 2 /* Pause time before player can re-roll */
196 
197 /* class level adjustment constants */
198 #define CLA_BTH 0
199 #define CLA_BTHB 1
200 #define CLA_DEVICE 2
201 #define CLA_DISARM 3
202 #define CLA_SAVE 4
203 /* this depends on the fact that CLA_SAVE values are all the same, if not,
204  then should add a separate column for this */
205 #define CLA_MISC_HIT 4
206 #define MAX_LEV_ADJ 5
207 
208 /* Base to hit constants */
209 #define BTH_PLUS_ADJ 3 /* Adjust BTH per plus-to-hit */
210 
211 /* magic numbers for players inventory array */
212 #define INVEN_WIELD 22 /* must be first item in equipment list */
213 #define INVEN_HEAD 23
214 #define INVEN_NECK 24
215 #define INVEN_BODY 25
216 #define INVEN_ARM 26
217 #define INVEN_HANDS 27
218 #define INVEN_RIGHT 28
219 #define INVEN_LEFT 29
220 #define INVEN_FEET 30
221 #define INVEN_OUTER 31
222 #define INVEN_LIGHT 32
223 #define INVEN_AUX 33
224 
225 /* Attribute indexes -CJS- */
226 
227 #define A_STR 0
228 #define A_INT 1
229 #define A_WIS 2
230 #define A_DEX 3
231 #define A_CON 4
232 #define A_CHR 5
233 
234 /* some systems have a non-ANSI definition of this, so undef it first */
235 #undef CTRL
236 #define CTRL(x) (x & 0x1F)
237 #define DELETE 0x7f
238 #ifdef VMS
239 #define ESCAPE '\032' /* Use CTRL-Z instead of ESCAPE. */
240 #else
241 #define ESCAPE '\033' /* ESCAPE character -CJS- */
242 #endif
243 
244 /* This used to be NULL, but that was technically incorrect. CNIL is used
245  instead of null to help avoid lint errors. */
246 #ifndef CNIL
247 #define CNIL (char *)0
248 #endif
249 
250 /* Fval definitions: these describe the various types of dungeon floors and
251  walls, if numbers above 15 are ever used, then the test against
252  MIN_CAVE_WALL will have to be changed, also the save routines will have
253  to be changed. */
254 #define NULL_WALL 0
255 #define DARK_FLOOR 1
256 #define LIGHT_FLOOR 2
257 #define MAX_CAVE_ROOM 2
258 #define CORR_FLOOR 3
259 #define BLOCKED_FLOOR 4 /* a corridor space with cl/st/se door or rubble */
260 #define MAX_CAVE_FLOOR 4
261 
262 #define MAX_OPEN_SPACE 3
263 #define MIN_CLOSED_SPACE 4
264 
265 #define TMP1_WALL 8
266 #define TMP2_WALL 9
267 
268 #define MIN_CAVE_WALL 12
269 #define GRANITE_WALL 12
270 #define MAGMA_WALL 13
271 #define QUARTZ_WALL 14
272 #define BOUNDARY_WALL 15
273 
274 /* Column for stats */
275 #define STAT_COLUMN 0
276 
277 /* Class spell types */
278 #define NONE 0
279 #define MAGE 1
280 #define PRIEST 2
281 
282 /* offsets to spell names in spell_names[] array */
283 #define SPELL_OFFSET 0
284 #define PRAYER_OFFSET 31
285 
286 /* definitions for the psuedo-normal distribution generation */
287 #define NORMAL_TABLE_SIZE 256
288 #define NORMAL_TABLE_SD 64 /* the standard deviation for the table */
289 
290 /* definitions for the player's status field */
291 #define PY_HUNGRY 0x00000001L
292 #define PY_WEAK 0x00000002L
293 #define PY_BLIND 0x00000004L
294 #define PY_CONFUSED 0x00000008L
295 #define PY_FEAR 0x00000010L
296 #define PY_POISONED 0x00000020L
297 #define PY_FAST 0x00000040L
298 #define PY_SLOW 0x00000080L
299 #define PY_SEARCH 0x00000100L
300 #define PY_REST 0x00000200L
301 #define PY_STUDY 0x00000400L
302 
303 #define PY_INVULN 0x00001000L
304 #define PY_HERO 0x00002000L
305 #define PY_SHERO 0x00004000L
306 #define PY_BLESSED 0x00008000L
307 #define PY_DET_INV 0x00010000L
308 #define PY_TIM_INFRA 0x00020000L
309 #define PY_SPEED 0x00040000L
310 #define PY_STR_WGT 0x00080000L
311 #define PY_PARALYSED 0x00100000L
312 #define PY_REPEAT 0x00200000L
313 #define PY_ARMOR 0x00400000L
314 
315 #define PY_STATS 0x3F000000L
316 #define PY_STR 0x01000000L /* these 6 stat flags must be adjacent */
317 #define PY_INT 0x02000000L
318 #define PY_WIS 0x04000000L
319 #define PY_DEX 0x08000000L
320 #define PY_CON 0x10000000L
321 #define PY_CHR 0x20000000L
322 
323 #define PY_HP 0x40000000L
324 #define PY_MANA 0x80000000L
325 
326 /* definitions for objects that can be worn */
327 #define TR_STATS 0x0000003FL /* the stats must be the low 6 bits */
328 #define TR_STR 0x00000001L
329 #define TR_INT 0x00000002L
330 #define TR_WIS 0x00000004L
331 #define TR_DEX 0x00000008L
332 #define TR_CON 0x00000010L
333 #define TR_CHR 0x00000020L
334 #define TR_SEARCH 0x00000040L
335 #define TR_SLOW_DIGEST 0x00000080L
336 #define TR_STEALTH 0x00000100L
337 #define TR_AGGRAVATE 0x00000200L
338 #define TR_TELEPORT 0x00000400L
339 #define TR_REGEN 0x00000800L
340 #define TR_SPEED 0x00001000L
341 
342 #define TR_EGO_WEAPON 0x0007E000L
343 #define TR_SLAY_DRAGON 0x00002000L
344 #define TR_SLAY_ANIMAL 0x00004000L
345 #define TR_SLAY_EVIL 0x00008000L
346 #define TR_SLAY_UNDEAD 0x00010000L
347 #define TR_FROST_BRAND 0x00020000L
348 #define TR_FLAME_TONGUE 0x00040000L
349 
350 #define TR_RES_FIRE 0x00080000L
351 #define TR_RES_ACID 0x00100000L
352 #define TR_RES_COLD 0x00200000L
353 #define TR_SUST_STAT 0x00400000L
354 #define TR_FREE_ACT 0x00800000L
355 #define TR_SEE_INVIS 0x01000000L
356 #define TR_RES_LIGHT 0x02000000L
357 #define TR_FFALL 0x04000000L
358 #define TR_BLIND 0x08000000L
359 #define TR_TIMID 0x10000000L
360 #define TR_TUNNEL 0x20000000L
361 #define TR_INFRA 0x40000000L
362 #define TR_CURSED 0x80000000L
363 
364 /* definitions for chests */
365 #define CH_LOCKED 0x00000001L
366 #define CH_TRAPPED 0x000001F0L
367 #define CH_LOSE_STR 0x00000010L
368 #define CH_POISON 0x00000020L
369 #define CH_PARALYSED 0x00000040L
370 #define CH_EXPLODE 0x00000080L
371 #define CH_SUMMON 0x00000100L
372 
373 /* definitions for creatures, cmove field */
374 #define CM_ALL_MV_FLAGS 0x0000003FL
375 #define CM_ATTACK_ONLY 0x00000001L
376 #define CM_MOVE_NORMAL 0x00000002L
377 /* For Quylthulgs, which have no physical movement. */
378 #define CM_ONLY_MAGIC 0x00000004L
379 
380 #define CM_RANDOM_MOVE 0x00000038L
381 #define CM_20_RANDOM 0x00000008L
382 #define CM_40_RANDOM 0x00000010L
383 #define CM_75_RANDOM 0x00000020L
384 
385 #define CM_SPECIAL 0x003F0000L
386 #define CM_INVISIBLE 0x00010000L
387 #define CM_OPEN_DOOR 0x00020000L
388 #define CM_PHASE 0x00040000L
389 #define CM_EATS_OTHER 0x00080000L
390 #define CM_PICKS_UP 0x00100000L
391 #define CM_MULTIPLY 0x00200000L
392 
393 #define CM_CARRY_OBJ 0x01000000L
394 #define CM_CARRY_GOLD 0x02000000L
395 #define CM_TREASURE 0x7C000000L
396 #define CM_TR_SHIFT 26 /* used for recall of treasure */
397 #define CM_60_RANDOM 0x04000000L
398 #define CM_90_RANDOM 0x08000000L
399 #define CM_1D2_OBJ 0x10000000L
400 #define CM_2D2_OBJ 0x20000000L
401 #define CM_4D2_OBJ 0x40000000L
402 #define CM_WIN 0x80000000L
403 
404 /* creature spell definitions */
405 #define CS_FREQ 0x0000000FL
406 #define CS_SPELLS 0x0001FFF0L
407 #define CS_TEL_SHORT 0x00000010L
408 #define CS_TEL_LONG 0x00000020L
409 #define CS_TEL_TO 0x00000040L
410 #define CS_LGHT_WND 0x00000080L
411 #define CS_SER_WND 0x00000100L
412 #define CS_HOLD_PER 0x00000200L
413 #define CS_BLIND 0x00000400L
414 #define CS_CONFUSE 0x00000800L
415 #define CS_FEAR 0x00001000L
416 #define CS_SUMMON_MON 0x00002000L
417 #define CS_SUMMON_UND 0x00004000L
418 #define CS_SLOW_PER 0x00008000L
419 #define CS_DRAIN_MANA 0x00010000L
420 
421 #define CS_BREATHE 0x00F80000L
422 #define CS_BR_LIGHT 0x00080000L
423 #define CS_BR_GAS 0x00100000L
424 #define CS_BR_ACID 0x00200000L
425 #define CS_BR_FROST 0x00400000L
426 #define CS_BR_FIRE 0x00800000L
427 
428 /* creature defense flags */
429 #define CD_DRAGON 0x0001
430 #define CD_ANIMAL 0x0002
431 #define CD_EVIL 0x0004
432 #define CD_UNDEAD 0x0008
433 #define CD_WEAKNESS 0x03F0
434 #define CD_FROST 0x0010
435 #define CD_FIRE 0x0020
436 #define CD_POISON 0x0040
437 #define CD_ACID 0x0080
438 #define CD_LIGHT 0x0100
439 #define CD_STONE 0x0200
440 
441 #define CD_NO_SLEEP 0x1000
442 #define CD_INFRA 0x2000
443 #define CD_MAX_HP 0x4000
444 
445 /* inventory stacking subvals */
446 /* these never stack */
447 #define ITEM_NEVER_STACK_MIN 0
448 #define ITEM_NEVER_STACK_MAX 63
449 /* these items always stack with others of same subval, always treated as
450  single objects, must be power of 2 */
451 #define ITEM_SINGLE_STACK_MIN 64
452 #define ITEM_SINGLE_STACK_MAX 192 /* see NOTE below */
453 /* these items stack with others only if have same subval and same p1,
454  they are treated as a group for wielding, etc. */
455 #define ITEM_GROUP_MIN 192
456 #define ITEM_GROUP_MAX 255
457 /* NOTE: items with subval 192 are treated as single objects, but only stack
458  with others of same subval if have the same p1 value, only used for
459  torches */
460 
461 /* id's used for object description, stored in object_ident */
462 #define OD_TRIED 0x1
463 #define OD_KNOWN1 0x2
464 
465 /* id's used for item description, stored in i_ptr->ident */
466 #define ID_MAGIK 0x1
467 #define ID_DAMD 0x2
468 #define ID_EMPTY 0x4
469 #define ID_KNOWN2 0x8
470 #define ID_STOREBOUGHT 0x10
471 #define ID_SHOW_HITDAM 0x20
472 #define ID_NOSHOW_P1 0x40
473 #define ID_SHOW_P1 0x80
474 
475 /* indexes into the special name table */
476 #define SN_NULL 0
477 #define SN_R 1
478 #define SN_RA 2
479 #define SN_RF 3
480 #define SN_RC 4
481 #define SN_RL 5
482 #define SN_HA 6
483 #define SN_DF 7
484 #define SN_SA 8
485 #define SN_SD 9
486 #define SN_SE 10
487 #define SN_SU 11
488 #define SN_FT 12
489 #define SN_FB 13
490 #define SN_FREE_ACTION 14
491 #define SN_SLAYING 15
492 #define SN_CLUMSINESS 16
493 #define SN_WEAKNESS 17
494 #define SN_SLOW_DESCENT 18
495 #define SN_SPEED 19
496 #define SN_STEALTH 20
497 #define SN_SLOWNESS 21
498 #define SN_NOISE 22
499 #define SN_GREAT_MASS 23
500 #define SN_INTELLIGENCE 24
501 #define SN_WISDOM 25
502 #define SN_INFRAVISION 26
503 #define SN_MIGHT 27
504 #define SN_LORDLINESS 28
505 #define SN_MAGI 29
506 #define SN_BEAUTY 30
507 #define SN_SEEING 31
508 #define SN_REGENERATION 32
509 #define SN_STUPIDITY 33
510 #define SN_DULLNESS 34
511 #define SN_BLINDNESS 35
512 #define SN_TIMIDNESS 36
513 #define SN_TELEPORTATION 37
514 #define SN_UGLINESS 38
515 #define SN_PROTECTION 39
516 #define SN_IRRITATION 40
517 #define SN_VULNERABILITY 41
518 #define SN_ENVELOPING 42
519 #define SN_FIRE 43
520 #define SN_SLAY_EVIL 44
521 #define SN_DRAGON_SLAYING 45
522 #define SN_EMPTY 46
523 #define SN_LOCKED 47
524 #define SN_POISON_NEEDLE 48
525 #define SN_GAS_TRAP 49
526 #define SN_EXPLOSION_DEVICE 50
527 #define SN_SUMMONING_RUNES 51
528 #define SN_MULTIPLE_TRAPS 52
529 #define SN_DISARMED 53
530 #define SN_UNLOCKED 54
531 #define SN_SLAY_ANIMAL 55
532 #define SN_ARRAY_SIZE 56 /* must be at end of this list */
533 
534 /* defines for treasure type values (tval) */
535 #define TV_NEVER -1 /* used by find_range() for non-search */
536 #define TV_NOTHING 0
537 #define TV_MISC 1
538 #define TV_CHEST 2
539 /* min tval for wearable items, all items between TV_MIN_WEAR and TV_MAX_WEAR
540  use the same flag bits, see the TR_* defines */
541 #define TV_MIN_WEAR 10
542 /* items tested for enchantments, i.e. the MAGIK inscription, see the
543  enchanted() procedure */
544 #define TV_MIN_ENCHANT 10
545 #define TV_SLING_AMMO 10
546 #define TV_BOLT 11
547 #define TV_ARROW 12
548 #define TV_SPIKE 13
549 #define TV_LIGHT 15
550 #define TV_BOW 20
551 #define TV_HAFTED 21
552 #define TV_POLEARM 22
553 #define TV_SWORD 23
554 #define TV_DIGGING 25
555 #define TV_BOOTS 30
556 #define TV_GLOVES 31
557 #define TV_CLOAK 32
558 #define TV_HELM 33
559 #define TV_SHIELD 34
560 #define TV_HARD_ARMOR 35
561 #define TV_SOFT_ARMOR 36
562 /* max tval that uses the TR_* flags */
563 #define TV_MAX_ENCHANT 39
564 #define TV_AMULET 40
565 #define TV_RING 45
566 /* max tval for wearable items */
567 #define TV_MAX_WEAR 50
568 #define TV_STAFF 55
569 #define TV_WAND 65
570 #define TV_SCROLL1 70
571 #define TV_SCROLL2 71
572 #define TV_POTION1 75
573 #define TV_POTION2 76
574 #define TV_FLASK 77
575 #define TV_FOOD 80
576 #define TV_MAGIC_BOOK 90
577 #define TV_PRAYER_BOOK 91
578 /* objects with tval above this are never picked up by monsters */
579 #define TV_MAX_OBJECT 99
580 #define TV_GOLD 100
581 /* objects with higher tvals can not be picked up */
582 #define TV_MAX_PICK_UP 100
583 #define TV_INVIS_TRAP 101
584 /* objects between TV_MIN_VISIBLE and TV_MAX_VISIBLE are always visible,
585  i.e. the cave fm flag is set when they are present */
586 #define TV_MIN_VISIBLE 102
587 #define TV_VIS_TRAP 102
588 #define TV_RUBBLE 103
589 /* following objects are never deleted when trying to create another one
590  during level generation */
591 #define TV_MIN_DOORS 104
592 #define TV_OPEN_DOOR 104
593 #define TV_CLOSED_DOOR 105
594 #define TV_UP_STAIR 107
595 #define TV_DOWN_STAIR 108
596 #define TV_SECRET_DOOR 109
597 #define TV_STORE_DOOR 110
598 #define TV_MAX_VISIBLE 110
599 
600 /* spell types used by get_flags(), breathe(), fire_bolt() and fire_ball() */
601 #define GF_MAGIC_MISSILE 0
602 #define GF_LIGHTNING 1
603 #define GF_POISON_GAS 2
604 #define GF_ACID 3
605 #define GF_FROST 4
606 #define GF_FIRE 5
607 #define GF_HOLY_ORB 6
608 
609 /* Number of entries allowed in the scorefile. */
610 #define SCOREFILE_SIZE 1000