5 * @brief 主要なマクロ定義ヘッダ / Purpose: global constants and macro definitions
8 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\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
14 * Do not edit this file unless you know *exactly* what you are doing.\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
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
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
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
38 * You have been warned.\n
44 #define ARENA_DEFEATED_OLD_VER (-(MAX_SHORT)) /*<! 旧バージョンの闘技場敗北定義 */
47 * @brief 視界及び光源の過渡処理配列サイズ / Maximum size of the "temp" array (see "current_floor_ptr->grid_array.c")
48 * @details We must be as large as "VIEW_MAX" and "LITE_MAX" for proper functioning
49 * of "update_view()" and "update_lite()". We must also be as large as the
50 * largest illuminatable room, but no room is larger than 800 grids. We
51 * must also be large enough to allow "good enough" use as a circular queue,
52 * to calculate monster flow, but note that the flow code is "paranoid".
57 * @brief 再描画処理用配列サイズ / Maximum size of the "redraw" array (see "current_floor_ptr->grid_array.c")
58 * @details We must be large for proper functioning of delayed redrawing.
59 * We must also be as large as two times of the largest view area.
60 * Note that maximum view grids are 1149 entries.
62 #define REDRAW_MAX 2298
66 * @brief マクロ登録の最大数 / Maximum number of macros (see "io.c")
67 * @note Default: assume at most 256 macros are used
72 * @brief 銘情報の最大数 / Maximum number of "quarks" (see "io.c")
74 * Default: assume at most 512 different inscriptions are used<br>
75 * Was 512... 256 quarks added for random artifacts<br>
80 * OPTION: Maximum number of messages to remember (see "io.c")
81 * Default: assume maximal memorization of 2048 total messages
83 #define MESSAGE_MAX 81920
86 * OPTION: Maximum space for the message text buffer (see "io.c")
87 * Default: assume that each of the 2048 messages is repeated an
88 * average of three times, and has an average length of 48
90 #define MESSAGE_BUF 655360
93 /*** Screen Locations ***/
98 #define OBJ_GOLD_LIST 480 /* First "gold" entry */
99 #define MAX_GOLD 18 /* Number of "gold" entries */
104 * Old variables for object flags such as flags1, flags2, and flags3
105 * are obsolated. Now single array flgs[TR_FLAG_SIZE] contains all
106 * object flags. And each flag is refered by single index number
107 * instead of a bit mask.
109 * Therefore it's very easy to add a lot of new flags; no one need to
110 * worry about in which variable a new flag should be put, nor to
111 * modify a huge number of files all over the source directory at once
112 * to add new flag variables such as flags4, a_ability_flags1, etc...
114 * All management of flags is now treated using a set of macros
115 * instead of bit operations.
116 * Note: These macros are using division, modulo, and bit shift
117 * operations, and it seems that these operations are rather slower
118 * than original bit operation. But since index numbers are almost
119 * always given as constant, such slow operations are performed in the
120 * compile time. So there is no problem on the speed.
122 * Exceptions of new flag management is a set of flags to control
123 * object generation and the curse flags. These are not yet rewritten
124 * in new index form; maybe these have no merit of rewriting.
127 #define have_flag(ARRAY, INDEX) !!((ARRAY)[(INDEX)/32] & (1L << ((INDEX)%32)))
128 #define add_flag(ARRAY, INDEX) ((ARRAY)[(INDEX)/32] |= (1L << ((INDEX)%32)))
129 #define remove_flag(ARRAY, INDEX) ((ARRAY)[(INDEX)/32] &= ~(1L << ((INDEX)%32)))
130 #define is_pval_flag(INDEX) ((TR_STR <= (INDEX) && (INDEX) <= TR_MAGIC_MASTERY) || (TR_STEALTH <= (INDEX) && (INDEX) <= TR_BLOWS))
131 #define have_pval_flags(ARRAY) !!((ARRAY)[0] & (0x00003f7f))
134 * Is the monster seen by the player?
137 ((bool)((A)->ml && (!ignore_unview || p_ptr->inside_battle || \
138 (player_can_see_bold((A)->fy, (A)->fx) && projectable(p_ptr->y, p_ptr->x, (A)->fy, (A)->fx)))))
142 #define EATER_CHARGE 0x10000L
143 #define EATER_ROD_CHARGE 0x10L
147 /* Maximum "Nazguls" number */
148 #define MAX_NAZGUL_NUM 5
150 #define VIRTUE_LARGE 1
151 #define VIRTUE_SMALL 2
154 #define DUNGEON_FEAT_PROB_NUM 3
157 * Max numbers of macro trigger names
159 #define MAX_MACRO_MOD 12
160 #define MAX_MACRO_TRIG 200 /*!< 登録を許すマクロ(トリガー)の最大数 */
163 #define MTIMED_CSLEEP 0 /* Monster is sleeping */
164 #define MTIMED_FAST 1 /* Monster is temporarily fast */
165 #define MTIMED_SLOW 2 /* Monster is temporarily slow */
166 #define MTIMED_STUNNED 3 /* Monster is stunned */
167 #define MTIMED_CONFUSED 4 /* Monster is confused */
168 #define MTIMED_MONFEAR 5 /* Monster is afraid */
169 #define MTIMED_INVULNER 6 /* Monster is temporarily invulnerable */
173 #define MON_CSLEEP(M_PTR) ((M_PTR)->mtimed[MTIMED_CSLEEP])
174 #define MON_FAST(M_PTR) ((M_PTR)->mtimed[MTIMED_FAST])
175 #define MON_SLOW(M_PTR) ((M_PTR)->mtimed[MTIMED_SLOW])
176 #define MON_STUNNED(M_PTR) ((M_PTR)->mtimed[MTIMED_STUNNED])
177 #define MON_CONFUSED(M_PTR) ((M_PTR)->mtimed[MTIMED_CONFUSED])
178 #define MON_MONFEAR(M_PTR) ((M_PTR)->mtimed[MTIMED_MONFEAR])
179 #define MON_INVULNER(M_PTR) ((M_PTR)->mtimed[MTIMED_INVULNER])
182 * For travel command (auto run)
186 #define CONCENT_RADAR_THRESHOLD 2
187 #define CONCENT_TELE_THRESHOLD 5
190 Language selection macro
193 #define _(JAPANESE,ENGLISH) (JAPANESE)
195 #define _(JAPANESE,ENGLISH) (ENGLISH)
198 /* Lite flag macro */
199 #define have_lite_flag(ARRAY) \
200 (have_flag(ARRAY, TR_LITE_1) || have_flag(ARRAY, TR_LITE_2) || have_flag(ARRAY, TR_LITE_3))
202 #define have_dark_flag(ARRAY) \
203 (have_flag(ARRAY, TR_LITE_M1) || have_flag(ARRAY, TR_LITE_M2) || have_flag(ARRAY, TR_LITE_M3))
206 #define COMMAND_ARG_REST_UNTIL_DONE -2 /*!<休憩コマンド引数 … 必要な分だけ回復 */
207 #define COMMAND_ARG_REST_FULL_HEALING -1 /*!<休憩コマンド引数 … HPとMPが全回復するまで */