4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: global constants and macro definitions */
15 * Do not edit this file unless you know *exactly* what you are doing.
17 * Some of the values in this file were chosen to preserve game balance,
18 * while others are hard-coded based on the format of old save-files, the
19 * definition of arrays in various places, mathematical properties, fast
20 * computation, storage limits, or the format of external text files.
22 * Changing some of these values will induce crashes or memory errors or
23 * savefile mis-reads. Most of the comments in this file are meant as
24 * reminders, not complete descriptions, and even a complete knowledge
25 * of the source may not be sufficient to fully understand the effects
26 * of changing certain definitions.
28 * Lastly, note that the code does not always use the symbolic constants
29 * below, and sometimes uses various hard-coded values that may not even
30 * be defined in this file, but which may be related to definitions here.
31 * This is of course bad programming practice, but nobody is perfect...
33 * For example, there are MANY things that depend on the screen being
34 * 80x24, with the top line used for messages, the bottom line being
35 * used for status, and exactly 22 lines used to show the dungeon.
36 * Just because your screen can hold 46 lines does not mean that the
37 * game will work if you try to use 44 lines to show the dungeon.
39 * You have been warned.
44 * Name of the version/variant
46 #define VERSION_NAME "Hengband"
50 * "Program Version Number" of the game
52 * FAKE_VER_MAJOR=1,2 were reserved for ZAngband version 1.x.x/2.x.x .
54 * Program Version of Hengband version is
55 * "(FAKE_VER_MAJOR-10).(FAKE_VER_MINOR).(FAKE_VER_PATCH)".
57 #define FAKE_VERSION 0
58 #define FAKE_VER_MAJOR 11
59 #define FAKE_VER_MINOR 7
60 #define FAKE_VER_PATCH 0
64 * "Savefile Version Number" for Hengband 1.1.1 and later
66 * First three digits may be same as the Program Version. But not
67 * always same. It means that newer version may preserves lower
68 * compatibility with the older version.
70 * For example, newer Hengband 1.4.4 creates savefiles marked with
71 * Savefile Version 1.4.0.0 . It means that Hengband 1.4.0 can load a
72 * savefile of Hengband 1.4.4 (lower compatibility!).
74 * Upper compatibility is always guaranteed.
86 * Number of grids in each block (vertically)
87 * Probably hard-coded to 11, see "generate.c"
92 * Number of grids in each block (horizontally)
93 * Probably hard-coded to 11, see "generate.c"
99 * Number of grids in each panel (vertically)
100 * Must be a multiple of BLOCK_HGT
105 * Number of grids in each panel (horizontally)
106 * Must be a multiple of BLOCK_WID
112 * Number of grids used to display the dungeon (vertically).
113 * Must be a multiple of 11, probably hard-coded to 22.
115 #define SCREEN_HGT 22
118 * Number of grids used to display the dungeon (horizontally).
119 * Must be a multiple of 33, probably hard-coded to 66.
121 #define SCREEN_WID 66
125 * Maximum dungeon height in grids, must be a multiple of SCREEN_HGT,
126 * probably hard-coded to SCREEN_HGT * 3.
131 * Maximum dungeon width in grids, must be a multiple of SCREEN_WID,
132 * probably hard-coded to SCREEN_WID * 3.
140 #define MIN_RANDOM_QUEST 40
141 #define MAX_RANDOM_QUEST 49
143 /* Check is the quest index is "fixed" */
144 #define is_fixed_quest_idx(Q_IDX) (((Q_IDX) < MIN_RANDOM_QUEST) || ((Q_IDX) > MAX_RANDOM_QUEST))
146 #define QUEST_OBERON 8
147 #define QUEST_SERPENT 9
152 #define MAX_ARENA_MONS 38 /* -KMW- */
153 #define ARENA_DEFEATED_OLD_VER (-(MAX_SHORT))
157 * Total number of stores (see "store.c", etc)
159 #define MAX_STORES 10
162 * Number of buildings
169 #define STORE_GENERAL 0
170 #define STORE_ARMOURY 1
171 #define STORE_WEAPON 2
172 #define STORE_TEMPLE 3
173 #define STORE_ALCHEMIST 4
174 #define STORE_MAGIC 5
175 #define STORE_BLACK 6
178 #define STORE_MUSEUM 9
181 #define BUILDING_NON_MEMBER 0
182 #define BUILDING_MEMBER 1
183 #define BUILDING_OWNER 2
186 * Total number of owners per store (see "store.c", etc)
188 #define MAX_OWNERS 32
191 * Maximum number of player "sex" types (see "table.c", etc)
196 * Maximum number of player "class" types (see "table.c", etc)
200 #define MAX_SEIKAKU 12
202 /* The number of "patrons" available (for Chaos Warriors) */
203 #define MAX_PATRON 16
205 /* Number of entries in the sanity-blast descriptions */
206 #define MAX_SAN_HORROR 20
207 #define MAX_SAN_FUNNY 22
208 #define MAX_SAN_COMMENT 5
210 /* Chaos Warrior: Reward types: */
211 #define REW_POLY_SLF 1
212 #define REW_GAIN_EXP 2
213 #define REW_LOSE_EXP 3
214 #define REW_GOOD_OBJ 4
215 #define REW_GREA_OBJ 5
216 #define REW_CHAOS_WP 6
217 #define REW_GOOD_OBS 7
218 #define REW_GREA_OBS 8
219 #define REW_TY_CURSE 9
220 #define REW_SUMMON_M 10
221 #define REW_H_SUMMON 11
222 #define REW_DO_HAVOC 12
223 #define REW_GAIN_ABL 13
224 #define REW_LOSE_ABL 14
225 #define REW_RUIN_ABL 15
226 #define REW_AUGM_ABL 16
227 #define REW_POLY_WND 17
228 #define REW_HEAL_FUL 18
229 #define REW_HURT_LOT 19
230 #define REW_CURSE_WP 20
231 #define REW_CURSE_AR 21
232 #define REW_PISS_OFF 22
234 #define REW_DESTRUCT 24
235 #define REW_GENOCIDE 25
236 #define REW_MASS_GEN 26
237 #define REW_DISPEL_C 27
238 #define REW_UNUSED_1 28
239 #define REW_UNUSED_2 29
240 #define REW_UNUSED_3 30
241 #define REW_UNUSED_4 31
242 #define REW_UNUSED_5 32
243 #define REW_IGNORE 33
244 #define REW_SER_UNDE 34
245 #define REW_SER_DEMO 35
246 #define REW_SER_MONS 36
248 /* Chaos mutations */
250 /* "Activatable" mutations must be in MUT1_* */
251 #define MUT1_SPIT_ACID 0x00000001L
252 #define MUT1_BR_FIRE 0x00000002L
253 #define MUT1_HYPN_GAZE 0x00000004L
254 #define MUT1_TELEKINES 0x00000008L
255 #define MUT1_VTELEPORT 0x00000010L /* Voluntary teleport */
256 #define MUT1_MIND_BLST 0x00000020L
257 #define MUT1_RADIATION 0x00000040L
258 #define MUT1_VAMPIRISM 0x00000080L
259 #define MUT1_SMELL_MET 0x00000100L
260 #define MUT1_SMELL_MON 0x00000200L
261 #define MUT1_BLINK 0x00000400L
262 #define MUT1_EAT_ROCK 0x00000800L
263 #define MUT1_SWAP_POS 0x00001000L
264 #define MUT1_SHRIEK 0x00002000L
265 #define MUT1_ILLUMINE 0x00004000L
266 #define MUT1_DET_CURSE 0x00008000L
267 #define MUT1_BERSERK 0x00010000L
268 #define MUT1_POLYMORPH 0x00020000L
269 #define MUT1_MIDAS_TCH 0x00040000L
270 #define MUT1_GROW_MOLD 0x00080000L
271 #define MUT1_RESIST 0x00100000L
272 #define MUT1_EARTHQUAKE 0x00200000L
273 #define MUT1_EAT_MAGIC 0x00400000L
274 #define MUT1_WEIGH_MAG 0x00800000L
275 #define MUT1_STERILITY 0x01000000L
276 #define MUT1_PANIC_HIT 0x02000000L
277 #define MUT1_DAZZLE 0x04000000L
278 #define MUT1_LASER_EYE 0x08000000L
279 #define MUT1_RECALL 0x10000000L
280 #define MUT1_BANISH 0x20000000L
281 #define MUT1_COLD_TOUCH 0x40000000L
282 #define MUT1_LAUNCHER 0x80000000L
284 /* Randomly activating mutations must be MUT2_* */
285 #define MUT2_BERS_RAGE 0x00000001L
286 #define MUT2_COWARDICE 0x00000002L
287 #define MUT2_RTELEPORT 0x00000004L /* Random teleport, instability */
288 #define MUT2_ALCOHOL 0x00000008L
289 #define MUT2_HALLU 0x00000010L
290 #define MUT2_FLATULENT 0x00000020L
291 #define MUT2_SCOR_TAIL 0x00000040L
292 #define MUT2_HORNS 0x00000080L
293 #define MUT2_BEAK 0x00000100L
294 #define MUT2_ATT_DEMON 0x00000200L
295 #define MUT2_PROD_MANA 0x00000400L
296 #define MUT2_SPEED_FLUX 0x00000800L
297 #define MUT2_BANISH_ALL 0x00001000L
298 #define MUT2_EAT_LIGHT 0x00002000L
299 #define MUT2_TRUNK 0x00004000L
300 #define MUT2_ATT_ANIMAL 0x00008000L
301 #define MUT2_TENTACLES 0x00010000L
302 #define MUT2_RAW_CHAOS 0x00020000L
303 #define MUT2_NORMALITY 0x00040000L
304 #define MUT2_WRAITH 0x00080000L
305 #define MUT2_POLY_WOUND 0x00100000L
306 #define MUT2_WASTING 0x00200000L
307 #define MUT2_ATT_DRAGON 0x00400000L
308 #define MUT2_WEIRD_MIND 0x00800000L
309 #define MUT2_NAUSEA 0x01000000L
310 #define MUT2_CHAOS_GIFT 0x02000000L
311 #define MUT2_WALK_SHAD 0x04000000L
312 #define MUT2_WARNING 0x08000000L
313 #define MUT2_INVULN 0x10000000L
314 #define MUT2_SP_TO_HP 0x20000000L
315 #define MUT2_HP_TO_SP 0x40000000L
316 #define MUT2_DISARM 0x80000000L
320 /* Other mutations will be mainly in MUT3_* */
322 #define MUT3_HYPER_STR 0x00000001L
323 #define MUT3_PUNY 0x00000002L
324 #define MUT3_HYPER_INT 0x00000004L
325 #define MUT3_MORONIC 0x00000008L
326 #define MUT3_RESILIENT 0x00000010L
327 #define MUT3_XTRA_FAT 0x00000020L
328 #define MUT3_ALBINO 0x00000040L
329 #define MUT3_FLESH_ROT 0x00000080L
330 #define MUT3_SILLY_VOI 0x00000100L
331 #define MUT3_BLANK_FAC 0x00000200L
332 #define MUT3_ILL_NORM 0x00000400L
333 #define MUT3_XTRA_EYES 0x00000800L
334 #define MUT3_MAGIC_RES 0x00001000L
335 #define MUT3_XTRA_NOIS 0x00002000L
336 #define MUT3_INFRAVIS 0x00004000L
337 #define MUT3_XTRA_LEGS 0x00008000L
338 #define MUT3_SHORT_LEG 0x00010000L
339 #define MUT3_ELEC_TOUC 0x00020000L
340 #define MUT3_FIRE_BODY 0x00040000L
341 #define MUT3_WART_SKIN 0x00080000L
342 #define MUT3_SCALES 0x00100000L
343 #define MUT3_IRON_SKIN 0x00200000L
344 #define MUT3_WINGS 0x00400000L
345 #define MUT3_FEARLESS 0x00800000L
346 #define MUT3_REGEN 0x01000000L
347 #define MUT3_ESP 0x02000000L
348 #define MUT3_LIMBER 0x04000000L
349 #define MUT3_ARTHRITIS 0x08000000L
350 #define MUT3_BAD_LUCK 0x10000000L
351 #define MUT3_VULN_ELEM 0x20000000L
352 #define MUT3_MOTION 0x40000000L
353 #define MUT3_GOOD_LUCK 0x80000000L
356 /* Monk martial arts... */
362 #define MAX_MIND_POWERS 21
364 /* Hallucination stuff */
366 #define MAX_SILLY_ATTACK 41
368 #define MAX_SILLY_ATTACK 29
371 #define MIND_MINDCRAFTER 0
373 #define MIND_BERSERKER 2
374 #define MIND_MIRROR_MASTER 3
375 #define MIND_NINJUTSU 4
379 * Size of memory reserved for initialization of some arrays
381 #define FAKE_NAME_SIZE 40 * 1024L
382 #define FAKE_TEXT_SIZE 150 * 1024L
386 * Maximum number of high scores in the high score file
388 #define MAX_HISCORES 999
392 * Maximum dungeon level. The player can never reach this level
393 * in the dungeon, and this value is used for various calculations
394 * involving object and monster creation. It must be at least 100.
395 * Setting it below 128 may prevent the creation of some objects.
397 #define MAX_DEPTH 128
401 * Maximum number of saved floors.
403 #define MAX_SAVED_FLOORS 20
407 * Maximum size of the "lite" array (see "cave.c")
408 * Note that the "lite radius" will NEVER exceed 14, and we would
409 * never require more than 581 entries in the array for circular "lite".
414 * Maximum size of the "mon_lite" array (see "cave.c")
415 * Note that the "view radius" will NEVER exceed 20, monster illumination
416 * flags are dependent on CAVE_VIEW, and even if the "view" was octagonal,
417 * we would never require more than 1520 entries in the array.
419 #define MON_LITE_MAX 1536
422 * Maximum size of the "view" array (see "cave.c")
423 * Note that the "view radius" will NEVER exceed 20, and even if the "view"
424 * was octagonal, we would never require more than 1520 entries in the array.
426 #define VIEW_MAX 1536
429 * Maximum size of the "temp" array (see "cave.c")
430 * We must be as large as "VIEW_MAX" and "LITE_MAX" for proper functioning
431 * of "update_view()" and "update_lite()". We must also be as large as the
432 * largest illuminatable room, but no room is larger than 800 grids. We
433 * must also be large enough to allow "good enough" use as a circular queue,
434 * to calculate monster flow, but note that the flow code is "paranoid".
436 #define TEMP_MAX 2298
439 * Maximum size of the "redraw" array (see "cave.c")
440 * We must be large for proper functioning of delayed redrawing.
441 * We must also be as large as two times of the largest view area.
442 * Note that maximum view grids are 1149 entries.
444 #define REDRAW_MAX 2298
448 * Number of keymap modes
450 #define KEYMAP_MODES 2
453 * Mode for original keyset commands
455 #define KEYMAP_MODE_ORIG 0
458 * Mode for roguelike keyset commands
460 #define KEYMAP_MODE_ROGUE 1
464 * OPTION: Maximum number of macros (see "io.c")
465 * Default: assume at most 256 macros are used
467 #define MACRO_MAX 256
470 * OPTION: Maximum number of "quarks" (see "io.c")
471 * Default: assume at most 512 different inscriptions are used
473 #define QUARK_MAX 768
474 /* Was 512... 256 quarks added for random artifacts */
477 * OPTION: Maximum number of messages to remember (see "io.c")
478 * Default: assume maximal memorization of 2048 total messages
480 #define MESSAGE_MAX 2048
483 * OPTION: Maximum space for the message text buffer (see "io.c")
484 * Default: assume that each of the 2048 messages is repeated an
485 * average of three times, and has an average length of 48
487 #define MESSAGE_BUF 32768
491 * Maximum value storable in a "byte" (hard-coded)
493 #define MAX_UCHAR 255
496 * Maximum value storable in a "s16b" (hard-coded)
498 #define MAX_SHORT 32767
501 * Maximum length of object's name
506 * Special internal key
508 #define SPECIAL_KEY_QUEST 255
509 #define SPECIAL_KEY_BUILDING 254
510 #define SPECIAL_KEY_STORE 253
511 #define SPECIAL_KEY_QUIT 252
516 #define STORE_INVEN_MAX 24 /* Max number of discrete objs in inven */
517 #define STORE_CHOICES 48 /* Number of items to choose stock from */
518 #define STORE_OBJ_LEVEL 5 /* Magic Level for normal stores */
519 #define STORE_TURNOVER 9 /* Normal shop turnover, per day */
520 #define STORE_MIN_KEEP 6 /* Min slots to "always" keep full */
521 #define STORE_MAX_KEEP 18 /* Max slots to "always" keep full */
522 #define STORE_SHUFFLE 21 /* 1/Chance (per day) of an owner changing */
523 #define STORE_TICKS 1000 /* Number of ticks between turnovers */
529 #define ENERGY_NEED() (randnor(100, 31))
533 * Extract energy from speed (Assumes that SPEED is unsigned)
535 #define SPEED_TO_ENERGY(SPEED) \
536 (((SPEED) > 199) ? 49 : extract_energy[(SPEED)])
542 #define TOWN_DAWN 10000 /* Number of ticks from dawn to dawn XXX */
543 #define TURNS_PER_TICK 10L /* Number of energy-gain-turns per ticks */
544 #define BREAK_GLYPH 550 /* Rune of protection resistance */
545 #define BREAK_MINOR_GLYPH 299 /* For explosive runes */
546 #define BTH_PLUS_ADJ 3 /* Adjust BTH per plus-to-hit */
547 #define MON_MULT_ADJ 8 /* High value slows multiplication */
548 #define MON_SUMMON_ADJ 2 /* Adjust level of summoned creatures */
549 #define MON_DRAIN_LIFE 2 /* Percent of player exp drained per hit */
550 #define USE_DEVICE 3 /* x> Harder devices x< Easier devices */
553 /* "Biases" for random artifact gen */
566 #define BIAS_CHAOS 12
567 #define BIAS_PRIESTLY 13
568 #define BIAS_NECROMANTIC 14
570 #define BIAS_ROGUE 16
572 #define BIAS_WARRIOR 18
573 #define BIAS_RANGER 19
576 /*** Pet constants ***/
582 #define PET_DISMISS 1
584 #define PET_STAY_CLOSE 3
585 #define PET_FOLLOW_ME 4
586 #define PET_SEEK_AND_DESTROY 5
587 #define PET_ALLOW_SPACE 6
588 #define PET_STAY_AWAY 7
589 #define PET_OPEN_DOORS 8
590 #define PET_TAKE_ITEMS 9
591 #define PET_TELEPORT 10
592 #define PET_ATTACK_SPELL 11
593 #define PET_SUMMON_SPELL 12
594 #define PET_BALL_SPELL 13
595 #define PET_RIDING 14
597 #define PET_RYOUTE 16
602 #define PET_CLOSE_DIST 1
603 #define PET_FOLLOW_DIST 6
604 #define PET_SEEK_DIST 10
605 #define PET_DESTROY_DIST 255
606 #define PET_SPACE_DIST (-10)
607 #define PET_AWAY_DIST (-25)
609 #define PF_OPEN_DOORS 0x0001
610 #define PF_PICKUP_ITEMS 0x0002
611 #define PF_TELEPORT 0x0004
612 #define PF_ATTACK_SPELL 0x0008
613 #define PF_SUMMON_SPELL 0x0010
614 #define PF_BALL_SPELL 0x0020
615 #define PF_RYOUTE 0x0040
618 /* Maximum number of preservable pets */
619 #define MAX_PARTY_MON 21
623 * There is a 1/20 (5%) chance of inflating the requested object_level
624 * during the creation of an object (see "get_obj_num()" in "object.c").
625 * Lower values yield better objects more often.
630 * There is a 1/50 (2%) chance of inflating the requested monster_level
631 * during the creation of a monsters (see "get_mon_num()" in "monster.c").
632 * Lower values yield harder monsters more often.
634 #define NASTY_MON 50 /* 1/chance of inflated monster level */
636 /* 1/x chance of hurting even if invulnerable! */
637 #define PENETRATE_INVULNERABILITY 13
642 * Refueling constants
644 #define FUEL_TORCH 5000 /* Maximum amount of fuel in a torch */
645 #define FUEL_LAMP 15000 /* Maximum amount of fuel in a lantern */
649 * More maximum values
651 #define MAX_SIGHT 20 /* Maximum view distance */
652 #define MAX_RANGE (p_ptr->inside_battle ? 36 : 18) /* Maximum range (spells, etc) */
653 #define AAF_LIMIT 100 /* Limit of sensing radius */
658 * The town starts out with 4 residents during the day
660 #define MIN_M_ALLOC_TD 4
663 * The town starts out with 8 residents during the night
665 #define MIN_M_ALLOC_TN 8
669 * A monster can only "multiply" (reproduce) if there are fewer than 100
670 * monsters on the level capable of such spontaneous reproduction. This
671 * is a hack which prevents the "m_list[]" array from exploding due to
672 * reproducing monsters. Messy, but necessary.
674 #define MAX_REPRO 100
680 #define PY_MAX_EXP 99999999L /* Maximum exp */
681 #define PY_MAX_GOLD 999999999L /* Maximum gold */
682 #define PY_MAX_LEVEL 50 /* Maximum level */
685 * Player "food" crucial values
687 #define PY_FOOD_MAX 15000 /* Food value (Bloated) */
688 #define PY_FOOD_FULL 10000 /* Food value (Normal) */
689 #define PY_FOOD_ALERT 2000 /* Food value (Hungry) */
690 #define PY_FOOD_WEAK 1000 /* Food value (Weak) */
691 #define PY_FOOD_FAINT 500 /* Food value (Fainting) */
692 #define PY_FOOD_STARVE 100 /* Food value (Starving) */
695 * Player regeneration constants
697 #define PY_REGEN_NORMAL 197 /* Regen factor*2^16 when full */
698 #define PY_REGEN_WEAK 98 /* Regen factor*2^16 when weak */
699 #define PY_REGEN_FAINT 33 /* Regen factor*2^16 when fainting */
700 #define PY_REGEN_HPBASE 1442 /* Min amount hp regen*2^16 */
701 #define PY_REGEN_MNBASE 524 /* Min amount mana regen*2^16 */
704 * Possible realms that can be chosen;
705 * currently used only by birth.c and tables.c
709 #define CH_SORCERY 0x02
710 #define CH_NATURE 0x04
711 #define CH_CHAOS 0x08
712 #define CH_DEATH 0x10
713 #define CH_TRUMP 0x20
714 #define CH_ARCANE 0x40
715 #define CH_ENCHANT 0x80
716 #define CH_DAEMON 0x100
717 #define CH_CRUSADE 0x200
719 #define CH_MUSIC 0x10000
720 #define CH_HISSATSU 0x20000
728 #define REALM_SORCERY 2
729 #define REALM_NATURE 3
730 #define REALM_CHAOS 4
731 #define REALM_DEATH 5
732 #define REALM_TRUMP 6
733 #define REALM_ARCANE 7
734 #define REALM_ENCHANT 8
735 #define REALM_DAEMON 9
736 #define REALM_CRUSADE 10
738 #define MIN_TECHNIC 16
739 #define REALM_MUSIC 16
740 #define REALM_HISSATSU 17
743 #define VALID_REALM (MAX_REALM + MAX_MAGIC - MIN_TECHNIC + 1)
744 #define NUM_TECHNIC (MAX_REALM - MIN_TECHNIC + 1)
746 #define is_magic(A) ((((A) > REALM_NONE) && ((A) < MAX_MAGIC + 1)) ? TRUE : FALSE)
747 #define tval2realm(A) ((A) - TV_LIFE_BOOK + 1)
748 #define technic2magic(A) (is_magic(A) ? (A) : (A) - MIN_TECHNIC + 1 + MAX_MAGIC)
749 #define is_good_realm(REALM) ((REALM) == REALM_LIFE || (REALM) == REALM_CRUSADE)
752 * Magic-books for the realms
754 #define REALM1_BOOK (p_ptr->realm1 + TV_LIFE_BOOK - 1)
755 #define REALM2_BOOK (p_ptr->realm2 + TV_LIFE_BOOK - 1)
759 * Maximum number of "normal" pack slots, and the index of the "overflow"
760 * slot, which can hold an item, but only temporarily, since it causes the
761 * pack to "overflow", dropping the "last" item onto the ground. Since this
762 * value is used as an actual slot, it must be less than "INVEN_RARM" (below).
763 * Note that "INVEN_PACK" is probably hard-coded by its use in savefiles, and
764 * by the fact that the screen can only show 23 items plus a one-line prompt.
766 #define INVEN_PACK 23
769 * Indexes used for various "equipment" slots (hard-coded by savefiles, etc).
771 #define INVEN_RARM 24
772 #define INVEN_LARM 25
774 #define INVEN_RIGHT 27
775 #define INVEN_LEFT 28
776 #define INVEN_NECK 29
777 #define INVEN_LITE 30
778 #define INVEN_BODY 31
779 #define INVEN_OUTER 32
780 #define INVEN_HEAD 33
781 #define INVEN_HANDS 34
782 #define INVEN_FEET 35
785 * used for get_random_ego()
787 #define INVEN_AMMO 23
790 * Total number of inventory slots (hard-coded).
792 #define INVEN_TOTAL 36
795 * Fake inventory slot for selecting force (hard-coded).
797 #define INVEN_FORCE 1111
801 * Indexes of the various "stats" (hard-coded by savefiles, etc).
811 * Player sex constants (hard-coded by save-files, arrays, etc)
818 * Player race constants (hard-coded by save-files, arrays, etc)
821 #define RACE_HALF_ELF 1
823 #define RACE_HOBBIT 3
826 #define RACE_HALF_ORC 6
827 #define RACE_HALF_TROLL 7
828 #define RACE_AMBERITE 8
829 #define RACE_HIGH_ELF 9
830 #define RACE_BARBARIAN 10
831 #define RACE_HALF_OGRE 11
832 #define RACE_HALF_GIANT 12
833 #define RACE_HALF_TITAN 13
834 #define RACE_CYCLOPS 14
836 #define RACE_KLACKON 16
837 #define RACE_KOBOLD 17
838 #define RACE_NIBELUNG 18
839 #define RACE_DARK_ELF 19
840 #define RACE_DRACONIAN 20
841 #define RACE_MIND_FLAYER 21
843 #define RACE_GOLEM 23
844 #define RACE_SKELETON 24
845 #define RACE_ZOMBIE 25
846 #define RACE_VAMPIRE 26
847 #define RACE_SPECTRE 27
848 #define RACE_SPRITE 28
849 #define RACE_BEASTMAN 29
851 #define RACE_ANGEL 31
852 #define RACE_DEMON 32
853 #define RACE_DUNADAN 33
854 #define RACE_S_FAIRY 34
856 #define RACE_ANDROID 36
859 * Maximum number of player "race" types (see "table.c", etc)
865 * Player class constants (hard-coded by save-files, arrays, etc)
867 #define CLASS_WARRIOR 0
869 #define CLASS_PRIEST 2
870 #define CLASS_ROGUE 3
871 #define CLASS_RANGER 4
872 #define CLASS_PALADIN 5
873 #define CLASS_WARRIOR_MAGE 6
874 #define CLASS_CHAOS_WARRIOR 7
876 #define CLASS_MINDCRAFTER 9
877 #define CLASS_HIGH_MAGE 10
878 #define CLASS_TOURIST 11
879 #define CLASS_IMITATOR 12
880 #define CLASS_BEASTMASTER 13
881 #define CLASS_SORCERER 14
882 #define CLASS_ARCHER 15
883 #define CLASS_MAGIC_EATER 16
884 #define CLASS_BARD 17
885 #define CLASS_RED_MAGE 18
886 #define CLASS_SAMURAI 19
887 #define CLASS_FORCETRAINER 20
888 #define CLASS_BLUE_MAGE 21
889 #define CLASS_CAVALRY 22
890 #define CLASS_BERSERKER 23
891 #define CLASS_SMITH 24
892 #define CLASS_MIRROR_MASTER 25
893 #define CLASS_NINJA 26
895 #define SEIKAKU_FUTUU 0
896 #define SEIKAKU_CHIKARA 1
897 #define SEIKAKU_KIREMONO 2
898 #define SEIKAKU_SHIAWASE 3
899 #define SEIKAKU_SUBASI 4
900 #define SEIKAKU_INOCHI 5
901 #define SEIKAKU_COMBAT 6
902 #define SEIKAKU_NAMAKE 7
903 #define SEIKAKU_SEXY 8
904 #define SEIKAKU_LUCKY 9
905 #define SEIKAKU_GAMAN 10
906 #define SEIKAKU_MUNCHKIN 11
908 /*** Screen Locations ***/
911 * Some screen locations for various display routines
912 * Currently, row 8 and 15 are the only "blank" rows.
913 * That leaves a "border" around the "stat" values.
917 #define COL_RACE 0 /* <race name> */
919 /*#define ROW_CLASS 2 */
920 /*#define COL_CLASS 0 */ /* <class name> */
923 #define COL_TITLE 0 /* <title> or <mode> */
925 /*#define ROW_SEIKAKU 4 */
926 /*#define COL_SEIKAKU 0*/ /* <seikaku> */
929 #define COL_DAY 0 /* day */
931 #define ROW_DUNGEON 22
932 #define COL_DUNGEON 0 /* dungeon */
935 #define COL_LEVEL 0 /* "LEVEL xxxxxx" */
938 #define COL_EXP 0 /* "EXP xxxxxxxx" */
941 #define COL_GOLD 0 /* "AU xxxxxxxxx" */
943 #define ROW_EQUIPPY 6
944 #define COL_EQUIPPY 0 /* equippy chars */
947 #define COL_STAT 0 /* "xxx xxxxxx" */
950 #define COL_AC 0 /* "Cur AC xxxxx" */
956 #define COL_CURHP 0 /* "Cur HP xxxxx" */
959 #define COL_CURSP 0 /* "Cur SP xxxxx" */
961 #define ROW_RIDING_INFO 16
962 #define COL_RIDING_INFO 0 /* "xxxxxxxxxxxx" */
965 #define COL_INFO 0 /* "xxxxxxxxxxxx" */
971 #define COL_CUT 0 /* <cut> */
974 #define COL_STUN 0 /* <stun> */
976 #define ROW_HUNGRY 20
977 #define COL_HUNGRY 0 /* "Weak" / "Hungry" / "Full" / "Gorged" */
980 #define COL_STATE 7 /* <state> */
982 #define ROW_SPEED (-1)
983 #define COL_SPEED (-24) /* "Slow (-NN)" or "Fast (+NN)" */
985 #define ROW_STUDY (-1)
986 #define COL_STUDY (-13) /* "Study" */
988 #define ROW_DEPTH (-1)
989 #define COL_DEPTH (-8) /* "Lev NNN" / "NNNN ft" */
991 #define ROW_STATBAR (-1)
992 #define COL_STATBAR 0
993 #define MAX_COL_STATBAR (-26)
996 /*** Terrain Feature Indexes (see "lib/edit/f_info.txt") ***/
999 #define FEAT_NONE 0x00
1002 #define FEAT_FLOOR 0x01
1003 #define FEAT_INVIS 0x02
1004 #define FEAT_GLYPH 0x03
1005 #define FEAT_OPEN 0x04
1006 #define FEAT_BROKEN 0x05
1007 #define FEAT_LESS 0x06
1008 #define FEAT_MORE 0x07
1010 /* Quest features -KMW- */
1011 #define FEAT_QUEST_ENTER 0x08
1012 #define FEAT_QUEST_EXIT 0x09
1013 #define FEAT_QUEST_DOWN 0x0A
1014 #define FEAT_QUEST_UP 0x0B
1016 #define FEAT_LESS_LESS 0x0D
1017 #define FEAT_MORE_MORE 0x0E
1019 /* Feature 0x0E - 0x0F unused */
1022 #define FEAT_TRAP_TRAPDOOR 0x10
1023 #define FEAT_TRAP_PIT 0x11
1024 #define FEAT_TRAP_SPIKED_PIT 0x12
1025 #define FEAT_TRAP_POISON_PIT 0x13
1026 #define FEAT_TRAP_TY_CURSE 0x14
1027 #define FEAT_TRAP_TELEPORT 0x15
1028 #define FEAT_TRAP_FIRE 0x16
1029 #define FEAT_TRAP_ACID 0x17
1030 #define FEAT_TRAP_SLOW 0x18
1031 #define FEAT_TRAP_LOSE_STR 0x19
1032 #define FEAT_TRAP_LOSE_DEX 0x1A
1033 #define FEAT_TRAP_LOSE_CON 0x1B
1034 #define FEAT_TRAP_BLIND 0x1C
1035 #define FEAT_TRAP_CONFUSE 0x1D
1036 #define FEAT_TRAP_POISON 0x1E
1037 #define FEAT_TRAP_SLEEP 0x1F
1040 #define FEAT_DOOR_HEAD 0x20
1041 #define FEAT_DOOR_TAIL 0x2F
1044 #define FEAT_SECRET 0x30
1045 #define FEAT_RUBBLE 0x31
1048 #define FEAT_MAGMA 0x32
1049 #define FEAT_QUARTZ 0x33
1050 #define FEAT_MAGMA_H 0x34
1051 #define FEAT_QUARTZ_H 0x35
1052 #define FEAT_MAGMA_K 0x36
1053 #define FEAT_QUARTZ_K 0x37
1056 #define FEAT_WALL_EXTRA 0x38
1057 #define FEAT_WALL_INNER 0x39
1058 #define FEAT_WALL_OUTER 0x3A
1059 #define FEAT_WALL_SOLID 0x3B
1060 #define FEAT_PERM_EXTRA 0x3C
1061 #define FEAT_PERM_INNER 0x3D
1062 #define FEAT_PERM_OUTER 0x3E
1063 #define FEAT_PERM_SOLID 0x3F
1066 #define FEAT_MINOR_GLYPH 0x40
1069 #define FEAT_PATTERN_START 0x41
1070 #define FEAT_PATTERN_1 0x42
1071 #define FEAT_PATTERN_2 0x43
1072 #define FEAT_PATTERN_3 0x44
1073 #define FEAT_PATTERN_4 0x45
1074 #define FEAT_PATTERN_END 0x46
1075 #define FEAT_PATTERN_OLD 0x47
1076 #define FEAT_PATTERN_XTRA1 0x48
1077 #define FEAT_PATTERN_XTRA2 0x49
1080 #define FEAT_SHOP_HEAD 0x4A
1081 #define FEAT_SHOP_TAIL 0x52
1084 #define FEAT_DEEP_WATER 0x53
1085 #define FEAT_SHAL_WATER 0x54
1086 #define FEAT_DEEP_LAVA 0x55
1087 #define FEAT_SHAL_LAVA 0x56
1088 #define FEAT_DARK_PIT 0x57
1089 #define FEAT_DIRT 0x58
1090 #define FEAT_GRASS 0x59
1092 #define FEAT_TRAP_TRAPS 0x5A
1093 #define FEAT_TRAP_ALARM 0x5B
1094 #define FEAT_TRAP_OPEN 0x5C
1096 #define FEAT_FLOWER 0x5D
1097 #define FEAT_DEEP_GRASS 0x5E
1098 #define FEAT_MUSEUM 0x5F
1100 /* Feature 0x5A - 0x5F unused */
1103 #define FEAT_TREES 0x60
1104 #define FEAT_MOUNTAIN 0x61
1106 /* Feature 0x62 - 0x7F unused */
1109 #define FEAT_BLDG_HEAD 0x80
1110 #define FEAT_BLDG_TAIL 0x9F
1112 #define FEAT_TOWN 0xc0
1113 #define FEAT_ENTRANCE 0xc1
1114 #define FEAT_SWAMP 0xc2
1116 /* for mirror master */
1117 #define FEAT_MIRROR 0xc3
1119 /* unknown grid (not detected) */
1120 #define FEAT_UNDETECTED 0xc4
1123 #define FEAT_TRAP_ARMAGEDDON 0xc5
1124 #define FEAT_TRAP_PIRANHA 0xc6
1127 * Wilderness terrains
1129 #define TERRAIN_EDGE 0 /* Edge of the World */
1130 #define TERRAIN_TOWN 1 /* Town */
1131 #define TERRAIN_DEEP_WATER 2 /* Deep water */
1132 #define TERRAIN_SHALLOW_WATER 3 /* Shallow water */
1133 #define TERRAIN_SWAMP 4 /* Swamp */
1134 #define TERRAIN_DIRT 5 /* Dirt */
1135 #define TERRAIN_GRASS 6 /* Grass */
1136 #define TERRAIN_TREES 7 /* Trees */
1137 #define TERRAIN_DESERT 8 /* Desert */
1138 #define TERRAIN_SHALLOW_LAVA 9 /* Shallow lava */
1139 #define TERRAIN_DEEP_LAVA 10 /* Deep lava */
1140 #define TERRAIN_MOUNTAIN 11 /* Mountain */
1142 #define MAX_WILDERNESS 12 /* Maximum wilderness index */
1146 /*** Artifact indexes (see "lib/edit/a_info.txt") ***/
1149 #define ART_GALADRIEL 1
1150 #define ART_ELENDIL 2
1152 #define ART_EDISON 7
1153 #define ART_PALANTIR 15
1154 #define ART_STONE_LORE 17
1155 #define ART_FLY_STONE 147
1158 #define ART_CARLAMMAS 4
1160 #define ART_DWARVES 6
1161 #define ART_FARAMIR 18
1162 #define ART_BOROMIR 143
1163 #define ART_MAGATAMA 149
1164 #define ART_INROU 166
1165 #define ART_NIGHT 215
1166 #define ART_SACRED_KNIGHTS 217
1167 #define ART_HELL 218
1168 #define ART_CHARMED 219
1169 #define ART_GOGO 220
1172 #define ART_FRAKIR 8
1173 #define ART_TULKAS 9
1174 #define ART_NARYA 10
1175 #define ART_NENYA 11
1176 #define ART_VILYA 12
1177 #define ART_POWER 13
1181 #define ART_RAZORBACK 129
1182 #define ART_BLADETURNER 130
1183 #define ART_SEIRYU 201
1186 #define ART_SOULKEEPER 19
1187 #define ART_ISILDUR 20
1188 #define ART_ROHIRRIM 21
1189 #define ART_LOHENGRIN 22
1190 #define ART_JULIAN 23
1191 #define ART_ARVEDUI 24
1192 #define ART_CASPANION 25
1193 #define ART_GILES 168
1194 #define ART_MORLOK 203
1195 #define ART_VETERAN 206
1198 #define ART_SHIVA_JACKET 26
1199 #define ART_HITHLOMIR 27
1200 #define ART_THALKETTOTH 28
1201 #define ART_HIMRING 127
1202 #define ART_ICANUS 131
1203 #define ART_NAMAKE_ARMOR 183
1205 #define ART_DASAI 200
1206 #define ART_KESHO 204
1209 #define ART_THORIN 30
1210 #define ART_CELEGORM 31
1211 #define ART_ANARION 32
1212 #define ART_GIL_GALAD 138
1213 #define ART_YENDOR 141
1214 #define ART_YATA 151
1215 #define ART_EARENDIL 186
1216 #define ART_PERSEUS 197
1218 /* Helms and Crowns */
1219 #define ART_INDRA 33
1220 #define ART_CHAOS 34
1221 #define ART_BERUTHIEL 35
1222 #define ART_THRANDUIL 36
1223 #define ART_THENGEL 37
1224 #define ART_HAMMERHAND 38
1226 #define ART_HOLHENNETH 40
1227 #define ART_TERROR 41
1228 #define ART_AMBER 42
1229 #define ART_NUMENOR 132
1230 #define ART_STONEMASK 146
1234 #define ART_COLLUIN 44
1235 #define ART_HOLCOLLETH 45
1236 #define ART_THINGOL 46
1237 #define ART_THORONGIL 47
1238 #define ART_COLANNON 48
1239 #define ART_LUTHIEN 49
1241 #define ART_MOOK 205
1244 #define ART_CAMBELEG 52
1245 #define ART_CAMMITHRIM 53
1246 #define ART_PAURHACH 54
1247 #define ART_CORWIN 55
1248 #define ART_PAURAEGEN 56
1249 #define ART_PAURNEN 57
1250 #define ART_THANOS 58
1251 #define ART_FINGOLFIN 59
1252 #define ART_PAURNIMMEN 185
1255 #define ART_FEANOR 60
1256 #define ART_FLORA 61
1257 #define ART_THROR 62
1258 #define ART_SHIVA_BOOTS 63
1259 #define ART_GLASS 165
1260 #define ART_GETA 210
1263 #define ART_NAIN 211
1266 #define ART_MAEDHROS 64
1267 #define ART_CAINE 65
1268 #define ART_NARTHANC 66
1269 #define ART_NIMTHANC 67
1270 #define ART_DETHANC 68
1271 #define ART_RILIA 69
1272 #define ART_FIONA 70
1273 #define ART_CALRIS 71
1274 #define ART_GRAYSWANDIR 72
1275 #define ART_GLAMDRING 73
1276 #define ART_NOTHUNG 74
1277 #define ART_ORCRIST 75
1278 #define ART_GURTHANG 76
1279 #define ART_ZARCUTHRA 77
1280 #define ART_TWILIGHT 78
1281 #define ART_GONDRICAM 79
1282 #define ART_CRISDURIAN 80
1283 #define ART_AGLARANG 81
1284 #define ART_RINGIL 82
1285 #define ART_ANDURIL 83
1286 #define ART_WEREWINDLE 84
1287 #define ART_CHAINSWORD 85
1288 #define ART_FORASGIL 86
1289 #define ART_CARETH 87
1290 #define ART_STING 88
1291 #define ART_SOULSWORD 89
1292 #define ART_MERLIN 90
1293 #define ART_DOOMCALLER 91
1294 #define ART_VORPAL_BLADE 92
1295 #define ART_SLAYER 123
1296 #define ART_KUSANAGI 128
1297 #define ART_HURIN 133
1298 #define ART_AZAGHAL 135
1299 #define ART_NOVA 137
1300 #define ART_CHARIOT 140
1301 #define ART_WORPAL_BLADE 142
1302 #define ART_MURAMASA 144
1303 #define ART_ZANTETSU 150
1304 #define ART_SOULCRUSH 154
1305 #define ART_FALIS 155
1306 #define ART_HRUNTING 156
1307 #define ART_ANUBIS 158
1308 #define ART_GURENKI 160
1309 #define ART_TAILBITER 167
1310 #define ART_MUSASI_KATANA 171
1311 #define ART_MUSASI_WAKIZASI 172
1312 #define ART_QUICKTHORN 174
1313 #define ART_TINYTHORN 175
1314 #define ART_EXCALIBUR 176
1315 #define ART_EXCALIPUR 177
1316 #define ART_EXCALIBUR_J 179
1317 #define ART_ARUNRUTH 184
1318 #define ART_HAKABUSA 189
1319 #define ART_STORMBRINGER 190
1320 #define ART_NARSIL 191
1321 #define ART_KANNU 193
1322 #define ART_GRIMTOOTH 196
1323 #define ART_KAMUI 198
1324 #define ART_GOURYU 207
1325 #define ART_EOWYN 216
1328 #define ART_THEODEN 93
1330 #define ART_OSONDIR 95
1332 #define ART_RUNESPEAR 97
1333 #define ART_DESTINY 98
1334 #define ART_HAGEN 99
1335 #define ART_EORLINGAS 100
1336 #define ART_DURIN 101
1337 #define ART_EONWE 102
1338 #define ART_BALLI 103
1339 #define ART_LOTHARANG 104
1340 #define ART_DWARVES_AXE 105
1341 #define ART_BARUKKHELED 106
1342 #define ART_WRATH 107
1343 #define ART_ULMO 108
1344 #define ART_AVAVIR 109
1345 #define ART_BENKEI 152
1346 #define ART_TAIKOBO 159
1347 #define ART_TONBO 161
1348 #define ART_GAEBOLG 163
1349 #define ART_ARRYU 164
1350 #define ART_AEGLOS 187
1351 #define ART_BLOOD 199
1352 #define ART_NUMAHOKO 202
1354 /* The sword of the Dawn */
1355 #define ART_DAWN 110
1358 #define ART_GROND 111
1359 #define ART_TOTILA 112
1360 #define ART_THUNDERFIST 113
1361 #define ART_BLOODSPIKE 114
1362 #define ART_FIRESTAR 115
1363 #define ART_TARATOL 116
1364 #define ART_AULE 117
1366 #define ART_ERIRIL 119
1367 #define ART_GANDALF 120
1368 #define ART_DEATHWREAKER 121
1369 #define ART_TURMIL 122
1370 #define ART_MJOLLNIR 136
1371 #define ART_WINBLOWS 139
1372 #define ART_XIAOLONG 145
1373 #define ART_NYOIBOU 157
1374 #define ART_JONES 162
1375 #define ART_HYOUSIGI 169
1376 #define ART_MATOI 170
1377 #define ART_IRON_BALL 173
1378 #define ART_SAMSON 178
1379 #define ART_NAMAKE_HAMMER 181
1380 #define ART_BOLISHOI 188
1381 #define ART_SHUTEN_DOJI 194
1382 #define ART_G_HAMMER 195
1383 #define ART_AEGISFANG 208
1384 #define ART_HERMIT 209
1385 #define ART_GOTHMOG 212
1386 #define ART_JIZO 213
1387 #define ART_FUNDIN 214
1390 #define ART_BELTHRONDING 124
1391 #define ART_BARD 125
1392 #define ART_BRAND 126
1393 #define ART_CRIMSON 16
1394 #define ART_BUCKLAND 134
1395 #define ART_YOICHI 148
1396 #define ART_HARAD 180
1397 #define ART_NAMAKE_BOW 182
1400 #define ART_BARD_ARROW 153
1402 /*** Ego-Item indexes (see "lib/edit/e_info.txt") ***/
1411 #define EGO_RESIST_ACID 4
1412 #define EGO_RESIST_ELEC 5
1413 #define EGO_RESIST_FIRE 6
1414 #define EGO_RESIST_COLD 7
1415 #define EGO_RESISTANCE 8
1416 #define EGO_ELVENKIND 9
1417 #define EGO_DWARVEN 10
1418 #define EGO_PERMANENCE 11
1419 #define EGO_YOIYAMI 12
1425 #define EGO_ENDURE_ACID 16
1426 #define EGO_ENDURE_ELEC 17
1427 #define EGO_ENDURE_FIRE 18
1428 #define EGO_ENDURE_COLD 19
1429 #define EGO_ENDURANCE 20
1430 #define EGO_REFLECTION 21
1431 #define EGO_NIGHT_DAY 22
1433 /* Crowns and Helms */
1435 #define EGO_INTELLIGENCE 24
1436 #define EGO_WISDOM 25
1437 #define EGO_BEAUTY 26
1439 #define EGO_MIGHT 28
1440 #define EGO_LORDLINESS 29
1441 #define EGO_SEEING 30
1442 #define EGO_INFRAVISION 31
1444 #define EGO_TELEPATHY 33
1445 #define EGO_REGENERATION 34
1446 #define EGO_TELEPORTATION 35
1447 #define EGO_STUPIDITY 36
1448 #define EGO_NAIVETY 37
1449 #define EGO_UGLINESS 38
1450 #define EGO_SICKLINESS 39
1453 #define EGO_PROTECTION 40
1454 #define EGO_STEALTH 41
1456 #define EGO_AURA_FIRE 43
1457 #define EGO_ENVELOPING 44
1458 #define EGO_VULNERABILITY 45
1459 #define EGO_IRRITATION 46
1460 #define EGO_AURA_ELEC 47
1461 #define EGO_AURA_COLD 128
1465 #define EGO_FREE_ACTION 48
1466 #define EGO_SLAYING 49
1467 #define EGO_AGILITY 50
1468 #define EGO_POWER 51
1469 #define EGO_2WEAPON 52
1470 #define EGO_MAGIC_MASTERY 53
1471 #define EGO_WEAKNESS 54
1472 #define EGO_CLUMSINESS 55
1475 #define EGO_SLOW_DESCENT 56
1476 #define EGO_QUIET 57
1477 #define EGO_MOTION 58
1478 #define EGO_SPEED 59
1480 #define EGO_NOISE 61
1481 #define EGO_SLOWNESS 62
1482 #define EGO_ANNOYANCE 63
1487 #define EGO_BLESS_BLADE 66
1490 #define EGO_ATTACKS 69
1491 #define EGO_SLAYING_WEAPON 70
1492 #define EGO_FORCE_WEAPON 71
1493 #define EGO_BRAND_ACID 72
1494 #define EGO_BRAND_ELEC 73
1495 #define EGO_BRAND_FIRE 74
1496 #define EGO_BRAND_COLD 75
1497 #define EGO_BRAND_POIS 76
1498 #define EGO_CHAOTIC 77
1499 #define EGO_SHARPNESS 78
1500 #define EGO_EARTHQUAKES 79
1501 #define EGO_SLAY_ANIMAL 80
1502 #define EGO_SLAY_EVIL 81
1503 #define EGO_SLAY_UNDEAD 82
1504 #define EGO_SLAY_DEMON 83
1505 #define EGO_SLAY_ORC 84
1506 #define EGO_SLAY_TROLL 85
1507 #define EGO_SLAY_GIANT 86
1508 #define EGO_SLAY_DRAGON 87
1509 #define EGO_KILL_ANIMAL 88
1510 #define EGO_KILL_EVIL 89
1511 #define EGO_KILL_UNDEAD 90
1512 #define EGO_KILL_DEMON 91
1513 #define EGO_KILL_ORC 92
1514 #define EGO_KILL_TROLL 93
1515 #define EGO_KILL_GIANT 94
1516 #define EGO_KILL_DRAGON 95
1517 #define EGO_VAMPIRIC 96
1518 #define EGO_PRISM 97
1519 #define EGO_TRUMP 98
1520 #define EGO_PATTERN 99
1521 #define EGO_DIGGING 100
1522 #define EGO_SLAY_HUMAN 101
1523 #define EGO_MORGUL 102
1524 #define EGO_KILL_HUMAN 103
1527 #define EGO_ACCURACY 104
1528 #define EGO_VELOCITY 105
1531 #define EGO_EXTRA_MIGHT 108
1532 #define EGO_EXTRA_SHOTS 109
1537 #define EGO_HURT_ANIMAL 112
1538 #define EGO_HURT_EVIL 113
1544 #define EGO_HURT_DRAGON 119
1545 #define EGO_SLAYING_BOLT 120
1546 #define EGO_LIGHTNING_BOLT 121
1547 #define EGO_FLAME 122
1548 #define EGO_FROST 123
1549 #define EGO_WOUNDING 124
1550 #define EGO_BACKBITING 125
1551 #define EGO_SHATTERED 126
1552 #define EGO_BLASTED 127
1554 #define EGO_LITE_SHINE 140
1555 #define EGO_LITE_ILLUMINATION 141
1556 #define EGO_LITE_AURA_FIRE 142
1557 #define EGO_LITE_INFRA 143
1558 #define EGO_LITE_LONG 144
1559 #define EGO_LITE_DARKNESS 145
1560 #define EGO_LITE_EYE 146
1562 #define EGO_RING_HERO 150
1563 #define EGO_RING_SLAY 151
1564 #define EGO_RING_SUPER_AC 152
1565 #define EGO_RING_MAGIC_MIS 153
1566 #define EGO_RING_FIRE_BOLT 154
1567 #define EGO_RING_COLD_BOLT 155
1568 #define EGO_RING_ELEC_BOLT 156
1569 #define EGO_RING_ACID_BOLT 157
1570 #define EGO_RING_MANA_BOLT 158
1571 #define EGO_RING_FIRE_BALL 159
1572 #define EGO_RING_COLD_BALL 160
1573 #define EGO_RING_ELEC_BALL 161
1574 #define EGO_RING_ACID_BALL 162
1575 #define EGO_RING_MANA_BALL 163
1576 #define EGO_RING_DRAGON_F 164
1577 #define EGO_RING_DRAGON_C 165
1578 #define EGO_RING_D_SPEED 166
1579 #define EGO_RING_BERSERKER 167
1580 #define EGO_RING_HUNTER 168
1581 #define EGO_RING_THROW 169
1582 #define EGO_RING_REGEN 170
1583 #define EGO_RING_LITE 171
1584 #define EGO_RING_M_DETECT 172
1585 #define EGO_RING_STEALTH 173
1586 #define EGO_RING_TELE_AWAY 174
1587 #define EGO_RING_TO_H 175
1588 #define EGO_RING_TO_D 176
1589 #define EGO_RING_RES_LITE 177
1590 #define EGO_RING_RES_DARK 178
1591 #define EGO_RING_WIZARD 179
1592 #define EGO_RING_TRUE 180
1593 #define EGO_RING_DRAIN_EXP 181
1594 #define EGO_RING_NO_MELEE 182
1595 #define EGO_RING_AGGRAVATE 183
1596 #define EGO_RING_TY_CURSE 184
1597 #define EGO_RING_RES_TIME 185
1598 #define EGO_RING_TELEPORT 186
1599 #define EGO_RING_ALBINO 187
1601 #define EGO_AMU_SLOW_D 210
1602 #define EGO_AMU_INFRA 211
1603 #define EGO_AMU_SEE_INVIS 212
1604 #define EGO_AMU_HOLD_LIFE 213
1605 #define EGO_AMU_DRAIN_EXP 214
1606 #define EGO_AMU_FOOL 215
1607 #define EGO_AMU_AGGRAVATE 216
1608 #define EGO_AMU_TY_CURSE 217
1609 #define EGO_AMU_AC 218
1610 #define EGO_AMU_IDENT 219
1611 #define EGO_AMU_CHARM 220
1612 #define EGO_AMU_STEALTH 221
1613 #define EGO_AMU_JUMP 222
1614 #define EGO_AMU_TELEPORT 223
1615 #define EGO_AMU_D_DOOR 224
1616 #define EGO_AMU_DEFENDER 225
1617 #define EGO_AMU_RES_FIRE 226
1618 #define EGO_AMU_RES_FIRE_ 227
1619 #define EGO_AMU_RES_COLD 228
1620 #define EGO_AMU_RES_COLD_ 229
1621 #define EGO_AMU_RES_ELEC 230
1622 #define EGO_AMU_RES_ELEC_ 231
1623 #define EGO_AMU_RES_ACID 232
1624 #define EGO_AMU_RES_ACID_ 233
1625 #define EGO_AMU_LEVITATION 234
1626 #define EGO_AMU_GREAT 235
1627 #define EGO_AMU_DETECTION 236
1628 #define EGO_AMU_NAIVETY 237
1630 /* Activation effects for random artifacts */
1631 #define ACT_SUNLIGHT 1
1632 #define ACT_BO_MISS_1 2
1633 #define ACT_BA_POIS_1 3
1634 #define ACT_BO_ELEC_1 4
1635 #define ACT_BO_ACID_1 5
1636 #define ACT_BO_COLD_1 6
1637 #define ACT_BO_FIRE_1 7
1638 #define ACT_BA_COLD_1 8
1639 #define ACT_BA_FIRE_1 9
1640 #define ACT_DRAIN_1 10
1641 #define ACT_BA_COLD_2 11
1642 #define ACT_BA_ELEC_2 12
1643 #define ACT_DRAIN_2 13
1644 #define ACT_VAMPIRE_1 14
1645 #define ACT_BO_MISS_2 15
1646 #define ACT_BA_FIRE_2 16
1647 #define ACT_BA_COLD_3 17
1648 #define ACT_BA_ELEC_3 18
1649 #define ACT_WHIRLWIND 19
1650 #define ACT_VAMPIRE_2 20
1651 #define ACT_CALL_CHAOS 21
1652 #define ACT_ROCKET 22
1653 #define ACT_DISP_EVIL 23
1654 #define ACT_BA_MISS_3 24
1655 #define ACT_DISP_GOOD 25
1656 /* 26 - 50 unused */
1657 #define ACT_CONFUSE 51
1658 #define ACT_SLEEP 52
1659 #define ACT_QUAKE 53
1660 #define ACT_TERROR 54
1661 #define ACT_TELE_AWAY 55
1662 #define ACT_BANISH_EVIL 56
1663 #define ACT_GENOCIDE 57
1664 #define ACT_MASS_GENO 58
1665 /* 59 - 64 unused */
1666 #define ACT_CHARM_ANIMAL 65
1667 #define ACT_CHARM_UNDEAD 66
1668 #define ACT_CHARM_OTHER 67
1669 #define ACT_CHARM_ANIMALS 68
1670 #define ACT_CHARM_OTHERS 69
1671 #define ACT_SUMMON_ANIMAL 70
1672 #define ACT_SUMMON_PHANTOM 71
1673 #define ACT_SUMMON_ELEMENTAL 72
1674 #define ACT_SUMMON_DEMON 73
1675 #define ACT_SUMMON_UNDEAD 74
1676 /* 75 - 80 unused */
1677 #define ACT_CURE_LW 81
1678 #define ACT_CURE_MW 82
1679 #define ACT_CURE_POISON 83
1680 #define ACT_REST_LIFE 84
1681 #define ACT_REST_ALL 85
1682 #define ACT_CURE_700 86
1683 #define ACT_CURE_1000 87
1684 /* 88 - 90 unused */
1686 #define ACT_BERSERK 92
1687 #define ACT_PROT_EVIL 93
1688 #define ACT_RESIST_ALL 94
1689 #define ACT_SPEED 95
1690 #define ACT_XTRA_SPEED 96
1691 #define ACT_WRAITH 97
1692 #define ACT_INVULN 98
1693 /* 99 - 110 unused */
1694 #define ACT_LIGHT 111
1695 #define ACT_MAP_LIGHT 112
1696 #define ACT_DETECT_ALL 113
1697 #define ACT_DETECT_XTRA 114
1698 #define ACT_ID_FULL 115
1699 #define ACT_ID_PLAIN 116
1700 #define ACT_RUNE_EXPLO 117
1701 #define ACT_RUNE_PROT 118
1702 #define ACT_SATIATE 119
1703 #define ACT_DEST_DOOR 120
1704 #define ACT_STONE_MUD 121
1705 #define ACT_RECHARGE 122
1706 #define ACT_ALCHEMY 123
1707 #define ACT_DIM_DOOR 124
1708 #define ACT_TELEPORT 125
1709 #define ACT_RECALL 126
1712 /*** Object "tval" and "sval" codes ***/
1716 * The values for the "tval" field of various objects.
1718 * This value is the primary means by which items are sorted in the
1719 * player inventory, followed by "sval" and "cost".
1721 * Note that a "BOW" with tval = 19 and sval S = 10*N+P takes a missile
1722 * weapon with tval = 16+N, and does (xP) damage when so combined. This
1723 * fact is not actually used in the source, but it kind of interesting.
1725 * Note that as of 2.7.8, the "item flags" apply to all items, though
1726 * only armor and weapons and a few other items use any of these flags.
1729 #define TV_SKELETON 1 /* Skeletons ('s'), not specified */
1730 #define TV_BOTTLE 2 /* Empty bottles ('!') */
1731 #define TV_JUNK 3 /* Sticks, Pottery, etc ('~') */
1732 #define TV_WHISTLE 4 /* Whistle ('~') */
1733 #define TV_SPIKE 5 /* Spikes ('~') */
1734 #define TV_CHEST 7 /* Chests ('&') */
1735 #define TV_FIGURINE 8 /* Magical figurines */
1736 #define TV_STATUE 9 /* Statue, what a silly object... */
1737 #define TV_CORPSE 10 /* Corpses and Skeletons, specific */
1738 #define TV_CAPTURE 11 /* Monster ball */
1739 #define TV_NO_AMMO 15 /* Ammo for crimson */
1740 #define TV_SHOT 16 /* Ammo for slings */
1741 #define TV_ARROW 17 /* Ammo for bows */
1742 #define TV_BOLT 18 /* Ammo for x-bows */
1743 #define TV_BOW 19 /* Slings/Bows/Xbows */
1744 #define TV_DIGGING 20 /* Shovels/Picks */
1745 #define TV_HAFTED 21 /* Priest Weapons */
1746 #define TV_POLEARM 22 /* Axes and Pikes */
1747 #define TV_SWORD 23 /* Edged Weapons */
1748 #define TV_BOOTS 30 /* Boots */
1749 #define TV_GLOVES 31 /* Gloves */
1750 #define TV_HELM 32 /* Helms */
1751 #define TV_CROWN 33 /* Crowns */
1752 #define TV_SHIELD 34 /* Shields */
1753 #define TV_CLOAK 35 /* Cloaks */
1754 #define TV_SOFT_ARMOR 36 /* Soft Armor */
1755 #define TV_HARD_ARMOR 37 /* Hard Armor */
1756 #define TV_DRAG_ARMOR 38 /* Dragon Scale Mail */
1757 #define TV_LITE 39 /* Lites (including Specials) */
1758 #define TV_AMULET 40 /* Amulets (including Specials) */
1759 #define TV_RING 45 /* Rings (including Specials) */
1764 #define TV_PARCHMENT 69
1765 #define TV_SCROLL 70
1766 #define TV_POTION 75
1769 #define TV_LIFE_BOOK 90
1770 #define TV_SORCERY_BOOK 91
1771 #define TV_NATURE_BOOK 92
1772 #define TV_CHAOS_BOOK 93
1773 #define TV_DEATH_BOOK 94
1774 #define TV_TRUMP_BOOK 95
1775 #define TV_ARCANE_BOOK 96
1776 #define TV_ENCHANT_BOOK 97
1777 #define TV_DAEMON_BOOK 98
1778 #define TV_CRUSADE_BOOK 99
1779 #define TV_MUSIC_BOOK 105
1780 #define TV_HISSATSU_BOOK 106
1781 #define TV_GOLD 127 /* Gold can only be picked up by players */
1783 #define TV_MISSILE_BEGIN TV_SHOT
1784 #define TV_MISSILE_END TV_BOLT
1785 #define TV_EQUIP_BEGIN TV_BOW
1786 #define TV_EQUIP_END TV_CARD
1787 #define TV_WEAPON_BEGIN TV_BOW
1788 #define TV_WEAPON_END TV_SWORD
1789 #define TV_ARMOR_BEGIN TV_BOOTS
1790 #define TV_ARMOR_END TV_DRAG_ARMOR
1795 /* The "sval" codes for TV_FIGURINE */
1796 #define SV_FIGURINE_NORMAL 0
1798 #define SV_CAPTURE_NONE 0
1800 /* The "sval" codes for TV_STATUE */
1801 #define SV_WOODEN_STATUE 0
1802 #define SV_CLAY_STATUE 1
1803 #define SV_STONE_STATUE 2
1804 #define SV_IRON_STATUE 3
1805 #define SV_COPPER_STATUE 4
1806 #define SV_SILVER_STATUE 5
1807 #define SV_GOLDEN_STATUE 6
1808 #define SV_IVORY_STATUE 7
1809 #define SV_MITHRIL_STATUE 8
1810 #define SV_ORNATE_STATUE 9
1813 /* The "sval" codes for TV_CORPSE */
1814 #define SV_SKELETON 0
1817 /* The "sval" codes for TV_SHOT/TV_ARROW/TV_BOLT */
1818 #define SV_AMMO_LIGHT 0 /* pebbles */
1819 #define SV_AMMO_NORMAL 1 /* shots, arrows, bolts */
1820 #define SV_AMMO_HEAVY 2 /* seeker arrows and bolts, mithril shots */
1822 /* The "sval" codes for TV_BOW (note information in "sval") */
1823 #define SV_SLING 2 /* (x2) */
1824 #define SV_SHORT_BOW 12 /* (x2) */
1825 #define SV_LONG_BOW 13 /* (x3) */
1826 #define SV_LIGHT_XBOW 23 /* (x3) */
1827 #define SV_HEAVY_XBOW 24 /* (x4) */
1828 #define SV_CRIMSON 50 /* (x0) */
1829 #define SV_NAMAKE_BOW 63 /* (x3) */
1831 /* The "sval" codes for TV_DIGGING */
1833 #define SV_GNOMISH_SHOVEL 2
1834 #define SV_DWARVEN_SHOVEL 3
1836 #define SV_ORCISH_PICK 5
1837 #define SV_DWARVEN_PICK 6
1838 #define SV_MATTOCK 7
1840 /* The "sval" values for TV_HAFTED */
1841 #define SV_CLUB 1 /* 1d4 */
1842 #define SV_WHIP 2 /* 1d6 */
1843 #define SV_QUARTERSTAFF 3 /* 1d9 */
1844 #define SV_NUNCHAKU 4 /* 2d3 */
1845 #define SV_MACE 5 /* 2d4 */
1846 #define SV_BALL_AND_CHAIN 6 /* 2d4 */
1847 #define SV_JO_STAFF 7 /* 1d7 */
1848 #define SV_WAR_HAMMER 8 /* 3d3 */
1849 #define SV_THREE_PIECE_ROD 11 /* 3d3 */
1850 #define SV_MORNING_STAR 12 /* 2d6 */
1851 #define SV_FLAIL 13 /* 2d6 */
1852 #define SV_BO_STAFF 14 /* 1d11 */
1853 #define SV_LEAD_FILLED_MACE 15 /* 3d4 */
1854 #define SV_TETSUBO 16 /* 2d7 */
1855 #define SV_TWO_HANDED_FLAIL 18 /* 3d6 */
1856 #define SV_GREAT_HAMMER 19 /* 4d6 */
1857 #define SV_MACE_OF_DISRUPTION 20 /* 5d8 */
1858 #define SV_WIZSTAFF 21 /* 1d2 */
1859 #define SV_GROND 50 /* 3d9 */
1860 #define SV_NAMAKE_HAMMER 63 /* 1d77 */
1862 /* The "sval" values for TV_POLEARM */
1863 #define SV_HATCHET 1 /* 1d5 */
1864 #define SV_SPEAR 2 /* 1d6 */
1865 #define SV_SICKLE 3 /* 2d3 */
1866 #define SV_AWL_PIKE 4 /* 1d8 */
1867 #define SV_TRIDENT 5 /* 1d9 */
1868 #define SV_FAUCHARD 6 /* 1d10 */
1869 #define SV_BROAD_SPEAR 7 /* 1d9 */
1870 #define SV_PIKE 8 /* 2d5 */
1871 #define SV_NAGINATA 9 /* 2d6 */
1872 #define SV_BEAKED_AXE 10 /* 2d6 */
1873 #define SV_BROAD_AXE 11 /* 2d6 */
1874 #define SV_LUCERNE_HAMMER 12 /* 2d5 */
1875 #define SV_GLAIVE 13 /* 2d6 */
1876 #define SV_LAJATANG 14 /* 2d7 */
1877 #define SV_HALBERD 15 /* 3d4 */
1878 #define SV_GUISARME 16 /* 2d5 */
1879 #define SV_SCYTHE 17 /* 5d3 */
1880 #define SV_LANCE 20 /* 2d8 */
1881 #define SV_BATTLE_AXE 22 /* 2d8 */
1882 #define SV_GREAT_AXE 25 /* 4d4 */
1883 #define SV_TRIFURCATE_SPEAR 26 /* 2d9 */
1884 #define SV_LOCHABER_AXE 28 /* 3d8 */
1885 #define SV_HEAVY_LANCE 29 /* 4d8 */
1886 #define SV_SCYTHE_OF_SLICING 30 /* 8d4 */
1887 #define SV_TSURIZAO 40 /* 1d1 */
1888 #define SV_DEATH_SCYTHE 50 /* 10d10 */
1890 /* The "sval" codes for TV_SWORD */
1891 #define SV_BROKEN_DAGGER 1 /* 1d1 */
1892 #define SV_BROKEN_SWORD 2 /* 1d2 */
1893 #define SV_DAGGER 4 /* 1d4 */
1894 #define SV_MAIN_GAUCHE 5 /* 1d5 */
1895 #define SV_TANTO 6 /* 1d5 */
1896 #define SV_RAPIER 7 /* 1d6 */
1897 #define SV_SMALL_SWORD 8 /* 1d6 */
1898 #define SV_BASILLARD 9 /* 1d8 */
1899 #define SV_SHORT_SWORD 10 /* 1d7 */
1900 #define SV_SABRE 11 /* 1d7 */
1901 #define SV_CUTLASS 12 /* 1d7 */
1902 #define SV_WAKIZASHI 13 /* 2d4 */
1903 #define SV_KHOPESH 14 /* 2d4 */
1904 #define SV_TULWAR 15 /* 2d4 */
1905 #define SV_BROAD_SWORD 16 /* 2d5 */
1906 #define SV_LONG_SWORD 17 /* 2d5 */
1907 #define SV_SCIMITAR 18 /* 2d5 */
1908 #define SV_NINJATO 19 /* 1d9 */
1909 #define SV_KATANA 20 /* 3d4 */
1910 #define SV_BASTARD_SWORD 21 /* 3d4 */
1911 #define SV_GREAT_SCIMITAR 22 /* 4d5 */
1912 #define SV_CLAYMORE 23 /* 2d8 */
1913 #define SV_ESPADON 24 /* 2d9 */
1914 #define SV_TWO_HANDED_SWORD 25 /* 3d6 */
1915 #define SV_FLAMBERGE 26 /* 3d7 */
1916 #define SV_NO_DACHI 27 /* 5d4 */
1917 #define SV_EXECUTIONERS_SWORD 28 /* 4d5 */
1918 #define SV_ZWEIHANDER 29 /* 4d6 */
1919 #define SV_BLADE_OF_CHAOS 30 /* 6d5 */
1920 #define SV_DIAMOND_EDGE 31 /* 7d5 */
1921 #define SV_DOKUBARI 32 /* 1d1 */
1922 #define SV_HAYABUSA 33 /* 1d6 */
1924 /* The "sval" codes for TV_SHIELD */
1925 #define SV_SMALL_LEATHER_SHIELD 2
1926 #define SV_SMALL_METAL_SHIELD 3
1927 #define SV_LARGE_LEATHER_SHIELD 4
1928 #define SV_LARGE_METAL_SHIELD 5
1929 #define SV_DRAGON_SHIELD 6
1930 #define SV_KNIGHT_SHIELD 7
1931 #define SV_MIRROR_SHIELD 10
1932 #define SV_YATA_MIRROR 50
1934 /* The "sval" codes for TV_HELM */
1935 #define SV_HARD_LEATHER_CAP 2
1936 #define SV_METAL_CAP 3
1937 #define SV_JINGASA 4 /* 4 */
1938 #define SV_IRON_HELM 5
1939 #define SV_STEEL_HELM 6
1940 #define SV_DRAGON_HELM 7
1941 #define SV_KABUTO 8 /* 7 */
1943 /* The "sval" codes for TV_CROWN */
1944 #define SV_IRON_CROWN 10
1945 #define SV_GOLDEN_CROWN 11
1946 #define SV_JEWELED_CROWN 12
1949 /* The "sval" codes for TV_BOOTS */
1950 #define SV_PAIR_OF_SOFT_LEATHER_BOOTS 2
1951 #define SV_PAIR_OF_HARD_LEATHER_BOOTS 3
1952 #define SV_PAIR_OF_DRAGON_GREAVE 4
1953 #define SV_PAIR_OF_METAL_SHOD_BOOTS 6
1955 /* The "sval" codes for TV_CLOAK */
1957 #define SV_ELVEN_CLOAK 2
1958 #define SV_FUR_CLOAK 3
1959 #define SV_ETHEREAL_CLOAK 5
1960 #define SV_SHADOW_CLOAK 6
1962 /* The "sval" codes for TV_GLOVES */
1963 #define SV_SET_OF_LEATHER_GLOVES 1
1964 #define SV_SET_OF_GAUNTLETS 2
1965 #define SV_SET_OF_DRAGON_GLOVES 3
1966 #define SV_SET_OF_CESTI 5
1968 /* The "sval" codes for TV_SOFT_ARMOR */
1969 #define SV_T_SHIRT 0
1970 #define SV_FILTHY_RAG 1
1972 #define SV_PAPER_ARMOR 3 /* 4 */
1973 #define SV_SOFT_LEATHER_ARMOR 4
1974 #define SV_SOFT_STUDDED_LEATHER 5
1975 #define SV_HARD_LEATHER_ARMOR 6
1976 #define SV_HARD_STUDDED_LEATHER 7
1977 #define SV_RHINO_HIDE_ARMOR 8
1978 #define SV_CORD_ARMOR 9 /* 6 */
1979 #define SV_PADDED_ARMOR 10 /* 4 */
1980 #define SV_LEATHER_SCALE_MAIL 11
1981 #define SV_LEATHER_JACK 12
1982 #define SV_KUROSHOUZOKU 13
1983 #define SV_STONE_AND_HIDE_ARMOR 15 /* 15 */
1984 #define SV_ABUNAI_MIZUGI 50
1985 #define SV_YOIYAMI_ROBE 60
1986 #define SV_NAMAKE_ARMOR 63
1988 /* The "sval" codes for TV_HARD_ARMOR */
1989 #define SV_RUSTY_CHAIN_MAIL 1 /* 14- */
1990 #define SV_RING_MAIL 2 /* 12 */
1991 #define SV_METAL_SCALE_MAIL 3 /* 13 */
1992 #define SV_CHAIN_MAIL 4 /* 14 */
1993 #define SV_DOUBLE_RING_MAIL 5 /* 15 */
1994 #define SV_AUGMENTED_CHAIN_MAIL 6 /* 16 */
1995 #define SV_DOUBLE_CHAIN_MAIL 7 /* 16 */
1996 #define SV_BAR_CHAIN_MAIL 8 /* 18 */
1997 #define SV_METAL_BRIGANDINE_ARMOUR 9 /* 19 */
1998 #define SV_SPLINT_MAIL 10 /* 19 */
1999 #define SV_DO_MARU 11 /* 20 */
2000 #define SV_PARTIAL_PLATE_ARMOUR 12 /* 22 */
2001 #define SV_METAL_LAMELLAR_ARMOUR 13 /* 23 */
2002 #define SV_HARAMAKIDO 14 /* 17 */
2003 #define SV_FULL_PLATE_ARMOUR 15 /* 25 */
2004 #define SV_O_YOROI 16 /* 24 */
2005 #define SV_RIBBED_PLATE_ARMOUR 18 /* 28 */
2006 #define SV_MITHRIL_CHAIN_MAIL 20 /* 28+ */
2007 #define SV_MITHRIL_PLATE_MAIL 25 /* 35+ */
2008 #define SV_ADAMANTITE_PLATE_MAIL 30 /* 40+ */
2010 /* The "sval" codes for TV_DRAG_ARMOR */
2011 #define SV_DRAGON_BLACK 1
2012 #define SV_DRAGON_BLUE 2
2013 #define SV_DRAGON_WHITE 3
2014 #define SV_DRAGON_RED 4
2015 #define SV_DRAGON_GREEN 5
2016 #define SV_DRAGON_MULTIHUED 6
2017 #define SV_DRAGON_SHINING 10
2018 #define SV_DRAGON_LAW 12
2019 #define SV_DRAGON_BRONZE 14
2020 #define SV_DRAGON_GOLD 16
2021 #define SV_DRAGON_CHAOS 18
2022 #define SV_DRAGON_BALANCE 20
2023 #define SV_DRAGON_POWER 30
2025 /* The sval codes for TV_LITE */
2026 #define SV_LITE_TORCH 0
2027 #define SV_LITE_LANTERN 1
2028 #define SV_LITE_FEANOR 2
2029 #define SV_LITE_EDISON 3
2030 #define SV_LITE_GALADRIEL 4
2031 #define SV_LITE_ELENDIL 5
2032 #define SV_LITE_JUDGE 6
2033 #define SV_LITE_LORE 7
2034 #define SV_LITE_PALANTIR 8
2035 #define SV_LITE_FLY_STONE 9
2037 /* The "sval" codes for TV_AMULET */
2038 #define SV_AMULET_DOOM 0
2039 #define SV_AMULET_TELEPORT 1
2040 #define SV_AMULET_ADORNMENT 2
2041 #define SV_AMULET_SLOW_DIGEST 3
2042 #define SV_AMULET_RESIST_ACID 4
2043 #define SV_AMULET_SEARCHING 5
2044 #define SV_AMULET_BRILLIANCE 6
2045 #define SV_AMULET_CHARISMA 7
2046 #define SV_AMULET_THE_MAGI 8
2047 #define SV_AMULET_REFLECTION 9
2048 #define SV_AMULET_CARLAMMAS 10
2049 #define SV_AMULET_INGWE 11
2050 #define SV_AMULET_DWARVES 12
2051 #define SV_AMULET_NO_MAGIC 13
2052 #define SV_AMULET_NO_TELE 14
2053 #define SV_AMULET_RESISTANCE 15
2054 #define SV_AMULET_TELEPATHY 16
2055 #define SV_AMULET_FARAMIR 17
2056 #define SV_AMULET_BOROMIR 18
2057 #define SV_AMULET_MAGATAMA 19
2058 #define SV_AMULET_INROU 20
2059 #define SV_AMULET_INTELLIGENCE 21
2060 #define SV_AMULET_WISDOM 22
2061 #define SV_AMULET_MAGIC_MASTERY 23
2062 #define SV_AMULET_NIGHT 24
2064 /* The sval codes for TV_RING */
2065 #define SV_RING_WOE 0
2066 #define SV_RING_AGGRAVATION 1
2067 #define SV_RING_WEAKNESS 2
2068 #define SV_RING_STUPIDITY 3
2069 #define SV_RING_TELEPORTATION 4
2070 #define SV_RING_SLOW_DIGESTION 6
2071 #define SV_RING_FEATHER_FALL 7
2072 #define SV_RING_RESIST_FIRE 8
2073 #define SV_RING_RESIST_COLD 9
2074 #define SV_RING_SUSTAIN_STR 10
2075 #define SV_RING_SUSTAIN_INT 11
2076 #define SV_RING_SUSTAIN_WIS 12
2077 #define SV_RING_SUSTAIN_DEX 13
2078 #define SV_RING_SUSTAIN_CON 14
2079 #define SV_RING_SUSTAIN_CHR 15
2080 #define SV_RING_PROTECTION 16
2081 #define SV_RING_ACID 17
2082 #define SV_RING_FLAMES 18
2083 #define SV_RING_ICE 19
2084 #define SV_RING_RESIST_POIS 20
2085 #define SV_RING_FREE_ACTION 21
2086 #define SV_RING_SEE_INVIS 22
2087 #define SV_RING_SEARCHING 23
2088 #define SV_RING_STR 24
2089 #define SV_RING_ELEC 25
2090 #define SV_RING_DEX 26
2091 #define SV_RING_CON 27
2092 #define SV_RING_ACCURACY 28
2093 #define SV_RING_DAMAGE 29
2094 #define SV_RING_SLAYING 30
2095 #define SV_RING_SPEED 31
2096 #define SV_RING_FRAKIR 32
2097 #define SV_RING_TULKAS 33
2098 #define SV_RING_NARYA 34
2099 #define SV_RING_NENYA 35
2100 #define SV_RING_VILYA 36
2101 #define SV_RING_POWER 37
2102 #define SV_RING_RES_FEAR 38
2103 #define SV_RING_RES_LD 39
2104 #define SV_RING_RES_NETHER 40
2105 #define SV_RING_RES_NEXUS 41
2106 #define SV_RING_RES_SOUND 42
2107 #define SV_RING_RES_CONFUSION 43
2108 #define SV_RING_RES_SHARDS 44
2109 #define SV_RING_RES_DISENCHANT 45
2110 #define SV_RING_RES_CHAOS 46
2111 #define SV_RING_RES_BLINDNESS 47
2112 #define SV_RING_LORDLY 48
2113 #define SV_RING_ATTACKS 49
2114 #define SV_RING_AHO 50
2115 #define SV_RING_SHOTS 51
2116 #define SV_RING_SUSTAIN 52
2117 #define SV_RING_DEC_MANA 53
2118 #define SV_RING_WARNING 54
2119 #define SV_RING_MUSCLE 55
2121 #define SV_EXPRESS_CARD 0
2123 /* The "sval" codes for TV_STAFF */
2124 #define SV_STAFF_DARKNESS 0
2125 #define SV_STAFF_SLOWNESS 1
2126 #define SV_STAFF_HASTE_MONSTERS 2
2127 #define SV_STAFF_SUMMONING 3
2128 #define SV_STAFF_TELEPORTATION 4
2129 #define SV_STAFF_IDENTIFY 5
2130 #define SV_STAFF_REMOVE_CURSE 6
2131 #define SV_STAFF_STARLITE 7
2132 #define SV_STAFF_LITE 8
2133 #define SV_STAFF_MAPPING 9
2134 #define SV_STAFF_DETECT_GOLD 10
2135 #define SV_STAFF_DETECT_ITEM 11
2136 #define SV_STAFF_DETECT_TRAP 12
2137 #define SV_STAFF_DETECT_DOOR 13
2138 #define SV_STAFF_DETECT_INVIS 14
2139 #define SV_STAFF_DETECT_EVIL 15
2140 #define SV_STAFF_CURE_LIGHT 16
2141 #define SV_STAFF_CURING 17
2142 #define SV_STAFF_HEALING 18
2143 #define SV_STAFF_THE_MAGI 19
2144 #define SV_STAFF_SLEEP_MONSTERS 20
2145 #define SV_STAFF_SLOW_MONSTERS 21
2146 #define SV_STAFF_SPEED 22
2147 #define SV_STAFF_PROBING 23
2148 #define SV_STAFF_DISPEL_EVIL 24
2149 #define SV_STAFF_POWER 25
2150 #define SV_STAFF_HOLINESS 26
2151 #define SV_STAFF_GENOCIDE 27
2152 #define SV_STAFF_EARTHQUAKES 28
2153 #define SV_STAFF_DESTRUCTION 29
2154 #define SV_STAFF_ANIMATE_DEAD 30
2155 #define SV_STAFF_MSTORM 31
2156 #define SV_STAFF_NOTHING 32
2159 /* The "sval" codes for TV_WAND */
2160 #define SV_WAND_HEAL_MONSTER 0
2161 #define SV_WAND_HASTE_MONSTER 1
2162 #define SV_WAND_CLONE_MONSTER 2
2163 #define SV_WAND_TELEPORT_AWAY 3
2164 #define SV_WAND_DISARMING 4
2165 #define SV_WAND_TRAP_DOOR_DEST 5
2166 #define SV_WAND_STONE_TO_MUD 6
2167 #define SV_WAND_LITE 7
2168 #define SV_WAND_SLEEP_MONSTER 8
2169 #define SV_WAND_SLOW_MONSTER 9
2170 #define SV_WAND_CONFUSE_MONSTER 10
2171 #define SV_WAND_FEAR_MONSTER 11
2172 #define SV_WAND_DRAIN_LIFE 12
2173 #define SV_WAND_POLYMORPH 13
2174 #define SV_WAND_STINKING_CLOUD 14
2175 #define SV_WAND_MAGIC_MISSILE 15
2176 #define SV_WAND_ACID_BOLT 16
2177 #define SV_WAND_CHARM_MONSTER 17
2178 #define SV_WAND_FIRE_BOLT 18
2179 #define SV_WAND_COLD_BOLT 19
2180 #define SV_WAND_ACID_BALL 20
2181 #define SV_WAND_ELEC_BALL 21
2182 #define SV_WAND_FIRE_BALL 22
2183 #define SV_WAND_COLD_BALL 23
2184 #define SV_WAND_WONDER 24
2185 #define SV_WAND_DISINTEGRATE 25
2186 #define SV_WAND_DRAGON_FIRE 26
2187 #define SV_WAND_DRAGON_COLD 27
2188 #define SV_WAND_DRAGON_BREATH 28
2189 #define SV_WAND_ROCKETS 29
2190 #define SV_WAND_STRIKING 30
2191 #define SV_WAND_GENOCIDE 31
2193 /* The "sval" codes for TV_ROD */
2194 #define SV_ROD_DETECT_TRAP 0
2195 #define SV_ROD_DETECT_DOOR 1
2196 #define SV_ROD_IDENTIFY 2
2197 #define SV_ROD_RECALL 3
2198 #define SV_ROD_ILLUMINATION 4
2199 #define SV_ROD_MAPPING 5
2200 #define SV_ROD_DETECTION 6
2201 #define SV_ROD_PROBING 7
2202 #define SV_ROD_CURING 8
2203 #define SV_ROD_HEALING 9
2204 #define SV_ROD_RESTORATION 10
2205 #define SV_ROD_SPEED 11
2206 #define SV_ROD_PESTICIDE 12
2207 #define SV_ROD_TELEPORT_AWAY 13
2208 #define SV_ROD_DISARMING 14
2209 #define SV_ROD_LITE 15
2210 #define SV_ROD_SLEEP_MONSTER 16
2211 #define SV_ROD_SLOW_MONSTER 17
2212 #define SV_ROD_DRAIN_LIFE 18
2213 #define SV_ROD_POLYMORPH 19
2214 #define SV_ROD_ACID_BOLT 20
2215 #define SV_ROD_ELEC_BOLT 21
2216 #define SV_ROD_FIRE_BOLT 22
2217 #define SV_ROD_COLD_BOLT 23
2218 #define SV_ROD_ACID_BALL 24
2219 #define SV_ROD_ELEC_BALL 25
2220 #define SV_ROD_FIRE_BALL 26
2221 #define SV_ROD_COLD_BALL 27
2222 #define SV_ROD_HAVOC 28
2223 #define SV_ROD_STONE_TO_MUD 29
2224 #define SV_ROD_AGGRAVATE 30
2227 /* The "sval" codes for TV_SCROLL */
2229 #define SV_SCROLL_DARKNESS 0
2230 #define SV_SCROLL_AGGRAVATE_MONSTER 1
2231 #define SV_SCROLL_CURSE_ARMOR 2
2232 #define SV_SCROLL_CURSE_WEAPON 3
2233 #define SV_SCROLL_SUMMON_MONSTER 4
2234 #define SV_SCROLL_SUMMON_UNDEAD 5
2235 #define SV_SCROLL_SUMMON_PET 6
2236 #define SV_SCROLL_TRAP_CREATION 7
2237 #define SV_SCROLL_PHASE_DOOR 8
2238 #define SV_SCROLL_TELEPORT 9
2239 #define SV_SCROLL_TELEPORT_LEVEL 10
2240 #define SV_SCROLL_WORD_OF_RECALL 11
2241 #define SV_SCROLL_IDENTIFY 12
2242 #define SV_SCROLL_STAR_IDENTIFY 13
2243 #define SV_SCROLL_REMOVE_CURSE 14
2244 #define SV_SCROLL_STAR_REMOVE_CURSE 15
2245 #define SV_SCROLL_ENCHANT_ARMOR 16
2246 #define SV_SCROLL_ENCHANT_WEAPON_TO_HIT 17
2247 #define SV_SCROLL_ENCHANT_WEAPON_TO_DAM 18
2248 /* xxx enchant missile? */
2249 #define SV_SCROLL_STAR_ENCHANT_ARMOR 20
2250 #define SV_SCROLL_STAR_ENCHANT_WEAPON 21
2251 #define SV_SCROLL_RECHARGING 22
2252 #define SV_SCROLL_MUNDANITY 23
2253 #define SV_SCROLL_LIGHT 24
2254 #define SV_SCROLL_MAPPING 25
2255 #define SV_SCROLL_DETECT_GOLD 26
2256 #define SV_SCROLL_DETECT_ITEM 27
2257 #define SV_SCROLL_DETECT_TRAP 28
2258 #define SV_SCROLL_DETECT_DOOR 29
2259 #define SV_SCROLL_DETECT_INVIS 30
2260 /* xxx (detect evil?) */
2261 #define SV_SCROLL_SATISFY_HUNGER 32
2262 #define SV_SCROLL_BLESSING 33
2263 #define SV_SCROLL_HOLY_CHANT 34
2264 #define SV_SCROLL_HOLY_PRAYER 35
2265 #define SV_SCROLL_MONSTER_CONFUSION 36
2266 #define SV_SCROLL_PROTECTION_FROM_EVIL 37
2267 #define SV_SCROLL_RUNE_OF_PROTECTION 38
2268 #define SV_SCROLL_TRAP_DOOR_DESTRUCTION 39
2270 #define SV_SCROLL_STAR_DESTRUCTION 41
2271 #define SV_SCROLL_DISPEL_UNDEAD 42
2272 #define SV_SCROLL_SPELL 43
2273 #define SV_SCROLL_GENOCIDE 44
2274 #define SV_SCROLL_MASS_GENOCIDE 45
2275 #define SV_SCROLL_ACQUIREMENT 46
2276 #define SV_SCROLL_STAR_ACQUIREMENT 47
2277 #define SV_SCROLL_FIRE 48
2278 #define SV_SCROLL_ICE 49
2279 #define SV_SCROLL_CHAOS 50
2280 #define SV_SCROLL_RUMOR 51
2281 #define SV_SCROLL_ARTIFACT 52
2282 #define SV_SCROLL_RESET_RECALL 53
2283 #define SV_SCROLL_SUMMON_KIN 54
2285 /* The "sval" codes for TV_POTION */
2286 #define SV_POTION_WATER 0
2287 #define SV_POTION_APPLE_JUICE 1
2288 #define SV_POTION_SLIME_MOLD 2
2289 /* xxx (fixed color) */
2290 #define SV_POTION_SLOWNESS 4
2291 #define SV_POTION_SALT_WATER 5
2292 #define SV_POTION_POISON 6
2293 #define SV_POTION_BLINDNESS 7
2295 #define SV_POTION_CONFUSION 9
2297 #define SV_POTION_SLEEP 11
2299 #define SV_POTION_LOSE_MEMORIES 13
2301 #define SV_POTION_RUINATION 15
2302 #define SV_POTION_DEC_STR 16
2303 #define SV_POTION_DEC_INT 17
2304 #define SV_POTION_DEC_WIS 18
2305 #define SV_POTION_DEC_DEX 19
2306 #define SV_POTION_DEC_CON 20
2307 #define SV_POTION_DEC_CHR 21
2308 #define SV_POTION_DETONATIONS 22
2309 #define SV_POTION_DEATH 23
2310 #define SV_POTION_INFRAVISION 24
2311 #define SV_POTION_DETECT_INVIS 25
2312 #define SV_POTION_SLOW_POISON 26
2313 #define SV_POTION_CURE_POISON 27
2314 #define SV_POTION_BOLDNESS 28
2315 #define SV_POTION_SPEED 29
2316 #define SV_POTION_RESIST_HEAT 30
2317 #define SV_POTION_RESIST_COLD 31
2318 #define SV_POTION_HEROISM 32
2319 #define SV_POTION_BESERK_STRENGTH 33
2320 #define SV_POTION_CURE_LIGHT 34
2321 #define SV_POTION_CURE_SERIOUS 35
2322 #define SV_POTION_CURE_CRITICAL 36
2323 #define SV_POTION_HEALING 37
2324 #define SV_POTION_STAR_HEALING 38
2325 #define SV_POTION_LIFE 39
2326 #define SV_POTION_RESTORE_MANA 40
2327 #define SV_POTION_RESTORE_EXP 41
2328 #define SV_POTION_RES_STR 42
2329 #define SV_POTION_RES_INT 43
2330 #define SV_POTION_RES_WIS 44
2331 #define SV_POTION_RES_DEX 45
2332 #define SV_POTION_RES_CON 46
2333 #define SV_POTION_RES_CHR 47
2334 #define SV_POTION_INC_STR 48
2335 #define SV_POTION_INC_INT 49
2336 #define SV_POTION_INC_WIS 50
2337 #define SV_POTION_INC_DEX 51
2338 #define SV_POTION_INC_CON 52
2339 #define SV_POTION_INC_CHR 53
2341 #define SV_POTION_AUGMENTATION 55
2342 #define SV_POTION_ENLIGHTENMENT 56
2343 #define SV_POTION_STAR_ENLIGHTENMENT 57
2344 #define SV_POTION_SELF_KNOWLEDGE 58
2345 #define SV_POTION_EXPERIENCE 59
2346 #define SV_POTION_RESISTANCE 60
2347 #define SV_POTION_CURING 61
2348 #define SV_POTION_INVULNERABILITY 62
2349 #define SV_POTION_NEW_LIFE 63
2350 #define SV_POTION_NEO_TSUYOSHI 64
2351 #define SV_POTION_TSUYOSHI 65
2352 #define SV_POTION_POLYMORPH 66
2354 /* The "sval" codes for TV_FLASK */
2355 #define SV_FLASK_OIL 0
2357 /* The "sval" codes for TV_FOOD */
2358 #define SV_FOOD_POISON 0
2359 #define SV_FOOD_BLINDNESS 1
2360 #define SV_FOOD_PARANOIA 2
2361 #define SV_FOOD_CONFUSION 3
2362 #define SV_FOOD_HALLUCINATION 4
2363 #define SV_FOOD_PARALYSIS 5
2364 #define SV_FOOD_WEAKNESS 6
2365 #define SV_FOOD_SICKNESS 7
2366 #define SV_FOOD_STUPIDITY 8
2367 #define SV_FOOD_NAIVETY 9
2368 #define SV_FOOD_UNHEALTH 10
2369 #define SV_FOOD_DISEASE 11
2370 #define SV_FOOD_CURE_POISON 12
2371 #define SV_FOOD_CURE_BLINDNESS 13
2372 #define SV_FOOD_CURE_PARANOIA 14
2373 #define SV_FOOD_CURE_CONFUSION 15
2374 #define SV_FOOD_CURE_SERIOUS 16
2375 #define SV_FOOD_RESTORE_STR 17
2376 #define SV_FOOD_RESTORE_CON 18
2377 #define SV_FOOD_RESTORING 19
2378 /* many missing mushrooms */
2379 #define SV_FOOD_BISCUIT 32
2380 #define SV_FOOD_JERKY 33
2381 #define SV_FOOD_RATION 35
2382 #define SV_FOOD_SLIME_MOLD 36
2383 #define SV_FOOD_WAYBREAD 37
2384 #define SV_FOOD_PINT_OF_ALE 38
2385 #define SV_FOOD_PINT_OF_WINE 39
2389 * Special "sval" limit -- first "normal" food
2391 #define SV_FOOD_MIN_FOOD 32
2394 * Special "sval" limit -- first "aimed" rod
2396 #define SV_ROD_MIN_DIRECTION 12
2399 * Special "sval" limit -- first "large" chest
2401 #define SV_CHEST_MIN_LARGE 4
2402 #define SV_CHEST_KANDUME 50
2405 * Special "sval" limit -- first "good" magic/prayer book
2407 #define SV_BOOK_MIN_GOOD 2
2410 #define OBJ_GOLD_LIST 480 /* First "gold" entry */
2411 #define MAX_GOLD 18 /* Number of "gold" entries */
2414 /*** General flag values ***/
2418 * Special cave grid flags
2420 #define CAVE_MARK 0x0001 /* memorized feature */
2421 #define CAVE_GLOW 0x0002 /* self-illuminating */
2422 #define CAVE_ICKY 0x0004 /* part of a vault */
2423 #define CAVE_ROOM 0x0008 /* part of a room */
2424 #define CAVE_LITE 0x0010 /* lite flag */
2425 #define CAVE_VIEW 0x0020 /* view flag */
2426 #define CAVE_TEMP 0x0040 /* temp flag */
2427 #define CAVE_XTRA 0x0080 /* misc flag */
2428 #define CAVE_MNLT 0x0100 /* Illuminated by monster */
2429 #define CAVE_MNDK 0x8000 /* Darken by monster */
2431 /* Used only while cave generation */
2432 #define CAVE_FLOOR 0x0200
2433 #define CAVE_EXTRA 0x0400
2434 #define CAVE_INNER 0x0800
2435 #define CAVE_OUTER 0x1000
2436 #define CAVE_SOLID 0x2000
2437 #define CAVE_VAULT 0x4000
2438 #define CAVE_MASK (CAVE_FLOOR | CAVE_EXTRA | CAVE_INNER | CAVE_OUTER | CAVE_SOLID | CAVE_VAULT)
2440 /* Used only after cave generation */
2441 #define CAVE_XXXX1 0x0200
2442 #define CAVE_NOTE 0x0400 /* Flag for delayed visual update (needs note_spot()) */
2443 #define CAVE_REDRAW 0x0800 /* Flag for delayed visual update (needs lite_spot()) */
2444 #define CAVE_OBJECT 0x1000 /* Mirror, glyph, etc. */
2445 #define CAVE_UNSAFE 0x2000 /* Might have trap */
2446 #define CAVE_IN_DETECT 0x4000 /* trap detected area (inner circle only) */
2450 * Bit flags for the "project()" function
2452 * JUMP: Jump directly to the target location (this is a hack)
2453 * BEAM: Work as a beam weapon (affect every grid passed through)
2454 * THRU: Continue "through" the target (used for "bolts"/"beams")
2455 * STOP: Stop as soon as we hit a monster (used for "bolts")
2456 * GRID: Affect each grid in the "blast area" in some way
2457 * ITEM: Affect each object in the "blast area" in some way
2458 * KILL: Affect each monster in the "blast area" in some way
2459 * HIDE: Hack -- disable "visual" feedback from projection
2460 * DISI: Disintegrate non-permanent features
2461 * PLAYER: Main target is player (used for riding player)
2462 * AIMED: Target is only player or monster, so don't affect another.
2463 * Depend on PROJECT_PLAYER.
2464 * (used for minimum (rad == 0) balls on riding player)
2465 * REFLECTABLE: Refrectable spell attacks (used for "bolts")
2466 * NO_HANGEKI: Avoid counter attacks of monsters
2467 * PATH: Only used for printing project path
2468 * FAST: Hide "visual" of flying bolts until blast
2470 #define PROJECT_JUMP 0x01
2471 #define PROJECT_BEAM 0x02
2472 #define PROJECT_THRU 0x04
2473 #define PROJECT_STOP 0x08
2474 #define PROJECT_GRID 0x10
2475 #define PROJECT_ITEM 0x20
2476 #define PROJECT_KILL 0x40
2477 #define PROJECT_HIDE 0x80
2478 #define PROJECT_DISI 0x100
2479 #define PROJECT_PLAYER 0x200
2480 #define PROJECT_AIMED 0x400
2481 #define PROJECT_REFLECTABLE 0x800
2482 #define PROJECT_NO_HANGEKI 0x1000
2483 #define PROJECT_PATH 0x2000
2484 #define PROJECT_FAST 0x4000
2487 * Bit flags for the "enchant()" function
2489 #define ENCH_TOHIT 0x01 /* Enchant to hit */
2490 #define ENCH_TODAM 0x02 /* Enchant to damage */
2491 #define ENCH_TOAC 0x04 /* Enchant to AC */
2492 #define ENCH_FORCE 0x08 /* Force enchantment */
2495 * Bit flags for the "target_set" function XXX XXX XXX
2497 * KILL: Target monsters
2498 * LOOK: Describe grid fully
2499 * XTRA: Currently unused flag
2500 * GRID: Select from all grids
2502 #define TARGET_KILL 0x01
2503 #define TARGET_LOOK 0x02
2504 #define TARGET_XTRA 0x04
2505 #define TARGET_GRID 0x08
2509 * Bit flags for control of get_check_strict()
2511 #define CHECK_OKAY_CANCEL 0x01
2512 #define CHECK_NO_ESCAPE 0x02
2513 #define CHECK_NO_HISTORY 0x04
2514 #define CHECK_DEFAULT_Y 0x08
2518 * Some bit-flags for the "smart" field
2520 #define SM_RES_ACID 0x00000001
2521 #define SM_RES_ELEC 0x00000002
2522 #define SM_RES_FIRE 0x00000004
2523 #define SM_RES_COLD 0x00000008
2524 #define SM_RES_POIS 0x00000010
2525 #define SM_RES_NETH 0x00000020
2526 #define SM_RES_LITE 0x00000040
2527 #define SM_RES_DARK 0x00000080
2528 #define SM_RES_FEAR 0x00000100
2529 #define SM_RES_CONF 0x00000200
2530 #define SM_RES_CHAOS 0x00000400
2531 #define SM_RES_DISEN 0x00000800
2532 #define SM_RES_BLIND 0x00001000
2533 #define SM_RES_NEXUS 0x00002000
2534 #define SM_RES_SOUND 0x00004000
2535 #define SM_RES_SHARD 0x00008000
2536 #define SM_OPP_ACID 0x00010000
2537 #define SM_OPP_ELEC 0x00020000
2538 #define SM_OPP_FIRE 0x00040000
2539 #define SM_OPP_COLD 0x00080000
2540 #define SM_OPP_POIS 0x00100000
2541 #define SM_OPP_XXX1 0x00200000 /* (unused) */
2542 #define SM_CLONED 0x00400000 /* XXX Cloned */
2543 #define SM_PET 0x00800000 /* XXX Pet */
2544 #define SM_IMM_ACID 0x01000000
2545 #define SM_IMM_ELEC 0x02000000
2546 #define SM_IMM_FIRE 0x04000000
2547 #define SM_IMM_COLD 0x08000000
2548 #define SM_FRIENDLY 0x10000000 /* XXX Friendly */
2549 #define SM_IMM_REFLECT 0x20000000
2550 #define SM_IMM_FREE 0x40000000
2551 #define SM_IMM_MANA 0x80000000
2555 * Bit flags for the "get_item" function
2557 #define USE_EQUIP 0x01 /* Allow equip items */
2558 #define USE_INVEN 0x02 /* Allow inven items */
2559 #define USE_FLOOR 0x04 /* Allow floor items */
2563 * Bit flags for the "p_ptr->notice" variable
2565 #define PN_COMBINE 0x00000001L /* Combine the pack */
2566 #define PN_REORDER 0x00000002L /* Reorder the pack */
2567 #define PN_AUTODESTROY 0x00000004L /* Auto-destroy marked item */
2572 * Bit flags for the "p_ptr->update" variable
2574 #define PU_BONUS 0x00000001L /* Calculate bonuses */
2575 #define PU_TORCH 0x00000002L /* Calculate torch radius */
2577 #define PU_HP 0x00000010L /* Calculate chp and mhp */
2578 #define PU_MANA 0x00000020L /* Calculate csp and msp */
2579 #define PU_SPELLS 0x00000040L /* Calculate spells */
2582 #define PU_UN_VIEW 0x00010000L /* Forget view */
2583 #define PU_UN_LITE 0x00020000L /* Forget lite */
2585 #define PU_VIEW 0x00100000L /* Update view */
2586 #define PU_LITE 0x00200000L /* Update lite */
2587 #define PU_MON_LITE 0x00400000L /* Monster illumination */
2588 #define PU_DELAY_VIS 0x00800000L /* Mega-Hack -- Delayed visual update */
2589 #define PU_MONSTERS 0x01000000L /* Update monsters */
2590 #define PU_DISTANCE 0x02000000L /* Update distances */
2592 #define PU_FLOW 0x10000000L /* Update flow */
2597 * Bit flags for the "p_ptr->redraw" variable
2599 #define PR_MISC 0x00000001L /* Display Race/Class */
2600 #define PR_TITLE 0x00000002L /* Display Title */
2601 #define PR_LEV 0x00000004L /* Display Level */
2602 #define PR_EXP 0x00000008L /* Display Experience */
2603 #define PR_STATS 0x00000010L /* Display Stats */
2604 #define PR_ARMOR 0x00000020L /* Display Armor */
2605 #define PR_HP 0x00000040L /* Display Hitpoints */
2606 #define PR_MANA 0x00000080L /* Display Mana */
2607 #define PR_GOLD 0x00000100L /* Display Gold */
2608 #define PR_DEPTH 0x00000200L /* Display Depth */
2609 #define PR_EQUIPPY 0x00000400L /* Display equippy chars */
2610 #define PR_HEALTH 0x00000800L /* Display Health Bar */
2611 #define PR_CUT 0x00001000L /* Display Extra (Cut) */
2612 #define PR_STUN 0x00002000L /* Display Extra (Stun) */
2613 #define PR_HUNGER 0x00004000L /* Display Extra (Hunger) */
2614 #define PR_STATUS 0x00008000L /* Display Status Bar */
2615 #define PR_XXX0 0x00010000L /* (unused) */
2616 #define PR_UHEALTH 0x00020000L /* Display Uma Health Bar */
2617 #define PR_XXX1 0x00040000L /* (unused) */
2618 #define PR_XXX2 0x00080000L /* (unused) */
2619 #define PR_STATE 0x00100000L /* Display Extra (State) */
2620 #define PR_SPEED 0x00200000L /* Display Extra (Speed) */
2621 #define PR_STUDY 0x00400000L /* Display Extra (Study) */
2622 #define PR_MANE 0x00800000L /* Display Extra (Mane) */
2623 #define PR_EXTRA 0x01000000L /* Display Extra Info */
2624 #define PR_BASIC 0x02000000L /* Display Basic Info */
2625 #define PR_MAP 0x04000000L /* Display Map */
2626 #define PR_WIPE 0x08000000L /* Hack -- Total Redraw */
2633 * Bit flags for the "p_ptr->window" variable (etc)
2635 #define PW_INVEN 0x00000001L /* Display inven/equip */
2636 #define PW_EQUIP 0x00000002L /* Display equip/inven */
2637 #define PW_SPELL 0x00000004L /* Display spell list */
2638 #define PW_PLAYER 0x00000008L /* Display character */
2641 #define PW_MESSAGE 0x00000040L /* Display messages */
2642 #define PW_OVERHEAD 0x00000080L /* Display overhead view */
2643 #define PW_MONSTER 0x00000100L /* Display monster recall */
2644 #define PW_OBJECT 0x00000200L /* Display object recall */
2645 #define PW_DUNGEON 0x00000400L /* Display dungeon view */
2646 #define PW_SNAPSHOT 0x00000800L /* Display snap-shot */
2649 #define PW_BORG_1 0x00004000L /* Display borg messages */
2650 #define PW_BORG_2 0x00008000L /* Display borg status */
2653 * Bit flags for the place_monster_???() (etc)
2655 #define PM_ALLOW_SLEEP 0x00000001
2656 #define PM_ALLOW_GROUP 0x00000002
2657 #define PM_FORCE_FRIENDLY 0x00000004
2658 #define PM_FORCE_PET 0x00000008
2659 #define PM_NO_KAGE 0x00000010
2660 #define PM_NO_PET 0x00000020
2661 #define PM_ALLOW_UNIQUE 0x00000040
2662 #define PM_IGNORE_TERRAIN 0x00000080
2663 #define PM_HASTE 0x00000100
2664 #define PM_KAGE 0x00000200
2667 /* Bit flags for monster_desc() */
2668 #define MD_OBJECTIVE 0x00000001 /* Objective (or Reflexive) */
2669 #define MD_POSSESSIVE 0x00000002 /* Possessive (or Reflexive) */
2670 #define MD_INDEF_HIDDEN 0x00000004 /* Use indefinites for hidden monsters ("something") */
2671 #define MD_INDEF_VISIBLE 0x00000008 /* Use indefinites for visible monsters ("a kobold") */
2672 #define MD_PRON_HIDDEN 0x00000010 /* Pronominalize hidden monsters */
2673 #define MD_PRON_VISIBLE 0x00000020 /* Pronominalize visible monsters */
2674 #define MD_ASSUME_HIDDEN 0x00000040 /* Assume the monster is hidden */
2675 #define MD_ASSUME_VISIBLE 0x00000080 /* Assume the monster is visible */
2676 #define MD_TRUE_NAME 0x00000100 /* Chameleon's true name */
2677 #define MD_IGNORE_HALLU 0x00000200 /* Ignore hallucination, and penetrate shape change */
2680 * Bit flags for the "p_ptr->special_attack" variable. -LM-
2682 * Note: The elemental and poison attacks should be managed using the
2683 * function "set_ele_attack", in spell2.c. This provides for timeouts and
2684 * prevents the player from getting more than one at a time.
2686 #define ATTACK_CONFUSE 0x00000001
2687 #define ATTACK_XXX1 0x00000002
2688 #define ATTACK_XXX2 0x00000004
2689 #define ATTACK_XXX3 0x00000008
2690 #define ATTACK_ACID 0x00000010
2691 #define ATTACK_ELEC 0x00000020
2692 #define ATTACK_FIRE 0x00000040
2693 #define ATTACK_COLD 0x00000080
2694 #define ATTACK_POIS 0x00000100
2695 #define ATTACK_HOLY 0x00000200
2696 #define ATTACK_SUIKEN 0x00000400
2699 #define DEFENSE_ACID 0x00000001
2700 #define DEFENSE_ELEC 0x00000002
2701 #define DEFENSE_FIRE 0x00000004
2702 #define DEFENSE_COLD 0x00000008
2703 #define DEFENSE_POIS 0x00000010
2704 #define KAMAE_GENBU 0x00000020
2705 #define KAMAE_BYAKKO 0x00000040
2706 #define KAMAE_SEIRYU 0x00000080
2707 #define KAMAE_SUZAKU 0x00000100
2708 #define KATA_IAI 0x00000200
2709 #define KATA_FUUJIN 0x00000400
2710 #define KATA_KOUKIJIN 0x00000800
2711 #define KATA_MUSOU 0x00001000
2712 #define NINJA_KAWARIMI 0x00002000
2713 #define NINJA_S_STEALTH 0x00004000
2716 #define KAMAE_MASK (KAMAE_GENBU | KAMAE_BYAKKO | KAMAE_SEIRYU | KAMAE_SUZAKU)
2719 #define KATA_MASK (KATA_IAI | KATA_FUUJIN | KATA_KOUKIJIN | KATA_MUSOU)
2722 #define ACTION_NONE 0
2723 #define ACTION_SEARCH 1
2724 #define ACTION_REST 2
2725 #define ACTION_LEARN 3
2726 #define ACTION_FISH 4
2727 #define ACTION_KAMAE 5
2728 #define ACTION_KATA 6
2729 #define ACTION_SING 7
2730 #define ACTION_HAYAGAKE 8
2733 /* Empty hand status */
2734 #define EMPTY_HAND_NONE 0x0000 /* Both hands are used */
2735 #define EMPTY_HAND_LARM 0x0001 /* Left hand is empty */
2736 #define EMPTY_HAND_RARM 0x0002 /* Right hand is empty */
2738 /*** General index values ***/
2742 * Legal restrictions for "summon_specific()"
2744 #define SUMMON_ANT 11
2745 #define SUMMON_SPIDER 12
2746 #define SUMMON_HOUND 13
2747 #define SUMMON_HYDRA 14
2748 #define SUMMON_ANGEL 15
2749 #define SUMMON_DEMON 16
2750 #define SUMMON_UNDEAD 17
2751 #define SUMMON_DRAGON 18
2752 #define SUMMON_HI_UNDEAD 21
2753 #define SUMMON_HI_DRAGON 22
2754 #define SUMMON_HI_DEMON 23
2755 #define SUMMON_AMBERITES 31
2756 #define SUMMON_UNIQUE 32
2757 #define SUMMON_BIZARRE1 33
2758 #define SUMMON_BIZARRE2 34
2759 #define SUMMON_BIZARRE3 35
2760 #define SUMMON_BIZARRE4 36
2761 #define SUMMON_BIZARRE5 37
2762 #define SUMMON_BIZARRE6 38
2763 #define SUMMON_CYBER 39
2764 #define SUMMON_KIN 40
2765 #define SUMMON_DAWN 41
2766 #define SUMMON_ANIMAL 42
2767 #define SUMMON_ANIMAL_RANGER 43
2768 /*#define SUMMON_HI_UNDEAD_NO_UNIQUES 44*/
2769 /*#define SUMMON_HI_DRAGON_NO_UNIQUES 45*/
2770 /*#define SUMMON_NO_UNIQUES 46*/
2771 #define SUMMON_PHANTOM 47
2772 /*#define SUMMON_ELEMENTAL_NO_UNIQUES 48*/
2773 #define SUMMON_BLUE_HORROR 49
2774 #define SUMMON_LIVING 50
2775 #define SUMMON_HI_DRAGON_LIVING 51
2776 #define SUMMON_GOLEM 52
2777 #define SUMMON_ELEMENTAL 53
2778 #define SUMMON_VORTEX 54
2779 #define SUMMON_HYBRID 55
2780 #define SUMMON_BIRD 56
2781 /*#define SUMMON_AQUATIC_NO_UNIQUES 57*/
2782 #define SUMMON_KAMIKAZE 58
2783 #define SUMMON_KAMIKAZE_LIVING 59
2784 #define SUMMON_MANES 60
2785 #define SUMMON_LOUSE 61
2786 #define SUMMON_GUARDIANS 62
2787 #define SUMMON_KNIGHTS 63
2788 #define SUMMON_EAGLES 64
2789 #define SUMMON_PIRANHAS 65
2790 #define SUMMON_ARMAGE_GOOD 66
2791 #define SUMMON_ARMAGE_EVIL 67
2795 * Spell types used by project(), and related functions.
2802 #define GF_PSY_SPEAR 9
2803 #define GF_MISSILE 10
2805 #define GF_PLASMA 12
2806 /* Replaced with GF_HOLY_FIRE and GF_HELL_FIRE */
2807 /* #define GF_HOLY_ORB 13 */
2811 #define GF_LITE_WEAK 17
2812 #define GF_DARK_WEAK 18
2813 #define GF_SHARDS 20
2815 #define GF_CONFUSION 22
2817 #define GF_INERTIA 24
2819 #define GF_METEOR 27
2822 #define GF_NETHER 31
2823 #define GF_DISENCHANT 32
2826 #define GF_GRAVITY 35
2827 #define GF_KILL_WALL 40
2828 #define GF_KILL_DOOR 41
2829 #define GF_KILL_TRAP 42
2830 #define GF_MAKE_WALL 45
2831 #define GF_MAKE_DOOR 46
2832 #define GF_MAKE_TRAP 47
2833 #define GF_MAKE_TREE 48
2834 #define GF_OLD_CLONE 51
2835 #define GF_OLD_POLY 52
2836 #define GF_OLD_HEAL 53
2837 #define GF_OLD_SPEED 54
2838 #define GF_OLD_SLOW 55
2839 #define GF_OLD_CONF 56
2840 #define GF_OLD_SLEEP 57
2841 #define GF_OLD_DRAIN 58
2842 #define GF_AWAY_UNDEAD 61
2843 #define GF_AWAY_EVIL 62
2844 #define GF_AWAY_ALL 63
2845 #define GF_TURN_UNDEAD 64
2846 #define GF_TURN_EVIL 65
2847 #define GF_TURN_ALL 66
2848 #define GF_DISP_UNDEAD 67
2849 #define GF_DISP_EVIL 68
2850 #define GF_DISP_ALL 69
2851 #define GF_DISP_DEMON 70 /* New types for Zangband begin here... */
2852 #define GF_DISP_LIVING 71
2853 #define GF_ROCKET 72
2855 #define GF_MAKE_GLYPH 74
2856 #define GF_STASIS 75
2857 #define GF_STONE_WALL 76
2858 #define GF_DEATH_RAY 77
2860 #define GF_HOLY_FIRE 79
2861 #define GF_HELL_FIRE 80
2862 #define GF_DISINTEGRATE 81
2864 #define GF_CONTROL_UNDEAD 83
2865 #define GF_CONTROL_ANIMAL 84
2867 #define GF_PSI_DRAIN 86
2868 #define GF_TELEKINESIS 87
2869 #define GF_JAM_DOOR 88
2870 #define GF_DOMINATION 89
2871 #define GF_DISP_GOOD 90
2872 #define GF_DRAIN_MANA 91
2873 #define GF_MIND_BLAST 92
2874 #define GF_BRAIN_SMASH 93
2875 #define GF_CAUSE_1 94
2876 #define GF_CAUSE_2 95
2877 #define GF_CAUSE_3 96
2878 #define GF_CAUSE_4 97
2879 #define GF_HAND_DOOM 98
2880 #define GF_CAPTURE 99
2881 #define GF_ANIM_DEAD 100
2882 #define GF_CONTROL_LIVING 101
2883 #define GF_IDENTIFY 102
2884 #define GF_ATTACK 103
2885 #define GF_ENGETSU 104
2886 #define GF_GENOCIDE 105
2887 #define GF_PHOTO 106
2888 #define GF_CONTROL_DEMON 107
2889 #define GF_LAVA_FLOW 108
2890 #define GF_BLOOD_CURSE 109
2891 #define GF_SEEKER 110
2892 #define GF_SUPER_RAY 111
2893 #define GF_STAR_HEAL 112
2894 #define GF_WATER_FLOW 113
2895 #define GF_CRUSADE 114
2896 #define GF_STASIS_EVIL 115
2897 #define GF_WOUNDS 116
2902 * Some things which induce learning
2914 #define DRS_CHAOS 11
2915 #define DRS_DISEN 12
2916 #define DRS_BLIND 13
2917 #define DRS_NEXUS 14
2918 #define DRS_SOUND 15
2919 #define DRS_SHARD 16
2922 #define DRS_REFLECT 32
2926 #define DAMAGE_FORCE 1
2927 #define DAMAGE_GENO 2
2928 #define DAMAGE_LOSELIFE 3
2929 #define DAMAGE_ATTACK 4
2930 #define DAMAGE_NOESCAPE 5
2931 #define DAMAGE_USELIFE 6
2935 * Game generated inscription indices. These are stored in the object,
2936 * and are used to index the string array from tables.c.
2940 #define FEEL_BROKEN 1
2941 #define FEEL_TERRIBLE 2
2942 #define FEEL_WORTHLESS 3
2943 #define FEEL_CURSED 4
2944 #define FEEL_UNCURSED 5
2945 #define FEEL_AVERAGE 6
2947 #define FEEL_EXCELLENT 8
2948 #define FEEL_SPECIAL 9
2953 * Hack -- special "xtra" object powers
2956 /* Sustain one stat */
2957 #define EGO_XTRA_SUSTAIN 1
2960 #define EGO_XTRA_POWER 2
2962 /* Special ability */
2963 #define EGO_XTRA_ABILITY 3
2965 /*** Object flag values ***/
2969 * Chest trap flags (see "tables.c")
2971 #define CHEST_LOSE_STR 0x0001
2972 #define CHEST_LOSE_CON 0x0002
2973 #define CHEST_POISON 0x0004
2974 #define CHEST_PARALYZE 0x0008
2975 #define CHEST_EXPLODE 0x0010
2976 #define CHEST_SUMMON 0x0020
2977 #define CHEST_SCATTER 0x0040
2978 #define CHEST_E_SUMMON 0x0080
2979 #define CHEST_BIRD_STORM 0x0100
2980 #define CHEST_H_SUMMON 0x0200
2981 #define CHEST_RUNES_OF_EVIL 0x0400
2982 #define CHEST_ALARM 0x0800
2986 * Special Object Flags
2988 #define IDENT_SENSE 0x01 /* Item has been "sensed" */
2989 #define IDENT_FIXED 0x02 /* Item has been "haggled" */
2990 #define IDENT_EMPTY 0x04 /* Item charges are known */
2991 #define IDENT_KNOWN 0x08 /* Item abilities are known */
2992 #define IDENT_STOREB 0x10 /* Item is storebought !!!! */
2993 #define IDENT_MENTAL 0x20 /* Item information is known */
2995 #define IDENT_CURSED 0x40 /* Item is temporarily cursed */
2997 #define IDENT_BROKEN 0x80 /* Item is permanently worthless */
3001 * How object is marked (flags in object_type.mark)
3002 * OM_FOUND --- original boolean flag
3003 * OM_NOMSG --- temporary flag to suppress messages which were
3004 * already printed in auto_pickup_items().
3006 #define OM_FOUND 0x01 /* original boolean flag */
3007 #define OM_NOMSG 0x02 /* temporary flag to suppress messages */
3008 #define OM_NO_QUERY 0x04 /* Query for auto-pick was already answered as 'No' */
3009 #define OM_AUTODESTROY 0x08 /* Destroy later to avoid illegal inventry shift */
3013 * Special Monster Flags (all temporary)
3015 #define MFLAG_VIEW 0x01 /* Monster is in line of sight */
3016 #define MFLAG_TEMP 0x02 /* Monster is marked for project_hack() */
3017 #define MFLAG_XXX2 0x04 /* (unused) */
3018 #define MFLAG_XXX3 0x08 /* (unused) */
3019 #define MFLAG_BORN 0x10 /* Monster is still being born */
3020 #define MFLAG_NICE 0x20 /* Monster is still being nice */
3022 #define MFLAG2_KAGE 0x01 /* Monster is kage */
3023 #define MFLAG2_NOPET 0x02 /* Cannot make monster pet */
3024 #define MFLAG2_NOGENO 0x04 /* Cannot genocide */
3025 #define MFLAG2_CHAMELEON 0x08 /* Monster is chameleon */
3026 #define MFLAG2_NOFLOW 0x10 /* Monster is in no_flow_by_smell mode */
3027 #define MFLAG2_SHOW 0x20 /* Monster is recently memorized */
3028 #define MFLAG2_MARK 0x40 /* Monster is currently memorized */
3034 * Old variables for object flags such as flags1, flags2, and flags3
3035 * are obsolated. Now single array flgs[TR_FLAG_SIZE] contains all
3036 * object flags. And each flag is refered by single index number
3037 * instead of a bit mask.
3039 * Therefore it's very easy to add a lot of new flags; no one need to
3040 * worry about in which variable a new flag should be put, nor to
3041 * modify a huge number of files all over the source directory at once
3042 * to add new flag variables such as flags4, flags5, etc...
3044 * All management of flags is now treated using a set of macros
3045 * instead of bit operations.
3046 * Note: These macros are using division, modulo, and bit shift
3047 * operations, and it seems that these operations are rather slower
3048 * than original bit operation. But since index numbers are almost
3049 * always given as constant, such slow operations are performed in the
3050 * compile time. So there is no problem on the speed.
3052 * Exceptions of new flag management is a set of flags to control
3053 * object generation and the curse flags. These are not yet rewritten
3054 * in new index form; maybe these have no merit of rewriting.
3057 #define have_flag(ARRAY, INDEX) !!((ARRAY)[(INDEX)/32] & (1L << ((INDEX)%32)))
3058 #define add_flag(ARRAY, INDEX) ((ARRAY)[(INDEX)/32] |= (1L << ((INDEX)%32)))
3059 #define remove_flag(ARRAY, INDEX) ((ARRAY)[(INDEX)/32] &= ~(1L << ((INDEX)%32)))
3060 #define is_pval_flag(INDEX) ((TR_STR <= (INDEX) && (INDEX) <= TR_MAGIC_MASTERY) || (TR_STEALTH <= (INDEX) && (INDEX) <= TR_BLOWS))
3061 #define have_pval_flags(ARRAY) !!((ARRAY)[0] & (0x00003f7f))
3064 #define TR_STR 0 /* STR += "pval" */
3065 #define TR_INT 1 /* INT += "pval" */
3066 #define TR_WIS 2 /* WIS += "pval" */
3067 #define TR_DEX 3 /* DEX += "pval" */
3068 #define TR_CON 4 /* CON += "pval" */
3069 #define TR_CHR 5 /* CHR += "pval" */
3070 #define TR_MAGIC_MASTERY 6 /* Later */
3071 #define TR_FORCE_WEAPON 7 /* Later */
3072 #define TR_STEALTH 8 /* Stealth += "pval" */
3073 #define TR_SEARCH 9 /* Search += "pval" */
3074 #define TR_INFRA 10 /* Infra += "pval" */
3075 #define TR_TUNNEL 11 /* Tunnel += "pval" */
3076 #define TR_SPEED 12 /* Speed += "pval" */
3077 #define TR_BLOWS 13 /* Blows += "pval" */
3078 #define TR_CHAOTIC 14
3079 #define TR_VAMPIRIC 15
3080 #define TR_SLAY_ANIMAL 16
3081 #define TR_SLAY_EVIL 17
3082 #define TR_SLAY_UNDEAD 18
3083 #define TR_SLAY_DEMON 19
3084 #define TR_SLAY_ORC 20
3085 #define TR_SLAY_TROLL 21
3086 #define TR_SLAY_GIANT 22
3087 #define TR_SLAY_DRAGON 23
3088 #define TR_KILL_DRAGON 24 /* Execute Dragon */
3089 #define TR_VORPAL 25 /* Later */
3090 #define TR_IMPACT 26 /* Cause Earthquakes */
3091 #define TR_BRAND_POIS 27
3092 #define TR_BRAND_ACID 28
3093 #define TR_BRAND_ELEC 29
3094 #define TR_BRAND_FIRE 30
3095 #define TR_BRAND_COLD 31
3097 #define TR_SUST_STR 32
3098 #define TR_SUST_INT 33
3099 #define TR_SUST_WIS 34
3100 #define TR_SUST_DEX 35
3101 #define TR_SUST_CON 36
3102 #define TR_SUST_CHR 37
3103 #define TR_RIDING 38
3104 #define TR_EASY_SPELL 39
3105 #define TR_IM_ACID 40
3106 #define TR_IM_ELEC 41
3107 #define TR_IM_FIRE 42
3108 #define TR_IM_COLD 43
3109 #define TR_THROW 44 /* Later */
3110 #define TR_REFLECT 45 /* Reflect 'bolts' */
3111 #define TR_FREE_ACT 46 /* Free Action */
3112 #define TR_HOLD_LIFE 47 /* Hold Life */
3113 #define TR_RES_ACID 48
3114 #define TR_RES_ELEC 49
3115 #define TR_RES_FIRE 50
3116 #define TR_RES_COLD 51
3117 #define TR_RES_POIS 52
3118 #define TR_RES_FEAR 53 /* Added for Zangband */
3119 #define TR_RES_LITE 54
3120 #define TR_RES_DARK 55
3121 #define TR_RES_BLIND 56
3122 #define TR_RES_CONF 57
3123 #define TR_RES_SOUND 58
3124 #define TR_RES_SHARDS 59
3125 #define TR_RES_NETHER 60
3126 #define TR_RES_NEXUS 61
3127 #define TR_RES_CHAOS 62
3128 #define TR_RES_DISEN 63
3130 #define TR_SH_FIRE 64 /* Immolation (Fire) */
3131 #define TR_SH_ELEC 65 /* Electric Sheath */
3132 #define TR_SLAY_HUMAN 66 /* Slay human */
3133 #define TR_SH_COLD 67 /* cold aura */
3134 #define TR_NO_TELE 68 /* Anti-teleportation */
3135 #define TR_NO_MAGIC 69 /* Anti-magic */
3136 #define TR_DEC_MANA 70 /* ??? */
3137 #define TR_TY_CURSE 71 /* The Ancient Curse */
3138 #define TR_WARNING 72 /* Warning */
3139 #define TR_HIDE_TYPE 73 /* Hide "pval" description */
3140 #define TR_SHOW_MODS 74 /* Always show Tohit/Todam */
3141 #define TR_XXX1 75 /* XXX1 */
3142 #define TR_FEATHER 76 /* Feather Falling */
3143 #define TR_LITE 77 /* Permanent Light */
3144 #define TR_SEE_INVIS 78 /* See Invisible */
3145 #define TR_TELEPATHY 79 /* Telepathy */
3146 #define TR_SLOW_DIGEST 80 /* Item slows down digestion */
3147 #define TR_REGEN 81 /* Item induces regeneration */
3148 #define TR_XTRA_MIGHT 82 /* Bows get extra multiplier */
3149 #define TR_XTRA_SHOTS 83 /* Bows get extra shots */
3150 #define TR_IGNORE_ACID 84 /* Item ignores Acid Damage */
3151 #define TR_IGNORE_ELEC 85 /* Item ignores Elec Damage */
3152 #define TR_IGNORE_FIRE 86 /* Item ignores Fire Damage */
3153 #define TR_IGNORE_COLD 87 /* Item ignores Cold Damage */
3154 #define TR_ACTIVATE 88 /* Item can be activated */
3155 #define TR_DRAIN_EXP 89 /* Item drains Experience */
3156 #define TR_TELEPORT 90 /* Item teleports player */
3157 #define TR_AGGRAVATE 91 /* Item aggravates monsters */
3158 #define TR_BLESSED 92 /* Item is Blessed */
3159 #define TR_ES_ATTACK 93 /* Fake flag for Smith */
3160 #define TR_ES_AC 94 /* Fake flag for Smith */
3163 #define TR_KILL_ANIMAL 96
3164 #define TR_KILL_EVIL 97
3165 #define TR_KILL_UNDEAD 98
3166 #define TR_KILL_DEMON 99
3167 #define TR_KILL_ORC 100
3168 #define TR_KILL_TROLL 101
3169 #define TR_KILL_GIANT 102
3170 #define TR_KILL_HUMAN 103
3171 #define TR_ESP_ANIMAL 104
3172 #define TR_ESP_UNDEAD 105
3173 #define TR_ESP_DEMON 106
3174 #define TR_ESP_ORC 107
3175 #define TR_ESP_TROLL 108
3176 #define TR_ESP_GIANT 109
3177 #define TR_ESP_DRAGON 110
3178 #define TR_ESP_HUMAN 111
3179 #define TR_ESP_EVIL 112
3180 #define TR_ESP_GOOD 113
3181 #define TR_ESP_NONLIVING 114
3182 #define TR_ESP_UNIQUE 115
3183 #define TR_FULL_NAME 116
3185 #define TR_FLAG_MAX 117
3186 #define TR_FLAG_SIZE 4
3189 #define TRG_INSTA_ART 0x00000001L /* Item must be an artifact */
3190 #define TRG_QUESTITEM 0x00000002L /* quest level item -KMW- */
3191 #define TRG_XTRA_POWER 0x00000004L /* Extra power */
3192 #define TRG_ONE_SUSTAIN 0x00000008L /* One sustain */
3193 #define TRG_XTRA_RES_OR_POWER 0x00000010L /* Extra resistance or power */
3194 #define TRG_XTRA_H_RES 0x00000020L /* Extra high resistance */
3195 #define TRG_XTRA_E_RES 0x00000040L /* Extra element resistance */
3196 #define TRG_XTRA_L_RES 0x00000080L /* Extra lordly resistance */
3197 #define TRG_XTRA_D_RES 0x00000100L /* Extra dragon resistance */
3198 #define TRG_XTRA_RES 0x00000200L /* Extra resistance */
3199 #define TRG_CURSED 0x00000400L /* Item is Cursed */
3200 #define TRG_HEAVY_CURSE 0x00000800L /* Item is Heavily Cursed */
3201 #define TRG_PERMA_CURSE 0x00001000L /* Item is Perma Cursed */
3202 #define TRG_RANDOM_CURSE0 0x00002000L /* Item is Random Cursed */
3203 #define TRG_RANDOM_CURSE1 0x00004000L /* Item is Random Cursed */
3204 #define TRG_RANDOM_CURSE2 0x00008000L /* Item is Random Cursed */
3207 #define MAX_CURSE 17
3209 #define TRC_CURSED 0x00000001L
3210 #define TRC_HEAVY_CURSE 0x00000002L
3211 #define TRC_PERMA_CURSE 0x00000004L
3212 #define TRC_XXX1 0x00000008L
3213 #define TRC_TY_CURSE 0x00000010L
3214 #define TRC_AGGRAVATE 0x00000020L
3215 #define TRC_DRAIN_EXP 0x00000040L
3216 #define TRC_SLOW_REGEN 0x00000080L
3217 #define TRC_ADD_L_CURSE 0x00000100L
3218 #define TRC_ADD_H_CURSE 0x00000200L
3219 #define TRC_CALL_ANIMAL 0x00000400L
3220 #define TRC_CALL_DEMON 0x00000800L
3221 #define TRC_CALL_DRAGON 0x00001000L
3222 #define TRC_COWARDICE 0x00002000L
3223 #define TRC_TELEPORT 0x00004000L
3224 #define TRC_LOW_MELEE 0x00008000L
3225 #define TRC_LOW_AC 0x00010000L
3226 #define TRC_LOW_MAGIC 0x00020000L
3227 #define TRC_FAST_DIGEST 0x00040000L
3228 #define TRC_DRAIN_HP 0x00080000L
3229 #define TRC_DRAIN_MANA 0x00100000L
3231 #define TRC_TELEPORT_SELF 0x00000001L
3232 #define TRC_CHAINSWORD 0x00000002L
3234 #define TRC_SPECIAL_MASK \
3235 (TRC_TY_CURSE | TRC_AGGRAVATE)
3237 #define TRC_HEAVY_MASK \
3238 (TRC_TY_CURSE | TRC_AGGRAVATE | TRC_DRAIN_EXP | TRC_ADD_H_CURSE | \
3239 TRC_CALL_DEMON | TRC_CALL_DRAGON | TRC_TELEPORT)
3241 #define TRC_P_FLAG_MASK \
3242 (TRC_TELEPORT_SELF | TRC_CHAINSWORD | \
3243 TRC_TY_CURSE | TRC_DRAIN_EXP | TRC_ADD_L_CURSE | TRC_ADD_H_CURSE | \
3244 TRC_CALL_ANIMAL | TRC_CALL_DEMON | TRC_CALL_DRAGON | TRC_COWARDICE | \
3245 TRC_TELEPORT | TRC_DRAIN_HP | TRC_DRAIN_MANA)
3250 * Bit flags for apply_magic() (etc)
3252 #define AM_NO_FIXED_ART 0x00000001 /* Don't allow roll for fixed artifacts */
3253 #define AM_GOOD 0x00000002 /* Generate good items */
3254 #define AM_GREAT 0x00000004 /* Generate great items */
3255 #define AM_SPECIAL 0x00000008 /* Generate artifacts (for debug mode only) */
3256 #define AM_CURSED 0x00000010 /* Generate cursed/worthless items */
3259 /*** Monster blow constants ***/
3263 * New monster blow methods
3274 #define RBM_CRUSH 10
3275 #define RBM_ENGULF 11
3276 #define RBM_CHARGE 12
3277 #define RBM_CRAWL 13
3278 #define RBM_DROOL 14
3280 #define RBM_EXPLODE 16
3283 #define RBM_SPORE 19
3286 #define RBM_INSULT 22
3289 #define RBM_SHOOT 25
3293 * New monster blow effects
3296 #define RBE_POISON 2
3297 #define RBE_UN_BONUS 3
3298 #define RBE_UN_POWER 4
3299 #define RBE_EAT_GOLD 5
3300 #define RBE_EAT_ITEM 6
3301 #define RBE_EAT_FOOD 7
3302 #define RBE_EAT_LITE 8
3307 #define RBE_BLIND 13
3308 #define RBE_CONFUSE 14
3309 #define RBE_TERRIFY 15
3310 #define RBE_PARALYZE 16
3311 #define RBE_LOSE_STR 17
3312 #define RBE_LOSE_INT 18
3313 #define RBE_LOSE_WIS 19
3314 #define RBE_LOSE_DEX 20
3315 #define RBE_LOSE_CON 21
3316 #define RBE_LOSE_CHR 22
3317 #define RBE_LOSE_ALL 23
3318 #define RBE_SHATTER 24
3319 #define RBE_EXP_10 25
3320 #define RBE_EXP_20 26
3321 #define RBE_EXP_40 27
3322 #define RBE_EXP_80 28
3323 #define RBE_DISEASE 29
3325 #define RBE_EXP_VAMP 31
3326 #define RBE_DR_MANA 32
3327 #define RBE_SUPERHURT 33
3330 /*** Monster flag values (hard-coded) ***/
3334 * New monster race bit flags
3336 #define RF1_UNIQUE 0x00000001 /* Unique Monster */
3337 #define RF1_QUESTOR 0x00000002 /* Quest Monster */
3338 #define RF1_MALE 0x00000004 /* Male gender */
3339 #define RF1_FEMALE 0x00000008 /* Female gender */
3340 #define RF1_CHAR_CLEAR 0x00000010 /* Absorbs symbol */
3341 #define RF1_SHAPECHANGER 0x00000020 /* TY: shapechanger */
3342 #define RF1_ATTR_CLEAR 0x00000040 /* Absorbs color */
3343 #define RF1_ATTR_MULTI 0x00000080 /* Changes color */
3344 #define RF1_FORCE_DEPTH 0x00000100 /* Start at "correct" depth */
3345 #define RF1_FORCE_MAXHP 0x00000200 /* Start with max hitpoints */
3346 #define RF1_FORCE_SLEEP 0x00000400 /* Start out sleeping */
3347 #define RF1_FORCE_EXTRA 0x00000800 /* Start out something */
3348 #define RF1_ATTR_SEMIRAND 0x00001000 /* Color is determined semi-randomly */
3349 #define RF1_FRIENDS 0x00002000 /* Arrive with some friends */
3350 #define RF1_ESCORT 0x00004000 /* Arrive with an escort */
3351 #define RF1_ESCORTS 0x00008000 /* Arrive with some escorts */
3352 #define RF1_NEVER_BLOW 0x00010000 /* Never make physical blow */
3353 #define RF1_NEVER_MOVE 0x00020000 /* Never make physical move */
3354 #define RF1_RAND_25 0x00040000 /* Moves randomly (25%) */
3355 #define RF1_RAND_50 0x00080000 /* Moves randomly (50%) */
3356 #define RF1_ONLY_GOLD 0x00100000 /* Drop only gold */
3357 #define RF1_ONLY_ITEM 0x00200000 /* Drop only items */
3358 #define RF1_DROP_60 0x00400000 /* Drop an item/gold (60%) */
3359 #define RF1_DROP_90 0x00800000 /* Drop an item/gold (90%) */
3360 #define RF1_DROP_1D2 0x01000000 /* Drop 1d2 items/gold */
3361 #define RF1_DROP_2D2 0x02000000 /* Drop 2d2 items/gold */
3362 #define RF1_DROP_3D2 0x04000000 /* Drop 3d2 items/gold */
3363 #define RF1_DROP_4D2 0x08000000 /* Drop 4d2 items/gold */
3364 #define RF1_DROP_GOOD 0x10000000 /* Drop good items */
3365 #define RF1_DROP_GREAT 0x20000000 /* Drop great items */
3366 #define RF1_XXX2 0x40000000 /* XXX */
3367 #define RF1_XXX3 0x80000000 /* XXX */
3370 * New monster race bit flags
3372 #define RF2_STUPID 0x00000001 /* Monster is stupid */
3373 #define RF2_SMART 0x00000002 /* Monster is smart */
3374 #define RF2_CAN_SPEAK 0x00000004 /* TY: can speak */
3375 #define RF2_REFLECTING 0x00000008 /* Reflects bolts */
3376 #define RF2_INVISIBLE 0x00000010 /* Monster avoids vision */
3377 #define RF2_COLD_BLOOD 0x00000020 /* Monster avoids infra */
3378 #define RF2_EMPTY_MIND 0x00000040 /* Monster avoids telepathy */
3379 #define RF2_WEIRD_MIND 0x00000080 /* Monster avoids telepathy? */
3380 #define RF2_MULTIPLY 0x00000100 /* Monster reproduces */
3381 #define RF2_REGENERATE 0x00000200 /* Monster regenerates */
3382 #define RF2_CHAR_MULTI 0x00000400 /* (Not implemented) */
3383 #define RF2_ATTR_ANY 0x00000800 /* TY: Attr_any */
3384 #define RF2_POWERFUL 0x00001000 /* Monster has strong breath */
3385 #define RF2_ELDRITCH_HORROR 0x00002000 /* Sanity-blasting horror */
3386 #define RF2_AURA_FIRE 0x00004000 /* Burns in melee */
3387 #define RF2_AURA_ELEC 0x00008000 /* Shocks in melee */
3388 #define RF2_OPEN_DOOR 0x00010000 /* Monster can open doors */
3389 #define RF2_BASH_DOOR 0x00020000 /* Monster can bash doors */
3390 #define RF2_PASS_WALL 0x00040000 /* Monster can pass walls */
3391 #define RF2_KILL_WALL 0x00080000 /* Monster can destroy walls */
3392 #define RF2_MOVE_BODY 0x00100000 /* Monster can move monsters */
3393 #define RF2_KILL_BODY 0x00200000 /* Monster can kill monsters */
3394 #define RF2_TAKE_ITEM 0x00400000 /* Monster can pick up items */
3395 #define RF2_KILL_ITEM 0x00800000 /* Monster can crush items */
3396 #define RF2_XXX1 0x01000000
3397 #define RF2_XXX2 0x02000000
3398 #define RF2_XXX3 0x04000000
3399 #define RF2_XXX4 0x08000000
3400 #define RF2_XXX5 0x10000000
3401 #define RF2_XXX6 0x20000000
3402 #define RF2_HUMAN 0x40000000 /* Human */
3403 #define RF2_QUANTUM 0x80000000 /* Monster has quantum behavior */
3406 * New monster race bit flags
3408 #define RF3_ORC 0x00000001 /* Orc */
3409 #define RF3_TROLL 0x00000002 /* Troll */
3410 #define RF3_GIANT 0x00000004 /* Giant */
3411 #define RF3_DRAGON 0x00000008 /* Dragon */
3412 #define RF3_DEMON 0x00000010 /* Demon */
3413 #define RF3_UNDEAD 0x00000020 /* Undead */
3414 #define RF3_EVIL 0x00000040 /* Evil */
3415 #define RF3_ANIMAL 0x00000080 /* Animal */
3416 #define RF3_AMBERITE 0x00000100 /* TY: Amberite */
3417 #define RF3_GOOD 0x00000200 /* Good */
3418 #define RF3_AURA_COLD 0x00000400 /* Freezes in melee */
3419 #define RF3_NONLIVING 0x00000800 /* TY: Non-Living (?) */
3420 #define RF3_HURT_LITE 0x00001000 /* Hurt by lite */
3421 #define RF3_HURT_ROCK 0x00002000 /* Hurt by rock remover */
3422 #define RF3_HURT_FIRE 0x00004000 /* Hurt badly by fire */
3423 #define RF3_HURT_COLD 0x00008000 /* Hurt badly by cold */
3424 #define RF3_XXX16 0x00010000
3425 #define RF3_XXX17 0x00020000
3426 #define RF3_XXX18 0x00040000
3427 #define RF3_XXX19 0x00080000
3428 #define RF3_XXX20 0x00100000
3429 #define RF3_XXX21 0x00200000
3430 #define RF3_XXX22 0x00400000
3431 #define RF3_XXX23 0x00800000
3432 #define RF3_XXX24 0x01000000
3433 #define RF3_XXX25 0x02000000
3434 #define RF3_XXX26 0x04000000
3435 #define RF3_XXX27 0x08000000
3436 #define RF3_NO_FEAR 0x10000000 /* Cannot be scared */
3437 #define RF3_NO_STUN 0x20000000 /* Cannot be stunned */
3438 #define RF3_NO_CONF 0x40000000 /* Cannot be confused and resist confusion */
3439 #define RF3_NO_SLEEP 0x80000000 /* Cannot be slept */
3442 * New monster race bit flags
3444 #define RF4_SHRIEK 0x00000001 /* Shriek for help */
3445 #define RF4_XXX1 0x00000002 /* XXX */
3446 #define RF4_DISPEL 0x00000004 /* Dispel magic */
3447 #define RF4_ROCKET 0x00000008 /* TY: Rocket */
3448 #define RF4_SHOOT 0x00000010 /* Fire missiles */
3449 #define RF4_XXX2 0x00000020
3450 #define RF4_XXX3 0x00000040
3451 #define RF4_XXX4 0x00000080
3452 #define RF4_BR_ACID 0x00000100 /* Breathe Acid */
3453 #define RF4_BR_ELEC 0x00000200 /* Breathe Elec */
3454 #define RF4_BR_FIRE 0x00000400 /* Breathe Fire */
3455 #define RF4_BR_COLD 0x00000800 /* Breathe Cold */
3456 #define RF4_BR_POIS 0x00001000 /* Breathe Poison */
3457 #define RF4_BR_NETH 0x00002000 /* Breathe Nether */
3458 #define RF4_BR_LITE 0x00004000 /* Breathe Lite */
3459 #define RF4_BR_DARK 0x00008000 /* Breathe Dark */
3460 #define RF4_BR_CONF 0x00010000 /* Breathe Confusion */
3461 #define RF4_BR_SOUN 0x00020000 /* Breathe Sound */
3462 #define RF4_BR_CHAO 0x00040000 /* Breathe Chaos */
3463 #define RF4_BR_DISE 0x00080000 /* Breathe Disenchant */
3464 #define RF4_BR_NEXU 0x00100000 /* Breathe Nexus */
3465 #define RF4_BR_TIME 0x00200000 /* Breathe Time */
3466 #define RF4_BR_INER 0x00400000 /* Breathe Inertia */
3467 #define RF4_BR_GRAV 0x00800000 /* Breathe Gravity */
3468 #define RF4_BR_SHAR 0x01000000 /* Breathe Shards */
3469 #define RF4_BR_PLAS 0x02000000 /* Breathe Plasma */
3470 #define RF4_BR_WALL 0x04000000 /* Breathe Force */
3471 #define RF4_BR_MANA 0x08000000 /* Breathe Mana */
3472 #define RF4_BA_NUKE 0x10000000 /* TY: Nuke Ball */
3473 #define RF4_BR_NUKE 0x20000000 /* TY: Toxic Breath */
3474 #define RF4_BA_CHAO 0x40000000 /* TY: Logrus Ball */
3475 #define RF4_BR_DISI 0x80000000 /* Breathe Disintegration */
3478 * New monster race bit flags
3480 #define RF5_BA_ACID 0x00000001 /* Acid Ball */
3481 #define RF5_BA_ELEC 0x00000002 /* Elec Ball */
3482 #define RF5_BA_FIRE 0x00000004 /* Fire Ball */
3483 #define RF5_BA_COLD 0x00000008 /* Cold Ball */
3484 #define RF5_BA_POIS 0x00000010 /* Poison Ball */
3485 #define RF5_BA_NETH 0x00000020 /* Nether Ball */
3486 #define RF5_BA_WATE 0x00000040 /* Water Ball */
3487 #define RF5_BA_MANA 0x00000080 /* Mana Storm */
3488 #define RF5_BA_DARK 0x00000100 /* Darkness Storm */
3489 #define RF5_DRAIN_MANA 0x00000200 /* Drain Mana */
3490 #define RF5_MIND_BLAST 0x00000400 /* Blast Mind */
3491 #define RF5_BRAIN_SMASH 0x00000800 /* Smash Brain */
3492 #define RF5_CAUSE_1 0x00001000 /* Cause Light Wound */
3493 #define RF5_CAUSE_2 0x00002000 /* Cause Serious Wound */
3494 #define RF5_CAUSE_3 0x00004000 /* Cause Critical Wound */
3495 #define RF5_CAUSE_4 0x00008000 /* Cause Mortal Wound */
3496 #define RF5_BO_ACID 0x00010000 /* Acid Bolt */
3497 #define RF5_BO_ELEC 0x00020000 /* Elec Bolt (unused) */
3498 #define RF5_BO_FIRE 0x00040000 /* Fire Bolt */
3499 #define RF5_BO_COLD 0x00080000 /* Cold Bolt */
3500 #define RF5_BA_LITE 0x00100000 /* StarBurst */
3501 #define RF5_BO_NETH 0x00200000 /* Nether Bolt */
3502 #define RF5_BO_WATE 0x00400000 /* Water Bolt */
3503 #define RF5_BO_MANA 0x00800000 /* Mana Bolt */
3504 #define RF5_BO_PLAS 0x01000000 /* Plasma Bolt */
3505 #define RF5_BO_ICEE 0x02000000 /* Ice Bolt */
3506 #define RF5_MISSILE 0x04000000 /* Magic Missile */
3507 #define RF5_SCARE 0x08000000 /* Frighten Player */
3508 #define RF5_BLIND 0x10000000 /* Blind Player */
3509 #define RF5_CONF 0x20000000 /* Confuse Player */
3510 #define RF5_SLOW 0x40000000 /* Slow Player */
3511 #define RF5_HOLD 0x80000000 /* Paralyze Player */
3514 * New monster race bit flags
3516 #define RF6_HASTE 0x00000001 /* Speed self */
3517 #define RF6_HAND_DOOM 0x00000002 /* Hand of Doom */
3518 #define RF6_HEAL 0x00000004 /* Heal self */
3519 #define RF6_INVULNER 0x00000008 /* INVULNERABILITY! */
3520 #define RF6_BLINK 0x00000010 /* Teleport Short */
3521 #define RF6_TPORT 0x00000020 /* Teleport Long */
3522 #define RF6_WORLD 0x00000040 /* world */
3523 #define RF6_SPECIAL 0x00000080 /* Special Attack */
3524 #define RF6_TELE_TO 0x00000100 /* Move player to monster */
3525 #define RF6_TELE_AWAY 0x00000200 /* Move player far away */
3526 #define RF6_TELE_LEVEL 0x00000400 /* Move player vertically */
3527 #define RF6_PSY_SPEAR 0x00000800 /* Psyco-spear */
3528 #define RF6_DARKNESS 0x00001000 /* Create Darkness */
3529 #define RF6_TRAPS 0x00002000 /* Create Traps */
3530 #define RF6_FORGET 0x00004000 /* Cause amnesia */
3531 #define RF6_RAISE_DEAD 0x00008000 /* Raise Dead */
3532 #define RF6_S_KIN 0x00010000 /* Summon "kin" */
3533 #define RF6_S_CYBER 0x00020000 /* Summon Cyberdemons! */
3534 #define RF6_S_MONSTER 0x00040000 /* Summon Monster */
3535 #define RF6_S_MONSTERS 0x00080000 /* Summon Monsters */
3536 #define RF6_S_ANT 0x00100000 /* Summon Ants */
3537 #define RF6_S_SPIDER 0x00200000 /* Summon Spiders */
3538 #define RF6_S_HOUND 0x00400000 /* Summon Hounds */
3539 #define RF6_S_HYDRA 0x00800000 /* Summon Hydras */
3540 #define RF6_S_ANGEL 0x01000000 /* Summon Angel */
3541 #define RF6_S_DEMON 0x02000000 /* Summon Demon */
3542 #define RF6_S_UNDEAD 0x04000000 /* Summon Undead */
3543 #define RF6_S_DRAGON 0x08000000 /* Summon Dragon */
3544 #define RF6_S_HI_UNDEAD 0x10000000 /* Summon Greater Undead */
3545 #define RF6_S_HI_DRAGON 0x20000000 /* Summon Ancient Dragon */
3546 #define RF6_S_AMBERITES 0x40000000 /* Summon Amberites */
3547 #define RF6_S_UNIQUE 0x80000000 /* Summon Unique Monster */
3550 * New monster race bit flags
3552 #define RF7_AQUATIC 0x00000001 /* Aquatic monster */
3553 #define RF7_CAN_SWIM 0x00000002 /* Monster can swim */
3554 #define RF7_CAN_FLY 0x00000004 /* Monster can fly */
3555 #define RF7_FRIENDLY 0x00000008 /* Monster is friendly */
3556 #define RF7_NAZGUL 0x00000010 /* Is a "Nazgul" unique */
3557 #define RF7_UNIQUE2 0x00000020 /* Fake unique */
3558 #define RF7_RIDING 0x00000040 /* Good for riding */
3559 #define RF7_KAGE 0x00000080 /* Is kage */
3560 #define RF7_HAS_LITE_1 0x00000100 /* Monster carries light */
3561 #define RF7_SELF_LITE_1 0x00000200 /* Monster lights itself */
3562 #define RF7_HAS_LITE_2 0x00000400 /* Monster carries light */
3563 #define RF7_SELF_LITE_2 0x00000800 /* Monster lights itself */
3564 #define RF7_GUARDIAN 0x00001000 /* Guardian of a dungeon */
3565 #define RF7_CHAMELEON 0x00002000 /* Chameleon can change */
3566 #define RF7_KILL_EXP 0x00004000 /* No exp until you kill it */
3567 #define RF7_TANUKI 0x00008000 /* Tanuki disguise */
3568 #define RF7_HAS_DARK_1 0x00010000 /* Monster carries darkness */
3569 #define RF7_SELF_DARK_1 0x00020000 /* Monster darkens itself */
3570 #define RF7_HAS_DARK_2 0x00040000 /* Monster carries darkness */
3571 #define RF7_SELF_DARK_2 0x00080000 /* Monster darkens itself */
3574 * Monster race flags
3576 #define RF8_WILD_ONLY 0x00000001
3577 #define RF8_WILD_TOWN 0x00000002
3578 #define RF8_XXX8X02 0x00000004
3579 #define RF8_WILD_SHORE 0x00000008
3580 #define RF8_WILD_OCEAN 0x00000010
3581 #define RF8_WILD_WASTE 0x00000020
3582 #define RF8_WILD_WOOD 0x00000040
3583 #define RF8_WILD_VOLCANO 0x00000080
3584 #define RF8_XXX8X08 0x00000100
3585 #define RF8_WILD_MOUNTAIN 0x00000200
3586 #define RF8_WILD_GRASS 0x00000400
3587 #define RF8_WILD_ALL 0x80000000
3592 #define RF9_DROP_CORPSE 0x00000001
3593 #define RF9_DROP_SKELETON 0x00000002
3594 #define RF9_EAT_BLIND 0x00000004
3595 #define RF9_EAT_CONF 0x00000008
3596 #define RF9_EAT_MANA 0x00000010
3597 #define RF9_EAT_NEXUS 0x00000020
3598 #define RF9_EAT_SLEEP 0x00000040
3599 #define RF9_EAT_BERSERKER 0x00000080
3600 #define RF9_EAT_ACIDIC 0x00000100
3601 #define RF9_EAT_SPEED 0x00000200
3602 #define RF9_EAT_CURE 0x00000400
3603 #define RF9_EAT_FIRE_RES 0x00000800
3604 #define RF9_EAT_COLD_RES 0x00001000
3605 #define RF9_EAT_ACID_RES 0x00002000
3606 #define RF9_EAT_ELEC_RES 0x00004000
3607 #define RF9_EAT_POIS_RES 0x00008000
3608 #define RF9_EAT_INSANITY 0x00010000
3609 #define RF9_EAT_DRAIN_EXP 0x00020000
3610 #define RF9_EAT_POISONOUS 0x00040000
3611 #define RF9_EAT_GIVE_STR 0x00080000
3612 #define RF9_EAT_GIVE_INT 0x00100000
3613 #define RF9_EAT_GIVE_WIS 0x00200000
3614 #define RF9_EAT_GIVE_DEX 0x00400000
3615 #define RF9_EAT_GIVE_CON 0x00800000
3616 #define RF9_EAT_GIVE_CHR 0x01000000
3617 #define RF9_EAT_LOSE_STR 0x02000000
3618 #define RF9_EAT_LOSE_INT 0x04000000
3619 #define RF9_EAT_LOSE_WIS 0x08000000
3620 #define RF9_EAT_LOSE_DEX 0x01000000
3621 #define RF9_EAT_LOSE_CON 0x20000000
3622 #define RF9_EAT_LOSE_CHR 0x40000000
3623 #define RF9_EAT_DRAIN_MANA 0x80000000
3626 * Monster bit flags of racial resistances
3627 * Note: Resist confusion was merged to RFR_NO_CONF
3629 #define RFR_IM_ACID 0x00000001 /* Resist acid */
3630 #define RFR_IM_ELEC 0x00000002 /* Resist elec */
3631 #define RFR_IM_FIRE 0x00000004 /* Resist fire */
3632 #define RFR_IM_COLD 0x00000008 /* Resist cold */
3633 #define RFR_IM_POIS 0x00000010 /* Resist poison */
3634 #define RFR_RES_LITE 0x00000020 /* Resist lite */
3635 #define RFR_RES_DARK 0x00000040 /* Resist dark */
3636 #define RFR_RES_NETH 0x00000080 /* Resist nether */
3637 #define RFR_RES_WATE 0x00000100 /* Resist water */
3638 #define RFR_RES_PLAS 0x00000200 /* Resist plasma */
3639 #define RFR_RES_SHAR 0x00000400 /* Resist shards */
3640 #define RFR_RES_SOUN 0x00000800 /* Resist sound */
3641 #define RFR_RES_CHAO 0x00001000 /* Resist chaos */
3642 #define RFR_RES_NEXU 0x00002000 /* Resist nexus */
3643 #define RFR_RES_DISE 0x00004000 /* Resist disenchantment */
3644 #define RFR_RES_WALL 0x00008000 /* Resist force */
3645 #define RFR_RES_INER 0x00010000 /* Resist inertia */
3646 #define RFR_RES_TIME 0x00020000 /* Resist time */
3647 #define RFR_RES_GRAV 0x00040000 /* Resist gravity */
3648 #define RFR_RES_ALL 0x00080000 /* Resist all */
3649 #define RFR_RES_TELE 0x00100000 /* Resist teleportation */
3650 #define RFR_XXX21 0x00200000
3651 #define RFR_XXX22 0x00400000
3652 #define RFR_XXX23 0x00800000
3653 #define RFR_XXX24 0x01000000
3654 #define RFR_XXX25 0x02000000
3655 #define RFR_XXX26 0x04000000
3656 #define RFR_XXX27 0x08000000
3657 #define RFR_XXX28 0x10000000
3658 #define RFR_XXX29 0x20000000
3659 #define RFR_XXX30 0x40000000
3660 #define RFR_XXX31 0x80000000
3664 * Hack -- choose "intelligent" spells when desperate
3665 * Including "summon" spells
3667 #define RF4_INT_MASK \
3668 (RF4_SUMMON_MASK | RF4_DISPEL)
3670 #define RF5_INT_MASK \
3671 (RF5_SUMMON_MASK | \
3672 RF5_HOLD | RF5_SLOW | RF5_CONF | RF5_BLIND | RF5_SCARE)
3674 #define RF6_INT_MASK \
3675 (RF6_SUMMON_MASK | \
3676 RF6_BLINK | RF6_TPORT | RF6_TELE_LEVEL | RF6_TELE_AWAY | \
3677 RF6_HEAL | RF6_INVULNER | RF6_HASTE | RF6_TRAPS)
3680 * Hack -- spells that cannot be used while player riding on the monster
3682 #define RF4_RIDING_MASK \
3685 #define RF5_RIDING_MASK 0L
3687 #define RF6_RIDING_MASK \
3688 (RF6_BLINK | RF6_TPORT | RF6_TRAPS | RF6_DARKNESS | RF6_SPECIAL)
3691 * Hack -- "bolt" spells that may hurt fellow monsters
3692 * Currently "bolt" spells are included in "attack"
3694 #define RF4_BOLT_MASK \
3695 (RF4_ROCKET | RF4_SHOOT)
3697 #define RF5_BOLT_MASK \
3698 (RF5_BO_ACID | RF5_BO_ELEC | RF5_BO_FIRE | RF5_BO_COLD | \
3699 RF5_BO_NETH | RF5_BO_WATE | RF5_BO_MANA | RF5_BO_PLAS | \
3700 RF5_BO_ICEE | RF5_MISSILE)
3702 #define RF6_BOLT_MASK 0L
3705 * Hack -- "beam" spells that may hurt fellow monsters
3706 * Currently "beam" spells are included in "attack"
3708 #define RF4_BEAM_MASK 0L
3710 #define RF5_BEAM_MASK 0L
3712 #define RF6_BEAM_MASK (RF6_PSY_SPEAR)
3715 * Hack -- "ball" spells that may hurt friends
3716 * Including "radius 4 ball" and "breath" spells
3717 * Currently "ball" spells are included in "attack"
3719 #define RF4_BALL_MASK \
3720 (RF4_BIG_BALL_MASK | RF4_BREATH_MASK | \
3721 RF4_ROCKET | RF4_BA_NUKE)
3723 #define RF5_BALL_MASK \
3724 (RF5_BIG_BALL_MASK | RF5_BREATH_MASK | \
3725 RF5_BA_ACID | RF5_BA_ELEC | RF5_BA_FIRE | RF5_BA_COLD | \
3726 RF5_BA_POIS | RF5_BA_NETH)
3728 #define RF6_BALL_MASK \
3729 (RF6_BIG_BALL_MASK | RF6_BREATH_MASK)
3732 * Hack -- "ball" spells with radius 4 that may hurt friends
3733 * Currently "radius 4 ball" spells are included in "ball"
3735 #define RF4_BIG_BALL_MASK \
3738 #define RF5_BIG_BALL_MASK \
3739 (RF5_BA_LITE | RF5_BA_DARK | RF5_BA_WATE | RF5_BA_MANA)
3741 #define RF6_BIG_BALL_MASK 0L
3744 * Hack -- "breath" spells that may hurt friends
3745 * Currently "breath" spells are included in "ball" and "non-magic"
3747 #define RF4_BREATH_MASK \
3748 (RF4_BR_ACID | RF4_BR_ELEC | RF4_BR_FIRE | RF4_BR_COLD | \
3749 RF4_BR_POIS | RF4_BR_NETH | RF4_BR_LITE | RF4_BR_DARK | \
3750 RF4_BR_CONF | RF4_BR_SOUN | RF4_BR_CHAO | RF4_BR_DISE | \
3751 RF4_BR_NEXU | RF4_BR_SHAR | RF4_BR_TIME | RF4_BR_INER | \
3752 RF4_BR_GRAV | RF4_BR_PLAS | RF4_BR_WALL | RF4_BR_MANA | \
3753 RF4_BR_NUKE | RF4_BR_DISI)
3755 #define RF5_BREATH_MASK 0L
3757 #define RF6_BREATH_MASK 0L
3760 * Hack -- "summon" spells
3761 * Currently "summon" spells are included in "intelligent" and "indirect"
3763 #define RF4_SUMMON_MASK 0L
3765 #define RF5_SUMMON_MASK 0L
3767 #define RF6_SUMMON_MASK \
3768 (RF6_S_KIN | RF6_S_CYBER | RF6_S_MONSTER | RF6_S_MONSTERS | RF6_S_ANT | \
3769 RF6_S_SPIDER | RF6_S_HOUND | RF6_S_HYDRA | RF6_S_ANGEL | RF6_S_DEMON | \
3770 RF6_S_UNDEAD | RF6_S_DRAGON | RF6_S_HI_UNDEAD | RF6_S_HI_DRAGON | \
3771 RF6_S_AMBERITES | RF6_S_UNIQUE)
3774 * Hack -- "attack" spells
3775 * Including "bolt", "beam" and "ball" spells
3777 #define RF4_ATTACK_MASK \
3778 (RF4_BOLT_MASK | RF4_BEAM_MASK | RF4_BALL_MASK | RF4_DISPEL)
3780 #define RF5_ATTACK_MASK \
3781 (RF5_BOLT_MASK | RF5_BEAM_MASK | RF5_BALL_MASK | \
3782 RF5_DRAIN_MANA | RF5_MIND_BLAST | RF5_BRAIN_SMASH | \
3783 RF5_CAUSE_1 | RF5_CAUSE_2 | RF5_CAUSE_3 | RF5_CAUSE_4 | \
3784 RF5_SCARE | RF5_BLIND | RF5_CONF | RF5_SLOW | RF5_HOLD)
3786 #define RF6_ATTACK_MASK \
3787 (RF6_BOLT_MASK | RF6_BEAM_MASK | RF6_BALL_MASK | \
3788 RF6_HAND_DOOM | RF6_TELE_TO | RF6_TELE_AWAY | RF6_TELE_LEVEL | \
3789 RF6_DARKNESS | RF6_TRAPS | RF6_FORGET)
3792 * Hack -- "indirect" spells
3793 * Including "summon" spells
3795 #define RF4_INDIRECT_MASK \
3796 (RF4_SUMMON_MASK | RF4_SHRIEK)
3798 #define RF5_INDIRECT_MASK \
3801 #define RF6_INDIRECT_MASK \
3802 (RF6_SUMMON_MASK | \
3803 RF6_HASTE | RF6_HEAL | RF6_INVULNER | RF6_BLINK | RF6_WORLD | \
3804 RF6_TPORT | RF6_RAISE_DEAD)
3807 * Hack -- "non-magic" spells
3808 * Including "breath" spells
3810 #define RF4_NOMAGIC_MASK \
3811 (RF4_BREATH_MASK | RF4_SHRIEK | RF4_ROCKET | RF4_SHOOT)
3813 #define RF5_NOMAGIC_MASK \
3816 #define RF6_NOMAGIC_MASK \
3817 (RF6_BREATH_MASK | RF6_SPECIAL)
3820 * Hack -- "torch" masks
3822 #define RF7_LITE_MASK \
3823 (RF7_HAS_LITE_1 | RF7_SELF_LITE_1 | RF7_HAS_LITE_2 | RF7_SELF_LITE_2)
3825 #define RF7_DARK_MASK \
3826 (RF7_HAS_DARK_1 | RF7_SELF_DARK_1 | RF7_HAS_DARK_2 | RF7_SELF_DARK_2)
3828 #define RF7_HAS_LD_MASK \
3829 (RF7_HAS_LITE_1 | RF7_HAS_LITE_2 | RF7_HAS_DARK_1 | RF7_HAS_DARK_2)
3831 #define RF7_SELF_LD_MASK \
3832 (RF7_SELF_LITE_1 | RF7_SELF_LITE_2 | RF7_SELF_DARK_1 | RF7_SELF_DARK_2)
3835 * Hack -- effective elemental and poison immunity mask
3837 #define RFR_EFF_IM_ACID_MASK (RFR_IM_ACID | RFR_RES_ALL)
3838 #define RFR_EFF_IM_ELEC_MASK (RFR_IM_ELEC | RFR_RES_ALL)
3839 #define RFR_EFF_IM_FIRE_MASK (RFR_IM_FIRE | RFR_RES_ALL)
3840 #define RFR_EFF_IM_COLD_MASK (RFR_IM_COLD | RFR_RES_ALL)
3841 #define RFR_EFF_IM_POIS_MASK (RFR_IM_POIS | RFR_RES_ALL)
3842 #define RFR_EFF_RES_SHAR_MASK (RFR_RES_SHAR | RFR_RES_ALL)
3843 #define RFR_EFF_RES_CHAO_MASK (RFR_RES_CHAO | RFR_RES_ALL)
3844 #define RFR_EFF_RES_NEXU_MASK (RFR_RES_NEXU | RFR_RES_ALL)
3847 #define MR1_SINKA 0x01
3850 #define is_friendly(A) \
3851 (bool)(((A)->smart & SM_FRIENDLY) ? TRUE : FALSE)
3853 #define is_friendly_idx(IDX) \
3854 (bool)((IDX) > 0 && is_friendly(&m_list[(IDX)]))
3857 (bool)(((A)->smart & SM_PET) ? TRUE : FALSE)
3859 #define is_hostile(A) \
3860 (bool)((is_friendly(A) || is_pet(A)) ? FALSE : TRUE)
3862 /* Hack -- Determine monster race appearance index is same as race index */
3863 #define is_original_ap(A) \
3864 (bool)(((A)->ap_r_idx == (A)->r_idx) ? TRUE : FALSE)
3867 /*** Option Definitions ***/
3870 #define OPT_PAGE_INPUT 1
3871 #define OPT_PAGE_OUTPUT 2
3872 #define OPT_PAGE_GAMEPLAY 3
3873 #define OPT_PAGE_DISTURBANCE 4
3874 #define OPT_PAGE_EFFICIENCY 5
3875 #define OPT_PAGE_BIRTH 6
3876 #define OPT_PAGE_AUTODESTROY 7
3877 #define OPT_PAGE_PLAYRECORD 10
3879 #define OPT_PAGE_JAPANESE_ONLY 99
3882 /*** Macro Definitions ***/
3886 * Hack -- The main "screen"
3888 #define term_screen (angband_term[0])
3891 #ifndef SCRIPT_OBJ_KIND
3893 * Determine if a given inventory item is "aware"
3895 #define object_aware_p(T) \
3896 (k_info[(T)->k_idx].aware)
3899 * Determine if a given inventory item is "tried"
3901 #define object_tried_p(T) \
3902 (k_info[(T)->k_idx].tried)
3906 * Determine if a given inventory item is "known"
3907 * Test One -- Check for special "known" tag
3908 * Test Two -- Check for "Easy Know" + "Aware"
3910 #define object_known_p(T) \
3911 (((T)->ident & (IDENT_KNOWN)) || \
3912 (k_info[(T)->k_idx].easy_know && k_info[(T)->k_idx].aware))
3916 * Return the "attr" for a given item.
3917 * Use "flavor" if available.
3918 * Default to user definitions.
3920 #define object_attr(T) \
3921 ((k_info[(T)->k_idx].flavor) ? \
3922 (misc_to_attr[k_info[(T)->k_idx].flavor]) : \
3923 (k_info[(T)->k_idx].x_attr))
3926 * Return the "char" for a given item.
3927 * Use "flavor" if available.
3928 * Default to user definitions.
3930 #define object_char(T) \
3931 ((k_info[(T)->k_idx].flavor) ? \
3932 (misc_to_char[k_info[(T)->k_idx].flavor]) : \
3933 (k_info[(T)->k_idx].x_char))
3936 #else /* SCRIPT_OBJ_KIND */
3940 * Determine if a given inventory item is "aware"
3942 #define object_aware_p(T) \
3946 * Determine if a given inventory item is "tried"
3948 #define object_tried_p(T) \
3953 * Determine if a given inventory item is "known"
3954 * Test One -- Check for special "known" tag
3955 * Test Two -- Check for "Easy Know" + "Aware"
3957 #define object_known_p(T) \
3958 (((T)->ident & (IDENT_KNOWN)) || \
3959 ((T)->easy_know && (T)->aware))
3963 * Return the "attr" for a given item.
3964 * Use "flavor" if available.
3965 * Default to user definitions.
3967 #define object_attr(T) \
3969 (misc_to_attr[(T)->flavor]) : \
3973 * Return the "char" for a given item.
3974 * Use "flavor" if available.
3975 * Default to user definitions.
3977 #define object_char(T) \
3979 (misc_to_char[(T)->flavor]) : \
3982 #endif /* SCRIPT_OBJ_KIND */
3988 * Artifacts use the "name1" field
3990 #define artifact_p(T) \
3991 ((T)->name1 ? TRUE : FALSE)
3994 * Ego-Items use the "name2" field
3996 #define ego_item_p(T) \
3997 ((T)->name2 ? TRUE : FALSE)
4003 #define broken_p(T) \
4004 ((T)->ident & (IDENT_BROKEN))
4009 #define cursed_p(T) \
4014 * Convert an "attr"/"char" pair into a "pict" (P)
4017 ((((u16b)(A)) << 8) | ((byte)(C)))
4020 * Convert a "pict" (P) into an "attr" (A)
4026 * Convert a "pict" (P) into an "char" (C)
4033 * Convert a "location" (Y,X) into a "grid" (G)
4039 * Convert a "grid" (G) into a "location" (Y)
4045 * Convert a "grid" (G) into a "location" (X)
4052 * Determines if a map location is fully inside the outer walls
4054 #define in_bounds(Y,X) \
4055 (((Y) > 0) && ((X) > 0) && ((Y) < cur_hgt-1) && ((X) < cur_wid-1))
4058 * Determines if a map location is on or inside the outer walls
4060 #define in_bounds2(Y,X) \
4061 (((Y) >= 0) && ((X) >= 0) && ((Y) < cur_hgt) && ((X) < cur_wid))
4064 * Determines if a map location is on or inside the outer walls
4065 * (unsigned version)
4067 #define in_bounds2u(Y,X) \
4068 (((Y) < cur_hgt) && ((X) < cur_wid))
4071 * Determines if a map location is currently "on screen" -RAK-
4072 * Note that "panel_contains(Y,X)" always implies "in_bounds2(Y,X)".
4074 #define panel_contains(Y,X) \
4075 (((Y) >= panel_row_min) && ((Y) <= panel_row_max) && \
4076 ((X) >= panel_col_min) && ((X) <= panel_col_max))
4080 * Determine if player is on this grid
4082 #define player_bold(Y,X) \
4083 (((Y) == py) && ((X) == px))
4087 * Grid based version of "player_bold()"
4089 #define player_grid(C) \
4090 ((C) == &cave[py][px])
4094 * Determine if a "feature" is a "floor"
4096 #define feat_floor(F) \
4101 * Determine if a "legal" grid is a "floor" grid
4103 * Line 1 -- forbid doors, rubble, seams, walls
4105 * Note that the terrain features are split by a one bit test
4106 * into those features which block line of sight and those that
4107 * do not, allowing an extremely fast single bit check below.
4109 * Add in the fact that some new terrain (water & lava) do NOT block sight
4112 #define cave_floor_bold(Y,X) \
4113 (feat_floor(cave[(Y)][(X)].feat))
4117 * Determine if a "legal" grid is a "clean" floor grid
4119 * Line 1 -- forbid non-floors
4120 * Line 2 -- forbid deep water -KMW-
4121 * Line 3 -- forbid deep lava -KMW-
4122 * Line 4 -- forbid normal objects
4124 #define cave_clean_bold(Y,X) \
4125 (((cave[Y][X].feat == FEAT_FLOOR) || \
4126 (cave[Y][X].feat == FEAT_SHAL_WATER) || \
4127 (cave[Y][X].feat == FEAT_SHAL_LAVA) || \
4128 (cave[Y][X].feat == FEAT_DEEP_GRASS) || \
4129 (cave[Y][X].feat == FEAT_FLOWER) || \
4130 (cave[Y][X].feat == FEAT_GRASS) || \
4131 (cave[Y][X].feat == FEAT_DIRT)) && \
4132 !(cave[Y][X].info & CAVE_OBJECT) && \
4133 (cave[Y][X].o_idx == 0))
4137 * Determine if a "legal" grid is an "empty" floor grid
4139 * Line 1 -- forbid doors, rubble, seams, walls
4140 * Line 2 -- forbid normal monsters
4141 * Line 3 -- forbid the player
4143 #define cave_empty_bold(Y,X) \
4144 (cave_floor_bold(Y,X) && \
4145 !(cave[Y][X].m_idx) && \
4150 * Determine if a "legal" grid is an "empty" floor grid
4152 * Line 1 -- forbid doors, rubble, seams, walls
4153 * Line 2 -- forbid normal monsters
4154 * Line 3 -- forbid the player
4156 #define cave_empty_bold2(Y,X) \
4157 (((cave_floor_bold(Y,X) && (cave[Y][X].feat != FEAT_DARK_PIT)) || (character_dungeon && (cave[Y][X].feat == FEAT_TREES)))&& \
4158 !(cave[Y][X].m_idx) && \
4163 * Determine if a "legal" grid is an "naked" floor grid
4165 * Line 1 -- forbid non-floors, non-shallow water & lava -KMW-
4166 * Line 4 -- forbid normal objects
4167 * Line 5 -- forbid player/monsters
4169 #define cave_naked_bold(Y,X) \
4170 (((cave[Y][X].feat == FEAT_FLOOR) || \
4171 (cave[Y][X].feat == FEAT_SHAL_WATER) || \
4172 (cave[Y][X].feat == FEAT_SHAL_LAVA) || \
4173 (cave[Y][X].feat == FEAT_GRASS) || \
4174 (cave[Y][X].feat == FEAT_DEEP_GRASS) || \
4175 (cave[Y][X].feat == FEAT_FLOWER) || \
4176 (cave[Y][X].feat == FEAT_DIRT)) && \
4177 !(cave[Y][X].info & CAVE_OBJECT) && \
4178 (cave[Y][X].o_idx == 0) && \
4179 (cave[Y][X].m_idx == 0))
4184 * Determine if a "legal" grid is "permanent"
4186 * Line 1 -- perma-walls
4187 * Line 2-3 -- stairs
4188 * Line 4-5 -- building doors -KMW-
4189 * Line 6-7 -- shop doors
4191 #define cave_perma_bold(Y,X) \
4192 (((cave[Y][X].feat >= FEAT_PERM_EXTRA) && \
4193 (cave[Y][X].feat <= FEAT_PERM_SOLID)) || \
4194 (cave[Y][X].feat == FEAT_LESS) || \
4195 (cave[Y][X].feat == FEAT_MORE) || \
4196 (cave[Y][X].feat == FEAT_ENTRANCE) || \
4197 (cave[Y][X].feat == FEAT_LESS_LESS) || \
4198 (cave[Y][X].feat == FEAT_MORE_MORE) || \
4199 (cave[Y][X].feat == FEAT_MOUNTAIN) || \
4200 ((cave[Y][X].feat >= FEAT_QUEST_ENTER) && \
4201 (cave[Y][X].feat <= FEAT_QUEST_UP)) || \
4202 ((cave[Y][X].feat >= FEAT_PATTERN_START) && \
4203 (cave[Y][X].feat <= FEAT_PATTERN_XTRA2)) || \
4204 ((cave[Y][X].feat >= FEAT_SHOP_HEAD) && \
4205 (cave[Y][X].feat <= FEAT_SHOP_TAIL)) || \
4206 (cave[Y][X].feat == FEAT_MUSEUM) || \
4207 ((cave[Y][X].feat >= FEAT_BLDG_HEAD) && \
4208 (cave[Y][X].feat <= FEAT_BLDG_TAIL)))
4212 * Grid based version of "cave_floor_bold()"
4214 #define cave_floor_grid(C) \
4215 (feat_floor((C)->feat))
4219 * Grid based version of "cave_clean_bold()"
4221 #define cave_clean_grid(C) \
4222 (((C)->feat == FEAT_FLOOR) && \
4226 * Grid based version of "cave_empty_bold()"
4228 #define cave_empty_grid(C) \
4229 (cave_floor_grid(C) && \
4234 * Grid based version of "cave_empty_bold()"
4236 #define cave_empty_grid2(C) \
4237 ((cave_floor_grid(C) || ((C)->feat == FEAT_TREES)) && \
4242 * Grid based version of "cave_empty_bold()"
4244 #define cave_naked_grid(C) \
4245 (((C)->feat == FEAT_FLOOR) && \
4252 * Grid based version of "cave_perma_bold()"
4254 #define cave_perma_grid(C) \
4255 ((((C)->feat >= FEAT_PERM_EXTRA) && \
4256 ((C)->feat <= FEAT_PERM_SOLID)) || \
4257 ((C)->feat == FEAT_LESS) || \
4258 ((C)->feat == FEAT_MORE) || \
4259 ((C)->feat == FEAT_ENTRANCE) || \
4260 ((C)->feat == FEAT_LESS_LESS) || \
4261 ((C)->feat == FEAT_MORE_MORE) || \
4262 ((C)->feat == FEAT_MOUNTAIN) || \
4263 (((C)->feat >= FEAT_QUEST_ENTER) && \
4264 ((C)->feat <= FEAT_QUEST_UP)) || \
4265 (((C)->feat >= FEAT_PATTERN_START) && \
4266 ((C)->feat <= FEAT_PATTERN_XTRA2)) || \
4267 (((C)->feat >= FEAT_SHOP_HEAD) && \
4268 ((C)->feat <= FEAT_SHOP_TAIL)) || \
4269 ((C)->feat == FEAT_MUSEUM) || \
4270 (((C)->feat >= FEAT_BLDG_HEAD) && \
4271 ((C)->feat <= FEAT_BLDG_TAIL)))
4274 #define pattern_tile(Y,X) \
4275 ((cave[Y][X].feat <= FEAT_PATTERN_XTRA2) && (cave[Y][X].feat >= FEAT_PATTERN_START))
4278 * Does the grid stop disintegration?
4280 #define cave_stop_disintegration(Y,X) \
4281 (((cave[Y][X].feat >= FEAT_PERM_EXTRA) && \
4282 (cave[Y][X].feat <= FEAT_PERM_SOLID)) || \
4283 (cave[Y][X].feat == FEAT_MOUNTAIN) || \
4284 ((cave[Y][X].feat >= FEAT_SHOP_HEAD) && \
4285 (cave[Y][X].feat <= FEAT_SHOP_TAIL)) || \
4286 ((cave[Y][X].feat >= FEAT_BLDG_HEAD) && \
4287 (cave[Y][X].feat <= FEAT_BLDG_TAIL)) || \
4288 (cave[Y][X].feat == FEAT_MUSEUM))
4292 * Determine if a "legal" grid is within "los" of the player
4294 * Note the use of comparison to zero to force a "boolean" result
4296 #define player_has_los_grid(C) \
4297 (((C)->info & (CAVE_VIEW)) != 0)
4300 * Determine if a "legal" grid is within "los" of the player
4302 * Note the use of comparison to zero to force a "boolean" result
4304 #define player_has_los_bold(Y,X) \
4305 (((cave[Y][X].info & (CAVE_VIEW)) != 0) || p_ptr->inside_battle)
4308 * Determine if a "boundary" grid is "floor mimic"
4310 #define boundary_floor_bold(Y,X) \
4311 ((cave[(Y)][(X)].feat == FEAT_PERM_SOLID) && \
4312 cave[(Y)][(X)].mimic && feat_floor(cave[(Y)][(X)].mimic))
4314 #define boundary_floor_grid(C) \
4315 (((C)->feat == FEAT_PERM_SOLID) && \
4316 (C)->mimic && feat_floor((C)->mimic))
4318 #define update_playtime() \
4322 playtime += (tmp - start_time);\
4327 * Hack -- Prepare to use the "Secure" routines
4329 #if defined(SET_UID) && defined(SECURE)
4330 extern int PlayerUID;
4331 # define getuid() PlayerUID
4332 # define geteuid() PlayerUID
4337 /*** Color constants ***/
4341 * Angband "attributes" (with symbols, and base (R,G,B) codes)
4343 * The "(R,G,B)" codes are given in "fourths" of the "maximal" value,
4344 * and should "gamma corrected" on most (non-Macintosh) machines.
4346 #define TERM_DARK 0 /* 'd' */ /* 0,0,0 */
4347 #define TERM_WHITE 1 /* 'w' */ /* 4,4,4 */
4348 #define TERM_SLATE 2 /* 's' */ /* 2,2,2 */
4349 #define TERM_ORANGE 3 /* 'o' */ /* 4,2,0 */
4350 #define TERM_RED 4 /* 'r' */ /* 3,0,0 */
4351 #define TERM_GREEN 5 /* 'g' */ /* 0,2,1 */
4352 #define TERM_BLUE 6 /* 'b' */ /* 0,0,4 */
4353 #define TERM_UMBER 7 /* 'u' */ /* 2,1,0 */
4354 #define TERM_L_DARK 8 /* 'D' */ /* 1,1,1 */
4355 #define TERM_L_WHITE 9 /* 'W' */ /* 3,3,3 */
4356 #define TERM_VIOLET 10 /* 'v' */ /* 4,0,4 */
4357 #define TERM_YELLOW 11 /* 'y' */ /* 4,4,0 */
4358 #define TERM_L_RED 12 /* 'R' */ /* 4,0,0 */
4359 #define TERM_L_GREEN 13 /* 'G' */ /* 0,4,0 */
4360 #define TERM_L_BLUE 14 /* 'B' */ /* 0,4,4 */
4361 #define TERM_L_UMBER 15 /* 'U' */ /* 3,2,1 */
4364 /*** Sound constants ***/
4368 * Mega-Hack -- some primitive sound support (see "main-win.c")
4370 * Some "sound" constants for "Term_xtra(TERM_XTRA_SOUND, val)"
4373 #define SOUND_MISS 2
4374 #define SOUND_FLEE 3
4375 #define SOUND_DROP 4
4376 #define SOUND_KILL 5
4377 #define SOUND_LEVEL 6
4378 #define SOUND_DEATH 7
4379 #define SOUND_STUDY 8
4380 #define SOUND_TELEPORT 9
4381 #define SOUND_SHOOT 10
4382 #define SOUND_QUAFF 11
4383 #define SOUND_ZAP 12
4384 #define SOUND_WALK 13
4385 #define SOUND_TPOTHER 14
4386 #define SOUND_HITWALL 15
4387 #define SOUND_EAT 16
4388 #define SOUND_STORE1 17
4389 #define SOUND_STORE2 18
4390 #define SOUND_STORE3 19
4391 #define SOUND_STORE4 20
4392 #define SOUND_DIG 21
4393 #define SOUND_OPENDOOR 22
4394 #define SOUND_SHUTDOOR 23
4395 #define SOUND_TPLEVEL 24
4396 #define SOUND_SCROLL 25
4397 #define SOUND_BUY 26
4398 #define SOUND_SELL 27
4399 #define SOUND_WARN 28
4400 #define SOUND_ROCKET 29 /* Somebody's shooting rockets */
4401 #define SOUND_N_KILL 30 /* The player kills a non-living/undead monster */
4402 #define SOUND_U_KILL 31 /* The player kills a unique */
4403 #define SOUND_QUEST 32 /* The player has just completed a quest */
4404 #define SOUND_HEAL 33 /* The player was healed a little bit */
4405 #define SOUND_X_HEAL 34 /* The player was healed full health */
4406 #define SOUND_BITE 35 /* A monster bites you */
4407 #define SOUND_CLAW 36 /* A monster claws you */
4408 #define SOUND_M_SPELL 37 /* A monster casts a miscellaneous spell */
4409 #define SOUND_SUMMON 38 /* A monster casts a summoning spell */
4410 #define SOUND_BREATH 39 /* A monster breathes */
4411 #define SOUND_BALL 40 /* A monster casts a ball / bolt spell */
4412 #define SOUND_M_HEAL 41 /* A monster heals itself somehow */
4413 #define SOUND_ATK_SPELL 42 /* A monster casts a misc. offensive spell */
4414 #define SOUND_EVIL 43 /* Something nasty has just happened! */
4415 #define SOUND_TOUCH 44 /* A monster touches you */
4416 #define SOUND_STING 45 /* A monster stings you */
4417 #define SOUND_CRUSH 46 /* A monster crushes / envelopes you */
4418 #define SOUND_SLIME 47 /* A monster drools/spits/etc on you */
4419 #define SOUND_WAIL 48 /* A monster wails */
4420 #define SOUND_WINNER 49 /* Just won the game! */
4421 #define SOUND_FIRE 50 /* An item was burned */
4422 #define SOUND_ACID 51 /* An item was destroyed by acid */
4423 #define SOUND_ELEC 52 /* An item was destroyed by electricity */
4424 #define SOUND_COLD 53 /* An item was shattered */
4425 #define SOUND_ILLEGAL 54 /* Illegal command attempted */
4426 #define SOUND_FAIL 55 /* Fail to get a spell off / activate an item */
4427 #define SOUND_WAKEUP 56 /* A monster wakes up */
4428 #define SOUND_INVULN 57 /* Invulnerability! */
4429 #define SOUND_FALL 58 /* Falling through a trapdoor... */
4430 #define SOUND_PAIN 59 /* A monster is in pain! */
4431 #define SOUND_DESTITEM 60 /* An item was destroyed by misc. means */
4432 #define SOUND_MOAN 61 /* A monster makes a moan/beg/insult attack */
4433 #define SOUND_SHOW 62 /* A monster makes a "show" attack */
4434 #define SOUND_UNUSED 63 /* (no sound for gaze attacks) */
4435 #define SOUND_EXPLODE 64 /* Something (or somebody) explodes */
4438 * Mega-Hack -- maximum known sounds
4440 #define SOUND_MAX 65
4442 #define MAX_VIRTUE 18
4444 #define V_COMPASSION 1
4447 #define V_SACRIFICE 4
4448 #define V_KNOWLEDGE 5
4450 #define V_ENLIGHTEN 7
4454 #define V_HARMONY 11
4455 #define V_VITALITY 12
4457 #define V_PATIENCE 14
4458 #define V_TEMPERANCE 15
4459 #define V_DILIGENCE 16
4461 #define V_INDIVIDUALISM 18
4468 * Hack -- attempt to reduce various values
4472 # define MACRO_MAX 128
4474 # define QUARK_MAX 128
4476 # define MESSAGE_MAX 128
4478 # define MESSAGE_BUF 4096
4485 #define BACT_NOTHING 0
4486 #define BACT_RESEARCH_ITEM 1
4487 #define BACT_TOWN_HISTORY 2
4488 #define BACT_RACE_LEGENDS 3
4489 #define BACT_GREET_KING 4
4490 #define BACT_KING_LEGENDS 5
4491 #define BACT_QUEST 6
4493 #define BACT_POSTER 8
4494 #define BACT_ARENA_RULES 9
4495 #define BACT_ARENA 10
4496 #define BACT_ARENA_LEGENDS 11
4497 #define BACT_IN_BETWEEN 12
4498 #define BACT_GAMBLE_RULES 13
4499 #define BACT_CRAPS 14
4500 #define BACT_SPIN_WHEEL 15
4501 #define BACT_DICE_SLOTS 16
4502 #define BACT_REST 17
4503 #define BACT_FOOD 18
4504 #define BACT_RUMORS 19
4505 #define BACT_RESEARCH_MONSTER 20
4506 #define BACT_COMPARE_WEAPONS 21
4507 #define BACT_LEGENDS 22
4508 #define BACT_ENCHANT_WEAPON 23
4509 #define BACT_ENCHANT_ARMOR 24
4510 #define BACT_RECHARGE 25
4511 #define BACT_IDENTS 26
4512 #define BACT_LEARN 27
4513 #define BACT_HEALING 28
4514 #define BACT_RESTORE 29
4515 #define BACT_ENCHANT_ARROWS 30
4516 #define BACT_ENCHANT_BOW 31
4517 #define BACT_GREET 32
4518 #define BACT_RECALL 33
4519 #define BACT_TELEPORT_LEVEL 34
4520 #define BACT_LOSE_MUTATION 35
4521 #define BACT_BATTLE 36
4522 #define BACT_TSUCHINOKO 37
4523 #define BACT_TARGET 38
4524 #define BACT_KUBI 39
4525 #define BACT_KANKIN 40
4526 #define BACT_HEIKOUKA 41
4527 #define BACT_TELE_TOWN 42
4528 #define BACT_POKER 43
4529 #define BACT_IDENT_ONE 44
4530 #define BACT_RECHARGE_ALL 45
4531 #define BACT_EVAL_AC 46
4537 #define QUEST_STATUS_UNTAKEN 0
4538 #define QUEST_STATUS_TAKEN 1
4539 #define QUEST_STATUS_COMPLETED 2
4540 #define QUEST_STATUS_REWARDED 3
4541 #define QUEST_STATUS_FINISHED 4
4542 #define QUEST_STATUS_FAILED 5
4543 #define QUEST_STATUS_FAILED_DONE 6
4548 #define QUEST_TYPE_KILL_LEVEL 1
4549 #define QUEST_TYPE_KILL_ANY_LEVEL 2
4550 #define QUEST_TYPE_FIND_ARTIFACT 3
4551 #define QUEST_TYPE_FIND_EXIT 4
4552 #define QUEST_TYPE_KILL_NUMBER 5
4553 #define QUEST_TYPE_KILL_ALL 6
4554 #define QUEST_TYPE_RANDOM 7
4557 * Initialization flags
4559 #define INIT_SHOW_TEXT 0x01
4560 #define INIT_ASSIGN 0x02
4561 #define INIT_CREATE_DUNGEON 0x04
4562 #define INIT_ONLY_FEATURES 0x08
4563 #define INIT_ONLY_BUILDINGS 0x10
4568 #define QUEST_FLAG_SILENT 0x01 /* no messages fro completion */
4569 #define QUEST_FLAG_PRESET 0x02 /* quest is outside the main dungeon */
4570 #define QUEST_FLAG_ONCE 0x04 /* quest is marked finished after leaving */
4573 * Available graphic modes
4575 #define GRAPHICS_NONE 0
4576 #define GRAPHICS_ORIGINAL 1
4577 #define GRAPHICS_ADAM_BOLT 2
4580 * Modes for the random name generator
4582 #define NAME_DWARF 1
4584 #define NAME_GNOME 3
4585 #define NAME_HOBBIT 4
4586 #define NAME_HUMAN 5
4596 * Modes for the tokenizer
4598 #define TOKENIZE_CHECKQUOTE 0x01 /* Special handling of single quotes */
4603 #define PARSE_ERROR_GENERIC 1
4604 #define PARSE_ERROR_ABSOLETE_FILE 2
4605 #define PARSE_ERROR_MISSING_RECORD_HEADER 3
4606 #define PARSE_ERROR_NON_SEQUENTIAL_RECORDS 4
4607 #define PARSE_ERROR_INVALID_FLAG 5
4608 #define PARSE_ERROR_UNDEFINED_DIRECTIVE 6
4609 #define PARSE_ERROR_OUT_OF_MEMORY 7
4610 #define PARSE_ERROR_OUT_OF_BOUNDS 8
4611 #define PARSE_ERROR_TOO_FEW_ARGUMENTS 9
4612 #define PARSE_ERROR_MAX 10
4614 #define GINOU_SUDE 0
4615 #define GINOU_NITOURYU 1
4616 #define GINOU_RIDING 2
4618 /* Proficiency level */
4619 #define EXP_LEVEL_UNSKILLED 0
4620 #define EXP_LEVEL_BEGINNER 1
4621 #define EXP_LEVEL_SKILLED 2
4622 #define EXP_LEVEL_EXPERT 3
4623 #define EXP_LEVEL_MASTER 4
4625 /* Proficiency of weapons and misc. skills (except riding) */
4626 #define WEAPON_EXP_UNSKILLED 0
4627 #define WEAPON_EXP_BEGINNER 4000
4628 #define WEAPON_EXP_SKILLED 6000
4629 #define WEAPON_EXP_EXPERT 7000
4630 #define WEAPON_EXP_MASTER 8000
4632 /* Proficiency of riding */
4633 #define RIDING_EXP_UNSKILLED 0
4634 #define RIDING_EXP_BEGINNER 500
4635 #define RIDING_EXP_SKILLED 2000
4636 #define RIDING_EXP_EXPERT 5000
4637 #define RIDING_EXP_MASTER 8000
4639 /* Proficiency of spells */
4640 #define SPELL_EXP_UNSKILLED 0
4641 #define SPELL_EXP_BEGINNER 900
4642 #define SPELL_EXP_SKILLED 1200
4643 #define SPELL_EXP_EXPERT 1400
4644 #define SPELL_EXP_MASTER 1600
4647 #define SECRET_TOWN 5
4649 #define NIKKI_HIGAWARI 0
4650 #define NIKKI_BUNSHOU 1
4652 #define NIKKI_UNIQUE 3
4653 #define NIKKI_FIX_QUEST_C 4
4654 #define NIKKI_FIX_QUEST_F 5
4655 #define NIKKI_RAND_QUEST_C 6
4656 #define NIKKI_RAND_QUEST_F 7
4657 #define NIKKI_MAXDEAPTH 8
4658 #define NIKKI_TRUMP 9
4659 #define NIKKI_STAIR 10
4660 #define NIKKI_RECALL 11
4661 #define NIKKI_TO_QUEST 12
4662 #define NIKKI_TELE_LEV 13
4663 #define NIKKI_BUY 14
4664 #define NIKKI_SELL 15
4665 #define NIKKI_ARENA 16
4666 #define NIKKI_HANMEI 17
4667 #define NIKKI_LEVELUP 18
4668 #define NIKKI_GAMESTART 19
4669 #define NIKKI_WIZ_TELE 20
4670 #define NIKKI_NAMED_PET 21
4671 #define NIKKI_PAT_TELE 22
4674 #define MAX_MONSPELLS 96
4675 #define MONSPELL_TYPE_BOLT 1
4676 #define MONSPELL_TYPE_BALL 2
4677 #define MONSPELL_TYPE_BREATH 3
4678 #define MONSPELL_TYPE_SUMMON 4
4679 #define MONSPELL_TYPE_OTHER 5
4681 #define EATER_EXT 36
4682 #define EATER_CHARGE 0x10000L
4683 #define EATER_ROD_CHARGE 0x10L
4687 #define DETECT_RAD_DEFAULT 30
4688 #define DETECT_RAD_MAP 30
4689 #define DETECT_RAD_ALL 255
4691 /* Monster Spells */
4700 #define MS_BR_ACID 8
4701 #define MS_BR_ELEC 9
4702 #define MS_BR_FIRE 10
4703 #define MS_BR_COLD 11
4704 #define MS_BR_POIS 12
4705 #define MS_BR_NETHER 13
4706 #define MS_BR_LITE 14
4707 #define MS_BR_DARK 15
4708 #define MS_BR_CONF 16
4709 #define MS_BR_SOUND 17
4710 #define MS_BR_CHAOS 18
4711 #define MS_BR_DISEN 19
4712 #define MS_BR_NEXUS 20
4713 #define MS_BR_TIME 21
4714 #define MS_BR_INERTIA 22
4715 #define MS_BR_GRAVITY 23
4716 #define MS_BR_SHARDS 24
4717 #define MS_BR_PLASMA 25
4718 #define MS_BR_FORCE 26
4719 #define MS_BR_MANA 27
4720 #define MS_BALL_NUKE 28
4721 #define MS_BR_NUKE 29
4722 #define MS_BALL_CHAOS 30
4723 #define MS_BR_DISI 31
4724 #define MS_BALL_ACID 32
4725 #define MS_BALL_ELEC 33
4726 #define MS_BALL_FIRE 34
4727 #define MS_BALL_COLD 35
4728 #define MS_BALL_POIS 36
4729 #define MS_BALL_NETHER 37
4730 #define MS_BALL_WATER 38
4731 #define MS_BALL_MANA 39
4732 #define MS_BALL_DARK 40
4733 #define MS_DRAIN_MANA 41
4734 #define MS_MIND_BLAST 42
4735 #define MS_BRAIN_SMASH 43
4736 #define MS_CAUSE_1 44
4737 #define MS_CAUSE_2 45
4738 #define MS_CAUSE_3 46
4739 #define MS_CAUSE_4 47
4740 #define MS_BOLT_ACID 48
4741 #define MS_BOLT_ELEC 49
4742 #define MS_BOLT_FIRE 50
4743 #define MS_BOLT_COLD 51
4744 #define MS_STARBURST 52
4745 #define MS_BOLT_NETHER 53
4746 #define MS_BOLT_WATER 54
4747 #define MS_BOLT_MANA 55
4748 #define MS_BOLT_PLASMA 56
4749 #define MS_BOLT_ICE 57
4750 #define MS_MAGIC_MISSILE 58
4757 #define MS_HAND_DOOM 65
4759 #define MS_INVULNER 67
4761 #define MS_TELEPORT 69
4763 #define MS_SPECIAL 71
4764 #define MS_TELE_TO 72
4765 #define MS_TELE_AWAY 73
4766 #define MS_TELE_LEVEL 74
4767 #define MS_PSY_SPEAR 75
4768 #define MS_DARKNESS 76
4769 #define MS_MAKE_TRAP 77
4770 #define MS_FORGET 78
4771 #define MS_RAISE_DEAD 79
4773 #define MS_S_CYBER 81
4774 #define MS_S_MONSTER 82
4775 #define MS_S_MONSTERS 83
4777 #define MS_S_SPIDER 85
4778 #define MS_S_HOUND 86
4779 #define MS_S_HYDRA 87
4780 #define MS_S_ANGEL 88
4781 #define MS_S_DEMON 89
4782 #define MS_S_UNDEAD 90
4783 #define MS_S_DRAGON 91
4784 #define MS_S_HI_UNDEAD 92
4785 #define MS_S_HI_DRAGON 93
4786 #define MS_S_AMBERITE 94
4787 #define MS_S_UNIQUE 95
4790 #define MON_BEGGAR 12
4791 #define MON_LEPER 13
4792 #define MON_BLACK_MARKET 14
4794 #define MON_NOV_PRIEST 45
4798 #define MON_LOUSE 69
4799 #define MON_PIRANHA 70
4800 #define MON_COPPER_COINS 85
4801 #define MON_NOV_PALADIN 97
4802 #define MON_GREEN_G 100
4803 #define MON_NOV_PRIEST_G 109
4804 #define MON_SILVER_COINS 117
4805 #define MON_D_ELF 122
4806 #define MON_MANES 128
4807 #define MON_LOST_SOUL 133
4808 #define MON_ROBIN_HOOD 138
4809 #define MON_NOV_PALADIN_G 147
4810 #define MON_PHANTOM_W 152
4811 #define MON_WOUNDED_BEAR 159
4812 #define MON_D_ELF_MAGE 178
4813 #define MON_D_ELF_WARRIOR 182
4814 #define MON_BLUE_HORROR 189
4815 #define MON_GOLD_COINS 195
4816 #define MON_VORPAL_BUNNY 205
4817 #define MON_PRIEST 225
4818 #define MON_D_ELF_PRIEST 226
4819 #define MON_TIGER 230
4820 #define MON_MITHRIL_COINS 239
4821 #define MON_DRUID 241
4822 #define MON_PINK_HORROR 242
4823 #define MON_HILL_GIANT 255
4824 #define MON_WERERAT 270
4825 #define MON_UMBER_HULK 283
4826 #define MON_ORC_CAPTAIN 285
4827 #define MON_BERSERKER 293
4828 #define MON_SHAGRAT 314
4829 #define MON_GORBAG 315
4830 #define MON_STONE_GIANT 321
4831 #define MON_D_ELF_LORD 348
4832 #define MON_FIRE_VOR 354
4833 #define MON_WATER_VOR 355
4834 #define MON_ARCH_VILE 357
4835 #define MON_COLD_VOR 358
4836 #define MON_ENERGY_VOR 359
4837 #define MON_IRON_GOLEM 367
4838 #define MON_JADE_MONK 370
4839 #define MON_D_ELF_WARLOCK 375
4840 #define MON_HAGEN 383
4841 #define MON_MENELDOR 384
4842 #define MON_PHANTOM_B 385
4843 #define MON_C_CRAWLER 395
4844 #define MON_XICLOTLAN 396
4845 #define MON_D_ELF_DRUID 400
4846 #define MON_TROLL_PRIEST 403
4847 #define MON_GWAIHIR 410
4848 #define MON_ANGEL 417
4849 #define MON_ADAMANT_COINS 423
4850 #define MON_SPIRIT_NAGA 436
4851 #define MON_GACHAPIN 441
4852 #define MON_BASILISK 453
4853 #define MON_ARCHANGEL 456
4854 #define MON_MITHRIL_GOLEM 464
4855 #define MON_THORONDOR 468
4856 #define MON_SHADOW_DRAKE 471
4857 #define MON_GHOST 477
4858 #define MON_OGRE_SHAMAN 479
4859 #define MON_NINJA 485
4860 #define MON_BICLOPS 490
4861 #define MON_IVORY_MONK 492
4862 #define MON_LOG_MASTER 498
4863 #define MON_ETHER_DRAKE 504
4864 #define MON_GOEMON 505
4865 #define MON_CHERUB 511
4866 #define MON_WATER_ELEM 512
4867 #define MON_JURT 517
4868 #define MON_LICH 518
4869 #define MON_BLOODLETTER 523
4870 #define MON_HALFLING_S 539
4871 #define MON_GRAV_HOUND 540
4872 #define MON_REVENANT 555
4873 #define MON_RAAL 557
4874 #define MON_COLOSSUS 558
4875 #define MON_NIGHTBLADE 564
4876 #define MON_ELDER_THING 569
4877 #define MON_CRYPT_THING 577
4878 #define MON_NEXUS_VOR 587
4879 #define MON_PLASMA_VOR 588
4880 #define MON_TIME_VOR 589
4881 #define MON_M_MH_DRAGON 593
4882 #define MON_MANDOR 598
4883 #define MON_SHIM_VOR 600
4884 #define MON_SERAPH 605
4885 #define MON_KAVLAX 616
4886 #define MON_ETTIN 621
4887 #define MON_VAMPIRE_LORD 623
4888 #define MON_JUBJUB 640
4889 #define MON_CLUB_DEMON 648
4890 #define MON_D_ELF_SORC 657
4891 #define MON_MASTER_LICH 658
4892 #define MON_RINALDO 660
4893 #define MON_ARCHON 661
4894 #define MON_UND_BEHOLDER 664
4895 #define MON_IRON_LICH 666
4896 #define MON_JACK_SHADOWS 670
4897 #define MON_LLOIGOR 682
4898 #define MON_DREADMASTER 690
4899 #define MON_DAWN 693
4900 #define MON_NAZGUL 696
4901 #define MON_SMAUG 697
4902 #define MON_STORMBRINGER 698
4903 #define MON_ULTRA_PALADIN 699
4904 #define MON_G_TITAN 702
4905 #define MON_FAFNER 712
4906 #define MON_G_BALROG 720
4907 #define MON_TIME_HOUND 725
4908 #define MON_PLASMA_HOUND 726
4909 #define MON_BULLGATES 732
4910 #define MON_SANTACLAUS 733
4911 #define MON_LORD_CHAOS 737
4912 #define MON_TINDALOS 739
4913 #define MON_DEMILICH 742
4914 #define MON_NIGHTCRAWLER 744
4915 #define MON_CHAOS_VOR 751
4916 #define MON_AETHER_VOR 752
4917 #define MON_FUNDIN 762
4918 #define MON_DWORKIN 763
4919 #define MON_NIGHTWALKER 768
4920 #define MON_RAPHAEL 769
4921 #define MON_SARUMAN 771
4922 #define MON_GANDALF 772
4923 #define MON_BRAND 773
4924 #define MON_SHADOWLORD 774
4925 #define MON_ARCHLICH 776
4926 #define MON_CHAOS_HOUND 779
4927 #define MON_ULT_BEHOLDER 781
4928 #define MON_SHAMBLER 786
4929 #define MON_BLEYS 789
4930 #define MON_FIONA 791
4931 #define MON_SKY_DRAKE 793
4932 #define MON_JULIAN 794
4933 #define MON_BLACK_REAVER 798
4934 #define MON_CAINE 799
4935 #define MON_GERARD 807
4936 #define MON_UNGOLIANT 808
4937 #define MON_ATLACH_NACHA 809
4938 #define MON_Y_GOLONAC 810
4939 #define MON_AETHER_HOUND 811
4940 #define MON_WARP_DEMON 812
4941 #define MON_ERIC 813
4942 #define MON_UNMAKER 815
4943 #define MON_CYBER 816
4944 #define MON_KLING 819
4945 #define MON_CORWIN 820
4946 #define MON_ANGMAR 825
4947 #define MON_CANTORAS 830
4948 #define MON_GODZILLA 832
4949 #define MON_SPAWN_CTH 836
4950 #define MON_SURTUR 837
4951 #define MON_TARRASQUE 838
4952 #define MON_LUNGORTHIN 839
4953 #define MON_CYBER_KING 843
4954 #define MON_WYRM_POWER 847
4955 #define MON_NODENS 849
4956 #define MON_JORMUNGAND 854
4957 #define MON_DESTROYER 855
4958 #define MON_GOTHMOG 856
4959 #define MON_G_CTHULHU 857
4960 #define MON_SAURON 858
4961 #define MON_UNICORN_ORD 859
4962 #define MON_OBERON 860
4963 #define MON_MORGOTH 861
4964 #define MON_SERPENT 862
4965 #define MON_ONE_RING 864
4966 #define MON_CAAWS 866
4967 #define MON_CULVERIN 867
4968 #define MON_EBONY_MONK 870
4969 #define MON_HAGURE 871
4970 #define MON_OROCHI 872
4971 #define MON_ECHIZEN 873
4972 #define MON_SPECT_WYRM 874
4974 #define MON_OHMU 879
4975 #define MON_WONG 880
4976 #define MON_ZOMBI_SERPENT 883
4977 #define MON_D_ELF_SHADE 886
4978 #define MON_MANA_HOUND 887
4979 #define MON_VENOM_WYRM 890
4980 #define MON_BAZOOKER 896
4981 #define MON_SHARD_VOR 897
4982 #define MON_MASTER_MYS 916
4983 #define MON_G_MASTER_MYS 917
4985 #define MON_TSUCHINOKO 926
4986 #define MON_GCWADL 929
4987 #define MON_LOCKE_CLONE 930
4988 #define MON_CALDARM 931
4989 #define MON_BANORLUPART 932
4990 #define MON_BANOR 933
4991 #define MON_LUPART 934
4992 #define MON_KENSHIROU 936
4993 #define MON_W_KNIGHT 938
4994 #define MON_PLANETAR 942
4995 #define MON_SOLAR 943
4996 #define MON_BIKETAL 945
4997 #define MON_RICH 948
4998 #define MON_IKETA 949
4999 #define MON_B_DEATH_SWORD 953
5000 #define MON_YASE_HORSE 955
5001 #define MON_HORSE 956
5002 #define MON_BOTEI 963
5003 #define MON_KAGE 964
5004 #define MON_JAIAN 967
5005 #define MON_BELD 973
5006 #define MON_THAT_BAT 975
5007 #define MON_SHUTEN 979
5008 #define MON_FENGHUANG 988
5009 #define MON_KIRIN 989
5010 #define MON_BAHAMUT 1000
5011 #define MON_SUKE 1001
5012 #define MON_KAKU 1002
5013 #define MON_GHOST_Q 1003
5014 #define MON_PIP 1004
5015 #define MON_A_GOLD 1010
5016 #define MON_A_SILVER 1011
5017 #define MON_ROLENTO 1013
5018 #define MON_RAOU 1018
5019 #define MON_SHURYUUDAN 1023
5020 #define MON_WAHHA 1031
5021 #define MON_DEBBY 1032
5022 #define MON_KNI_TEMPLAR 1037
5023 #define MON_PALADIN 1038
5024 #define MON_CHAMELEON 1040
5025 #define MON_CHAMELEON_K 1041
5026 #define MON_TOPAZ_MONK 1047
5027 #define MON_NOBORTA 1059
5028 #define MON_MORI_TROLL 1060
5029 #define MON_BARNEY 1061
5030 #define MON_GROO 1062
5031 #define MON_LOUSY 1063
5032 #define MON_JIZOTAKO 1065
5033 #define MON_TANUKI 1067
5035 /* Maximum "Nazguls" number */
5036 #define MAX_NAZGUL_NUM 5
5038 #define DO_AUTOPICK 0x01
5039 #define DO_AUTODESTROY 0x02
5040 #define DO_DISPLAY 0x04
5041 #define DONT_AUTOPICK 0x08
5042 #define ITEM_DISPLAY 0x10
5043 #define DO_QUERY_AUTOPICK 0x20
5046 #define MAGIC_GLOVE_REDUCE_MANA 0x0001
5047 #define MAGIC_FAIL_5PERCENT 0x0002
5048 #define MAGIC_GAIN_EXP 0x0004
5050 #define VIRTUE_LARGE 1
5051 #define VIRTUE_SMALL 2
5053 #define SPELL_DD_S 27
5054 #define SPELL_DD_T 13
5056 #define SPELL_KABE 20
5058 #define KNOW_STAT 0x01
5059 #define KNOW_HPRATE 0x02
5064 #define MUSIC_NONE 0
5065 #define MUSIC_SLOW 1
5066 #define MUSIC_BLESS 2
5067 #define MUSIC_STUN 3
5068 #define MUSIC_L_LIFE 4
5069 #define MUSIC_FEAR 5
5070 #define MUSIC_HERO 6
5071 #define MUSIC_MIND 7
5072 #define MUSIC_STEALTH 8
5074 #define MUSIC_CONF 10
5075 #define MUSIC_SOUND 11
5076 #define MUSIC_CHARM 12
5077 #define MUSIC_WALL 13
5078 #define MUSIC_RESIST 14
5079 #define MUSIC_SPEED 15
5080 #define MUSIC_DISPEL 16
5081 #define MUSIC_SARUMAN 17
5082 #define MUSIC_QUAKE 18
5083 #define MUSIC_STASIS 19
5084 #define MUSIC_SHERO 20
5085 #define MUSIC_H_LIFE 21
5086 #define MUSIC_INVULN 22
5087 #define MUSIC_PSI 23
5089 #define MUSIC_DETECT 101
5091 #define music_singing(X) ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] == X))
5093 #define HISSATSU_NONE 0
5094 #define HISSATSU_2 1
5095 #define HISSATSU_3WAY 2
5096 #define HISSATSU_SUTEMI 3
5097 #define HISSATSU_FIRE 4
5098 #define HISSATSU_COLD 5
5099 #define HISSATSU_POISON 6
5100 #define HISSATSU_ELEC 7
5101 #define HISSATSU_NYUSIN 8
5102 #define HISSATSU_FUKI 9
5103 #define HISSATSU_MAJIN 10
5104 #define HISSATSU_BOOMER 11
5105 #define HISSATSU_DRAIN 12
5106 #define HISSATSU_SEKIRYUKA 13
5107 #define HISSATSU_OTAKEBI 14
5108 #define HISSATSU_SHOUGE 15
5109 #define HISSATSU_CONF 16
5110 #define HISSATSU_ISSEN 17
5111 #define HISSATSU_KYUSHO 18
5112 #define HISSATSU_KONSIN 19
5113 #define HISSATSU_HYAKU 20
5114 #define HISSATSU_MINEUCHI 21
5115 #define HISSATSU_MEKIKI 22
5116 #define HISSATSU_ZANMA 23
5117 #define HISSATSU_UNDEAD 24
5118 #define HISSATSU_HAGAN 25
5119 #define HISSATSU_QUAKE 26
5120 #define HISSATSU_COUNTER 27
5121 #define HISSATSU_HARAI 28
5122 #define HISSATSU_3DAN 29
5123 #define HISSATSU_100NIN 30
5125 #define HISSATSU_IAI 100
5128 * Special essence id for Weapon smith
5130 #define MIN_SPECIAL_ESSENCE 200
5132 #define ESSENCE_ATTACK (MIN_SPECIAL_ESSENCE + 0)
5133 #define ESSENCE_AC (MIN_SPECIAL_ESSENCE + 1)
5134 #define ESSENCE_TMP_RES_ACID (MIN_SPECIAL_ESSENCE + 2)
5135 #define ESSENCE_TMP_RES_ELEC (MIN_SPECIAL_ESSENCE + 3)
5136 #define ESSENCE_TMP_RES_FIRE (MIN_SPECIAL_ESSENCE + 4)
5137 #define ESSENCE_TMP_RES_COLD (MIN_SPECIAL_ESSENCE + 5)
5138 #define ESSENCE_SH_FIRE (MIN_SPECIAL_ESSENCE + 6)
5139 #define ESSENCE_SH_ELEC (MIN_SPECIAL_ESSENCE + 7)
5140 #define ESSENCE_SH_COLD (MIN_SPECIAL_ESSENCE + 8)
5141 #define ESSENCE_RESISTANCE (MIN_SPECIAL_ESSENCE + 9)
5142 #define ESSENCE_SUSTAIN (MIN_SPECIAL_ESSENCE + 10)
5143 #define ESSENCE_SLAY_GLOVE (MIN_SPECIAL_ESSENCE + 11)
5146 #define DUNGEON_MODE_NONE 0
5147 #define DUNGEON_MODE_AND 1
5148 #define DUNGEON_MODE_NAND 2
5149 #define DUNGEON_MODE_OR 3
5150 #define DUNGEON_MODE_NOR 4
5152 /*** Dungeon type flags -- DG ***/
5153 #define DF1_WINNER 0x00000001L
5154 #define DF1_MAZE 0x00000002L
5155 #define DF1_SMALLEST 0x00000004L
5156 #define DF1_BEGINNER 0x00000008L
5157 #define DF1_BIG 0x00000010L
5158 #define DF1_NO_DOORS 0x00000020L
5159 #define DF1_WATER_RIVER 0x00000040L
5160 #define DF1_LAVA_RIVER 0x00000080L
5161 #define DF1_XXX08 0x00000100L
5162 #define DF1_XXX09 0x00000200L
5163 #define DF1_CAVE 0x00000400L
5164 #define DF1_CAVERN 0x00000800L
5165 #define DF1_XXX12 0x00001000L
5166 #define DF1_XXX13 0x00002000L
5167 #define DF1_XXX14 0x00004000L
5168 #define DF1_XXX15 0x00008000L
5169 #define DF1_FORGET 0x00010000L
5170 #define DF1_LAKE_WATER 0x00020000L
5171 #define DF1_LAKE_LAVA 0x00040000L
5172 #define DF1_LAKE_RUBBLE 0x00080000L
5173 #define DF1_LAKE_TREE 0x00100000L
5174 #define DF1_NO_VAULT 0x00200000L
5175 #define DF1_ARENA 0x00400000L
5176 #define DF1_DESTROY 0x00800000L
5177 #define DF1_XXX24 0x01000000L
5178 #define DF1_NO_CAVE 0x02000000L
5179 #define DF1_NO_MAGIC 0x04000000L
5180 #define DF1_NO_MELEE 0x08000000L
5181 #define DF1_CHAMELEON 0x10000000L
5182 #define DF1_DARKNESS 0x20000000L
5183 #define DF1_XXX30 0x40000000L
5184 #define DF1_XXX31 0x80000000L
5186 #define DF1_LAKE_MASK (DF1_LAKE_WATER | DF1_LAKE_LAVA | DF1_LAKE_RUBBLE | DF1_LAKE_TREE)
5188 #define DUNGEON_ANGBAND 1
5189 #define DUNGEON_GALGALS 2
5190 #define DUNGEON_ORC 3
5191 #define DUNGEON_MAZE 4
5192 #define DUNGEON_DRAGON 5
5193 #define DUNGEON_GRAVE 6
5194 #define DUNGEON_WOOD 7
5195 #define DUNGEON_VOLCANO 8
5196 #define DUNGEON_HELL 9
5197 #define DUNGEON_HEAVEN 10
5198 #define DUNGEON_OCEAN 11
5199 #define DUNGEON_CASTLE 12
5200 #define DUNGEON_CTH 13
5201 #define DUNGEON_MOUNTAIN 14
5202 #define DUNGEON_GOLD 15
5203 #define DUNGEON_NO_MAGIC 16
5204 #define DUNGEON_NO_MELEE 17
5205 #define DUNGEON_CHAMELEON 18
5206 #define DUNGEON_DARKNESS 19
5210 * Flags for change floor mode
5212 #define CFM_UP 0x0001 /* Move up */
5213 #define CFM_DOWN 0x0002 /* Move down */
5214 #define CFM_LONG_STAIRS 0x0004 /* Randomly occurred long stairs/shaft */
5215 #define CFM_XXX 0x0008 /* XXX */
5216 #define CFM_SHAFT 0x0010 /* Shaft */
5217 #define CFM_RAND_PLACE 0x0020 /* Arrive at random grid */
5218 #define CFM_RAND_CONNECT 0x0040 /* Connect with random stairs */
5219 #define CFM_SAVE_FLOORS 0x0080 /* Save floors */
5220 #define CFM_NO_RETURN 0x0100 /* Flee from random quest etc... */
5221 #define CFM_FIRST_FLOOR 0x0200 /* Create exit from the dungeon */
5225 * Flags for save/load temporal saved floor file
5227 #define SLF_SECOND 0x0001 /* Called from another save/load function */
5228 #define SLF_NO_KILL 0x0002 /* Don't kill temporal files */
5232 * Flags for wr_item()/rd_item()
5234 #define SAVE_ITEM_PVAL 0x00000001
5235 #define SAVE_ITEM_DISCOUNT 0x00000002
5236 #define SAVE_ITEM_NUMBER 0x00000004
5237 #define SAVE_ITEM_NAME1 0x00000008
5238 #define SAVE_ITEM_NAME2 0x00000010
5239 #define SAVE_ITEM_TIMEOUT 0x00000020
5240 #define SAVE_ITEM_TO_H 0x00000040
5241 #define SAVE_ITEM_TO_D 0x00000080
5242 #define SAVE_ITEM_TO_A 0x00000100
5243 #define SAVE_ITEM_AC 0x00000200
5244 #define SAVE_ITEM_DD 0x00000400
5245 #define SAVE_ITEM_DS 0x00000800
5246 #define SAVE_ITEM_IDENT 0x00001000
5247 #define SAVE_ITEM_MARKED 0x00002000
5248 #define SAVE_ITEM_ART_FLAGS0 0x00004000
5249 #define SAVE_ITEM_ART_FLAGS1 0x00008000
5250 #define SAVE_ITEM_ART_FLAGS2 0x00010000
5251 #define SAVE_ITEM_ART_FLAGS3 0x00020000
5252 #define SAVE_ITEM_CURSE_FLAGS 0x00040000
5253 #define SAVE_ITEM_HELD_M_IDX 0x00080000
5254 #define SAVE_ITEM_XTRA1 0x00100000
5255 #define SAVE_ITEM_XTRA2 0x00200000
5256 #define SAVE_ITEM_XTRA3 0x00400000
5257 #define SAVE_ITEM_XTRA4 0x00800000
5258 #define SAVE_ITEM_XTRA5 0x01000000
5259 #define SAVE_ITEM_FEELING 0x02000000
5260 #define SAVE_ITEM_INSCRIPTION 0x04000000
5261 #define SAVE_ITEM_ART_NAME 0x08000000
5265 * Flags for wr_monster()/rd_monster()
5267 #define SAVE_MON_AP_R_IDX 0x00000001
5268 #define SAVE_MON_SUB_ALIGN 0x00000002
5269 #define SAVE_MON_CSLEEP 0x00000004
5270 #define SAVE_MON_FAST 0x00000008
5271 #define SAVE_MON_SLOW 0x00000010
5272 #define SAVE_MON_STUNNED 0x00000020
5273 #define SAVE_MON_CONFUSED 0x00000040
5274 #define SAVE_MON_MONFEAR 0x00000080
5275 #define SAVE_MON_TARGET_Y 0x00000100
5276 #define SAVE_MON_TARGET_X 0x00000200
5277 #define SAVE_MON_INVULNER 0x00000400
5278 #define SAVE_MON_SMART 0x00000800
5279 #define SAVE_MON_EXP 0x00001000
5280 #define SAVE_MON_MFLAG2 0x00002000
5281 #define SAVE_MON_NICKNAME 0x00004000
5282 #define SAVE_MON_PARENT 0x00008000
5286 * Constant for kinds of mimic
5288 #define MIMIC_NONE 0
5289 #define MIMIC_DEMON 1
5290 #define MIMIC_DEMON_LORD 2
5291 #define MIMIC_VAMPIRE 3
5294 #define MIMIC_FLAGS choice
5295 #define MIMIC_IS_NONLIVING 0x00000001
5296 #define MIMIC_IS_DEMON 0x00000002
5297 #define MIMIC_IS_UNDEAD 0x00000004
5300 #define prace_is_(A) (!p_ptr->mimic_form && (p_ptr->prace == A))
5302 /* Sub-alignment flags for neutral monsters */
5303 #define SUB_ALIGN_NEUTRAL 0x0000
5304 #define SUB_ALIGN_EVIL 0x0001
5305 #define SUB_ALIGN_GOOD 0x0002
5307 /* Temporary flags macro */
5308 #define IS_FAST() (p_ptr->fast || music_singing(MUSIC_SPEED) || music_singing(MUSIC_SHERO))
5309 #define IS_INVULN() (p_ptr->invuln || music_singing(MUSIC_INVULN))
5310 #define IS_HERO() (p_ptr->hero || music_singing(MUSIC_HERO) || music_singing(MUSIC_SHERO))
5311 #define IS_BLESSED() (p_ptr->blessed || music_singing(MUSIC_BLESS))
5312 #define IS_OPPOSE_ACID() (p_ptr->oppose_acid || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
5313 #define IS_OPPOSE_ELEC() (p_ptr->oppose_elec || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
5314 #define IS_OPPOSE_FIRE() (p_ptr->oppose_fire || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
5315 #define IS_OPPOSE_COLD() (p_ptr->oppose_cold || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
5316 #define IS_OPPOSE_POIS() (p_ptr->oppose_pois || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
5317 #define IS_TIM_ESP() (p_ptr->tim_esp || music_singing(MUSIC_MIND))
5318 #define IS_TIM_STEALTH() (p_ptr->tim_stealth || music_singing(MUSIC_STEALTH))
5320 /* Is "teleport level" ineffective to this target? */
5321 #define TELE_LEVEL_IS_INEFF(TARGET) \
5322 (p_ptr->inside_arena || p_ptr->inside_battle || \
5323 (p_ptr->inside_quest && !random_quest_number(dun_level)) || \
5324 (((TARGET) <= 0) && (quest_number(dun_level) || (dun_level >= d_info[dungeon_type].maxdepth)) && \
5325 (dun_level >= 1) && ironman_downward))
5328 * World Score -- internet resource value
5330 #define HTTP_PROXY "" /* Default proxy url */
5331 #define HTTP_PROXY_PORT 0 /* Default proxy port */
5332 #define HTTP_TIMEOUT 20 /* Timeout length (second) */
5333 #define SCORE_SERVER "www.kmc.gr.jp" /* Default score server url */
5334 #define SCORE_PORT 80 /* Default score server port */
5336 #define MAX_MACRO_MOD 12
5337 #define MAX_MACRO_TRIG 200
5339 #define SCREEN_BUF_SIZE 65536 /* max screen dump buffer size */