PageRenderTime 95ms CodeModel.GetById 20ms RepoModel.GetById 2ms app.codeStats 0ms

/src/defines.h

https://github.com/NickMcConnell/Beleriand
C Header | 2411 lines | 1254 code | 380 blank | 777 comment | 31 complexity | cb4ad089e57eea9319589354f10db85a MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. #ifndef INCLUDED_DEFINES_H
  2. #define INCLUDED_DEFINES_H
  3. /** \file defines.h
  4. \brief Constant, flag and macro definitions
  5. * Version #, grid, etc. size, MAX_* figures, limits, constants, critical
  6. * values, etc. for every characteristic of Angband. Indexes, text locat-
  7. * ions, list of summonable monsters. Feature, artifact and ego-item codes.
  8. * Object tval (kind) and sval (specific type) with sval limitations.
  9. * Monster blow constants, function, player, object and monster bit flags
  10. * (translation from code to flag). Definitions of options and object in-
  11. * scriptions.
  12. *
  13. * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
  14. *
  15. * This software may be copied and distributed for educational, research,
  16. * and not for profit purposes provided that this copyright and statement
  17. * are included in all such copies. Other copyrights may also apply.
  18. *
  19. *
  20. * Do not edit this file unless you know *exactly* what you are doing.
  21. *
  22. * Some of the values in this file were chosen to preserve game balance,
  23. * while others are hard-coded based on the format of old save-files, the
  24. * definition of arrays in various places, mathematical properties, fast
  25. * computation, storage limits, or the format of external text files.
  26. *
  27. * Changing some of these values will induce crashes or memory errors or
  28. * savefile mis-reads. Most of the comments in this file are meant as
  29. * reminders, not complete descriptions, and even a complete knowledge
  30. * of the source may not be sufficient to fully understand the effects
  31. * of changing certain definitions.
  32. *
  33. * Lastly, note that the code does not always use the symbolic constants
  34. * below, and sometimes uses various hard-coded values that may not even
  35. * be defined in this file, but which may be related to definitions here.
  36. * This is of course bad programming practice, but nobody is perfect...
  37. *
  38. * For example, there are MANY things that depend on the screen being
  39. * 80x24, with the top line used for messages, the bottom line being
  40. * used for status, and exactly 22 lines used to show the dungeon.
  41. * Just because your screen can hold 46 lines does not mean that the
  42. * game will work if you try to use 44 lines to show the dungeon.
  43. *
  44. * You have been warned.
  45. */
  46. /* Hack */
  47. #include "tvalsval.h"
  48. /**
  49. * Name of the version/variant
  50. */
  51. #define SAVEFILE_NAME "BELE"
  52. #define DEBUG 1
  53. /**
  54. * Current version string - according to FAangband reckoning.
  55. */
  56. /*
  57. #ifdef BUILD_ID
  58. #define VERSION_STRING "1.0.0 (" BUILD_ID ")"
  59. #endif
  60. */
  61. /*
  62. * Current FAangband version numbers.
  63. */
  64. #define VERSION_MAJOR 1
  65. #define VERSION_MINOR 0
  66. #define VERSION_PATCH 0
  67. #define VERSION_EXTRA 0
  68. /**
  69. * Number of grids in each block (vertically)
  70. * Probably hard-coded to 11, see "generate.c"
  71. */
  72. #define BLOCK_HGT 11
  73. /**
  74. * Number of grids in each block (horizontally)
  75. * Probably hard-coded to 11, see "generate.c"
  76. */
  77. #define BLOCK_WID 11
  78. /**
  79. * Number of grids in each chunk (vertically)
  80. */
  81. #define CHUNK_HGT 22
  82. /**
  83. * Number of grids in each chunkk (horizontally)
  84. */
  85. #define CHUNK_WID 22
  86. /**
  87. * Number of grids in each panel (vertically)
  88. */
  89. #define PANEL_HGT ((int)(BLOCK_HGT / tile_height))
  90. /**
  91. * Number of grids in each panel (horizontally)
  92. */
  93. #define PANEL_WID ((int)(BLOCK_WID / tile_width))
  94. /**
  95. * Number of text rows in each map screen, regardless of tile size
  96. */
  97. #define SCREEN_ROWS (Term->hgt - ROW_MAP - 1)
  98. /**
  99. * Number of grids in each screen (vertically)
  100. */
  101. #define SCREEN_HGT ((int) (SCREEN_ROWS / tile_height))
  102. /**
  103. * Number of grids in each screen (horizontally)
  104. */
  105. #define SCREEN_WID ((int)((Term->wid - COL_MAP - 1) / tile_width))
  106. #define ROW_MAP 1
  107. #define COL_MAP 13
  108. /**
  109. * Number of grids in each dungeon (from top to bottom)
  110. * Must be a multiple of SCREEN_HGT
  111. * Must be less or equal to 256
  112. */
  113. #define ARENA_HGT 66
  114. /**
  115. * Number of grids in each dungeon (from left to right)
  116. * Must be a multiple of SCREEN_WID
  117. * Must be less or equal to 256
  118. */
  119. #define ARENA_WID 66
  120. /*
  121. * Radii for various detection spells. -BR-
  122. */
  123. #define DETECT_RAD_DEFAULT 30
  124. #define DETECT_RAD_MAP 255
  125. /*
  126. * Hard line maxima for char_attr lines
  127. */
  128. #define MAX_C_A_LEN 80
  129. #define MAX_C_A_SML 48
  130. /**
  131. * Maximum amount of Angband windows.
  132. */
  133. #define ANGBAND_TERM_MAX 8
  134. /**
  135. * Maximum number of player "sex" types (see "table.c", etc)
  136. */
  137. #define MAX_SEXES 2
  138. /**
  139. * Maximum amount of starting equipment
  140. */
  141. #define MAX_START_ITEMS 4
  142. #define STARTING_GOLD 600
  143. /**
  144. * Maximum number of specialty abilities for a single character
  145. */
  146. #define MAX_SPECIALTIES 10
  147. /**
  148. * Number of specialty abilities available to a character class
  149. */
  150. #define CLASS_SPECIALTIES 15
  151. /*
  152. * Hack -- first normal and random artifact in the artifact list.
  153. * All of the artifacts with indexes from 1 to 22 are special (lights,
  154. * rings, amulets), the ones from 23 to 209 are normal, and the ones from
  155. * 210 to 249 are random.
  156. */
  157. #define ART_MIN_NORMAL 23
  158. #define ART_MIN_RANDOM 210
  159. /*
  160. * Number of tval/min-sval/max-sval slots per ego_item
  161. */
  162. #define EGO_TVALS_MAX 3
  163. /**
  164. * Hack -- Maximum number of quests
  165. */
  166. #define MAX_Q_IDX 5
  167. /**
  168. * Maximum number of high scores in the high score file
  169. */
  170. #define MAX_HISCORES 100
  171. /**
  172. * Maximum dungeon level. The player can never reach this level
  173. * in the dungeon, and this value is used for various calculations
  174. * involving object and monster creation. It must be at least 100.
  175. * Setting it below 128 may prevent the creation of some objects.
  176. */
  177. #define MAX_DEPTH 128
  178. /**
  179. * Maximum number of paths from a wilderness stage to adjoining stages.
  180. */
  181. #define MAX_PATHS 13
  182. /**
  183. * Number of recall points the player can set
  184. */
  185. #define MAX_RECALL_PTS 4
  186. /**
  187. * Maximum number of live world chunks.
  188. */
  189. #define MAX_CHUNKS 256
  190. /**
  191. * Size increment of the generated locations array
  192. */
  193. #define GEN_LOC_INCR 128
  194. /**
  195. * Maximum x and y values for region grids
  196. */
  197. #define MAX_Y_REGION 588
  198. #define MAX_X_REGION 735
  199. /**
  200. * Maximum number of region borders.
  201. */
  202. #define MAX_BORDERS 8
  203. /**
  204. * Maximum size of the "view" array (see "cave.c")
  205. * Note that the "view radius" will NEVER exceed 20, and even if the "view"
  206. * was octagonal, we would never require more than 1520 entries in the array.
  207. */
  208. #define VIEW_MAX 1536
  209. /**
  210. * Maximum size of the "temp" array (see "cave.c")
  211. * Note that we must be as large as "VIEW_MAX" for proper functioning
  212. * of the "update_view()" function, and we must also be as large as the
  213. * largest illuminatable room, but no room is larger than 800 grids. We
  214. * must also be large enough to allow "good enough" use as a circular queue,
  215. * to calculate monster flow, but note that the flow code is "paranoid".
  216. */
  217. #define TEMP_MAX 1536
  218. /**
  219. * Maximum distance from the character to store flow (noise) information
  220. */
  221. #define NOISE_STRENGTH 45
  222. /**
  223. * Character turns it takes for smell to totally dissipate
  224. */
  225. #define SMELL_STRENGTH 60
  226. /**
  227. * OPTION: Maximum number of "quarks" (see "io.c")
  228. * Default: assume at most 512 different inscriptions are used
  229. */
  230. #define QUARK_MAX 512
  231. /**
  232. * OPTION: Maximum number of autoinscriptions(see "object1.c")
  233. */
  234. #define AUTOINSCRIPTIONS_MAX 216
  235. /**
  236. * OPTION: Maximum number of messages to remember (see "io.c")
  237. * Default: assume maximal memorization of 2048 total messages
  238. */
  239. #define MESSAGE_MAX 2048
  240. /**
  241. * OPTION: Maximum space for the message text buffer (see "io.c")
  242. * Default: assume that each of the 2048 messages is repeated an
  243. * average of three times, and has an average length of 48
  244. */
  245. #define MESSAGE_BUF 32768
  246. /**
  247. * Defines for graphics mode
  248. */
  249. #define GRAPHICS_NONE 0
  250. /* player_type.noscore flags */
  251. #define NOSCORE_WIZARD 0x0002
  252. #define NOSCORE_DEBUG 0x0008
  253. #define NOSCORE_BORG 0x0010
  254. /* History message types */
  255. #define HISTORY_PLAYER_BIRTH 0x0001 /* Player was born */
  256. #define HISTORY_ARTIFACT_UNKNOWN 0x0002 /* Player found unknown artifact */
  257. #define HISTORY_ARTIFACT_KNOWN 0x0004 /* Player has IDed an artifact */
  258. #define HISTORY_ARTIFACT_LOST 0x0008 /* Player had an artifact and lost it */
  259. #define HISTORY_PLAYER_DEATH 0x0010 /* Player has been slain */
  260. #define HISTORY_SLAY_UNIQUE 0x0020 /* Player has slain a unique monster */
  261. #define HISTORY_USER_INPUT 0x0040 /* User-added note */
  262. #define HISTORY_MOVE_HOUSE 0x0080 /* PLayer moved house */
  263. #define HISTORY_GAIN_LEVEL 0x0100 /* Player gained a level */
  264. #define HISTORY_GAIN_SPECIALTY 0x0200 /* Player gained a specialty */
  265. /**
  266. * List of commands that will be auto-repeated
  267. *
  268. * ToDo: This string should be user-configurable.
  269. */
  270. #define AUTO_REPEAT_COMMANDS "TBDoc+"
  271. /**
  272. * Given an array, determine how many elements are in the array.
  273. */
  274. #define N_ELEMENTS(a) (sizeof(a) / sizeof((a)[0]))
  275. /**
  276. * Maximum value storable in a "byte" (hard-coded)
  277. #define MAX_UCHAR 255 */
  278. /**
  279. * Maximum value storable in a "s16b" (hard-coded)
  280. #define MAX_SHORT 32767 */
  281. /*** FAangband Themed Levels ***/
  282. /**
  283. * No current theme (player is on a normal level)
  284. */
  285. #define THEME_NONE 0
  286. /*
  287. * Themed level indices. Used to activate any theme-specific code.
  288. * See generate.c for the table of themed level information.
  289. */
  290. #define THEME_ELEMENTAL 1
  291. #define THEME_DRAGON 2
  292. #define THEME_WILDERNESS 3
  293. #define THEME_DEMON 4
  294. #define THEME_MINE 5
  295. #define THEME_WARLORDS 6
  296. #define THEME_AELUIN 7
  297. #define THEME_ESTOLAD 8
  298. #define THEME_SLAIN 9
  299. /**
  300. * Current number of defined themes. The maximum theoretical number is 32.
  301. */
  302. #define THEME_MAX 9
  303. /*
  304. * Misc constants
  305. */
  306. #define TOWN_DAWN 2000 /* Number of turns from dawn to dawn XXX */
  307. #define BREAK_GLYPH 300 /* Rune of protection resistance */
  308. #define BTH_PLUS_ADJ 1 /* Adjust BTH per plus-to-hit */
  309. #define MON_MULT_ADJ 8 /* High value slows multiplication */
  310. #define MON_SUMMON_ADJ 2 /* Adjust level of summoned creatures */
  311. #define MON_DRAIN_LIFE 2 /* Percent of player exp drained per hit */
  312. #define USE_DEVICE 3 /* x> Harder devices x< Easier devices */
  313. /**
  314. * Percentage likelihood that monsters will be disturbed by the
  315. * character each ten game turns, assuming a stealth of zero.
  316. *
  317. * This value is 100 in Angband. It has been lowered in Oangband because
  318. * combat and other actions can temporarily increase the noise level.
  319. */
  320. #define WAKEUP_ADJ 90
  321. /**
  322. * There is a 1/40 (2.5%) chance of inflating the requested object_level
  323. * during the creation of an object (see "get_obj_num()" in "object.c").
  324. * Lower values yield better objects more often.
  325. */
  326. #define GREAT_OBJ 40
  327. /**
  328. * There is a 1/25 (4%) chance that ego-items with an inflated base-level are
  329. * generated when an object is turned into an ego-item (see make_ego_item()
  330. * in object2.c). As above, lower values yield better ego-items more often.
  331. */
  332. #define GREAT_EGO 25
  333. /**
  334. * There is a 1/25 (4%) chance of inflating the requested monster_level
  335. * during the creation of a monsters (see "get_mon_num()" in "monster2.c").
  336. * Lower values yield harder monsters more often. Value raised in FAangband.
  337. */
  338. #define NASTY_MON 25 /** 1/chance of inflated monster level */
  339. /**
  340. * Fraction of turns in which the extend magic special ability causes timers to
  341. * not decrement.
  342. */
  343. #define EXTEND_MAGIC_FRACTION 3 /* Skip 3rd turn -> 50% longer durations */
  344. /**
  345. * Amount of mana removed by Mana Burn specialty.
  346. */
  347. #define BASE_MANA_BURN 20
  348. /*
  349. * Refueling constants
  350. */
  351. #define FUEL_TORCH 5000 /* Maximum amount of fuel in a torch */
  352. #define FUEL_LAMP 15000 /* Maximum amount of fuel in a lantern */
  353. /*
  354. * More maximum values
  355. */
  356. #define MAX_SIGHT_LGE 20 /* Maximum view distance */
  357. #define MAX_RANGE_LGE 20 /* Maximum projection range */
  358. #define MAX_SIGHT_SML 10 /* Maximum view distance (small devices) */
  359. #define MAX_RANGE_SML 10 /* Maximum projection range (small devices) */
  360. #define MAX_SIGHT (OPT(adult_small_device) ? MAX_SIGHT_SML : MAX_SIGHT_LGE)
  361. #define MAX_RANGE (OPT(adult_small_device) ? MAX_RANGE_SML : MAX_RANGE_LGE)
  362. /**
  363. * There is a 1/160 chance per round of creating a new monster
  364. */
  365. #define MAX_M_ALLOC_CHANCE 160
  366. /**
  367. * Normal levels get at least 16 monsters
  368. */
  369. #define MIN_M_ALLOC_LEVEL 16
  370. /**
  371. * A monster can only "multiply" (reproduce) if there are fewer than 100
  372. * monsters on the level capable of such spontaneous reproduction. This
  373. * is a hack which prevents the "m_list[]" array from exploding due to
  374. * reproducing monsters. Messy, but necessary.
  375. */
  376. #define MAX_REPRO 100
  377. /**
  378. * Special player ghost slot in lib/edit/monster.txt
  379. */
  380. #define PLAYER_GHOST_RACE 799
  381. /*
  382. * Player constants
  383. */
  384. #define PY_MAX_EXP 99999999L /* Maximum exp */
  385. #define PY_MAX_GOLD 99999999L /* Maximum gold */
  386. #define PY_MAX_LEVEL 50 /* Maximum level */
  387. #define PY_MAX_SPELLS 64 /* Maximum number of spells */
  388. #define PY_MAX_BOOKS 11 /* Maximum number of spellbooks */
  389. /*
  390. * Flags for player_type.spell_flags[]
  391. */
  392. #define PY_SPELL_LEARNED 0x01 /* Spell has been learned */
  393. #define PY_SPELL_WORKED 0x02 /* Spell has been successfully tried */
  394. #define PY_SPELL_FORGOTTEN 0x04 /* Spell has been forgotten */
  395. /*
  396. * Player "food" crucial values
  397. */
  398. #define PY_FOOD_UPPER 20000 /* Upper limit on food counter */
  399. #define PY_FOOD_MAX 15000 /* Food value (Bloated) */
  400. #define PY_FOOD_FULL 10000 /* Food value (Normal) */
  401. #define PY_FOOD_ALERT 2000 /* Food value (Hungry) */
  402. #define PY_FOOD_WEAK 1000 /* Food value (Weak) */
  403. #define PY_FOOD_FAINT 500 /* Food value (Fainting) */
  404. #define PY_FOOD_STARVE 100 /* Food value (Starving) */
  405. /*
  406. * Player regeneration constants
  407. */
  408. #define PY_REGEN_NORMAL 197 /* Regen factor*2^16 when full */
  409. #define PY_REGEN_WEAK 98 /* Regen factor*2^16 when weak */
  410. #define PY_REGEN_FAINT 33 /* Regen factor*2^16 when fainting */
  411. #define PY_REGEN_HPBASE 1442 /* Min amount hp regen*2^16 */
  412. #define PY_REGEN_MNBASE 524 /* Min amount mana regen*2^16 */
  413. /** Maximum number of blow types available to Druids. -LM- */
  414. #define NUM_D_BLOWS 20
  415. /**
  416. * Maximum number of "normal" pack slots, and the index of the "overflow"
  417. * slot, which can hold an item, but only temporarily, since it causes the
  418. * pack to "overflow", dropping the "last" item onto the ground. Since this
  419. * value is used as an actual slot, it must be less than "INVEN_WIELD" (below).
  420. * Note that "INVEN_PACK" is probably hard-coded by its use in savefiles, and
  421. * by the fact that the screen can only show 23 items plus a one-line prompt.
  422. */
  423. #define INVEN_PACK 23
  424. /**
  425. * Like the previous but takes into account the (variably full quiver).
  426. */
  427. #define INVEN_MAX_PACK (INVEN_PACK - p_ptr->quiver_slots)
  428. /*
  429. * Indexes used for various "equipment" slots (hard-coded by savefiles, etc).
  430. */
  431. #define INVEN_WIELD 24
  432. #define INVEN_BOW 25
  433. #define INVEN_LEFT 26
  434. #define INVEN_RIGHT 27
  435. #define INVEN_NECK 28
  436. #define INVEN_LIGHT 29
  437. #define INVEN_BODY 30
  438. #define INVEN_OUTER 31
  439. #define INVEN_ARM 32
  440. #define INVEN_HEAD 33
  441. #define INVEN_HANDS 34
  442. #define INVEN_FEET 35
  443. #define INVEN_TOTAL 36
  444. /**
  445. *Quiver
  446. */
  447. #define QUIVER_START 37
  448. #define QUIVER_SIZE 10
  449. #define QUIVER_END 47
  450. /**
  451. * Each throwing weapon in the "quiver" takes up the space of this
  452. * many pieces of ammo.
  453. */
  454. #define THROWER_AMMO_FACTOR 5
  455. /**
  456. * The number of ammo equivalents per quiver slot
  457. */
  458. #define QUIVER_SLOT_SIZE 99
  459. /**
  460. * Total number of inventory slots (hard-coded to be <= 47).
  461. */
  462. #define ALL_INVEN_TOTAL 47
  463. /**
  464. * Special 'Item' Identifier corresponding to all Squelched items.
  465. */
  466. #define ALL_SQUELCHED 101
  467. /**
  468. * A "stack" of items is limited to less than 100 items (hard-coded).
  469. */
  470. #define MAX_STACK_SIZE 100
  471. /**
  472. * An item's pval (for charges, amount of gold, etc) is limited to s16b
  473. */
  474. #define MAX_PVAL 32767
  475. /**
  476. * Maximum number of objects allowed in a single dungeon grid.
  477. *
  478. * The main-screen has a minimum size of 24 rows, so we can always
  479. * display 23 objects + 1 header line.
  480. */
  481. #define MAX_FLOOR_STACK 23
  482. /*** Constants for accessing the player struct ***/
  483. /*
  484. * Timed effects
  485. */
  486. enum
  487. {
  488. TMD_FAST = 0,
  489. TMD_SLOW,
  490. TMD_BLIND,
  491. TMD_PARALYZED,
  492. TMD_CONFUSED,
  493. TMD_AFRAID,
  494. TMD_IMAGE,
  495. TMD_POISONED,
  496. TMD_CUT,
  497. TMD_STUN,
  498. TMD_PROTEVIL,
  499. TMD_INVULN,
  500. TMD_HERO,
  501. TMD_SHERO,
  502. TMD_SHIELD,
  503. TMD_BLESSED,
  504. TMD_SINVIS,
  505. TMD_SINFRA,
  506. TMD_TELEPATHY,
  507. TMD_SSTEALTH,
  508. TMD_OPP_ACID,
  509. TMD_OPP_ELEC,
  510. TMD_OPP_FIRE,
  511. TMD_OPP_COLD,
  512. TMD_OPP_POIS,
  513. TMD_ATT_ACID,
  514. TMD_ATT_ELEC,
  515. TMD_ATT_FIRE,
  516. TMD_ATT_COLD,
  517. TMD_ATT_POIS,
  518. TMD_MAX
  519. };
  520. /*
  521. * Skill indexes
  522. */
  523. enum
  524. {
  525. SKILL_DISARM, /* Skill: Disarming */
  526. SKILL_DEVICE, /* Skill: Magic Devices */
  527. SKILL_SAVE, /* Skill: Saving throw */
  528. SKILL_STEALTH, /* Skill: Stealth factor */
  529. SKILL_SEARCH, /* Skill: Searching ability */
  530. SKILL_SEARCH_FREQUENCY, /* Skill: Searching frequency */
  531. SKILL_TO_HIT_MELEE, /* Skill: To hit (normal) */
  532. SKILL_TO_HIT_BOW, /* Skill: To hit (shooting) */
  533. SKILL_TO_HIT_THROW, /* Skill: To hit (throwing) */
  534. SKILL_DIGGING, /* Skill: Digging */
  535. SKILL_MAX
  536. };
  537. /*
  538. * Indexes of the various "stats" (hard-coded by savefiles, etc).
  539. */
  540. enum
  541. {
  542. A_STR = 0,
  543. A_INT,
  544. A_WIS,
  545. A_DEX,
  546. A_CON,
  547. A_CHR,
  548. A_MAX
  549. };
  550. /*
  551. * The range of possible indexes into tables based upon stats.
  552. * Currently things range from 3 to 18/220 = 40.
  553. */
  554. #define STAT_RANGE 38
  555. /*
  556. * Player sex constants (hard-coded by save-files, arrays, etc)
  557. */
  558. #define SEX_FEMALE 0
  559. #define SEX_MALE 1
  560. /*
  561. * Player class constants (hard-coded by save-files, arrays, etc)
  562. */
  563. enum
  564. {
  565. CLASS_WARRIOR = 0,
  566. CLASS_MAGE,
  567. CLASS_PRIEST,
  568. CLASS_ROGUE,
  569. CLASS_RANGER,
  570. CLASS_PALADIN,
  571. CLASS_DRUID,
  572. CLASS_NECRO,
  573. CLASS_ASSASSIN,
  574. CLASS_MAX
  575. };
  576. /* Different realms here. From Sangband */
  577. enum
  578. {
  579. REALM_NONE = 0,
  580. REALM_SORCERY,
  581. REALM_PIETY,
  582. REALM_NATURE,
  583. REALM_NECROMANTIC,
  584. REALM_MAX
  585. };
  586. /* Values for accessing the magic description array */
  587. enum
  588. {
  589. SPELL_NOUN = 0,
  590. SPELL_VERB,
  591. SPELL_FAIL,
  592. BOOK_NOUN,
  593. BOOK_LACK,
  594. MD_MAX
  595. };
  596. /*
  597. * Special values for the number of turns to rest, these need to be
  598. * negative numbers, as postive numbers are taken to be a turncount,
  599. * and zero means "not resting".
  600. */
  601. enum
  602. {
  603. REST_COMPLETE = -2,
  604. REST_ALL_POINTS = -1,
  605. REST_SUNLIGHT = -3
  606. };
  607. /*** General index values ***/
  608. /*
  609. * Legal restrictions for "summon_specific()"
  610. */
  611. #define SUMMON_KIN 1
  612. #define SUMMON_SAURON 2
  613. #define SUMMON_ANT 11
  614. #define SUMMON_SPIDER 12
  615. #define SUMMON_HOUND 13
  616. #define SUMMON_ANIMAL 14
  617. #define SUMMON_SWAMP 15
  618. #define SUMMON_DEMON 16
  619. #define SUMMON_UNDEAD 17
  620. #define SUMMON_DRAGON 18
  621. #define SUMMON_HI_DEMON 20
  622. #define SUMMON_HI_UNDEAD 21
  623. #define SUMMON_HI_DRAGON 22
  624. #define SUMMON_WRAITH 31 /* now unused */
  625. #define SUMMON_UNIQUE 32
  626. #define SUMMON_ELEMENTAL 33
  627. #define SUMMON_VORTEX 34
  628. #define SUMMON_HYBRID 35
  629. #define SUMMON_BIRD 36
  630. #define SUMMON_GOLEM 37
  631. #define SUMMON_THIEF 38
  632. /*
  633. * Indexes for array of player incremental resists.
  634. */
  635. #define P_RES_ACID 0
  636. #define P_RES_ELEC 1
  637. #define P_RES_FIRE 2
  638. #define P_RES_COLD 3
  639. #define P_RES_POIS 4
  640. #define P_RES_LIGHT 5
  641. #define P_RES_DARK 6
  642. #define P_RES_CONFU 7
  643. #define P_RES_SOUND 8
  644. #define P_RES_SHARD 9
  645. #define P_RES_NEXUS 10
  646. #define P_RES_NETHR 11
  647. #define P_RES_CHAOS 12
  648. #define P_RES_DISEN 13
  649. #define MAX_P_RES 14
  650. /*
  651. * Indexes for array of player non-stat bonuses.
  652. */
  653. #define P_BONUS_M_MASTERY 0
  654. #define P_BONUS_STEALTH 1
  655. #define P_BONUS_SEARCH 2
  656. #define P_BONUS_INFRA 3
  657. #define P_BONUS_TUNNEL 4
  658. #define P_BONUS_SPEED 5
  659. #define P_BONUS_SHOTS 6
  660. #define P_BONUS_MIGHT 7
  661. #define MAX_P_BONUS 8
  662. /*
  663. * Indexes for array of player slay multiples.
  664. */
  665. #define P_SLAY_ANIMAL 0
  666. #define P_SLAY_EVIL 1
  667. #define P_SLAY_UNDEAD 2
  668. #define P_SLAY_DEMON 3
  669. #define P_SLAY_ORC 4
  670. #define P_SLAY_TROLL 5
  671. #define P_SLAY_GIANT 6
  672. #define P_SLAY_DRAGON 7
  673. #define MAX_P_SLAY 8
  674. /*
  675. * Indexes for array of player brand multiples.
  676. */
  677. #define P_BRAND_ACID 0
  678. #define P_BRAND_ELEC 1
  679. #define P_BRAND_FIRE 2
  680. #define P_BRAND_COLD 3
  681. #define P_BRAND_POIS 4
  682. #define MAX_P_BRAND 5
  683. /*
  684. * Resistance limits - the number really means percentage damage taken -NRM-.
  685. */
  686. #define RES_LEVEL_BASE 100
  687. #define RES_LEVEL_MAX 200
  688. #define RES_LEVEL_MIN 0
  689. /*
  690. * Incremental resistance modifiers and caps.
  691. */
  692. #define RES_BOOST_NORMAL 60
  693. #define RES_BOOST_GREAT 45
  694. #define RES_BOOST_IMMUNE 0
  695. #define RES_BOOST_MINOR 75
  696. #define RES_CUT_MINOR 130
  697. #define RES_CUT_NORMAL 150
  698. #define RES_CUT_GREAT 180
  699. #define RES_CAP_EXTREME 75
  700. #define RES_CAP_MODERATE 40
  701. #define RES_CAP_ITEM 20
  702. /* Defaults and modifiers for bonuses and multiples */
  703. #define BONUS_BASE 0
  704. #define MULTIPLE_BASE 10
  705. #define SLAY_BOOST_SMALL 15 /* Slay Evil */
  706. #define SLAY_BOOST_MINOR 17 /* Slay Animal */
  707. #define SLAY_BOOST_NORMAL 20 /* Regular Slay */
  708. #define SLAY_BOOST_KILL 25 /* Slay Kill */
  709. #define BRAND_BOOST_NORMAL 17 /* Regular Brand */
  710. /*
  711. * Some qualitative checks.
  712. */
  713. #define p_resist_pos(X) \
  714. (p_ptr->state.res_list[X] < 100)
  715. #define p_resist_good(X) \
  716. (p_ptr->state.res_list[X] <= 80)
  717. #define p_resist_strong(X) \
  718. (p_ptr->state.res_list[X] <= 20)
  719. #define p_immune(X) \
  720. (p_ptr->state.res_list[X] == 0)
  721. #define p_vulnerable(X) \
  722. (p_ptr->state.res_list[X] > 100)
  723. #define k_resist_pos(X) \
  724. (p_ptr->state.dis_res_list[X] < 100)
  725. #define k_resist_good(X) \
  726. (p_ptr->state.dis_res_list[X] <= 80)
  727. #define k_resist_strong(X) \
  728. (p_ptr->state.dis_res_list[X] <= 20)
  729. #define k_immune(X) \
  730. (p_ptr->state.dis_res_list[X] == 0)
  731. #define k_vulnerable(X) \
  732. (p_ptr->state.dis_res_list[X] > 100)
  733. #define o_slay_weak(X, Y) \
  734. (X->multiple_slay[Y] < 10)
  735. #define o_slay(X, Y) \
  736. (X->multiple_slay[Y] > 10)
  737. #define o_kill(X, Y) \
  738. (X->multiple_slay[Y] > 20)
  739. #define o_brand(X, Y) \
  740. (X->multiple_brand[Y] > 10)
  741. /*
  742. * Some constants for the "learn" code. These generalized from the
  743. * old DRS constants.
  744. */
  745. #define LRN_FREE_SAVE 14
  746. #define LRN_MANA 15
  747. #define LRN_ACID 16
  748. #define LRN_ELEC 17
  749. #define LRN_FIRE 18
  750. #define LRN_COLD 19
  751. #define LRN_POIS 20
  752. #define LRN_FEAR_SAVE 21
  753. #define LRN_LIGHT 22
  754. #define LRN_DARK 23
  755. #define LRN_BLIND 24
  756. #define LRN_CONFU 25
  757. #define LRN_SOUND 26
  758. #define LRN_SHARD 27
  759. #define LRN_NEXUS 28
  760. #define LRN_NETHR 29
  761. #define LRN_CHAOS 30
  762. #define LRN_DISEN 31
  763. /* new in Oangband 0.5 and beyond */
  764. #define LRN_DFIRE 38
  765. #define LRN_SAVE 39
  766. #define LRN_ARCH 40
  767. #define LRN_PARCH 41
  768. #define LRN_ICE 42
  769. #define LRN_PLAS 43
  770. #define LRN_SOUND2 44 /* attacks which aren't resisted,
  771. * but res sound prevent stun */
  772. #define LRN_STORM 45
  773. #define LRN_WATER 46
  774. #define LRN_NEXUS_SAVE 47 /* Both resist Nexus and Saves apply */
  775. #define LRN_BLIND_SAVE 48 /* Both resist Blind and Saves apply */
  776. #define LRN_CONFU_SAVE 49 /* Both resist Confusion and Saves apply */
  777. #define LRN_ALL 50 /* Recurses to all the resistables */
  778. /*** Feature Indexes (see "lib/edit/terrain.txt") ***/
  779. /** Nothing */
  780. #define FEAT_NONE 0x00
  781. /* Various */
  782. #define FEAT_FLOOR 0x01
  783. #define FEAT_INVIS 0x02
  784. #define FEAT_OPEN 0x03
  785. #define FEAT_BROKEN 0x04
  786. #define FEAT_MORE 0x05
  787. #define FEAT_LESS 0x06
  788. #define FEAT_MORE_SHAFT 0x07
  789. #define FEAT_LESS_SHAFT 0x08
  790. /* Doors */
  791. #define FEAT_DOOR_HEAD 0x20
  792. #define FEAT_DOOR_TAIL 0x2F
  793. /* Extra */
  794. #define FEAT_SECRET 0x30
  795. #define FEAT_RUBBLE 0x31
  796. /* Seams */
  797. #define FEAT_MAGMA 0x32
  798. #define FEAT_QUARTZ 0x33
  799. #define FEAT_MAGMA_H 0x34
  800. #define FEAT_QUARTZ_H 0x35
  801. #define FEAT_MAGMA_K 0x36
  802. #define FEAT_QUARTZ_K 0x37
  803. /* Walls */
  804. #define FEAT_WALL_EXTRA 0x38
  805. #define FEAT_WALL_INNER 0x39
  806. #define FEAT_WALL_OUTER 0x3A
  807. #define FEAT_WALL_SOLID 0x3B
  808. #define FEAT_PERM_EXTRA 0x3C
  809. #define FEAT_PERM_INNER 0x3D
  810. #define FEAT_PERM_OUTER 0x3E
  811. #define FEAT_PERM_SOLID 0x3F
  812. /* "stairs" in wilderness -NRM- */
  813. #define FEAT_LESS_NORTH 0x60
  814. #define FEAT_MORE_NORTH 0x61
  815. #define FEAT_LESS_EAST 0x62
  816. #define FEAT_MORE_EAST 0x63
  817. #define FEAT_LESS_SOUTH 0x64
  818. #define FEAT_MORE_SOUTH 0x65
  819. #define FEAT_LESS_WEST 0x66
  820. #define FEAT_MORE_WEST 0x67
  821. /* Special dungeon/wilderness features. */
  822. #define FEAT_MIN_SPECIAL 0x70
  823. #define FEAT_LAVA 0x70
  824. #define FEAT_WATER 0x71
  825. #define FEAT_TREE 0x72
  826. #define FEAT_TREE2 0x73
  827. #define FEAT_GRASS 0x74
  828. #define FEAT_ROAD 0x75
  829. #define FEAT_VOID 0x77
  830. #define FEAT_PIT 0x78
  831. #define FEAT_DUNE 0x7a
  832. #define FEAT_REED 0x7b
  833. #define FEAT_MTN 0x7c
  834. #define FEAT_SNOW 0x7e
  835. #define FEAT_BTLMNT 0x7f
  836. #define FEAT_ICE 0x80
  837. /*** Trap Indexes (see "lib/edit/trap.txt") ***/
  838. /** Nothing */
  839. #define TRAP_NONE 0x00
  840. /* Runes */
  841. #define RUNE_HEAD 0x01
  842. #define RUNE_TAIL 0x07
  843. #define RUNE_ELEMENTS 0x01
  844. #define RUNE_MAGDEF 0x02
  845. #define RUNE_QUAKE 0x03
  846. #define RUNE_MANA 0x04
  847. #define RUNE_PROTECT 0x05
  848. #define RUNE_POWER 0x06
  849. #define RUNE_SPEED 0x07
  850. /* Other obstructions */
  851. #define OBST_WEB 0x0A
  852. /* Traps */
  853. #define TRAP_HEAD 0x10
  854. #define TRAP_TAIL 0x1F
  855. #define TRAP_TRAPDOOR 0x10
  856. #define TRAP_PIT 0x11
  857. #define TRAP_DART 0x12
  858. #define TRAP_SPOT 0x13
  859. #define TRAP_GAS 0x14
  860. #define TRAP_SUMMON 0x15
  861. #define TRAP_ALTER 0x16
  862. #define TRAP_HEX 0x17
  863. #define TRAP_PORTAL 0x18
  864. #define TRAP_MURDER 0x19
  865. #define TRAP_BRANCH 0x1A
  866. /* Specials trap that only effects monsters. Created only by rogues. -LM- */
  867. #define MTRAP_HEAD 0x40
  868. #define MTRAP_TAIL 0x4F
  869. #define MTRAP_BASE 0x40 /* Level 1 */
  870. #define MTRAP_STURDY 0x41 /* Level 1 */
  871. #define MTRAP_NET 0x42 /* Level 6 */
  872. #define MTRAP_CONF 0x43 /* Level 12 */
  873. #define MTRAP_POISON 0x44 /* Level 18 */
  874. #define MTRAP_SPIRIT 0x45 /* Level 24 */
  875. #define MTRAP_ELEC 0x46 /* Level 30 */
  876. #define MTRAP_EXPLOSIVE 0x47 /* Level 36 */
  877. #define MTRAP_PORTAL 0x48 /* Level 42 */
  878. #define MTRAP_STASIS 0x49 /* Level 48 */
  879. #define MTRAP_DRAIN_LIFE 0x4A /* Level * */
  880. #define MTRAP_UNMAGIC 0x4B /* Level * */
  881. #define MTRAP_DISPEL_M 0x4C /* Level * */
  882. #define MTRAP_GENOCIDE 0x4D /* Level * */
  883. /*** Artifact indexes (see "lib/edit/a_info.txt") ***/
  884. #define ART_MORGOTH 51
  885. #define ART_UNGOLIANT 74
  886. #define ART_GROND 158
  887. /*** Ego-Item indexes (see "lib/edit/e_info.txt") ***/
  888. /* Nothing */
  889. /* xxx */
  890. /* xxx */
  891. /* xxx */
  892. /* Body Armor */
  893. #define EGO_RESIST_ACID 4
  894. #define EGO_RESIST_ELEC 5
  895. #define EGO_RESIST_FIRE 6
  896. #define EGO_RESIST_COLD 7
  897. #define EGO_RESISTANCE 8
  898. #define EGO_ELVENKIND 9
  899. #define EGO_DWARVEN 10
  900. #define EGO_PERMANENCE 11
  901. /* xxx */
  902. /* xxx */
  903. /* xxx */
  904. /* xxx */
  905. /* Shields */
  906. #define EGO_ENDURE_ACID 16
  907. #define EGO_ENDURE_ELEC 17
  908. #define EGO_ENDURE_FIRE 18
  909. #define EGO_ENDURE_COLD 19
  910. #define EGO_ENDURANCE 20
  911. #define EGO_NIGHT_DAY 21 /* Added in Oangband. */
  912. /* xxx */
  913. /* xxx */
  914. /* Crowns and Helms */
  915. #define EGO_INTELLIGENCE 24
  916. #define EGO_WISDOM 25
  917. #define EGO_BEAUTY 26
  918. #define EGO_MAGI 27
  919. #define EGO_MIGHT 28
  920. #define EGO_LORDLINESS 29
  921. #define EGO_SEEING 30
  922. #define EGO_SERENITY 31 /* Changed in Oangband. */
  923. #define EGO_LIGHT 32
  924. #define EGO_TELEPATHY 33
  925. #define EGO_REGENERATION 34
  926. #define EGO_TELEPORTATION 35
  927. #define EGO_STUPIDITY 36
  928. #define EGO_NAIVETY 37
  929. #define EGO_UGLINESS 38
  930. #define EGO_SICKLINESS 39
  931. /* Cloaks */
  932. #define EGO_PROTECTION 40
  933. #define EGO_STEALTH 41
  934. #define EGO_AMAN 42
  935. /* xxx */
  936. #define EGO_ENVELOPING 44
  937. #define EGO_VULNERABILITY 45
  938. #define EGO_IRRITATION 46
  939. #define EGO_SHARD_PROT 47 /* Added in Oangband. */
  940. /* Gloves */
  941. #define EGO_FREE_ACTION 48
  942. #define EGO_SLAYING 49
  943. #define EGO_AGILITY 50
  944. #define EGO_POWER 51
  945. #define EGO_MAGIC_MASTERY 52 /* Added in Oangband. */
  946. /* xxx */
  947. #define EGO_WEAKNESS 54
  948. #define EGO_CLUMSINESS 55
  949. /* Boots */
  950. #define EGO_SLOW_DESCENT 56
  951. #define EGO_QUIET 57
  952. #define EGO_MOTION 58
  953. #define EGO_SPEED 59
  954. #define EGO_STABILITY 60 /* Added in Oangband. */
  955. #define EGO_NOISE 61
  956. #define EGO_SLOWNESS 62
  957. #define EGO_TORMENT 63
  958. /* Weapons */
  959. #define EGO_HA 64
  960. #define EGO_DORIATH 65
  961. #define EGO_BLESS_BLADE 66
  962. #define EGO_GONDOLIN 67
  963. #define EGO_NOLDOR 68
  964. #define EGO_NOGROD 69
  965. /* xxx */
  966. /* xxx */
  967. #define EGO_BRAND_ACID 72
  968. #define EGO_BRAND_ELEC 73
  969. #define EGO_BRAND_FIRE 74
  970. #define EGO_BRAND_COLD 75
  971. #define EGO_BRAND_POIS 76 /* Added in Oangband. */
  972. #define EGO_BALROG 77 /* Added in Oangband. */
  973. /* xxx */
  974. /* xxx */
  975. #define EGO_SLAY_ANIMAL 80
  976. #define EGO_SLAY_EVIL 81
  977. #define EGO_SLAY_UNDEAD 82
  978. #define EGO_SLAY_DEMON 83
  979. #define EGO_SLAY_ORC 84
  980. #define EGO_SLAY_TROLL 85
  981. #define EGO_SLAY_GIANT 86
  982. #define EGO_SLAY_DRAGON 87
  983. #define EGO_KILL_ANIMAL 88
  984. #define EGO_KILL_EVIL 89
  985. #define EGO_KILL_UNDEAD 90
  986. #define EGO_KILL_DEMON 83
  987. #define EGO_KILL_ORC 84
  988. #define EGO_KILL_TROLL 85
  989. #define EGO_KILL_GIANT 86
  990. #define EGO_KILL_DRAGON 95
  991. /* xxx */
  992. /* xxx */
  993. /* xxx */
  994. /* xxx */
  995. #define EGO_DIGGING 100
  996. /* xxx */
  997. #define EGO_ANGBAND 102
  998. /* xxx */
  999. /* Bows */
  1000. #define EGO_ACCURACY 104
  1001. #define EGO_VELOCITY 105
  1002. #define EGO_OSSIRIAND 106
  1003. #define EGO_EXTRA_MIGHT 107
  1004. /* xxx */
  1005. #define EGO_EXTRA_SHOTS 109
  1006. /* xxx */
  1007. /* xxx */
  1008. /* Ammo */
  1009. #define EGO_HURT_ANIMAL 111
  1010. #define EGO_HURT_EVIL 112
  1011. #define EGO_HURT_UNDEAD 113
  1012. #define EGO_HURT_DEMON 114
  1013. #define EGO_HURT_ORC 115
  1014. #define EGO_HURT_TROLL 116
  1015. #define EGO_HURT_GIANT 117
  1016. #define EGO_HURT_DRAGON 118
  1017. #define EGO_ACIDIC 119 /* Added in Oangband. */
  1018. #define EGO_ELECT 120 /* Added in Oangband. */
  1019. #define EGO_FLAME 121
  1020. #define EGO_FROST 122
  1021. #define EGO_POISON 123 /* Added in Oangband. */
  1022. #define EGO_WOUNDING 124
  1023. #define EGO_BACKBITING 125
  1024. /* Rings */
  1025. #define EGO_RING_ELEMENTS 128
  1026. #define EGO_RING_PHYSICAL 129
  1027. #define EGO_RING_COMBAT 130
  1028. #define EGO_RING_MOBILITY 131
  1029. #define EGO_RING_ARCANE_RES 132
  1030. #define EGO_RING_UTILITY 133
  1031. #define EGO_RING_BASIC_RES 134
  1032. #define EGO_RING_HINDRANCE 135
  1033. #define EGO_RING_DAWN 136
  1034. #define EGO_RING_SPEED 137
  1035. #define EGO_RING_WOE 138
  1036. #define EGO_RING_FICKLENESS 139
  1037. #define EGO_RING_POWER 140
  1038. /* Amulets */
  1039. #define EGO_AMULET_MENTAL 160
  1040. #define EGO_AMULET_DOOM 161
  1041. #define EGO_AMULET_BASIC_RES 162
  1042. #define EGO_AMULET_MAGIC_MAST 163
  1043. #define EGO_AMULET_CLARITY 164
  1044. #define EGO_AMULET_SHADOWS 165
  1045. #define EGO_AMULET_METAMORPH 166
  1046. #define EGO_AMULET_SUSTENANCE 167
  1047. #define EGO_AMULET_TRICKERY 168
  1048. #define EGO_AMULET_WEAPONMAST 169
  1049. #define EGO_AMULET_VITALITY 170
  1050. #define EGO_AMULET_INSIGHT 171
  1051. /*** Squelch stuff ***/
  1052. /** Number of bytes used in squelch sub-quality array - probably unnecessary */
  1053. #define SQUELCH_BYTES 6
  1054. /*** Monster blow constants ***/
  1055. #define MONSTER_BLOW_MAX 4
  1056. /*
  1057. * Monster blow methods
  1058. */
  1059. enum
  1060. {
  1061. #define RBM(x, y) RBM_##x,
  1062. #include "list-blow-methods.h"
  1063. #undef RBM
  1064. RBM_MAX
  1065. };
  1066. /*
  1067. * Monster blow effects
  1068. */
  1069. enum
  1070. {
  1071. #define RBE(x, y) RBE_##x,
  1072. #include "list-blow-effects.h"
  1073. #undef RBE
  1074. RBE_MAX
  1075. };
  1076. /** 1/x chance of reducing stats (for elemental attacks). From Zangband
  1077. * -LM-
  1078. */
  1079. #define HURT_CHANCE 25
  1080. /*** Function flags ***/
  1081. #define PROJECT_NO 0
  1082. #define PROJECT_NOT_CLEAR 1
  1083. #define PROJECT_CLEAR 2
  1084. /*
  1085. * Bit flags for the "target_set" function
  1086. *
  1087. * KILL: Target monsters
  1088. * LOOK: Describe grid fully
  1089. * OBJ : Target objects
  1090. * GRID: Select from all grids
  1091. */
  1092. #define TARGET_KILL 0x01
  1093. #define TARGET_LOOK 0x02
  1094. #define TARGET_OBJ 0x04
  1095. #define TARGET_GRID 0x08
  1096. #define TARGET_QUIET 0x10
  1097. /*
  1098. * Bit flags for the "monster_desc" function
  1099. */
  1100. #define MDESC_OBJE 0x01 /* Objective (or Reflexive) */
  1101. #define MDESC_POSS 0x02 /* Possessive (or Reflexive) */
  1102. #define MDESC_IND1 0x04 /* Indefinites for hidden monsters */
  1103. #define MDESC_IND2 0x08 /* Indefinites for visible monsters */
  1104. #define MDESC_PRO1 0x10 /* Pronominalize hidden monsters */
  1105. #define MDESC_PRO2 0x20 /* Pronominalize visible monsters */
  1106. #define MDESC_HIDE 0x40 /* Assume the monster is hidden */
  1107. #define MDESC_SHOW 0x80 /* Assume the monster is visible */
  1108. /*
  1109. * Bit flags for the "get_item" function
  1110. */
  1111. #define USE_EQUIP 0x01 /* Allow equip items */
  1112. #define USE_INVEN 0x02 /* Allow inven items */
  1113. #define USE_FLOOR 0x04 /* Allow floor items */
  1114. #define USE_TARGET 0x08 /* Allow targeted floor items */
  1115. #define CAN_SQUELCH 0x10 /* Allow selection of all squelched items */
  1116. #define IS_HARMLESS 0x20 /* Ignore generic warning inscriptions */
  1117. #define SHOW_PRICES 0x40 /* Show item prices in item lists */
  1118. #define SHOW_FAIL 0x80 /* Show device failure in item lists */
  1119. #define QUIVER_TAGS 0x100 /* 0-9 are quiver slots when selecting */
  1120. /*** Player flags ***/
  1121. /*
  1122. * Bit flags for the "p_ptr->notice" variable
  1123. */
  1124. #define PN_COMBINE 0x00000001L /* Combine the pack */
  1125. #define PN_REORDER 0x00000002L /* Reorder the pack */
  1126. #define PN_AUTOINSCRIBE 0x00000004L /* Autoinscribe items */
  1127. #define PN_PICKUP 0x00000008L /* Pick stuff up */
  1128. #define PN_SQUELCH 0x00000010L /* Squelch stuff */
  1129. #define PN_SORT_QUIVER 0x00000020L /* Sort the quiver */
  1130. /* xxx (many) */
  1131. /*
  1132. * Bit flags for the "p_ptr->update" variable
  1133. */
  1134. #define PU_BONUS 0x00000001L /* Calculate bonuses */
  1135. #define PU_TORCH 0x00000002L /* Calculate torch radius */
  1136. /* xxx (many) */
  1137. #define PU_HP 0x00000010L /* Calculate chp and mhp */
  1138. #define PU_MANA 0x00000020L /* Calculate csp and msp */
  1139. #define PU_SPELLS 0x00000040L /* Calculate spells */
  1140. #define PU_SPECIALTY 0x00000080L /* Calculate specialties */
  1141. /* xxx (many) */
  1142. #define PU_FORGET_VIEW 0x00010000L /* Forget field of view */
  1143. #define PU_UPDATE_VIEW 0x00020000L /* Update field of view */
  1144. /* xxx (many) */
  1145. #define PU_MONSTERS 0x10000000L /* Update monsters */
  1146. #define PU_DISTANCE 0x20000000L /* Update distances */
  1147. /* xxx */
  1148. #define PU_PANEL 0x80000000L /* Update panel */
  1149. /*
  1150. * Bit flags for the "p_ptr->redraw" variable
  1151. */
  1152. #define PR_MISC 0x00000001L /* Display Race/Class */
  1153. #define PR_TITLE 0x00000002L /* Display Title */
  1154. #define PR_LEV 0x00000004L /* Display Level */
  1155. #define PR_EXP 0x00000008L /* Display Experience */
  1156. #define PR_STATS 0x00000010L /* Display Stats */
  1157. #define PR_ARMOR 0x00000020L /* Display Armor */
  1158. #define PR_HP 0x00000040L /* Display Hitpoints */
  1159. #define PR_MANA 0x00000080L /* Display Mana */
  1160. #define PR_GOLD 0x00000100L /* Display Gold */
  1161. #define PR_DEPTH 0x00000200L /* Display Depth */
  1162. #define PR_SHAPE 0x00000400L /* Display Shape. -LM- */
  1163. #define PR_HEALTH 0x00000800L /* Display Health Bar */
  1164. #define PR_INVEN 0x00001000L /* Display inven/equip */
  1165. #define PR_EQUIP 0x00002000L /* Display equip/inven */
  1166. #define PR_MESSAGE 0x00004000L /* Display messages */
  1167. #define PR_MONSTER 0x00008000L /* Display monster recall */
  1168. #define PR_OBJECT 0x00010000L /* Display object recall */
  1169. #define PR_MONLIST 0x00020000L /* Display monster list */
  1170. #define PR_BUTTONS 0x00040000L /* Display mouse buttons */
  1171. #define PR_ITEMLIST 0x00080000L /* Display item list */
  1172. #define PR_STATE 0x00100000L /* Display Extra (State) */
  1173. #define PR_SPEED 0x00200000L /* Display Extra (Speed) */
  1174. #define PR_STUDY 0x00400000L /* Display Extra (Study) */
  1175. #define PR_DTRAP 0x00800000L /* Display Extra (DTrap) */
  1176. #define PR_MON_MANA 0x04000000L /* Display Mana Bar */
  1177. #define PR_MAP 0x08000000L /* Display Map */
  1178. #define PR_WIPE 0x10000000L /* Hack -- Total Redraw */
  1179. #define PR_STATUS 0x80000000L /* Display extra status messages */
  1180. /* Display Basic Info */
  1181. #define PR_BASIC \
  1182. (PR_MISC | PR_TITLE | PR_STATS | PR_LEV |\
  1183. PR_EXP | PR_GOLD | PR_ARMOR | PR_HP |\
  1184. PR_MANA | PR_DEPTH | PR_HEALTH | PR_SPEED)
  1185. /* Display Extra Info */
  1186. #define PR_EXTRA \
  1187. (PR_STATUS | PR_STATE | PR_STUDY)
  1188. /*
  1189. * Bit flags for the "p_ptr->window" variable (etc)
  1190. */
  1191. #define PW_INVEN 0x00000001L /* Display inven/equip */
  1192. #define PW_EQUIP 0x00000002L /* Display equip/inven */
  1193. #define PW_PLAYER_0 0x00000004L /* Display player (basic) */
  1194. #define PW_PLAYER_1 0x00000008L /* Display player (extra) */
  1195. #define PW_PLAYER_2 0x00000010L /* Display player (compact) */
  1196. #define PW_MAP 0x00000020L /* Display dungeon map */
  1197. #define PW_MESSAGE 0x00000040L /* Display messages */
  1198. #define PW_OVERHEAD 0x00000080L /* Display overhead view */
  1199. #define PW_MONSTER 0x00000100L /* Display monster recall */
  1200. #define PW_OBJECT 0x00000200L /* Display object recall */
  1201. #define PW_DUNGEON 0x00000400L /* Display dungeon view */
  1202. #define PW_SNAPSHOT 0x00000800L /* Display snap-shot */
  1203. #define PW_MONLIST 0x00001000L /* Display monster list */
  1204. #define PW_ITEMLIST 0x00002000L /* Display item list */
  1205. #define PW_BORG_1 0x00004000L /* Display borg messages */
  1206. #define PW_BORG_2 0x00008000L /* Display borg status */
  1207. #define PW_MAX_FLAGS 16
  1208. /*
  1209. * Bit flags for the "p_ptr->special_attack" variable. -LM-
  1210. *
  1211. * Note: The elemental and poison attacks should be managed using the
  1212. * function "set_ele_attack", in spell2.c. This provides for timeouts and
  1213. * prevents the player from getting more than one at a time.
  1214. */
  1215. #define ATTACK_NORMAL 0x00000000
  1216. #define ATTACK_CONFUSE 0x00000001
  1217. #define ATTACK_BLKBRTH 0x00000002
  1218. #define ATTACK_FLEE 0x00000004
  1219. #define ATTACK_SUPERSHOT 0x00000008
  1220. #define ATTACK_ACID 0x00000010
  1221. #define ATTACK_ELEC 0x00000020
  1222. #define ATTACK_FIRE 0x00000040
  1223. #define ATTACK_COLD 0x00000080
  1224. #define ATTACK_POIS 0x00000100
  1225. #define ATTACK_HOLY 0x00000200
  1226. #define ATTACK_DRUID_CONFU 0x00010000
  1227. /* Special attack states that may be displayed on screen */
  1228. #define ATTACK_NOTICE 0x000003ff
  1229. /*
  1230. * Values for shapechanges. From Sangband.
  1231. * As of FAangband 1.0.0 shapes must be consecutive
  1232. */
  1233. #define SHAPE_NORMAL 0 /* Unaltered form. */
  1234. #define SHAPE_MOUSE 1
  1235. #define SHAPE_FERRET 2
  1236. #define SHAPE_HOUND 3
  1237. #define SHAPE_GAZELLE 4
  1238. #define SHAPE_LION 5
  1239. #define SHAPE_ENT 6
  1240. #define SHAPE_BAT 7
  1241. #define SHAPE_WEREWOLF 8
  1242. #define SHAPE_VAMPIRE 9
  1243. #define SHAPE_WYRM 10
  1244. #define SHAPE_BEAR 11
  1245. #define MAX_SHAPE 11
  1246. #define SCHANGE \
  1247. (p_ptr->schange > 0 && p_ptr->schange < 12)
  1248. /*
  1249. * Cave flags
  1250. */
  1251. enum
  1252. {
  1253. #define CAVE(a,b) CAVE_##a,
  1254. #include "list-cave-flags.h"
  1255. #undef CAVE
  1256. CAVE_MAX
  1257. };
  1258. #define CAVE_SIZE FLAG_SIZE(CAVE_MAX)
  1259. #define cave_has(f, flag) flag_has_dbg(f, CAVE_SIZE, flag, #f, #flag)
  1260. #define cave_next(f, flag) flag_next(f, CAVE_SIZE, flag)
  1261. #define cave_is_empty(f) flag_is_empty(f, CAVE_SIZE)
  1262. #define cave_is_full(f) flag_is_full(f, CAVE_SIZE)
  1263. #define cave_is_inter(f1, f2) flag_is_inter(f1, f2, CAVE_SIZE)
  1264. #define cave_is_subset(f1, f2) flag_is_subset(f1, f2, CAVE_SIZE)
  1265. #define cave_is_equal(f1, f2) flag_is_equal(f1, f2, CAVE_SIZE)
  1266. #define cave_on(f, flag) flag_on_dbg(f, CAVE_SIZE, flag, #f, #flag)
  1267. #define cave_off(f, flag) flag_off(f, CAVE_SIZE, flag)
  1268. #define cave_wipe(f) flag_wipe(f, CAVE_SIZE)
  1269. #define cave_setall(f) flag_setall(f, CAVE_SIZE)
  1270. #define cave_negate(f) flag_negate(f, CAVE_SIZE)
  1271. #define cave_copy(f1, f2) flag_copy(f1, f2, CAVE_SIZE)
  1272. #define cave_union(f1, f2) flag_union(f1, f2, CAVE_SIZE)
  1273. #define cave_comp_union(f1, f2) flag_comp_union(f1, f2, CAVE_SIZE)
  1274. #define cave_inter(f1, f2) flag_inter(f1, f2, CAVE_SIZE)
  1275. #define cave_diff(f1, f2) flag_diff(f1, f2, CAVE_SIZE)
  1276. /*** Object flags ***/
  1277. /*
  1278. * Chest trap flags (see "tables.c")
  1279. */
  1280. #define CHEST_LOSE_STR 0x0001
  1281. #define CHEST_LOSE_CON 0x0002
  1282. #define CHEST_POISON 0x0004
  1283. #define CHEST_PARALYZE 0x0008
  1284. #define CHEST_EXPLODE 0x0010
  1285. #define CHEST_SUMMON 0x0020
  1286. #define CHEST_SCATTER 0x0040
  1287. #define CHEST_E_SUMMON 0x0080
  1288. #define CHEST_BIRD_STORM 0x0100
  1289. #define CHEST_H_SUMMON 0x0200
  1290. #define CHEST_RUNES_OF_EVIL 0x0400
  1291. /*
  1292. * Special Object Flags
  1293. */
  1294. #define IDENT_SENSE 0x01 /* Item has been "sensed" */
  1295. #define IDENT_STORE 0x02 /* Item is in the inventory of a store */
  1296. #define IDENT_EMPTY 0x04 /* Item charges are known */
  1297. #define IDENT_KNOWN 0x08 /* Item abilities are known */
  1298. #define IDENT_CURSED 0x10 /* Item is known to be cursed */
  1299. #define IDENT_UNCURSED 0x20 /* Item is known not to be cursed */
  1300. #define IDENT_KNOW_CURSES 0x40 /* Item curses are all known */
  1301. #define IDENT_WORN 0x80 /* Item has been wielded or worn */
  1302. /*
  1303. * Game-generated feelings. Used for inscriptions.
  1304. */
  1305. #define FEEL_NONE 0
  1306. #define FEEL_DUBIOUS_STRONG 1
  1307. #define FEEL_PERILOUS 2
  1308. #define FEEL_DUBIOUS_WEAK 3
  1309. #define FEEL_AVERAGE 4
  1310. #define FEEL_GOOD_STRONG 5
  1311. #define FEEL_EXCELLENT 6
  1312. #define FEEL_GOOD_WEAK 7
  1313. #define FEEL_SPECIAL 8
  1314. #define FEEL_MAX 9
  1315. /*
  1316. * Some bit-flags for the "smart" field
  1317. *
  1318. * Most of these relate to OF_* object flags or P_RES_* and percentage resists
  1319. */
  1320. #define SM_RES_STRONG_ACID 0x00000001
  1321. #define SM_RES_STRONG_ELEC 0x00000002
  1322. #define SM_RES_STRONG_FIRE 0x00000004
  1323. #define SM_RES_STRONG_COLD 0x00000008
  1324. #define SM_RES_STRONG_POIS 0x00000010
  1325. #define SM_XXX1 0x00000020
  1326. #define SM_XXX2 0x00000040
  1327. #define SM_XXX3 0x00000080
  1328. #define SM_GOOD_SAVE 0x00000100
  1329. #define SM_PERF_SAVE 0x00000200
  1330. #define SM_IMM_FREE 0x00000400
  1331. #define SM_IMM_MANA 0x00000800
  1332. #define SM_IMM_ACID 0x00001000
  1333. #define SM_IMM_ELEC 0x00002000
  1334. #define SM_IMM_FIRE 0x00004000
  1335. #define SM_IMM_COLD 0x00008000
  1336. #define SM_RES_ACID 0x00010000
  1337. #define SM_RES_ELEC 0x00020000
  1338. #define SM_RES_FIRE 0x00040000
  1339. #define SM_RES_COLD 0x00080000
  1340. #define SM_RES_POIS 0x00100000
  1341. #define SM_RES_FEAR 0x00200000
  1342. #define SM_RES_LIGHT 0x00400000
  1343. #define SM_RES_DARK 0x00800000
  1344. #define SM_RES_BLIND 0x01000000
  1345. #define SM_RES_CONFU 0x02000000
  1346. #define SM_RES_SOUND 0x04000000
  1347. #define SM_RES_SHARD 0x08000000
  1348. #define SM_RES_NEXUS 0x10000000
  1349. #define SM_RES_NETHR 0x20000000
  1350. #define SM_RES_CHAOS 0x40000000
  1351. #define SM_RES_DISEN 0x80000000
  1352. /*
  1353. * Object flags
  1354. */
  1355. enum
  1356. {
  1357. #define OF(a,b) OF_##a,
  1358. #include "list-object-flags.h"
  1359. #undef OF
  1360. OF_MAX
  1361. };
  1362. #define OF_SIZE FLAG_SIZE(OF_MAX)
  1363. #define of_has(f, flag) flag_has_dbg(f, OF_SIZE, flag, #f, #flag)
  1364. #define of_next(f, flag) flag_next(f, OF_SIZE, flag)
  1365. #define of_is_empty(f) flag_is_empty(f, OF_SIZE)
  1366. #define of_is_full(f) flag_is_full(f, OF_SIZE)
  1367. #define of_is_inter(f1, f2) flag_is_inter(f1, f2, OF_SIZE)
  1368. #define of_is_subset(f1, f2) flag_is_subset(f1, f2, OF_SIZE)
  1369. #define of_is_equal(f1, f2) flag_is_equal(f1, f2, OF_SIZE)
  1370. #define of_on(f, flag) flag_on_dbg(f, OF_SIZE, flag, #f, #flag)
  1371. #define of_off(f, flag) flag_off(f, OF_SIZE, flag)
  1372. #define of_wipe(f) flag_wipe(f, OF_SIZE)
  1373. #define of_setall(f) flag_setall(f, OF_SIZE)
  1374. #define of_negate(f) flag_negate(f, OF_SIZE)
  1375. #define of_copy(f1, f2) flag_copy(f1, f2, OF_SIZE)
  1376. #define of_union(f1, f2) flag_union(f1, f2, OF_SIZE)
  1377. #define of_comp_union(f1, f2) flag_comp_union(f1, f2, OF_SIZE)
  1378. #define of_inter(f1, f2) flag_inter(f1, f2, OF_SIZE)
  1379. #define of_diff(f1, f2) flag_diff(f1, f2, OF_SIZE)
  1380. #define OF_OBVIOUS_MASK \
  1381. OF_THROWING, OF_TWO_HANDED_REQ, OF_TWO_HANDED_DES, OF_SHOW_MODS
  1382. #define OF_PROOF_MASK \
  1383. OF_ACID_PROOF, OF_ELEC_PROOF, OF_FIRE_PROOF, OF_COLD_PROOF
  1384. /*
  1385. * Curse flags
  1386. */
  1387. enum
  1388. {
  1389. #define CF(a,b) CF_##a,
  1390. #include "list-curse-flags.h"
  1391. #undef CF
  1392. CF_MAX
  1393. };
  1394. #define CF_SIZE FLAG_SIZE(CF_MAX)
  1395. #define cf_has(f, flag) flag_has_dbg(f, CF_SIZE, flag, #f, #flag)
  1396. #define cf_next(f, flag) flag_next(f, CF_SIZE, flag)
  1397. #define cf_is_empty(f) flag_is_empty(f, CF_SIZE)
  1398. #define cf_is_full(f) flag_is_full(f, CF_SIZE)
  1399. #define cf_is_inter(f1, f2) flag_is_inter(f1, f2, CF_SIZE)
  1400. #define cf_is_subset(f1, f2) flag_is_subset(f1, f2, CF_SIZE)
  1401. #define cf_is_equal(f1, f2) flag_is_equal(f1, f2, CF_SIZE)
  1402. #define cf_on(f, flag) flag_on_dbg(f, CF_SIZE, flag, #f, #flag)
  1403. #define cf_off(f, flag) flag_off(f, CF_SIZE, flag)
  1404. #define cf_wipe(f) flag_wipe(f, CF_SIZE)
  1405. #define cf_setall(f) flag_setall(f, CF_SIZE)
  1406. #define cf_negate(f) flag_negate(f, CF_SIZE)
  1407. #define cf_copy(f1, f2) flag_copy(f1, f2, CF_SIZE)
  1408. #define cf_union(f1, f2) flag_union(f1, f2, CF_SIZE)
  1409. #define cf_comp_union(f1, f2) flag_comp_union(f1, f2, CF_SIZE)
  1410. #define cf_inter(f1, f2) flag_inter(f1, f2, CF_SIZE)
  1411. #define cf_diff(f1, f2) flag_diff(f1, f2, CF_SIZE)
  1412. /*
  1413. * Kind flags
  1414. */
  1415. enum
  1416. {
  1417. #define KF(a,b) KF_##a,
  1418. #include "list-kind-flags.h"
  1419. #undef KF
  1420. KF_MAX
  1421. };
  1422. #define KF_SIZE FLAG_SIZE(KF_MAX)
  1423. #define kf_has(f, flag) flag_has_dbg(f, KF_SIZE, flag, #f, #flag)
  1424. #define kf_next(f, flag) flag_next(f, KF_SIZE, flag)
  1425. #define kf_is_empty(f) flag_is_empty(f, KF_SIZE)
  1426. #define kf_is_full(f) flag_is_full(f, KF_SIZE)
  1427. #define kf_is_inter(f1, f2) flag_is_inter(f1, f2, KF_SIZE)
  1428. #define kf_is_subset(f1, f2) flag_is_subset(f1, f2, KF_SIZE)
  1429. #define kf_is_equal(f1, f2) flag_is_equal(f1, f2, KF_SIZE)
  1430. #define kf_on(f, flag) flag_on_dbg(f, KF_SIZE, flag, #f, #flag)
  1431. #define kf_off(f, flag) flag_off(f, KF_SIZE, flag)
  1432. #define kf_wipe(f) flag_wipe(f, KF_SIZE)
  1433. #define kf_setall(f) flag_setall(f, KF_SIZE)
  1434. #define kf_negate(f) flag_negate(f, KF_SIZE)
  1435. #define kf_copy(f1, f2) flag_copy(f1, f2, KF_SIZE)
  1436. #define kf_union(f1, f2) flag_union(f1, f2, KF_SIZE)
  1437. #define kf_comp_union(f1, f2) flag_comp_union(f1, f2, KF_SIZE)
  1438. #define kf_inter(f1, f2) flag_inter(f1, f2, KF_SIZE)
  1439. #define kf_diff(f1, f2) flag_diff(f1, f2, KF_SIZE)
  1440. /*
  1441. * Identify flags
  1442. */
  1443. enum
  1444. {
  1445. #define IF(a,b) IF_##a,
  1446. #include "list-identify-flags.h"
  1447. #undef IF
  1448. IF_MAX
  1449. };
  1450. #define IF_SIZE FLAG_SIZE(IF_MAX)
  1451. #define if_has(f, flag) flag_has_dbg(f, IF_SIZE, flag, #f, #flag)
  1452. #define if_next(f, flag) flag_next(f, IF_SIZE, flag)
  1453. #define if_is_empty(f) flag_is_empty(f, IF_SIZE)
  1454. #define if_is_full(f) flag_is_full(f, IF_SIZE)
  1455. #define if_is_inter(f1, f2) flag_is_inter(f1, f2, IF_SIZE)
  1456. #define if_is_subset(f1, f2) flag_is_subset(f1, f2, IF_SIZE)
  1457. #define if_is_equal(f1, f2) flag_is_equal(f1, f2, IF_SIZE)
  1458. #define if_on(f, flag) flag_on_dbg(f, IF_SIZE, flag, #f, #flag)
  1459. #define if_off(f, flag) flag_off(f, IF_SIZE, flag)
  1460. #define if_wipe(f) flag_wipe(f, IF_SIZE)
  1461. #define if_setall(f) flag_setall(f, IF_SIZE)
  1462. #define if_negate(f) flag_negate(f, IF_SIZE)
  1463. #define if_copy(f1, f2) flag_copy(f1, f2, IF_SIZE)
  1464. #define if_union(f1, f2) flag_union(f1, f2, IF_SIZE)
  1465. #define if_comp_union(f1, f2) flag_comp_union(f1, f2, IF_SIZE)
  1466. #define if_inter(f1, f2) flag_inter(f1, f2, IF_SIZE)
  1467. #define if_diff(f1, f2) flag_diff(f1, f2, IF_SIZE)
  1468. /*
  1469. * Random object kind flag info (base flag value)
  1470. */
  1471. #define OBJECT_RAND_BASE_SUSTAIN OF_SUSTAIN_STR
  1472. #define OBJECT_RAND_BASE_POWER OF_SLOW_DIGEST
  1473. /*
  1474. * Random object kind flag info (number of flags)
  1475. */
  1476. #define OBJECT_RAND_SIZE_SUSTAIN 6
  1477. #define OBJECT_RAND_SIZE_POWER 10
  1478. /*
  1479. * Object ID flag info (base flag value)
  1480. */
  1481. #define OBJECT_ID_BASE_RESIST IF_RES_ACID
  1482. #define OBJECT_ID_BASE_SLAY IF_SLAY_ANIMAL
  1483. #define OBJECT_ID_BASE_BRAND IF_BRAND_ACID
  1484. /*
  1485. * Player race and class flags
  1486. */
  1487. enum
  1488. {
  1489. #define PF(a, b, c, d) PF_##a
  1490. #include "list-player-flags.h"
  1491. #undef PF
  1492. PF_MAX
  1493. };
  1494. #define PF_SIZE FLAG_SIZE(PF_MAX)
  1495. enum
  1496. {
  1497. PLAYER_FLAG_SPECIAL,
  1498. PLAYER_FLAG_RACE,
  1499. PLAYER_FLAG_CLASS
  1500. };
  1501. #define PF_NO_SPECIALTY 255
  1502. #define pf_has(f, flag) flag_has_dbg(f, PF_SIZE, flag, #f, #flag)
  1503. #define pf_next(f, flag) flag_next(f, PF_SIZE, flag)
  1504. #define pf_is_empty(f) flag_is_empty(f, PF_SIZE)
  1505. #define pf_is_full(f) flag_is_full(f, PF_SIZE)
  1506. #define pf_is_inter(f1, f2) flag_is_inter(f1, f2, PF_SIZE)
  1507. #define pf_is_subset(f1, f2) flag_is_subset(f1, f2, PF_SIZE)
  1508. #define pf_is_equal(f1, f2) flag_is_equal(f1, f2, PF_SIZE)
  1509. #define pf_on(f, flag) flag_on_dbg(f, PF_SIZE, flag, #f, #flag)
  1510. #define pf_off(f, flag) flag_off(f, PF_SIZE, flag)
  1511. #define pf_wipe(f) flag_wipe(f, PF_SIZE)
  1512. #define pf_setall(f) flag_setall(f, PF_SIZE)
  1513. #define pf_negate(f) flag_negate(f, PF_SIZE)
  1514. #define pf_copy(f1, f2) flag_copy(f1, f2, PF_SIZE)
  1515. #define pf_union(f1, f2) flag_union(f1, f2, PF_SIZE)
  1516. #define pf_comp_union(f1, f2) flag_comp_union(f1, f2, PF_SIZE)
  1517. #define pf_inter(f1, f2) flag_inter(f1, f2, PF_SIZE)
  1518. #define pf_diff(f1, f2) flag_diff(f1, f2, PF_SIZE)
  1519. #define player_race_has(flag) (pf_has(rp_ptr->pflags, (flag)))
  1520. #define player_class_has(flag) (pf_has(cp_ptr->pflags, (flag)))
  1521. #define player_class_avail(flag) (pf_has(cp_ptr->specialties, (flag)))
  1522. #define player_chose(flag) (pf_has(p_ptr->pflags, (flag)))
  1523. #define player_has(flag) (pf_has(rp_ptr->pflags, (flag)) || pf_has(cp_ptr->pflags, (flag)) || pf_has(p_ptr->pflags, (flag)))
  1524. /*** Terrain flags ***/
  1525. enum
  1526. {
  1527. #define TF(a,b) TF_##a,
  1528. #include "list-terrain-flags.h"
  1529. #undef TF
  1530. TF_MAX
  1531. };
  1532. #define TF_SIZE FLAG_SIZE(TF_MAX)
  1533. #define tf_has(f, flag) flag_has_dbg(f, TF_SIZE, flag, #f, #flag)
  1534. /*** Trap flags ***/
  1535. enum
  1536. {
  1537. #define TRF(a,b) TRF_##a,
  1538. #include "list-trap-flags.h"
  1539. #undef TRF
  1540. TRF_MAX
  1541. };
  1542. #define TRF_SIZE FLAG_SIZE(TRF_MAX)
  1543. #define trf_has(f, flag) flag_has_dbg(f, TRF_SIZE

Large files files are truncated, but you can click here to view the full file