OSDN Git Service

[Refactor] #37353 TRG_* を artifact.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 表示上の基本的なパネル単位(垂直方向、BLOCK_HGTの倍数で設定すること)
44  * Number of grids in each panel (vertically) Must be a multiple of BLOCK_HGT
45  */
46 #define PANEL_HGT 11
47
48 /*!
49  * @brief 表示上の基本的なパネル単位(水平方向、BLOCK_WIDの倍数で設定すること)
50  * Number of grids in each panel (horizontally) Must be a multiple of BLOCK_WID
51  */
52 #define PANEL_WID 33
53
54 /*!
55  * @brief 表示上の基本的なブロック単位(垂直方向、PANEL_HGTの倍数で設定すること)
56  * Number of grids used to display the dungeon (vertically). Must be a multiple of 11, probably hard-coded to 22.
57  */
58 #define SCREEN_HGT 22
59
60 /*!
61  * @brief 表示上の基本的なブロック単位(水平方向、PANEL_WIDの倍数で設定すること)
62  * Number of grids used to display the dungeon (horizontally). Must be a multiple of 33, probably hard-coded to 66.
63  */
64 #define SCREEN_WID 66
65
66 /*!
67  * @brief 表示上のダンジョンの最大垂直サイズ(SCREEN_HGTの3倍が望ましい)
68  * Maximum dungeon height in grids, must be a multiple of SCREEN_HGT, probably hard-coded to SCREEN_HGT * 3.
69  */
70 #define MAX_HGT 66
71
72 /*!
73  * @brief 表示上のダンジョンの最大水平サイズ(SCREEN_WIDの3倍が望ましい)
74  * Maximum dungeon width in grids, must be a multiple of SCREEN_WID, probably hard-coded to SCREEN_WID * 3.
75  */
76 #define MAX_WID 198
77
78 /*
79  * Arena constants
80  */
81 #define ARENA_DEFEATED_OLD_VER (-(MAX_SHORT)) /*<! 旧バージョンの闘技場敗北定義 */
82
83 #define MAX_SEXES        2 /*!< 性別の定義最大数 / Maximum number of player "sex" types (see "table.c", etc) */
84 #define MAX_CLASS       28 /*!< 職業の最大定義数 Maximum number of player "class" types (see "table.c", etc) */
85 #define MAX_SEIKAKU     13 /*!< 性格の最大定義数 */
86
87 #define MAX_MIND_POWERS  21 /*!< 超能力の数 / Mindcraft */
88
89 /*
90  * Size of memory reserved for initialization of some arrays
91  */
92 #define FAKE_NAME_SIZE  40 * 1024L /*!< ゲーム情報の種別毎に用意される名前用バッファの容量 */
93 #define FAKE_TEXT_SIZE 150 * 1024L /*!< ゲーム情報の種別毎に用意されるテキスト用バッファの容量 */
94 #define FAKE_TAG_SIZE   10 * 1024L /*!< ゲーム情報の種別毎に用意されるタグ用バッファの容量 */
95
96 #define MAX_HISCORES    999 /*!< スコア情報保存の最大数 / Maximum number of high scores in the high score file */
97
98 /*!
99  * @brief プレイヤー用光源処理配列サイズ / Maximum size of the "lite" array (see "current_floor_ptr->grid_array.c")
100  * @details Note that the "lite radius" will NEVER exceed 14, and we would
101  * never require more than 581 entries in the array for circular "lite".
102  */
103 #define LITE_MAX 600
104
105 /*!
106  * @brief モンスター用光源処理配列サイズ / Maximum size of the "mon_lite" array (see "current_floor_ptr->grid_array.c")
107  * @details Note that the "view radius" will NEVER exceed 20, monster illumination
108  * flags are dependent on CAVE_VIEW, and even if the "view" was octagonal,
109  * we would never require more than 1520 entries in the array.
110  */
111 #define MON_LITE_MAX 1536
112
113 /*!
114  * @brief 視界処理配列サイズ / Maximum size of the "view" array (see "current_floor_ptr->grid_array.c")
115  * @details Note that the "view radius" will NEVER exceed 20, and even if the "view"
116  * was octagonal, we would never require more than 1520 entries in the array.
117  */
118 #define VIEW_MAX 1536
119
120 /*!
121  * @brief 視界及び光源の過渡処理配列サイズ / Maximum size of the "temp" array (see "current_floor_ptr->grid_array.c")
122  * @details We must be as large as "VIEW_MAX" and "LITE_MAX" for proper functioning
123  * of "update_view()" and "update_lite()".  We must also be as large as the
124  * largest illuminatable room, but no room is larger than 800 grids.  We
125  * must also be large enough to allow "good enough" use as a circular queue,
126  * to calculate monster flow, but note that the flow code is "paranoid".
127  */
128 #define TEMP_MAX 2298
129
130 /*!
131  * @brief 再描画処理用配列サイズ / Maximum size of the "redraw" array (see "current_floor_ptr->grid_array.c")
132  * @details We must be large for proper functioning of delayed redrawing.
133  * We must also be as large as two times of the largest view area.
134  * Note that maximum view grids are 1149 entries.
135  */
136 #define REDRAW_MAX 2298
137
138
139 /*!
140  * @brief マクロ登録の最大数 / Maximum number of macros (see "io.c")
141  * @note Default: assume at most 256 macros are used
142  */
143 #define MACRO_MAX       256
144
145 /*!
146  * @brief 銘情報の最大数 / Maximum number of "quarks" (see "io.c")
147  * @note 
148  * Default: assume at most 512 different inscriptions are used<br>
149  * Was 512... 256 quarks added for random artifacts<br>
150  */
151 #define QUARK_MAX       768
152
153 /*
154  * OPTION: Maximum number of messages to remember (see "io.c")
155  * Default: assume maximal memorization of 2048 total messages
156  */
157 #define MESSAGE_MAX  81920
158
159 /*
160  * OPTION: Maximum space for the message text buffer (see "io.c")
161  * Default: assume that each of the 2048 messages is repeated an
162  * average of three times, and has an average length of 48
163  */
164 #define MESSAGE_BUF 655360
165
166
167 /*
168  * Maximum number of "normal" pack slots, and the index of the "overflow"
169  * slot, which can hold an item, but only temporarily, since it causes the
170  * pack to "overflow", dropping the "last" item onto the ground.  Since this
171  * value is used as an actual slot, it must be less than "INVEN_RARM" (below).
172  * Note that "INVEN_PACK" is probably hard-coded by its use in savefiles, and
173  * by the fact that the screen can only show 23 items plus a one-line prompt.
174  */
175 #define INVEN_PACK      23 /*!< アイテムスロット…所持品(0~) */
176
177 /*
178  * Player sex constants (hard-coded by save-files, arrays, etc)
179  */
180 #define SEX_FEMALE              0
181 #define SEX_MALE                1
182
183
184 /*
185  * Player class constants (hard-coded by save-files, arrays, etc)
186  */
187 #define CLASS_WARRIOR            0
188 #define CLASS_MAGE               1
189 #define CLASS_PRIEST             2
190 #define CLASS_ROGUE              3
191 #define CLASS_RANGER             4
192 #define CLASS_PALADIN            5
193 #define CLASS_WARRIOR_MAGE       6
194 #define CLASS_CHAOS_WARRIOR      7
195 #define CLASS_MONK               8
196 #define CLASS_MINDCRAFTER        9
197 #define CLASS_HIGH_MAGE         10
198 #define CLASS_TOURIST           11
199 #define CLASS_IMITATOR          12
200 #define CLASS_BEASTMASTER       13
201 #define CLASS_SORCERER          14
202 #define CLASS_ARCHER            15
203 #define CLASS_MAGIC_EATER       16
204 #define CLASS_BARD              17
205 #define CLASS_RED_MAGE          18
206 #define CLASS_SAMURAI           19
207 #define CLASS_FORCETRAINER      20
208 #define CLASS_BLUE_MAGE         21
209 #define CLASS_CAVALRY           22
210 #define CLASS_BERSERKER         23
211 #define CLASS_SMITH             24
212 #define CLASS_MIRROR_MASTER     25
213 #define CLASS_NINJA             26
214 #define CLASS_SNIPER            27
215
216 #define SEIKAKU_FUTUU    0
217 #define SEIKAKU_CHIKARA  1
218 #define SEIKAKU_KIREMONO 2
219 #define SEIKAKU_SHIAWASE 3
220 #define SEIKAKU_SUBASI   4
221 #define SEIKAKU_INOCHI   5
222 #define SEIKAKU_COMBAT   6
223 #define SEIKAKU_NAMAKE   7
224 #define SEIKAKU_SEXY     8
225 #define SEIKAKU_LUCKY    9
226 #define SEIKAKU_GAMAN    10
227 #define SEIKAKU_MUNCHKIN 11
228 #define SEIKAKU_CHARGEMAN 12
229
230 /*** Screen Locations ***/
231
232 #define VER_INFO_ROW 3   //!< タイトル表記(行)
233
234
235 #define ROW_MAP                 0
236 #define COL_MAP                 12
237
238
239 /* Which features are dynamic */
240 #define have_dynamic_flags(ARRAY) \
241         (!!((ARRAY)[(FF_INSTANT / 32)] & \
242             ((1UL << (FF_INSTANT % 32)) | \
243              (1UL << (FF_EXPLODE % 32)) | \
244              (1UL << (FF_TIMED % 32)) | \
245              (1UL << (FF_ERUPT % 32)) | \
246              (1UL << (FF_STRIKE % 32)) | \
247              (1UL << (FF_SPREAD % 32)))))
248
249
250 /*
251  * Feature action flags
252  */
253 #define FAF_DESTROY     0x01
254 #define FAF_NO_DROP     0x02
255 #define FAF_CRASH_GLASS 0x04
256
257 /* Types of doors */
258 #define DOOR_DEFAULT    -1
259 #define DOOR_DOOR        0
260 #define DOOR_GLASS_DOOR  1
261 #define DOOR_CURTAIN     2
262
263 #define MAX_DOOR_TYPES   3
264
265 #define feat_locked_door_random(DOOR_TYPE) \
266         (feat_door[(DOOR_TYPE)].num_locked ? \
267          feat_door[(DOOR_TYPE)].locked[randint0(feat_door[(DOOR_TYPE)].num_locked)] : feat_none)
268
269 #define feat_jammed_door_random(DOOR_TYPE) \
270         (feat_door[(DOOR_TYPE)].num_jammed ? \
271          feat_door[(DOOR_TYPE)].jammed[randint0(feat_door[(DOOR_TYPE)].num_jammed)] : feat_none)
272
273
274 /*
275  * Bit flags for the *_can_enter() and monster_can_cross_terrain()
276  */
277 #define CEM_RIDING              0x0001
278 #define CEM_P_CAN_ENTER_PATTERN 0x0002
279
280
281 #define OBJ_GOLD_LIST   480     /* First "gold" entry */
282 #define MAX_GOLD        18      /* Number of "gold" entries */
283
284 /*** General flag values ***/
285
286 /*
287  * Special caster ID for project()
288  */
289 #define PROJECT_WHO_UNCTRL_POWER -1 /*!< 魔法効果の自然発生要因: 名状し難い力の解放 */
290 #define PROJECT_WHO_GLASS_SHARDS -2 /*!< 魔法効果の自然発生要因: 破壊されたガラス地形の破片 */
291
292
293 /*
294  * Bit flags for the "p_ptr->window" variable (etc)
295  */
296 #define PW_INVEN        0x00000001L     /*!<サブウィンドウ描画フラグ: 所持品-装備品 / Display inven/equip */
297 #define PW_EQUIP        0x00000002L     /*!<サブウィンドウ描画フラグ: 装備品-所持品 / Display equip/inven */
298 #define PW_SPELL        0x00000004L     /*!<サブウィンドウ描画フラグ: 魔法一覧 / Display spell list */
299 #define PW_PLAYER       0x00000008L     /*!<サブウィンドウ描画フラグ: プレイヤーのステータス / Display character */
300 #define PW_MONSTER_LIST 0x00000010L     /*!<サブウィンドウ描画フラグ: 視界内モンスターの一覧 / Display monster list */
301 /* xxx */
302 /* xxx */
303 #define PW_MESSAGE      0x00000040L     /*!<サブウィンドウ描画フラグ: メッセージログ / Display messages */
304 #define PW_OVERHEAD     0x00000080L     /*!<サブウィンドウ描画フラグ: 周辺の光景 / Display overhead view */
305 #define PW_MONSTER      0x00000100L     /*!<サブウィンドウ描画フラグ: モンスターの思い出 / Display monster recall */
306 #define PW_OBJECT       0x00000200L     /*!<サブウィンドウ描画フラグ: アイテムの知識 / Display object recall */
307 #define PW_DUNGEON      0x00000400L     /*!<サブウィンドウ描画フラグ: ダンジョンの地形 / Display dungeon view */
308 #define PW_SNAPSHOT     0x00000800L     /*!<サブウィンドウ描画フラグ: 記念写真 / Display snap-shot */
309 /* xxx */
310 /* xxx */
311 #define PW_BORG_1       0x00004000L     /*!<サブウィンドウ描画フラグ: ボーグメッセージ / Display borg messages */
312 #define PW_BORG_2       0x00008000L     /*!<サブウィンドウ描画フラグ: ボーグステータス / Display borg status */
313
314 /* Empty hand status */
315 #define EMPTY_HAND_NONE 0x0000 /* Both hands are used */
316 #define EMPTY_HAND_LARM 0x0001 /* Left hand is empty */
317 #define EMPTY_HAND_RARM 0x0002 /* Right hand is empty */
318
319 /*** General index values ***/
320
321
322
323 /*** Object flag values ***/
324
325
326 /*
327  * Object flags
328  *
329  * Old variables for object flags such as flags1, flags2, and flags3
330  * are obsolated.  Now single array flgs[TR_FLAG_SIZE] contains all
331  * object flags.  And each flag is refered by single index number
332  * instead of a bit mask.
333  *
334  * Therefore it's very easy to add a lot of new flags; no one need to
335  * worry about in which variable a new flag should be put, nor to
336  * modify a huge number of files all over the source directory at once
337  * to add new flag variables such as flags4, a_ability_flags1, etc...
338  *
339  * All management of flags is now treated using a set of macros
340  * instead of bit operations.
341  * Note: These macros are using division, modulo, and bit shift
342  * operations, and it seems that these operations are rather slower
343  * than original bit operation.  But since index numbers are almost
344  * always given as constant, such slow operations are performed in the
345  * compile time.  So there is no problem on the speed.
346  *
347  * Exceptions of new flag management is a set of flags to control
348  * object generation and the curse flags.  These are not yet rewritten
349  * in new index form; maybe these have no merit of rewriting.
350  */
351
352 #define have_flag(ARRAY, INDEX) !!((ARRAY)[(INDEX)/32] & (1L << ((INDEX)%32)))
353 #define add_flag(ARRAY, INDEX) ((ARRAY)[(INDEX)/32] |= (1L << ((INDEX)%32)))
354 #define remove_flag(ARRAY, INDEX) ((ARRAY)[(INDEX)/32] &= ~(1L << ((INDEX)%32)))
355 #define is_pval_flag(INDEX) ((TR_STR <= (INDEX) && (INDEX) <= TR_MAGIC_MASTERY) || (TR_STEALTH <= (INDEX) && (INDEX) <= TR_BLOWS))
356 #define have_pval_flags(ARRAY) !!((ARRAY)[0] & (0x00003f7f))
357
358
359
360 #define TRC_CURSED              0x00000001L
361 #define TRC_HEAVY_CURSE         0x00000002L
362 #define TRC_PERMA_CURSE         0x00000004L
363 #define TRC_XXX1                0x00000008L
364 #define TRC_TY_CURSE            0x00000010L
365 #define TRC_AGGRAVATE           0x00000020L
366 #define TRC_DRAIN_EXP           0x00000040L
367 #define TRC_SLOW_REGEN          0x00000080L
368 #define TRC_ADD_L_CURSE         0x00000100L
369 #define TRC_ADD_H_CURSE         0x00000200L
370 #define TRC_CALL_ANIMAL         0x00000400L
371 #define TRC_CALL_DEMON          0x00000800L
372 #define TRC_CALL_DRAGON         0x00001000L
373 #define TRC_COWARDICE           0x00002000L
374 #define TRC_TELEPORT            0x00004000L
375 #define TRC_LOW_MELEE           0x00008000L
376 #define TRC_LOW_AC              0x00010000L
377 #define TRC_LOW_MAGIC           0x00020000L
378 #define TRC_FAST_DIGEST         0x00040000L
379 #define TRC_DRAIN_HP            0x00080000L
380 #define TRC_DRAIN_MANA          0x00100000L
381 #define TRC_CALL_UNDEAD         0x00200000L
382 #define MAX_CURSE 18
383
384 #define TRC_TELEPORT_SELF       0x00000001L
385 #define TRC_CHAINSWORD          0x00000002L
386
387 #define TRC_SPECIAL_MASK \
388         (TRC_TY_CURSE | TRC_AGGRAVATE)
389
390 #define TRC_HEAVY_MASK   \
391         (TRC_TY_CURSE | TRC_AGGRAVATE | TRC_DRAIN_EXP | TRC_ADD_H_CURSE | \
392          TRC_CALL_DEMON | TRC_CALL_DRAGON | TRC_CALL_UNDEAD | TRC_TELEPORT)
393
394 #define TRC_P_FLAG_MASK  \
395         (TRC_TELEPORT_SELF | TRC_CHAINSWORD | \
396          TRC_TY_CURSE | TRC_DRAIN_EXP | TRC_ADD_L_CURSE | TRC_ADD_H_CURSE | \
397          TRC_CALL_ANIMAL | TRC_CALL_DEMON | TRC_CALL_DRAGON | TRC_COWARDICE | \
398          TRC_TELEPORT | TRC_DRAIN_HP | TRC_DRAIN_MANA | TRC_CALL_UNDEAD)
399
400
401
402  /*
403   * Hack -- "torch" masks
404   */
405 #define RF7_LITE_MASK \
406         (RF7_HAS_LITE_1 | RF7_SELF_LITE_1 | RF7_HAS_LITE_2 | RF7_SELF_LITE_2)
407
408 #define RF7_DARK_MASK \
409         (RF7_HAS_DARK_1 | RF7_SELF_DARK_1 | RF7_HAS_DARK_2 | RF7_SELF_DARK_2)
410
411 #define RF7_HAS_LD_MASK \
412         (RF7_HAS_LITE_1 | RF7_HAS_LITE_2 | RF7_HAS_DARK_1 | RF7_HAS_DARK_2)
413
414 #define RF7_SELF_LD_MASK \
415         (RF7_SELF_LITE_1 | RF7_SELF_LITE_2 | RF7_SELF_DARK_1 | RF7_SELF_DARK_2)
416
417   /*
418    * Hack -- effective elemental and poison immunity mask
419    */
420 #define RFR_EFF_IM_ACID_MASK  (RFR_IM_ACID | RFR_RES_ALL)
421 #define RFR_EFF_IM_ELEC_MASK  (RFR_IM_ELEC | RFR_RES_ALL)
422 #define RFR_EFF_IM_FIRE_MASK  (RFR_IM_FIRE | RFR_RES_ALL)
423 #define RFR_EFF_IM_COLD_MASK  (RFR_IM_COLD | RFR_RES_ALL)
424 #define RFR_EFF_IM_POIS_MASK  (RFR_IM_POIS | RFR_RES_ALL)
425 #define RFR_EFF_RES_SHAR_MASK (RFR_RES_SHAR | RFR_RES_ALL)
426 #define RFR_EFF_RES_CHAO_MASK (RFR_RES_CHAO | RFR_RES_ALL)
427 #define RFR_EFF_RES_NEXU_MASK (RFR_RES_NEXU | RFR_RES_ALL)
428
429
430 #define MR1_SINKA 0x01
431
432
433 /*
434  * Is the monster seen by the player?
435  */
436 #define is_seen(A) \
437         ((bool)((A)->ml && (!ignore_unview || p_ptr->inside_battle || \
438          (player_can_see_bold((A)->fy, (A)->fx) && projectable(p_ptr->y, p_ptr->x, (A)->fy, (A)->fx)))))
439
440
441 /*** Macro Definitions ***/
442 /*
443  * Convert an "attr"/"char" pair into a "pict" (P)
444  */
445 #define PICT(A,C) \
446         ((((u16b)(A)) << 8) | ((byte)(C)))
447
448 /*
449  * Convert a "pict" (P) into an "attr" (A)
450  */
451 #define PICT_A(P) \
452         ((byte)((P) >> 8))
453
454 /*
455  * Convert a "pict" (P) into an "char" (C)
456  */
457 #define PICT_C(P) \
458         ((char)((byte)(P)))
459
460
461 /*
462  * Hack -- Prepare to use the "Secure" routines
463  */
464 #if defined(SET_UID) && defined(SECURE)
465 extern int PlayerUID;
466 # define getuid() PlayerUID
467 # define geteuid() PlayerUID
468 #endif
469
470
471
472 /*** Color constants ***/
473
474 /*
475  * Not using graphical tiles for this feature?
476  */
477 #define is_ascii_graphics(A) (!((A) & 0x80))
478
479
480 /*** Hack ***/
481
482
483 /*
484  * Hack -- attempt to reduce various values
485  */
486 #ifdef ANGBAND_LITE
487 # undef MACRO_MAX
488 # define MACRO_MAX      128
489 # undef QUARK_MAX
490 # define QUARK_MAX      128
491 # undef MESSAGE_MAX
492 # define MESSAGE_MAX    128
493 # undef MESSAGE_BUF
494 # define MESSAGE_BUF    4096
495 #endif
496
497
498
499
500
501 /*
502  * Available graphic modes
503  */
504 #define GRAPHICS_NONE       0
505 #define GRAPHICS_ORIGINAL   1
506 #define GRAPHICS_ADAM_BOLT  2
507 #define GRAPHICS_HENGBAND   3
508
509
510 #ifdef JP
511 #define JVERB_AND 1
512 #define JVERB_TO  2
513 #define JVERB_OR  3
514 #endif
515
516 /*
517  * Modes for the tokenizer
518  */
519 #define TOKENIZE_CHECKQUOTE 0x01  /* Special handling of single quotes */
520
521 #define GINOU_MAX      10
522
523 #define NO_TOWN 6
524 #define SECRET_TOWN 5
525
526
527 #define MAX_MANE 16
528 #define MAX_MONSPELLS 96
529 #define MONSPELL_TYPE_BOLT 1
530 #define MONSPELL_TYPE_BALL 2
531 #define MONSPELL_TYPE_BREATH 3
532 #define MONSPELL_TYPE_SUMMON 4
533 #define MONSPELL_TYPE_OTHER 5
534
535 #define EATER_EXT 36
536 #define EATER_CHARGE 0x10000L
537 #define EATER_ROD_CHARGE 0x10L
538
539
540 #define DETECT_RAD_DEFAULT 30
541 #define DETECT_RAD_MAP     30
542 #define DETECT_RAD_ALL     255
543
544 /* Maximum "Nazguls" number */
545 #define MAX_NAZGUL_NUM 5
546
547 #define DO_AUTOPICK       0x01
548 #define DO_AUTODESTROY    0x02
549 #define DO_DISPLAY        0x04
550 #define DONT_AUTOPICK     0x08
551 #define ITEM_DISPLAY      0x10
552 #define DO_QUERY_AUTOPICK 0x20
553
554 #define VIRTUE_LARGE 1
555 #define VIRTUE_SMALL 2
556
557 #define SPELL_DD_S 27
558 #define SPELL_DD_T 13
559 #define SPELL_SW   22
560 #define SPELL_KABE 20
561
562 #define KNOW_STAT   0x01
563 #define KNOW_HPRATE 0x02
564
565
566
567 #define DUNGEON_FEAT_PROB_NUM 3
568
569 /*
570  * Flags for save/load temporal saved floor file
571  */
572 #define SLF_SECOND       0x0001  /* Called from another save/load function */
573 #define SLF_NO_KILL      0x0002  /* Don't kill temporal files */
574
575
576 #define prace_is_(A) (!p_ptr->mimic_form && (p_ptr->prace == A))
577
578 /* Sub-alignment flags for neutral monsters */
579 #define SUB_ALIGN_NEUTRAL 0x0000
580 #define SUB_ALIGN_EVIL    0x0001
581 #define SUB_ALIGN_GOOD    0x0002
582
583 /* Multishadow effects is determined by current_world_ptr->game_turn */
584 #define CHECK_MULTISHADOW() (p_ptr->multishadow && (current_world_ptr->game_turn & 1))
585
586 /* Is "teleport level" ineffective to this target? */
587 #define TELE_LEVEL_IS_INEFF(TARGET) \
588         (p_ptr->inside_arena || p_ptr->inside_battle || \
589          (p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || \
590          (((TARGET) <= 0) && (quest_number(current_floor_ptr->dun_level) || (current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth)) && \
591           (current_floor_ptr->dun_level >= 1) && ironman_downward))
592
593
594 /*
595  * Max numbers of macro trigger names
596  */
597 #define MAX_MACRO_MOD 12
598 #define MAX_MACRO_TRIG 200 /*!< 登録を許すマクロ(トリガー)の最大数 */
599
600 /* Max size of screen dump buffer */
601 #define SCREEN_BUF_MAX_SIZE (4 * 65536)
602
603 #define MTIMED_CSLEEP   0 /* Monster is sleeping */
604 #define MTIMED_FAST     1 /* Monster is temporarily fast */
605 #define MTIMED_SLOW     2 /* Monster is temporarily slow */
606 #define MTIMED_STUNNED  3 /* Monster is stunned */
607 #define MTIMED_CONFUSED 4 /* Monster is confused */
608 #define MTIMED_MONFEAR  5 /* Monster is afraid */
609 #define MTIMED_INVULNER 6 /* Monster is temporarily invulnerable */
610
611 #define MAX_MTIMED      7
612
613 #define MON_CSLEEP(M_PTR)   ((M_PTR)->mtimed[MTIMED_CSLEEP])
614 #define MON_FAST(M_PTR)     ((M_PTR)->mtimed[MTIMED_FAST])
615 #define MON_SLOW(M_PTR)     ((M_PTR)->mtimed[MTIMED_SLOW])
616 #define MON_STUNNED(M_PTR)  ((M_PTR)->mtimed[MTIMED_STUNNED])
617 #define MON_CONFUSED(M_PTR) ((M_PTR)->mtimed[MTIMED_CONFUSED])
618 #define MON_MONFEAR(M_PTR)  ((M_PTR)->mtimed[MTIMED_MONFEAR])
619 #define MON_INVULNER(M_PTR) ((M_PTR)->mtimed[MTIMED_INVULNER])
620
621 /*
622  * Bit flags for screen_object()
623  */
624 #define SCROBJ_FAKE_OBJECT  0x00000001
625 #define SCROBJ_FORCE_DETAIL 0x00000002
626
627 /*
628  * For travel command (auto run)
629  */
630 #define TRAVEL
631
632 #define CONCENT_RADAR_THRESHOLD 2
633 #define CONCENT_TELE_THRESHOLD  5
634
635 /* Hex */
636 #define hex_spelling_any() \
637         ((p_ptr->realm1 == REALM_HEX) && (p_ptr->magic_num1[0]))
638 #define hex_spelling(X) \
639         ((p_ptr->realm1 == REALM_HEX) && (p_ptr->magic_num1[0] & (1L << (X))))
640 #define CASTING_HEX_FLAGS(P_PTR) ((P_PTR)->magic_num1[0])
641 #define CASTING_HEX_NUM(P_PTR) ((P_PTR)->magic_num2[0])
642 #define HEX_REVENGE_POWER(P_PTR) ((P_PTR)->magic_num1[2])
643 #define HEX_REVENGE_TURN(P_PTR) ((P_PTR)->magic_num2[2])
644 #define HEX_REVENGE_TYPE(P_PTR) ((P_PTR)->magic_num2[1])
645
646 /*
647   Language selection macro
648 */
649 #ifdef JP
650 #define _(JAPANESE,ENGLISH) (JAPANESE)
651 #else
652 #define _(JAPANESE,ENGLISH) (ENGLISH)
653 #endif
654
655 /* Lite flag macro */
656 #define have_lite_flag(ARRAY) \
657         (have_flag(ARRAY, TR_LITE_1) || have_flag(ARRAY, TR_LITE_2) || have_flag(ARRAY, TR_LITE_3))
658
659 #define have_dark_flag(ARRAY) \
660         (have_flag(ARRAY, TR_LITE_M1) || have_flag(ARRAY, TR_LITE_M2) || have_flag(ARRAY, TR_LITE_M3))
661
662 /* Spell Type flag */
663 #define MONSTER_TO_PLAYER     0x01
664 #define MONSTER_TO_MONSTER    0x02
665
666 /* summoning number */
667 #define S_NUM_6     (easy_band ? 2 : 6)
668 #define S_NUM_4     (easy_band ? 1 : 4)
669
670 /* monster spell number */
671 #define RF4_SPELL_START 32 * 3
672 #define RF5_SPELL_START 32 * 4
673 #define RF6_SPELL_START 32 * 5
674
675 #define RF4_SPELL_SIZE 32
676 #define RF5_SPELL_SIZE 32
677 #define RF6_SPELL_SIZE 32
678
679 /* Spell Damage Calc Flag*/
680 #define DAM_ROLL 1
681 #define DAM_MAX 2
682 #define DAM_MIN 3
683 #define DICE_NUM 4
684 #define DICE_SIDE 5
685 #define DICE_MULT 6
686 #define DICE_DIV 7
687 #define BASE_DAM 8
688
689 /* Cheat Info Type */
690 #define CHEAT_OBJECT 0
691 #define CHEAT_MONSTER 1
692 #define CHEAT_DUNGEON 2
693 #define CHEAT_MISC 3
694
695 #define COMMAND_ARG_REST_UNTIL_DONE -2   /*!<休憩コマンド引数 … 必要な分だけ回復 */
696 #define COMMAND_ARG_REST_FULL_HEALING -1 /*!<休憩コマンド引数 … HPとMPが全回復するまで */
697
698 /*!
699  * チートオプションの最大数 / Number of cheating options
700  */
701 #define CHEAT_MAX 10