OSDN Git Service

[Refactor] #37353 バリアント名称とバージョン定義を core.h へ移動.
[hengband/hengband.git] / src / defines.h
1 #pragma once
2
3 /*!
4  *  @file defines.h
5  *  @brief 主要なマクロ定義ヘッダ / Purpose: global constants and macro definitions
6  *  @date 2014/01/02
7  *  @author
8  * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
9  *\n
10  * This software may be copied and distributed for educational, research,\n
11  * and not for profit purposes provided that this copyright and statement\n
12  * are included in all such copies.  Other copyrights may also apply.\n
13  *  @details
14  * Do not edit this file unless you know *exactly* what you are doing.\n
15  *\n
16  * Some of the values in this file were chosen to preserve game balance,\n
17  * while others are hard-coded based on the format of old save-files, the\n
18  * definition of arrays in various places, mathematical properties, fast\n
19  * computation, storage limits, or the format of external text files.\n
20  *\n
21  * Changing some of these values will induce crashes or memory errors or\n
22  * savefile mis-reads.  Most of the comments in this file are meant as\n
23  * reminders, not complete descriptions, and even a complete knowledge\n
24  * of the source may not be sufficient to fully understand the effects\n
25  * of changing certain definitions.\n
26  *\n
27  * Lastly, note that the code does not always use the symbolic constants\n
28  * below, and sometimes uses various hard-coded values that may not even\n
29  * be defined in this file, but which may be related to definitions here.\n
30  * This is of course bad programming practice, but nobody is perfect...\n
31  *\n
32  * For example, there are MANY things that depend on the screen being\n
33  * 80x24, with the top line used for messages, the bottom line being\n
34  * used for status, and exactly 22 lines used to show the dungeon.\n
35  * Just because your screen can hold 46 lines does not mean that the\n
36  * game will work if you try to use 44 lines to show the dungeon.\n
37  *\n
38  * You have been warned.\n
39  */
40
41
42 /*!
43  * @brief generate.cで用いられる基本的なブロック数単位(垂直方向)
44  * Number of grids in each block (vertically) Probably hard-coded to 11, see "generate.c"
45  */
46 #define BLOCK_HGT 11
47
48 /*!
49  * @brief generate.cで用いられる基本的なブロック数単位(水平方向)
50  * Number of grids in each block (horizontally) Probably hard-coded to 11, see "generate.c"
51  */
52 #define BLOCK_WID 11
53
54 /*!
55  * @brief 表示上の基本的なパネル単位(垂直方向、BLOCK_HGTの倍数で設定すること)
56  * Number of grids in each panel (vertically) Must be a multiple of BLOCK_HGT
57  */
58 #define PANEL_HGT 11
59
60 /*!
61  * @brief 表示上の基本的なパネル単位(水平方向、BLOCK_WIDの倍数で設定すること)
62  * Number of grids in each panel (horizontally) Must be a multiple of BLOCK_WID
63  */
64 #define PANEL_WID 33
65
66 /*!
67  * @brief 表示上の基本的なブロック単位(垂直方向、PANEL_HGTの倍数で設定すること)
68  * Number of grids used to display the dungeon (vertically). Must be a multiple of 11, probably hard-coded to 22.
69  */
70 #define SCREEN_HGT 22
71
72 /*!
73  * @brief 表示上の基本的なブロック単位(水平方向、PANEL_WIDの倍数で設定すること)
74  * Number of grids used to display the dungeon (horizontally). Must be a multiple of 33, probably hard-coded to 66.
75  */
76 #define SCREEN_WID 66
77
78 /*!
79  * @brief 表示上のダンジョンの最大垂直サイズ(SCREEN_HGTの3倍が望ましい)
80  * Maximum dungeon height in grids, must be a multiple of SCREEN_HGT, probably hard-coded to SCREEN_HGT * 3.
81  */
82 #define MAX_HGT 66
83
84 /*!
85  * @brief 表示上のダンジョンの最大水平サイズ(SCREEN_WIDの3倍が望ましい)
86  * Maximum dungeon width in grids, must be a multiple of SCREEN_WID, probably hard-coded to SCREEN_WID * 3.
87  */
88 #define MAX_WID 198
89
90 /*
91  * Arena constants
92  */
93 #define ARENA_DEFEATED_OLD_VER (-(MAX_SHORT)) /*<! 旧バージョンの闘技場敗北定義 */
94
95 #define MAX_SEXES        2 /*!< 性別の定義最大数 / Maximum number of player "sex" types (see "table.c", etc) */
96 #define MAX_CLASS       28 /*!< 職業の最大定義数 Maximum number of player "class" types (see "table.c", etc) */
97 #define MAX_SEIKAKU     13 /*!< 性格の最大定義数 */
98
99 #define MAX_MIND_POWERS  21 /*!< 超能力の数 / Mindcraft */
100
101 /*
102  * Size of memory reserved for initialization of some arrays
103  */
104 #define FAKE_NAME_SIZE  40 * 1024L /*!< ゲーム情報の種別毎に用意される名前用バッファの容量 */
105 #define FAKE_TEXT_SIZE 150 * 1024L /*!< ゲーム情報の種別毎に用意されるテキスト用バッファの容量 */
106 #define FAKE_TAG_SIZE   10 * 1024L /*!< ゲーム情報の種別毎に用意されるタグ用バッファの容量 */
107
108 #define MAX_HISCORES    999 /*!< スコア情報保存の最大数 / Maximum number of high scores in the high score file */
109
110
111
112 /*!
113  * @brief ダンジョンの最深層 / Maximum dungeon level. 
114  * @details
115  * The player can never reach this level
116  * in the dungeon, and this value is used for various calculations
117  * involving object and monster creation.  It must be at least 100.
118  * Setting it below 128 may prevent the creation of some objects.
119  */
120 #define MAX_DEPTH       128 
121
122 #define MAX_SAVED_FLOORS       20 /*!< 保存フロアの最大数 / Maximum number of saved floors. */
123
124 /*!
125  * @brief プレイヤー用光源処理配列サイズ / Maximum size of the "lite" array (see "current_floor_ptr->grid_array.c")
126  * @details Note that the "lite radius" will NEVER exceed 14, and we would
127  * never require more than 581 entries in the array for circular "lite".
128  */
129 #define LITE_MAX 600
130
131 /*!
132  * @brief モンスター用光源処理配列サイズ / Maximum size of the "mon_lite" array (see "current_floor_ptr->grid_array.c")
133  * @details Note that the "view radius" will NEVER exceed 20, monster illumination
134  * flags are dependent on CAVE_VIEW, and even if the "view" was octagonal,
135  * we would never require more than 1520 entries in the array.
136  */
137 #define MON_LITE_MAX 1536
138
139 /*!
140  * @brief 視界処理配列サイズ / Maximum size of the "view" array (see "current_floor_ptr->grid_array.c")
141  * @details Note that the "view radius" will NEVER exceed 20, and even if the "view"
142  * was octagonal, we would never require more than 1520 entries in the array.
143  */
144 #define VIEW_MAX 1536
145
146 /*!
147  * @brief 視界及び光源の過渡処理配列サイズ / Maximum size of the "temp" array (see "current_floor_ptr->grid_array.c")
148  * @details We must be as large as "VIEW_MAX" and "LITE_MAX" for proper functioning
149  * of "update_view()" and "update_lite()".  We must also be as large as the
150  * largest illuminatable room, but no room is larger than 800 grids.  We
151  * must also be large enough to allow "good enough" use as a circular queue,
152  * to calculate monster flow, but note that the flow code is "paranoid".
153  */
154 #define TEMP_MAX 2298
155
156 /*!
157  * @brief 再描画処理用配列サイズ / Maximum size of the "redraw" array (see "current_floor_ptr->grid_array.c")
158  * @details We must be large for proper functioning of delayed redrawing.
159  * We must also be as large as two times of the largest view area.
160  * Note that maximum view grids are 1149 entries.
161  */
162 #define REDRAW_MAX 2298
163
164 #define KEYMAP_MODE_ORIG        0 /*!< オリジナルキー配置 / Mode for original keyset commands */
165 #define KEYMAP_MODE_ROGUE       1 /*!< ローグライクキー配置 / Mode for roguelike keyset commands */
166 #define KEYMAP_MODES            2 /*!< キー配置の数 / Number of keymap modes */
167
168
169
170
171
172 /*!
173  * @brief マクロ登録の最大数 / Maximum number of macros (see "io.c")
174  * @note Default: assume at most 256 macros are used
175  */
176 #define MACRO_MAX       256
177
178 /*!
179  * @brief 銘情報の最大数 / Maximum number of "quarks" (see "io.c")
180  * @note 
181  * Default: assume at most 512 different inscriptions are used<br>
182  * Was 512... 256 quarks added for random artifacts<br>
183  */
184 #define QUARK_MAX       768
185
186 /*
187  * OPTION: Maximum number of messages to remember (see "io.c")
188  * Default: assume maximal memorization of 2048 total messages
189  */
190 #define MESSAGE_MAX  81920
191
192 /*
193  * OPTION: Maximum space for the message text buffer (see "io.c")
194  * Default: assume that each of the 2048 messages is repeated an
195  * average of three times, and has an average length of 48
196  */
197 #define MESSAGE_BUF 655360
198
199
200 /*
201  * Maximum value storable in a "byte" (hard-coded)
202  */
203 #define MAX_UCHAR       255
204
205 /*
206  * Maximum value storable in a "s16b" (hard-coded)
207  */
208 #define MAX_SHORT       32767
209
210 /*
211  * Maximum length of object's name
212  */
213 #define MAX_NLEN        160
214
215 /*
216  * Misc constants
217  */
218 #define TOWN_DAWN         10000   /*!< 1日分のターン / Number of ticks from dawn to dawn XXX */
219 #define TURNS_PER_TICK    10L     /*!< 時間経過処理を行うターン数の刻み / Number of energy-gain-turns per ticks */
220 #define INN_DUNGEON_TURN_ADJ 10   /*!< 宿屋で時間をつぶした場合に増えるcurrent_world_ptr->dungeon_turnの倍率 */
221 #define MAX_DAYS          20000   /*!< 内部処理中で保持される最大日数 / Maximum days */
222 #define BREAK_GLYPH       550     /*!< 守りのルーンの強靭度 / Rune of protection resistance */
223 #define BREAK_MINOR_GLYPH 299     /*!< 爆発のルーンの発動しやすさ / For explosive runes */
224 #define BTH_PLUS_ADJ      3       /*!< 武器経験値及びプレイヤーの打撃/射撃能力に応じた修正値倍率 / Adjust BTH per plus-to-hit */
225 #define MON_MULT_ADJ      8       /*!< モンスターの増殖しにくさの基本倍率 / High value slows multiplication */
226 #define MON_SUMMON_ADJ    2       /*!< 現在未使用 Adjust level of summoned creatures */
227 #define MON_DRAIN_LIFE    2       /*!< モンスターの打撃によるプレイヤーの経験値吸収基本倍率(%) / Percent of player exp drained per hit */
228 #define USE_DEVICE        3       /*!< 魔道具の最低失敗基準値 x> Harder devices x< Easier devices     */
229
230 /*
231  * Magic-books for the realms
232  */
233 #define REALM1_BOOK     (p_ptr->realm1 + TV_LIFE_BOOK - 1)
234 #define REALM2_BOOK     (p_ptr->realm2 + TV_LIFE_BOOK - 1)
235
236 /*
237  * Maximum number of "normal" pack slots, and the index of the "overflow"
238  * slot, which can hold an item, but only temporarily, since it causes the
239  * pack to "overflow", dropping the "last" item onto the ground.  Since this
240  * value is used as an actual slot, it must be less than "INVEN_RARM" (below).
241  * Note that "INVEN_PACK" is probably hard-coded by its use in savefiles, and
242  * by the fact that the screen can only show 23 items plus a one-line prompt.
243  */
244 #define INVEN_PACK      23 /*!< アイテムスロット…所持品(0~) */
245
246 /*
247  * Player sex constants (hard-coded by save-files, arrays, etc)
248  */
249 #define SEX_FEMALE              0
250 #define SEX_MALE                1
251
252 /*
253  * Player race constants (hard-coded by save-files, arrays, etc)
254  */
255 #define RACE_HUMAN               0
256 #define RACE_HALF_ELF            1
257 #define RACE_ELF                 2
258 #define RACE_HOBBIT              3
259 #define RACE_GNOME               4
260 #define RACE_DWARF               5
261 #define RACE_HALF_ORC            6
262 #define RACE_HALF_TROLL          7
263 #define RACE_AMBERITE            8
264 #define RACE_HIGH_ELF            9
265 #define RACE_BARBARIAN          10
266 #define RACE_HALF_OGRE          11
267 #define RACE_HALF_GIANT         12
268 #define RACE_HALF_TITAN         13
269 #define RACE_CYCLOPS            14
270 #define RACE_YEEK               15
271 #define RACE_KLACKON            16
272 #define RACE_KOBOLD             17
273 #define RACE_NIBELUNG           18
274 #define RACE_DARK_ELF           19
275 #define RACE_DRACONIAN          20
276 #define RACE_MIND_FLAYER        21
277 #define RACE_IMP                22
278 #define RACE_GOLEM              23
279 #define RACE_SKELETON           24
280 #define RACE_ZOMBIE             25
281 #define RACE_VAMPIRE            26
282 #define RACE_SPECTRE            27
283 #define RACE_SPRITE             28
284 #define RACE_BEASTMAN           29
285 #define RACE_ENT                30
286 #define RACE_ANGEL              31
287 #define RACE_DEMON              32
288 #define RACE_DUNADAN            33
289 #define RACE_S_FAIRY            34
290 #define RACE_KUTAR              35
291 #define RACE_ANDROID            36
292 #define RACE_MERFOLK            37
293
294 /*
295  * Maximum number of player "race" types (see "table.c", etc)
296  */
297 #define MAX_RACES               38
298
299
300 /*
301  * Player class constants (hard-coded by save-files, arrays, etc)
302  */
303 #define CLASS_WARRIOR            0
304 #define CLASS_MAGE               1
305 #define CLASS_PRIEST             2
306 #define CLASS_ROGUE              3
307 #define CLASS_RANGER             4
308 #define CLASS_PALADIN            5
309 #define CLASS_WARRIOR_MAGE       6
310 #define CLASS_CHAOS_WARRIOR      7
311 #define CLASS_MONK               8
312 #define CLASS_MINDCRAFTER        9
313 #define CLASS_HIGH_MAGE         10
314 #define CLASS_TOURIST           11
315 #define CLASS_IMITATOR          12
316 #define CLASS_BEASTMASTER       13
317 #define CLASS_SORCERER          14
318 #define CLASS_ARCHER            15
319 #define CLASS_MAGIC_EATER       16
320 #define CLASS_BARD              17
321 #define CLASS_RED_MAGE          18
322 #define CLASS_SAMURAI           19
323 #define CLASS_FORCETRAINER      20
324 #define CLASS_BLUE_MAGE         21
325 #define CLASS_CAVALRY           22
326 #define CLASS_BERSERKER         23
327 #define CLASS_SMITH             24
328 #define CLASS_MIRROR_MASTER     25
329 #define CLASS_NINJA             26
330 #define CLASS_SNIPER            27
331
332 #define SEIKAKU_FUTUU    0
333 #define SEIKAKU_CHIKARA  1
334 #define SEIKAKU_KIREMONO 2
335 #define SEIKAKU_SHIAWASE 3
336 #define SEIKAKU_SUBASI   4
337 #define SEIKAKU_INOCHI   5
338 #define SEIKAKU_COMBAT   6
339 #define SEIKAKU_NAMAKE   7
340 #define SEIKAKU_SEXY     8
341 #define SEIKAKU_LUCKY    9
342 #define SEIKAKU_GAMAN    10
343 #define SEIKAKU_MUNCHKIN 11
344 #define SEIKAKU_CHARGEMAN 12
345
346 /*** Screen Locations ***/
347
348 #define VER_INFO_ROW 3   //!< タイトル表記(行)
349
350
351 #define ROW_MAP                 0
352 #define COL_MAP                 12
353
354
355 /* Which features are dynamic */
356 #define have_dynamic_flags(ARRAY) \
357         (!!((ARRAY)[(FF_INSTANT / 32)] & \
358             ((1UL << (FF_INSTANT % 32)) | \
359              (1UL << (FF_EXPLODE % 32)) | \
360              (1UL << (FF_TIMED % 32)) | \
361              (1UL << (FF_ERUPT % 32)) | \
362              (1UL << (FF_STRIKE % 32)) | \
363              (1UL << (FF_SPREAD % 32)))))
364
365
366 /*
367  * Feature action flags
368  */
369 #define FAF_DESTROY     0x01
370 #define FAF_NO_DROP     0x02
371 #define FAF_CRASH_GLASS 0x04
372
373 /* Types of doors */
374 #define DOOR_DEFAULT    -1
375 #define DOOR_DOOR        0
376 #define DOOR_GLASS_DOOR  1
377 #define DOOR_CURTAIN     2
378
379 #define MAX_DOOR_TYPES   3
380
381 #define feat_locked_door_random(DOOR_TYPE) \
382         (feat_door[(DOOR_TYPE)].num_locked ? \
383          feat_door[(DOOR_TYPE)].locked[randint0(feat_door[(DOOR_TYPE)].num_locked)] : feat_none)
384
385 #define feat_jammed_door_random(DOOR_TYPE) \
386         (feat_door[(DOOR_TYPE)].num_jammed ? \
387          feat_door[(DOOR_TYPE)].jammed[randint0(feat_door[(DOOR_TYPE)].num_jammed)] : feat_none)
388
389
390
391 /* Types of conversions */
392 #define CONVERT_TYPE_FLOOR   0
393 #define CONVERT_TYPE_WALL    1
394 #define CONVERT_TYPE_INNER   2
395 #define CONVERT_TYPE_OUTER   3
396 #define CONVERT_TYPE_SOLID   4
397 #define CONVERT_TYPE_STREAM1 5
398 #define CONVERT_TYPE_STREAM2 6
399
400
401 /*
402  * Bit flags for the *_can_enter() and monster_can_cross_terrain()
403  */
404 #define CEM_RIDING              0x0001
405 #define CEM_P_CAN_ENTER_PATTERN 0x0002
406
407
408 /* Lighting levels of features' attr and char */
409
410 #define F_LIT_STANDARD 0 /* Standard */
411 #define F_LIT_LITE     1 /* Brightly lit */
412 #define F_LIT_DARK     2 /* Darkened */
413
414 #define F_LIT_NS_BEGIN 1 /* Nonstandard */
415 #define F_LIT_MAX      3
416
417
418
419 /*** Object "tval" and "sval" codes ***/
420
421
422 /*
423  * The values for the "tval" field of various objects.
424  *
425  * This value is the primary means by which items are sorted in the
426  * player p_ptr->inventory_list, followed by "sval" and "cost".
427  *
428  * Note that a "BOW" with tval = 19 and sval S = 10*N+P takes a missile
429  * weapon with tval = 16+N, and does (xP) damage when so combined.  This
430  * fact is not actually used in the source, but it kind of interesting.
431  *
432  * Note that as of 2.7.8, the "item flags" apply to all items, though
433  * only armor and weapons and a few other items use any of these flags.
434  */
435
436 #define TV_SKELETON      1      /* Skeletons ('s'), not specified */
437 #define TV_BOTTLE        2      /* Empty bottles ('!') */
438 #define TV_JUNK          3      /* Sticks, Pottery, etc ('~') */
439 #define TV_WHISTLE       4      /* Whistle ('~') */
440 #define TV_SPIKE         5      /* Spikes ('~') */
441 #define TV_CHEST         7      /* Chests ('&') */
442 #define TV_FIGURINE      8      /* Magical figurines */
443 #define TV_STATUE        9      /* Statue, what a silly object... */
444 #define TV_CORPSE       10      /* Corpses and Skeletons, specific */
445 #define TV_CAPTURE      11      /* Monster ball */
446 #define TV_NO_AMMO      15      /* Ammo for crimson */
447 #define TV_SHOT         16      /* Ammo for slings */
448 #define TV_ARROW        17      /* Ammo for bows */
449 #define TV_BOLT         18      /* Ammo for x-bows */
450 #define TV_BOW          19      /* Slings/Bows/Xbows */
451 #define TV_DIGGING      20      /* Shovels/Picks */
452 #define TV_HAFTED       21      /* Priest Weapons */
453 #define TV_POLEARM      22      /* Axes and Pikes */
454 #define TV_SWORD        23      /* Edged Weapons */
455 #define TV_BOOTS        30      /* Boots */
456 #define TV_GLOVES       31      /* Gloves */
457 #define TV_HELM         32      /* Helms */
458 #define TV_CROWN        33      /* Crowns */
459 #define TV_SHIELD       34      /* Shields */
460 #define TV_CLOAK        35      /* Cloaks */
461 #define TV_SOFT_ARMOR   36      /* Soft Armor */
462 #define TV_HARD_ARMOR   37      /* Hard Armor */
463 #define TV_DRAG_ARMOR   38      /* Dragon Scale Mail */
464 #define TV_LITE         39      /* Lites (including Specials) */
465 #define TV_AMULET       40      /* Amulets (including Specials) */
466 #define TV_RING         45      /* Rings (including Specials) */
467 #define TV_CARD         50
468 #define TV_STAFF        55
469 #define TV_WAND         65
470 #define TV_ROD          66
471 #define TV_PARCHMENT    69
472 #define TV_SCROLL       70
473 #define TV_POTION       75
474 #define TV_FLASK        77
475 #define TV_FOOD         80
476 #define TV_LIFE_BOOK    90
477 #define TV_SORCERY_BOOK 91
478 #define TV_NATURE_BOOK  92
479 #define TV_CHAOS_BOOK   93
480 #define TV_DEATH_BOOK   94
481 #define TV_TRUMP_BOOK   95
482 #define TV_ARCANE_BOOK  96
483 #define TV_CRAFT_BOOK 97
484 #define TV_DAEMON_BOOK  98
485 #define TV_CRUSADE_BOOK 99
486 #define TV_MUSIC_BOOK   105
487 #define TV_HISSATSU_BOOK 106
488 #define TV_HEX_BOOK     107
489 #define TV_GOLD         127     /* Gold can only be picked up by players */
490
491 #define TV_EQUIP_BEGIN    TV_SHOT
492 #define TV_EQUIP_END      TV_CARD
493 #define TV_MISSILE_BEGIN  TV_SHOT
494 #define TV_MISSILE_END    TV_BOLT
495 #define TV_WEARABLE_BEGIN TV_BOW
496 #define TV_WEARABLE_END   TV_CARD
497 #define TV_WEAPON_BEGIN   TV_BOW
498 #define TV_WEAPON_END     TV_SWORD
499 #define TV_ARMOR_BEGIN    TV_BOOTS
500 #define TV_ARMOR_END      TV_DRAG_ARMOR
501
502 /* Any subvalue */
503 #define SV_ANY                                  255
504
505 /* The "sval" codes for TV_FIGURINE */
506 #define SV_FIGURINE_NORMAL              0
507
508 #define SV_CAPTURE_NONE         0
509
510 /* The "sval" codes for TV_STATUE */
511 #define SV_WOODEN_STATUE                0
512 #define SV_CLAY_STATUE                  1
513 #define SV_STONE_STATUE                 2
514 #define SV_IRON_STATUE                  3
515 #define SV_COPPER_STATUE                4
516 #define SV_SILVER_STATUE                5
517 #define SV_GOLDEN_STATUE                6
518 #define SV_IVORY_STATUE                 7
519 #define SV_MITHRIL_STATUE               8
520 #define SV_ORNATE_STATUE                9
521 #define SV_PHOTO                        50
522
523 /* The "sval" codes for TV_CORPSE */
524 #define SV_SKELETON                     0
525 #define SV_CORPSE                       1
526
527 /* The "sval" codes for TV_SHOT/TV_ARROW/TV_BOLT */
528 #define SV_AMMO_LIGHT                    0      /* pebbles */
529 #define SV_AMMO_NORMAL                   1      /* shots, arrows, bolts */
530 #define SV_AMMO_HEAVY                    2      /* seeker arrows and bolts, mithril shots */
531
532 /* The "sval" codes for TV_BOW (note information in "sval") */
533 #define SV_SLING                         2      /* (x2) */
534 #define SV_SHORT_BOW                    12      /* (x2) */
535 #define SV_LONG_BOW                     13      /* (x3) */
536 #define SV_LIGHT_XBOW                   23      /* (x3) */
537 #define SV_HEAVY_XBOW                   24      /* (x4) */
538 #define SV_CRIMSON                      50      /* (x0) */
539 #define SV_HARP                         51      /* (x0) */
540 #define SV_NAMAKE_BOW                   63      /* (x3) */
541
542 /* The "sval" codes for TV_DIGGING */
543 #define SV_SHOVEL                        1
544 #define SV_GNOMISH_SHOVEL                2
545 #define SV_DWARVEN_SHOVEL                3
546 #define SV_PICK                          4
547 #define SV_ORCISH_PICK                   5
548 #define SV_DWARVEN_PICK                  6
549 #define SV_MATTOCK                       7
550
551 /* The "sval" values for TV_HAFTED */
552 #define SV_CLUB                          1      /* 1d4  */
553 #define SV_WHIP                          2      /* 1d6  */
554 #define SV_QUARTERSTAFF                  3      /* 1d9  */
555 #define SV_NUNCHAKU                      4      /* 2d3  */
556 #define SV_MACE                          5      /* 2d4  */
557 #define SV_BALL_AND_CHAIN                6      /* 2d4  */
558 #define SV_JO_STAFF                      7      /* 1d7  */
559 #define SV_WAR_HAMMER                    8      /* 3d3  */
560 #define SV_THREE_PIECE_ROD              11      /* 3d3  */
561 #define SV_MORNING_STAR                 12      /* 2d6  */
562 #define SV_FLAIL                        13      /* 2d6  */
563 #define SV_BO_STAFF                     14      /* 1d11 */
564 #define SV_LEAD_FILLED_MACE             15      /* 3d4  */
565 #define SV_TETSUBO                      16      /* 2d7  */
566 #define SV_TWO_HANDED_FLAIL             18      /* 3d6  */
567 #define SV_GREAT_HAMMER                 19      /* 4d6  */
568 #define SV_MACE_OF_DISRUPTION           20      /* 5d8  */
569 #define SV_WIZSTAFF                     21      /* 1d2  */
570 #define SV_GROND                        50      /* 3d9  */
571 #define SV_NAMAKE_HAMMER                63      /* 1d77 */
572
573 /* The "sval" values for TV_POLEARM */
574 #define SV_HATCHET                       1      /* 1d5 */
575 #define SV_SPEAR                         2      /* 1d6 */
576 #define SV_SICKLE                        3      /* 2d3 */
577 #define SV_AWL_PIKE                      4      /* 1d8 */
578 #define SV_TRIDENT                       5      /* 1d9 */
579 #define SV_FAUCHARD                      6  /* 1d10 */
580 #define SV_BROAD_SPEAR                   7      /* 1d9 */
581 #define SV_PIKE                          8      /* 2d5 */
582 #define SV_NAGINATA                      9  /* 2d6 */
583 #define SV_BEAKED_AXE                   10      /* 2d6 */
584 #define SV_BROAD_AXE                    11      /* 2d6 */
585 #define SV_LUCERNE_HAMMER               12      /* 2d5  */
586 #define SV_GLAIVE                       13      /* 2d6 */
587 #define SV_LAJATANG                     14      /* 2d7 */
588 #define SV_HALBERD                      15      /* 3d4 */
589 #define SV_GUISARME                     16  /* 2d5 */
590 #define SV_SCYTHE                       17      /* 5d3 */
591 #define SV_LANCE                        20      /* 2d8 */
592 #define SV_BATTLE_AXE                   22      /* 2d8 */
593 #define SV_GREAT_AXE                    25      /* 4d4 */
594 #define SV_TRIFURCATE_SPEAR             26      /* 2d9 */
595 #define SV_LOCHABER_AXE                 28      /* 3d8 */
596 #define SV_HEAVY_LANCE                  29  /* 4d8 */
597 #define SV_SCYTHE_OF_SLICING            30      /* 8d4 */
598 #define SV_TSURIZAO                     40      /* 1d1 */
599 #define SV_DEATH_SCYTHE                 50      /* 10d10 */
600
601 /* The "sval" codes for TV_SWORD */
602 #define SV_BROKEN_DAGGER                 1  /* 1d1 */
603 #define SV_BROKEN_SWORD                  2  /* 1d2 */
604 #define SV_DAGGER                        4  /* 1d4 */
605 #define SV_MAIN_GAUCHE                   5  /* 1d5 */
606 #define SV_TANTO                         6  /* 1d5 */
607 #define SV_RAPIER                        7  /* 1d6 */
608 #define SV_SMALL_SWORD                   8  /* 1d6 */
609 #define SV_BASILLARD                     9  /* 1d8 */
610 #define SV_SHORT_SWORD                  10  /* 1d7 */
611 #define SV_SABRE                        11  /* 1d7 */
612 #define SV_CUTLASS                      12  /* 1d7 */
613 #define SV_WAKIZASHI                    13  /* 2d4 */
614 #define SV_KHOPESH                      14  /* 2d4 */
615 #define SV_TULWAR                       15  /* 2d4 */
616 #define SV_BROAD_SWORD                  16  /* 2d5 */
617 #define SV_LONG_SWORD                   17  /* 2d5 */
618 #define SV_SCIMITAR                     18  /* 2d5 */
619 #define SV_NINJATO                      19  /* 1d9 */
620 #define SV_KATANA                       20  /* 3d4 */
621 #define SV_BASTARD_SWORD                21  /* 3d4 */
622 #define SV_GREAT_SCIMITAR               22  /* 4d5 */
623 #define SV_CLAYMORE                     23  /* 2d8 */
624 #define SV_ESPADON                      24  /* 2d9 */
625 #define SV_TWO_HANDED_SWORD             25  /* 3d6 */
626 #define SV_FLAMBERGE                    26  /* 3d7 */
627 #define SV_NO_DACHI                     27  /* 5d4 */
628 #define SV_EXECUTIONERS_SWORD           28  /* 4d5 */
629 #define SV_ZWEIHANDER                   29  /* 4d6 */
630 #define SV_BLADE_OF_CHAOS               30  /* 6d5 */
631 #define SV_DIAMOND_EDGE                 31  /* 7d5 */
632 #define SV_DOKUBARI                     32  /* 1d1 */
633 #define SV_HAYABUSA                     33  /* 1d6 */
634
635 /* The "sval" codes for TV_SHIELD */
636 #define SV_SMALL_LEATHER_SHIELD          2
637 #define SV_SMALL_METAL_SHIELD            3
638 #define SV_LARGE_LEATHER_SHIELD          4
639 #define SV_LARGE_METAL_SHIELD            5
640 #define SV_DRAGON_SHIELD                 6
641 #define SV_KNIGHT_SHIELD                 7
642 #define SV_MIRROR_SHIELD                10
643 #define SV_YATA_MIRROR                  50
644
645 /* The "sval" codes for TV_HELM */
646 #define SV_HARD_LEATHER_CAP              2
647 #define SV_METAL_CAP                     3
648 #define SV_JINGASA                       4  /* 4 */
649 #define SV_IRON_HELM                     5
650 #define SV_STEEL_HELM                    6
651 #define SV_DRAGON_HELM                   7
652 #define SV_KABUTO                        8  /* 7 */
653
654 /* The "sval" codes for TV_CROWN */
655 #define SV_IRON_CROWN                   10
656 #define SV_GOLDEN_CROWN                 11
657 #define SV_JEWELED_CROWN                12
658 #define SV_CHAOS                        50
659
660 /* The "sval" codes for TV_BOOTS */
661 #define SV_PAIR_OF_SOFT_LEATHER_BOOTS    2
662 #define SV_PAIR_OF_HARD_LEATHER_BOOTS    3
663 #define SV_PAIR_OF_DRAGON_GREAVE         4
664 #define SV_PAIR_OF_METAL_SHOD_BOOTS      6
665
666 /* The "sval" codes for TV_CLOAK */
667 #define SV_CLOAK                         1
668 #define SV_ELVEN_CLOAK                   2
669 #define SV_FUR_CLOAK                     3
670 #define SV_ETHEREAL_CLOAK                5
671 #define SV_SHADOW_CLOAK                  6
672
673 /* The "sval" codes for TV_GLOVES */
674 #define SV_SET_OF_LEATHER_GLOVES         1
675 #define SV_SET_OF_GAUNTLETS              2
676 #define SV_SET_OF_DRAGON_GLOVES          3
677 #define SV_SET_OF_CESTI                  5
678
679 /* The "sval" codes for TV_SOFT_ARMOR */
680 #define SV_T_SHIRT                       0
681 #define SV_FILTHY_RAG                    1
682 #define SV_ROBE                          2
683 #define SV_PAPER_ARMOR                   3  /* 4 */
684 #define SV_SOFT_LEATHER_ARMOR            4
685 #define SV_SOFT_STUDDED_LEATHER          5
686 #define SV_HARD_LEATHER_ARMOR            6
687 #define SV_HARD_STUDDED_LEATHER          7
688 #define SV_RHINO_HIDE_ARMOR              8
689 #define SV_CORD_ARMOR                    9  /*  6 */
690 #define SV_PADDED_ARMOR                 10  /*  4 */
691 #define SV_LEATHER_SCALE_MAIL           11
692 #define SV_LEATHER_JACK                 12
693 #define SV_KUROSHOUZOKU                 13
694 #define SV_STONE_AND_HIDE_ARMOR         15  /* 15 */
695 #define SV_ABUNAI_MIZUGI                50
696 #define SV_YOIYAMI_ROBE                 60
697 #define SV_NAMAKE_ARMOR                 63
698
699 /* The "sval" codes for TV_HARD_ARMOR */
700 #define SV_RUSTY_CHAIN_MAIL              1  /* 14- */
701 #define SV_RING_MAIL                     2  /* 12  */
702 #define SV_METAL_SCALE_MAIL              3  /* 13  */
703 #define SV_CHAIN_MAIL                    4  /* 14  */
704 #define SV_DOUBLE_RING_MAIL              5  /* 15  */
705 #define SV_AUGMENTED_CHAIN_MAIL          6  /* 16  */
706 #define SV_DOUBLE_CHAIN_MAIL             7  /* 16  */
707 #define SV_BAR_CHAIN_MAIL                8  /* 18  */
708 #define SV_METAL_BRIGANDINE_ARMOUR       9  /* 19  */
709 #define SV_SPLINT_MAIL                  10  /* 19  */
710 #define SV_DO_MARU                      11  /* 20  */
711 #define SV_PARTIAL_PLATE_ARMOUR         12  /* 22  */
712 #define SV_METAL_LAMELLAR_ARMOUR        13  /* 23  */
713 #define SV_HARAMAKIDO                   14  /* 17  */
714 #define SV_FULL_PLATE_ARMOUR            15  /* 25  */
715 #define SV_O_YOROI                      16  /* 24  */
716 #define SV_RIBBED_PLATE_ARMOUR          18  /* 28  */
717 #define SV_MITHRIL_CHAIN_MAIL           20  /* 28+ */
718 #define SV_MITHRIL_PLATE_MAIL           25  /* 35+ */
719 #define SV_ADAMANTITE_PLATE_MAIL        30  /* 40+ */
720
721 /* The "sval" codes for TV_DRAG_ARMOR */
722 #define SV_DRAGON_BLACK                  1
723 #define SV_DRAGON_BLUE                   2
724 #define SV_DRAGON_WHITE                  3
725 #define SV_DRAGON_RED                    4
726 #define SV_DRAGON_GREEN                  5
727 #define SV_DRAGON_MULTIHUED              6
728 #define SV_DRAGON_SHINING               10
729 #define SV_DRAGON_LAW                   12
730 #define SV_DRAGON_BRONZE                14
731 #define SV_DRAGON_GOLD                  16
732 #define SV_DRAGON_CHAOS                 18
733 #define SV_DRAGON_BALANCE               20
734 #define SV_DRAGON_POWER                 30
735
736 /* The sval codes for TV_LITE */
737 #define SV_LITE_TORCH                    0
738 #define SV_LITE_LANTERN                  1
739 #define SV_LITE_FEANOR                   2
740 #define SV_LITE_EDISON                   3
741 #define SV_LITE_GALADRIEL                4
742 #define SV_LITE_ELENDIL                  5
743 #define SV_LITE_JUDGE                    6
744 #define SV_LITE_LORE                     7
745 #define SV_LITE_PALANTIR                 8
746 #define SV_LITE_FLY_STONE                9
747
748 /* The "sval" codes for TV_AMULET */
749 #define SV_AMULET_DOOM                   0
750 #define SV_AMULET_TELEPORT               1
751 #define SV_AMULET_ADORNMENT              2
752 #define SV_AMULET_SLOW_DIGEST            3
753 #define SV_AMULET_RESIST_ACID            4
754 #define SV_AMULET_SEARCHING              5
755 #define SV_AMULET_BRILLIANCE             6
756 #define SV_AMULET_CHARISMA               7
757 #define SV_AMULET_THE_MAGI               8
758 #define SV_AMULET_REFLECTION             9
759 #define SV_AMULET_CARLAMMAS             10
760 #define SV_AMULET_INGWE                 11
761 #define SV_AMULET_DWARVES               12
762 #define SV_AMULET_NO_MAGIC              13
763 #define SV_AMULET_NO_TELE               14
764 #define SV_AMULET_RESISTANCE            15
765 #define SV_AMULET_TELEPATHY             16
766 #define SV_AMULET_FARAMIR               17
767 #define SV_AMULET_BOROMIR               18
768 #define SV_AMULET_MAGATAMA              19
769 #define SV_AMULET_INROU                 20
770 #define SV_AMULET_INTELLIGENCE          21
771 #define SV_AMULET_WISDOM                22
772 #define SV_AMULET_MAGIC_MASTERY         23
773 #define SV_AMULET_NIGHT                 24
774
775 /* The sval codes for TV_RING */
776 #define SV_RING_WOE                      0
777 #define SV_RING_AGGRAVATION              1
778 #define SV_RING_WEAKNESS                 2
779 #define SV_RING_STUPIDITY                3
780 #define SV_RING_TELEPORTATION            4
781 #define SV_RING_SLOW_DIGESTION           6
782 #define SV_RING_LEVITATION_FALL             7
783 #define SV_RING_RESIST_FIRE              8
784 #define SV_RING_RESIST_COLD              9
785 #define SV_RING_SUSTAIN_STR             10
786 #define SV_RING_SUSTAIN_INT             11
787 #define SV_RING_SUSTAIN_WIS             12
788 #define SV_RING_SUSTAIN_CON             13
789 #define SV_RING_SUSTAIN_DEX             14
790 #define SV_RING_SUSTAIN_CHR             15
791 #define SV_RING_PROTECTION              16
792 #define SV_RING_ACID                    17
793 #define SV_RING_FLAMES                  18
794 #define SV_RING_ICE                     19
795 #define SV_RING_RESIST_POIS             20
796 #define SV_RING_FREE_ACTION             21
797 #define SV_RING_SEE_INVIS               22
798 #define SV_RING_SEARCHING               23
799 #define SV_RING_STR                     24
800 #define SV_RING_ELEC                    25
801 #define SV_RING_DEX                     26
802 #define SV_RING_CON                     27
803 #define SV_RING_ACCURACY                28
804 #define SV_RING_DAMAGE                  29
805 #define SV_RING_SLAYING                 30
806 #define SV_RING_SPEED                   31
807 #define SV_RING_FRAKIR                  32
808 #define SV_RING_TULKAS                  33
809 #define SV_RING_NARYA                   34
810 #define SV_RING_NENYA                   35
811 #define SV_RING_VILYA                   36
812 #define SV_RING_POWER                   37
813 #define SV_RING_RES_FEAR                38
814 #define SV_RING_RES_LD                  39
815 #define SV_RING_RES_NETHER              40
816 #define SV_RING_RES_NEXUS               41
817 #define SV_RING_RES_SOUND               42
818 #define SV_RING_RES_CONFUSION           43
819 #define SV_RING_RES_SHARDS              44
820 #define SV_RING_RES_DISENCHANT          45
821 #define SV_RING_RES_CHAOS               46
822 #define SV_RING_RES_BLINDNESS           47
823 #define SV_RING_LORDLY                  48
824 #define SV_RING_ATTACKS                 49
825 #define SV_RING_AHO                     50
826 #define SV_RING_SHOTS                   51
827 #define SV_RING_SUSTAIN                 52
828 #define SV_RING_DEC_MANA                53
829 #define SV_RING_WARNING                 54
830 #define SV_RING_MUSCLE                  55
831
832 #define SV_EXPRESS_CARD                  0
833
834 /* The "sval" codes for TV_STAFF */
835 #define SV_STAFF_DARKNESS                0
836 #define SV_STAFF_SLOWNESS                1
837 #define SV_STAFF_HASTE_MONSTERS          2
838 #define SV_STAFF_SUMMONING               3
839 #define SV_STAFF_TELEPORTATION           4
840 #define SV_STAFF_IDENTIFY                5
841 #define SV_STAFF_REMOVE_CURSE            6
842 #define SV_STAFF_STARLITE                7
843 #define SV_STAFF_LITE                    8
844 #define SV_STAFF_MAPPING                 9
845 #define SV_STAFF_DETECT_GOLD            10
846 #define SV_STAFF_DETECT_ITEM            11
847 #define SV_STAFF_DETECT_TRAP            12
848 #define SV_STAFF_DETECT_DOOR            13
849 #define SV_STAFF_DETECT_INVIS           14
850 #define SV_STAFF_DETECT_EVIL            15
851 #define SV_STAFF_CURE_LIGHT             16
852 #define SV_STAFF_CURING                 17
853 #define SV_STAFF_HEALING                18
854 #define SV_STAFF_THE_MAGI               19
855 #define SV_STAFF_SLEEP_MONSTERS         20
856 #define SV_STAFF_SLOW_MONSTERS          21
857 #define SV_STAFF_SPEED                  22
858 #define SV_STAFF_PROBING                23
859 #define SV_STAFF_DISPEL_EVIL            24
860 #define SV_STAFF_POWER                  25
861 #define SV_STAFF_HOLINESS               26
862 #define SV_STAFF_GENOCIDE               27
863 #define SV_STAFF_EARTHQUAKES            28
864 #define SV_STAFF_DESTRUCTION            29
865 #define SV_STAFF_ANIMATE_DEAD           30
866 #define SV_STAFF_MSTORM                 31
867 #define SV_STAFF_NOTHING                32
868
869
870 /* The "sval" codes for TV_WAND */
871 #define SV_WAND_HEAL_MONSTER             0
872 #define SV_WAND_HASTE_MONSTER            1
873 #define SV_WAND_CLONE_MONSTER            2
874 #define SV_WAND_TELEPORT_AWAY            3
875 #define SV_WAND_DISARMING                4
876 #define SV_WAND_TRAP_DOOR_DEST           5
877 #define SV_WAND_STONE_TO_MUD             6
878 #define SV_WAND_LITE                     7
879 #define SV_WAND_SLEEP_MONSTER            8
880 #define SV_WAND_SLOW_MONSTER             9
881 #define SV_WAND_CONFUSE_MONSTER         10
882 #define SV_WAND_FEAR_MONSTER            11
883 #define SV_WAND_HYPODYNAMIA              12
884 #define SV_WAND_POLYMORPH               13
885 #define SV_WAND_STINKING_CLOUD          14
886 #define SV_WAND_MAGIC_MISSILE           15
887 #define SV_WAND_ACID_BOLT               16
888 #define SV_WAND_CHARM_MONSTER           17
889 #define SV_WAND_FIRE_BOLT               18
890 #define SV_WAND_COLD_BOLT               19
891 #define SV_WAND_ACID_BALL               20
892 #define SV_WAND_ELEC_BALL               21
893 #define SV_WAND_FIRE_BALL               22
894 #define SV_WAND_COLD_BALL               23
895 #define SV_WAND_WONDER                  24
896 #define SV_WAND_DISINTEGRATE            25
897 #define SV_WAND_DRAGON_FIRE             26
898 #define SV_WAND_DRAGON_COLD             27
899 #define SV_WAND_DRAGON_BREATH           28
900 #define SV_WAND_ROCKETS                 29
901 #define SV_WAND_STRIKING                30
902 #define SV_WAND_GENOCIDE                31
903
904 /* The "sval" codes for TV_ROD */
905 #define SV_ROD_DETECT_TRAP               0
906 #define SV_ROD_DETECT_DOOR               1
907 #define SV_ROD_IDENTIFY                  2
908 #define SV_ROD_RECALL                    3
909 #define SV_ROD_ILLUMINATION              4
910 #define SV_ROD_MAPPING                   5
911 #define SV_ROD_DETECTION                 6
912 #define SV_ROD_PROBING                   7
913 #define SV_ROD_CURING                    8
914 #define SV_ROD_HEALING                   9
915 #define SV_ROD_RESTORATION              10
916 #define SV_ROD_SPEED                    11
917 #define SV_ROD_PESTICIDE                12
918 #define SV_ROD_TELEPORT_AWAY            13
919 #define SV_ROD_DISARMING                14
920 #define SV_ROD_LITE                     15
921 #define SV_ROD_SLEEP_MONSTER            16
922 #define SV_ROD_SLOW_MONSTER             17
923 #define SV_ROD_HYPODYNAMIA               18
924 #define SV_ROD_POLYMORPH                19
925 #define SV_ROD_ACID_BOLT                20
926 #define SV_ROD_ELEC_BOLT                21
927 #define SV_ROD_FIRE_BOLT                22
928 #define SV_ROD_COLD_BOLT                23
929 #define SV_ROD_ACID_BALL                24
930 #define SV_ROD_ELEC_BALL                25
931 #define SV_ROD_FIRE_BALL                26
932 #define SV_ROD_COLD_BALL                27
933 #define SV_ROD_HAVOC                    28
934 #define SV_ROD_STONE_TO_MUD             29
935 #define SV_ROD_AGGRAVATE                30
936
937
938 /* The "sval" codes for TV_SCROLL */
939
940 #define SV_SCROLL_DARKNESS               0
941 #define SV_SCROLL_AGGRAVATE_MONSTER      1
942 #define SV_SCROLL_CURSE_ARMOR            2
943 #define SV_SCROLL_CURSE_WEAPON           3
944 #define SV_SCROLL_SUMMON_MONSTER         4
945 #define SV_SCROLL_SUMMON_UNDEAD          5
946 #define SV_SCROLL_SUMMON_PET             6
947 #define SV_SCROLL_TRAP_CREATION          7
948 #define SV_SCROLL_PHASE_DOOR             8
949 #define SV_SCROLL_TELEPORT               9
950 #define SV_SCROLL_TELEPORT_LEVEL        10
951 #define SV_SCROLL_WORD_OF_RECALL        11
952 #define SV_SCROLL_IDENTIFY              12
953 #define SV_SCROLL_STAR_IDENTIFY         13
954 #define SV_SCROLL_REMOVE_CURSE          14
955 #define SV_SCROLL_STAR_REMOVE_CURSE     15
956 #define SV_SCROLL_ENCHANT_ARMOR         16
957 #define SV_SCROLL_ENCHANT_WEAPON_TO_HIT 17
958 #define SV_SCROLL_ENCHANT_WEAPON_TO_DAM 18
959 /* xxx enchant missile? */
960 #define SV_SCROLL_STAR_ENCHANT_ARMOR    20
961 #define SV_SCROLL_STAR_ENCHANT_WEAPON   21
962 #define SV_SCROLL_RECHARGING            22
963 #define SV_SCROLL_MUNDANITY             23
964 #define SV_SCROLL_LIGHT                 24
965 #define SV_SCROLL_MAPPING               25
966 #define SV_SCROLL_DETECT_GOLD           26
967 #define SV_SCROLL_DETECT_ITEM           27
968 #define SV_SCROLL_DETECT_TRAP           28
969 #define SV_SCROLL_DETECT_DOOR           29
970 #define SV_SCROLL_DETECT_INVIS          30
971 /* xxx (detect evil?) */
972 #define SV_SCROLL_SATISFY_HUNGER        32
973 #define SV_SCROLL_BLESSING              33
974 #define SV_SCROLL_HOLY_CHANT            34
975 #define SV_SCROLL_HOLY_PRAYER           35
976 #define SV_SCROLL_MONSTER_CONFUSION     36
977 #define SV_SCROLL_PROTECTION_FROM_EVIL  37
978 #define SV_SCROLL_RUNE_OF_PROTECTION    38
979 #define SV_SCROLL_TRAP_DOOR_DESTRUCTION 39
980 /* xxx */
981 #define SV_SCROLL_STAR_DESTRUCTION      41
982 #define SV_SCROLL_DISPEL_UNDEAD         42
983 #define SV_SCROLL_SPELL                 43
984 #define SV_SCROLL_GENOCIDE              44
985 #define SV_SCROLL_MASS_GENOCIDE         45
986 #define SV_SCROLL_ACQUIREMENT           46
987 #define SV_SCROLL_STAR_ACQUIREMENT      47
988 #define SV_SCROLL_FIRE                  48
989 #define SV_SCROLL_ICE                   49
990 #define SV_SCROLL_CHAOS                 50
991 #define SV_SCROLL_RUMOR                 51
992 #define SV_SCROLL_ARTIFACT              52
993 #define SV_SCROLL_RESET_RECALL          53
994 #define SV_SCROLL_SUMMON_KIN            54
995 #define SV_SCROLL_AMUSEMENT             55
996 #define SV_SCROLL_STAR_AMUSEMENT        56
997
998 /* The "sval" codes for TV_POTION */
999 #define SV_POTION_WATER                  0
1000 #define SV_POTION_APPLE_JUICE            1
1001 #define SV_POTION_SLIME_MOLD             2
1002 /* xxx (fixed color) */
1003 #define SV_POTION_SLOWNESS               4
1004 #define SV_POTION_SALT_WATER             5
1005 #define SV_POTION_POISON                 6
1006 #define SV_POTION_BLINDNESS              7
1007 /* xxx */
1008 #define SV_POTION_BOOZE              9
1009 /* xxx */
1010 #define SV_POTION_SLEEP                 11
1011 /* xxx */
1012 #define SV_POTION_LOSE_MEMORIES         13
1013 /* xxx */
1014 #define SV_POTION_RUINATION             15
1015 #define SV_POTION_DEC_STR               16
1016 #define SV_POTION_DEC_INT               17
1017 #define SV_POTION_DEC_WIS               18
1018 #define SV_POTION_DEC_DEX               19
1019 #define SV_POTION_DEC_CON               20
1020 #define SV_POTION_DEC_CHR               21
1021 #define SV_POTION_DETONATIONS           22
1022 #define SV_POTION_DEATH                 23
1023 #define SV_POTION_INFRAVISION           24
1024 #define SV_POTION_DETECT_INVIS          25
1025 #define SV_POTION_SLOW_POISON           26
1026 #define SV_POTION_CURE_POISON           27
1027 #define SV_POTION_BOLDNESS              28
1028 #define SV_POTION_SPEED                 29
1029 #define SV_POTION_RESIST_HEAT           30
1030 #define SV_POTION_RESIST_COLD           31
1031 #define SV_POTION_HEROISM               32
1032 #define SV_POTION_BESERK_STRENGTH       33
1033 #define SV_POTION_CURE_LIGHT            34
1034 #define SV_POTION_CURE_SERIOUS          35
1035 #define SV_POTION_CURE_CRITICAL         36
1036 #define SV_POTION_HEALING               37
1037 #define SV_POTION_STAR_HEALING          38
1038 #define SV_POTION_LIFE                  39
1039 #define SV_POTION_RESTORE_MANA          40
1040 #define SV_POTION_RESTORE_EXP           41
1041 #define SV_POTION_RES_STR               42
1042 #define SV_POTION_RES_INT               43
1043 #define SV_POTION_RES_WIS               44
1044 #define SV_POTION_RES_DEX               45
1045 #define SV_POTION_RES_CON               46
1046 #define SV_POTION_RES_CHR               47
1047 #define SV_POTION_INC_STR               48
1048 #define SV_POTION_INC_INT               49
1049 #define SV_POTION_INC_WIS               50
1050 #define SV_POTION_INC_DEX               51
1051 #define SV_POTION_INC_CON               52
1052 #define SV_POTION_INC_CHR               53
1053 /* xxx */
1054 #define SV_POTION_AUGMENTATION          55
1055 #define SV_POTION_ENLIGHTENMENT         56
1056 #define SV_POTION_STAR_ENLIGHTENMENT    57
1057 #define SV_POTION_SELF_KNOWLEDGE        58
1058 #define SV_POTION_EXPERIENCE            59
1059 #define SV_POTION_RESISTANCE            60
1060 #define SV_POTION_CURING                61
1061 #define SV_POTION_INVULNERABILITY       62
1062 #define SV_POTION_NEW_LIFE              63
1063 #define SV_POTION_NEO_TSUYOSHI          64
1064 #define SV_POTION_TSUYOSHI              65
1065 #define SV_POTION_POLYMORPH             66
1066
1067 /* The "sval" codes for TV_FLASK */
1068 #define SV_FLASK_OIL                   0
1069
1070 /* The "sval" codes for TV_FOOD */
1071 #define SV_FOOD_POISON                   0
1072 #define SV_FOOD_BLINDNESS                1
1073 #define SV_FOOD_PARANOIA                 2
1074 #define SV_FOOD_CONFUSION                3
1075 #define SV_FOOD_HALLUCINATION            4
1076 #define SV_FOOD_PARALYSIS                5
1077 #define SV_FOOD_WEAKNESS                 6
1078 #define SV_FOOD_SICKNESS                 7
1079 #define SV_FOOD_STUPIDITY                8
1080 #define SV_FOOD_NAIVETY                  9
1081 #define SV_FOOD_UNHEALTH                10
1082 #define SV_FOOD_DISEASE                 11
1083 #define SV_FOOD_CURE_POISON             12
1084 #define SV_FOOD_CURE_BLINDNESS          13
1085 #define SV_FOOD_CURE_PARANOIA           14
1086 #define SV_FOOD_CURE_CONFUSION          15
1087 #define SV_FOOD_CURE_SERIOUS            16
1088 #define SV_FOOD_RESTORE_STR             17
1089 #define SV_FOOD_RESTORE_CON             18
1090 #define SV_FOOD_RESTORING               19
1091 /* many missing mushrooms */
1092 #define SV_FOOD_BISCUIT                 32
1093 #define SV_FOOD_JERKY                   33
1094 #define SV_FOOD_RATION                  35
1095 #define SV_FOOD_SLIME_MOLD              36
1096 #define SV_FOOD_WAYBREAD                37
1097 #define SV_FOOD_PINT_OF_ALE             38
1098 #define SV_FOOD_PINT_OF_WINE            39
1099
1100
1101 #define SV_ROD_MIN_DIRECTION    12 /*!< この値以降の小項目IDを持ったロッドは使用時にターゲットを要求する / Special "sval" limit -- first "aimed" rod */
1102
1103 #define SV_CHEST_MIN_LARGE      4  /*!< この値以降の小項目IDを持った箱は大型の箱としてドロップ数を増やす / Special "sval" limit -- first "large" chest */
1104 #define SV_CHEST_KANDUME        50 /*!< 箱アイテムの小項目ID: おもちゃのカンヅメ */
1105
1106 /*
1107  * Special "sval" limit -- first "good" magic/prayer book
1108  */
1109 #define SV_BOOK_MIN_GOOD    2
1110
1111
1112 #define OBJ_GOLD_LIST   480     /* First "gold" entry */
1113 #define MAX_GOLD        18      /* Number of "gold" entries */
1114
1115 /*** General flag values ***/
1116
1117 /*
1118  * Special caster ID for project()
1119  */
1120 #define PROJECT_WHO_UNCTRL_POWER -1 /*!< 魔法効果の自然発生要因: 名状し難い力の解放 */
1121 #define PROJECT_WHO_GLASS_SHARDS -2 /*!< 魔法効果の自然発生要因: 破壊されたガラス地形の破片 */
1122
1123
1124 /*
1125  * Bit flags for the "p_ptr->window" variable (etc)
1126  */
1127 #define PW_INVEN        0x00000001L     /*!<サブウィンドウ描画フラグ: 所持品-装備品 / Display inven/equip */
1128 #define PW_EQUIP        0x00000002L     /*!<サブウィンドウ描画フラグ: 装備品-所持品 / Display equip/inven */
1129 #define PW_SPELL        0x00000004L     /*!<サブウィンドウ描画フラグ: 魔法一覧 / Display spell list */
1130 #define PW_PLAYER       0x00000008L     /*!<サブウィンドウ描画フラグ: プレイヤーのステータス / Display character */
1131 #define PW_MONSTER_LIST 0x00000010L     /*!<サブウィンドウ描画フラグ: 視界内モンスターの一覧 / Display monster list */
1132 /* xxx */
1133 /* xxx */
1134 #define PW_MESSAGE      0x00000040L     /*!<サブウィンドウ描画フラグ: メッセージログ / Display messages */
1135 #define PW_OVERHEAD     0x00000080L     /*!<サブウィンドウ描画フラグ: 周辺の光景 / Display overhead view */
1136 #define PW_MONSTER      0x00000100L     /*!<サブウィンドウ描画フラグ: モンスターの思い出 / Display monster recall */
1137 #define PW_OBJECT       0x00000200L     /*!<サブウィンドウ描画フラグ: アイテムの知識 / Display object recall */
1138 #define PW_DUNGEON      0x00000400L     /*!<サブウィンドウ描画フラグ: ダンジョンの地形 / Display dungeon view */
1139 #define PW_SNAPSHOT     0x00000800L     /*!<サブウィンドウ描画フラグ: 記念写真 / Display snap-shot */
1140 /* xxx */
1141 /* xxx */
1142 #define PW_BORG_1       0x00004000L     /*!<サブウィンドウ描画フラグ: ボーグメッセージ / Display borg messages */
1143 #define PW_BORG_2       0x00008000L     /*!<サブウィンドウ描画フラグ: ボーグステータス / Display borg status */
1144
1145 /* Empty hand status */
1146 #define EMPTY_HAND_NONE 0x0000 /* Both hands are used */
1147 #define EMPTY_HAND_LARM 0x0001 /* Left hand is empty */
1148 #define EMPTY_HAND_RARM 0x0002 /* Right hand is empty */
1149
1150 /*** General index values ***/
1151
1152
1153
1154 /*** Object flag values ***/
1155
1156
1157 /*
1158  * Object flags
1159  *
1160  * Old variables for object flags such as flags1, flags2, and flags3
1161  * are obsolated.  Now single array flgs[TR_FLAG_SIZE] contains all
1162  * object flags.  And each flag is refered by single index number
1163  * instead of a bit mask.
1164  *
1165  * Therefore it's very easy to add a lot of new flags; no one need to
1166  * worry about in which variable a new flag should be put, nor to
1167  * modify a huge number of files all over the source directory at once
1168  * to add new flag variables such as flags4, a_ability_flags1, etc...
1169  *
1170  * All management of flags is now treated using a set of macros
1171  * instead of bit operations.
1172  * Note: These macros are using division, modulo, and bit shift
1173  * operations, and it seems that these operations are rather slower
1174  * than original bit operation.  But since index numbers are almost
1175  * always given as constant, such slow operations are performed in the
1176  * compile time.  So there is no problem on the speed.
1177  *
1178  * Exceptions of new flag management is a set of flags to control
1179  * object generation and the curse flags.  These are not yet rewritten
1180  * in new index form; maybe these have no merit of rewriting.
1181  */
1182
1183 #define have_flag(ARRAY, INDEX) !!((ARRAY)[(INDEX)/32] & (1L << ((INDEX)%32)))
1184 #define add_flag(ARRAY, INDEX) ((ARRAY)[(INDEX)/32] |= (1L << ((INDEX)%32)))
1185 #define remove_flag(ARRAY, INDEX) ((ARRAY)[(INDEX)/32] &= ~(1L << ((INDEX)%32)))
1186 #define is_pval_flag(INDEX) ((TR_STR <= (INDEX) && (INDEX) <= TR_MAGIC_MASTERY) || (TR_STEALTH <= (INDEX) && (INDEX) <= TR_BLOWS))
1187 #define have_pval_flags(ARRAY) !!((ARRAY)[0] & (0x00003f7f))
1188
1189
1190
1191
1192 #define TRG_INSTA_ART           0x00000001L     /* Item must be an artifact */
1193 #define TRG_QUESTITEM           0x00000002L     /* quest level item -KMW- */
1194 #define TRG_XTRA_POWER          0x00000004L     /* Extra power */
1195 #define TRG_ONE_SUSTAIN         0x00000008L     /* One sustain */
1196 #define TRG_XTRA_RES_OR_POWER   0x00000010L     /* Extra resistance or power */
1197 #define TRG_XTRA_H_RES          0x00000020L     /* Extra high resistance */
1198 #define TRG_XTRA_E_RES          0x00000040L     /* Extra element resistance */
1199 #define TRG_XTRA_L_RES          0x00000080L     /* Extra lordly resistance */
1200 #define TRG_XTRA_D_RES          0x00000100L     /* Extra dragon resistance */
1201 #define TRG_XTRA_RES            0x00000200L     /* Extra resistance */
1202 #define TRG_CURSED              0x00000400L     /* Item is Cursed */
1203 #define TRG_HEAVY_CURSE         0x00000800L     /* Item is Heavily Cursed */
1204 #define TRG_PERMA_CURSE         0x00001000L     /* Item is Perma Cursed */
1205 #define TRG_RANDOM_CURSE0       0x00002000L     /* Item is Random Cursed */
1206 #define TRG_RANDOM_CURSE1       0x00004000L     /* Item is Random Cursed */
1207 #define TRG_RANDOM_CURSE2       0x00008000L     /* Item is Random Cursed */
1208 #define TRG_XTRA_DICE           0x00010000L     /* Extra dice */
1209 #define TRG_POWERFUL            0x00020000L     /* Item has good value even if Cursed */
1210
1211
1212 #define MAX_CURSE 18
1213
1214 #define TRC_CURSED              0x00000001L
1215 #define TRC_HEAVY_CURSE         0x00000002L
1216 #define TRC_PERMA_CURSE         0x00000004L
1217 #define TRC_XXX1                0x00000008L
1218 #define TRC_TY_CURSE            0x00000010L
1219 #define TRC_AGGRAVATE           0x00000020L
1220 #define TRC_DRAIN_EXP           0x00000040L
1221 #define TRC_SLOW_REGEN          0x00000080L
1222 #define TRC_ADD_L_CURSE         0x00000100L
1223 #define TRC_ADD_H_CURSE         0x00000200L
1224 #define TRC_CALL_ANIMAL         0x00000400L
1225 #define TRC_CALL_DEMON          0x00000800L
1226 #define TRC_CALL_DRAGON         0x00001000L
1227 #define TRC_COWARDICE           0x00002000L
1228 #define TRC_TELEPORT            0x00004000L
1229 #define TRC_LOW_MELEE           0x00008000L
1230 #define TRC_LOW_AC              0x00010000L
1231 #define TRC_LOW_MAGIC           0x00020000L
1232 #define TRC_FAST_DIGEST         0x00040000L
1233 #define TRC_DRAIN_HP            0x00080000L
1234 #define TRC_DRAIN_MANA          0x00100000L
1235 #define TRC_CALL_UNDEAD         0x00200000L
1236
1237 #define TRC_TELEPORT_SELF       0x00000001L
1238 #define TRC_CHAINSWORD          0x00000002L
1239
1240 #define TRC_SPECIAL_MASK \
1241         (TRC_TY_CURSE | TRC_AGGRAVATE)
1242
1243 #define TRC_HEAVY_MASK   \
1244         (TRC_TY_CURSE | TRC_AGGRAVATE | TRC_DRAIN_EXP | TRC_ADD_H_CURSE | \
1245          TRC_CALL_DEMON | TRC_CALL_DRAGON | TRC_CALL_UNDEAD | TRC_TELEPORT)
1246
1247 #define TRC_P_FLAG_MASK  \
1248         (TRC_TELEPORT_SELF | TRC_CHAINSWORD | \
1249          TRC_TY_CURSE | TRC_DRAIN_EXP | TRC_ADD_L_CURSE | TRC_ADD_H_CURSE | \
1250          TRC_CALL_ANIMAL | TRC_CALL_DEMON | TRC_CALL_DRAGON | TRC_COWARDICE | \
1251          TRC_TELEPORT | TRC_DRAIN_HP | TRC_DRAIN_MANA | TRC_CALL_UNDEAD)
1252
1253
1254
1255  /*
1256   * Hack -- "torch" masks
1257   */
1258 #define RF7_LITE_MASK \
1259         (RF7_HAS_LITE_1 | RF7_SELF_LITE_1 | RF7_HAS_LITE_2 | RF7_SELF_LITE_2)
1260
1261 #define RF7_DARK_MASK \
1262         (RF7_HAS_DARK_1 | RF7_SELF_DARK_1 | RF7_HAS_DARK_2 | RF7_SELF_DARK_2)
1263
1264 #define RF7_HAS_LD_MASK \
1265         (RF7_HAS_LITE_1 | RF7_HAS_LITE_2 | RF7_HAS_DARK_1 | RF7_HAS_DARK_2)
1266
1267 #define RF7_SELF_LD_MASK \
1268         (RF7_SELF_LITE_1 | RF7_SELF_LITE_2 | RF7_SELF_DARK_1 | RF7_SELF_DARK_2)
1269
1270   /*
1271    * Hack -- effective elemental and poison immunity mask
1272    */
1273 #define RFR_EFF_IM_ACID_MASK  (RFR_IM_ACID | RFR_RES_ALL)
1274 #define RFR_EFF_IM_ELEC_MASK  (RFR_IM_ELEC | RFR_RES_ALL)
1275 #define RFR_EFF_IM_FIRE_MASK  (RFR_IM_FIRE | RFR_RES_ALL)
1276 #define RFR_EFF_IM_COLD_MASK  (RFR_IM_COLD | RFR_RES_ALL)
1277 #define RFR_EFF_IM_POIS_MASK  (RFR_IM_POIS | RFR_RES_ALL)
1278 #define RFR_EFF_RES_SHAR_MASK (RFR_RES_SHAR | RFR_RES_ALL)
1279 #define RFR_EFF_RES_CHAO_MASK (RFR_RES_CHAO | RFR_RES_ALL)
1280 #define RFR_EFF_RES_NEXU_MASK (RFR_RES_NEXU | RFR_RES_ALL)
1281
1282
1283 #define MR1_SINKA 0x01
1284
1285
1286 /*
1287  * Is the monster seen by the player?
1288  */
1289 #define is_seen(A) \
1290         ((bool)((A)->ml && (!ignore_unview || p_ptr->inside_battle || \
1291          (player_can_see_bold((A)->fy, (A)->fx) && projectable(p_ptr->y, p_ptr->x, (A)->fy, (A)->fx)))))
1292
1293
1294 /*** Macro Definitions ***/
1295 /*
1296  * Convert an "attr"/"char" pair into a "pict" (P)
1297  */
1298 #define PICT(A,C) \
1299         ((((u16b)(A)) << 8) | ((byte)(C)))
1300
1301 /*
1302  * Convert a "pict" (P) into an "attr" (A)
1303  */
1304 #define PICT_A(P) \
1305         ((byte)((P) >> 8))
1306
1307 /*
1308  * Convert a "pict" (P) into an "char" (C)
1309  */
1310 #define PICT_C(P) \
1311         ((char)((byte)(P)))
1312
1313
1314 /*
1315  * Hack -- Prepare to use the "Secure" routines
1316  */
1317 #if defined(SET_UID) && defined(SECURE)
1318 extern int PlayerUID;
1319 # define getuid() PlayerUID
1320 # define geteuid() PlayerUID
1321 #endif
1322
1323
1324
1325 /*** Color constants ***/
1326
1327 /*
1328  * Not using graphical tiles for this feature?
1329  */
1330 #define is_ascii_graphics(A) (!((A) & 0x80))
1331
1332
1333 /*** Hack ***/
1334
1335
1336 /*
1337  * Hack -- attempt to reduce various values
1338  */
1339 #ifdef ANGBAND_LITE
1340 # undef MACRO_MAX
1341 # define MACRO_MAX      128
1342 # undef QUARK_MAX
1343 # define QUARK_MAX      128
1344 # undef MESSAGE_MAX
1345 # define MESSAGE_MAX    128
1346 # undef MESSAGE_BUF
1347 # define MESSAGE_BUF    4096
1348 #endif
1349
1350
1351
1352
1353
1354 /*
1355  * Available graphic modes
1356  */
1357 #define GRAPHICS_NONE       0
1358 #define GRAPHICS_ORIGINAL   1
1359 #define GRAPHICS_ADAM_BOLT  2
1360 #define GRAPHICS_HENGBAND   3
1361
1362
1363 #ifdef JP
1364 #define JVERB_AND 1
1365 #define JVERB_TO  2
1366 #define JVERB_OR  3
1367 #endif
1368
1369 /*
1370  * Modes for the tokenizer
1371  */
1372 #define TOKENIZE_CHECKQUOTE 0x01  /* Special handling of single quotes */
1373
1374 #define GINOU_MAX      10
1375
1376 #define NO_TOWN 6
1377 #define SECRET_TOWN 5
1378
1379
1380 #define MAX_MANE 16
1381 #define MAX_MONSPELLS 96
1382 #define MONSPELL_TYPE_BOLT 1
1383 #define MONSPELL_TYPE_BALL 2
1384 #define MONSPELL_TYPE_BREATH 3
1385 #define MONSPELL_TYPE_SUMMON 4
1386 #define MONSPELL_TYPE_OTHER 5
1387
1388 #define EATER_EXT 36
1389 #define EATER_CHARGE 0x10000L
1390 #define EATER_ROD_CHARGE 0x10L
1391
1392
1393 #define DETECT_RAD_DEFAULT 30
1394 #define DETECT_RAD_MAP     30
1395 #define DETECT_RAD_ALL     255
1396
1397 /* Maximum "Nazguls" number */
1398 #define MAX_NAZGUL_NUM 5
1399
1400 #define DO_AUTOPICK       0x01
1401 #define DO_AUTODESTROY    0x02
1402 #define DO_DISPLAY        0x04
1403 #define DONT_AUTOPICK     0x08
1404 #define ITEM_DISPLAY      0x10
1405 #define DO_QUERY_AUTOPICK 0x20
1406
1407 #define VIRTUE_LARGE 1
1408 #define VIRTUE_SMALL 2
1409
1410 #define SPELL_DD_S 27
1411 #define SPELL_DD_T 13
1412 #define SPELL_SW   22
1413 #define SPELL_KABE 20
1414
1415 #define KNOW_STAT   0x01
1416 #define KNOW_HPRATE 0x02
1417
1418
1419
1420 #define DUNGEON_FEAT_PROB_NUM 3
1421
1422 /*
1423  * Flags for save/load temporal saved floor file
1424  */
1425 #define SLF_SECOND       0x0001  /* Called from another save/load function */
1426 #define SLF_NO_KILL      0x0002  /* Don't kill temporal files */
1427
1428
1429 #define prace_is_(A) (!p_ptr->mimic_form && (p_ptr->prace == A))
1430
1431 /* Sub-alignment flags for neutral monsters */
1432 #define SUB_ALIGN_NEUTRAL 0x0000
1433 #define SUB_ALIGN_EVIL    0x0001
1434 #define SUB_ALIGN_GOOD    0x0002
1435
1436 /* Multishadow effects is determined by current_world_ptr->game_turn */
1437 #define CHECK_MULTISHADOW() (p_ptr->multishadow && (current_world_ptr->game_turn & 1))
1438
1439 /* Is "teleport level" ineffective to this target? */
1440 #define TELE_LEVEL_IS_INEFF(TARGET) \
1441         (p_ptr->inside_arena || p_ptr->inside_battle || \
1442          (p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || \
1443          (((TARGET) <= 0) && (quest_number(current_floor_ptr->dun_level) || (current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth)) && \
1444           (current_floor_ptr->dun_level >= 1) && ironman_downward))
1445
1446
1447 /*
1448  * Max numbers of macro trigger names
1449  */
1450 #define MAX_MACRO_MOD 12
1451 #define MAX_MACRO_TRIG 200 /*!< 登録を許すマクロ(トリガー)の最大数 */
1452
1453 /* Max size of screen dump buffer */
1454 #define SCREEN_BUF_MAX_SIZE (4 * 65536)
1455
1456 #define MTIMED_CSLEEP   0 /* Monster is sleeping */
1457 #define MTIMED_FAST     1 /* Monster is temporarily fast */
1458 #define MTIMED_SLOW     2 /* Monster is temporarily slow */
1459 #define MTIMED_STUNNED  3 /* Monster is stunned */
1460 #define MTIMED_CONFUSED 4 /* Monster is confused */
1461 #define MTIMED_MONFEAR  5 /* Monster is afraid */
1462 #define MTIMED_INVULNER 6 /* Monster is temporarily invulnerable */
1463
1464 #define MAX_MTIMED      7
1465
1466 #define MON_CSLEEP(M_PTR)   ((M_PTR)->mtimed[MTIMED_CSLEEP])
1467 #define MON_FAST(M_PTR)     ((M_PTR)->mtimed[MTIMED_FAST])
1468 #define MON_SLOW(M_PTR)     ((M_PTR)->mtimed[MTIMED_SLOW])
1469 #define MON_STUNNED(M_PTR)  ((M_PTR)->mtimed[MTIMED_STUNNED])
1470 #define MON_CONFUSED(M_PTR) ((M_PTR)->mtimed[MTIMED_CONFUSED])
1471 #define MON_MONFEAR(M_PTR)  ((M_PTR)->mtimed[MTIMED_MONFEAR])
1472 #define MON_INVULNER(M_PTR) ((M_PTR)->mtimed[MTIMED_INVULNER])
1473
1474 /*
1475  * Bit flags for screen_object()
1476  */
1477 #define SCROBJ_FAKE_OBJECT  0x00000001
1478 #define SCROBJ_FORCE_DETAIL 0x00000002
1479
1480 /*
1481  * For travel command (auto run)
1482  */
1483 #define TRAVEL
1484
1485 #define CONCENT_RADAR_THRESHOLD 2
1486 #define CONCENT_TELE_THRESHOLD  5
1487
1488 /* Hex */
1489 #define hex_spelling_any() \
1490         ((p_ptr->realm1 == REALM_HEX) && (p_ptr->magic_num1[0]))
1491 #define hex_spelling(X) \
1492         ((p_ptr->realm1 == REALM_HEX) && (p_ptr->magic_num1[0] & (1L << (X))))
1493 #define CASTING_HEX_FLAGS(P_PTR) ((P_PTR)->magic_num1[0])
1494 #define CASTING_HEX_NUM(P_PTR) ((P_PTR)->magic_num2[0])
1495 #define HEX_REVENGE_POWER(P_PTR) ((P_PTR)->magic_num1[2])
1496 #define HEX_REVENGE_TURN(P_PTR) ((P_PTR)->magic_num2[2])
1497 #define HEX_REVENGE_TYPE(P_PTR) ((P_PTR)->magic_num2[1])
1498
1499 /*
1500   Language selection macro
1501 */
1502 #ifdef JP
1503 #define _(JAPANESE,ENGLISH) (JAPANESE)
1504 #else
1505 #define _(JAPANESE,ENGLISH) (ENGLISH)
1506 #endif
1507
1508 /* Lite flag macro */
1509 #define have_lite_flag(ARRAY) \
1510         (have_flag(ARRAY, TR_LITE_1) || have_flag(ARRAY, TR_LITE_2) || have_flag(ARRAY, TR_LITE_3))
1511
1512 #define have_dark_flag(ARRAY) \
1513         (have_flag(ARRAY, TR_LITE_M1) || have_flag(ARRAY, TR_LITE_M2) || have_flag(ARRAY, TR_LITE_M3))
1514
1515 /* Spell Type flag */
1516 #define MONSTER_TO_PLAYER     0x01
1517 #define MONSTER_TO_MONSTER    0x02
1518
1519 /* summoning number */
1520 #define S_NUM_6     (easy_band ? 2 : 6)
1521 #define S_NUM_4     (easy_band ? 1 : 4)
1522
1523 /* monster spell number */
1524 #define RF4_SPELL_START 32 * 3
1525 #define RF5_SPELL_START 32 * 4
1526 #define RF6_SPELL_START 32 * 5
1527
1528 #define RF4_SPELL_SIZE 32
1529 #define RF5_SPELL_SIZE 32
1530 #define RF6_SPELL_SIZE 32
1531
1532 /* Spell Damage Calc Flag*/
1533 #define DAM_ROLL 1
1534 #define DAM_MAX 2
1535 #define DAM_MIN 3
1536 #define DICE_NUM 4
1537 #define DICE_SIDE 5
1538 #define DICE_MULT 6
1539 #define DICE_DIV 7
1540 #define BASE_DAM 8
1541
1542 /* Cheat Info Type */
1543 #define CHEAT_OBJECT 0
1544 #define CHEAT_MONSTER 1
1545 #define CHEAT_DUNGEON 2
1546 #define CHEAT_MISC 3
1547
1548 #define COMMAND_ARG_REST_UNTIL_DONE -2   /*!<休憩コマンド引数 … 必要な分だけ回復 */
1549 #define COMMAND_ARG_REST_FULL_HEALING -1 /*!<休憩コマンド引数 … HPとMPが全回復するまで */
1550
1551 /*!
1552  * チートオプションの最大数 / Number of cheating options
1553  */
1554 #define CHEAT_MAX 10