1 /* File: defines.h */
2 
3 /* Purpose: global constants and macro definitions */
4 
5 
6 /*
7  * Do not edit this file unless you know *exactly* what you are doing.
8  *
9  * Some of the values in this file were chosen to preserve game balance,
10  * while others are hard-coded based on the format of old save-files, the
11  * definition of arrays in various places, mathematical properties, fast
12  * computation, storage limits, or the format of external text files.
13  *
14  * Changing some of these values will induce crashes or memory errors or
15  * savefile mis-reads.  Most of the comments in this file are meant as
16  * reminders, not complete descriptions, and even a complete knowledge
17  * of the source may not be sufficient to fully understand the effects
18  * of changing certain definitions.
19  *
20  * Lastly, note that the code does not always use the symbolic constants
21  * below, and sometimes uses various hard-coded values that may not even
22  * be defined in this file, but which may be related to definitions here.
23  * This is of course bad programming practice, but nobody is perfect...
24  *
25  * For example, there are MANY things that depend on the screen being
26  * 80x24, with the top line used for messages, the bottom line being
27  * used for status, and exactly 22 lines used to show the dungeon.
28  * Just because your screen can hold 46 lines does not mean that the
29  * game will work if you try to use 44 lines to show the dungeon.
30  *
31  * You have been warned.
32  */
33 
34 /*
35  * Define the maximum number of columns to use in many things
36  */
37 #define MAX_COLS 80
38 
39 /*
40  * Define the maximum number of characters to use in strlcpy-styled
41  * strings, where \0 terminator is *always* present (thus extra byte).
42  */
43 #define MAX_CHARS (80+1)
44 
45 /*
46  * Maximum message length
47  */
48 #define MSG_LEN 256
49 
50 /*
51  * Maximum number of messages to keep in player message history
52  */
53 #define MAX_MSG_HIST 60
54 
55 /*
56  * Maximum number of events to keep in the character event history
57  */
58 #define MAX_CHAR_HIST 300
59 
60 /*
61  * Maximum number of lines in 'special info' (*ID*, Self-Knowledge, Recalls)
62  */
63 #define MAX_TXT_INFO 300
64 
65 /*
66  * Number of grids used to display the dungeon (vertically).
67  * Must be a multiple of 11, probably hard-coded to 22.
68  */
69 #define SCREEN_HGT	22
70 
71 /*
72  * Number of grids used to display the dungeon (horizontally).
73  * Must be a multiple of 33, probably hard-coded to 66.
74  */
75 #define SCREEN_WID	66
76 
77 
78 /*
79  * Maximum dungeon height in grids, must be a multiple of SCREEN_HGT,
80  * probably hard-coded to SCREEN_HGT * 3.
81  */
82 #define MAX_HGT 	66
83 
84 /*
85  * Maximum dungeon width in grids, must be a multiple of SCREEN_WID,
86  * probably hard-coded to SCREEN_WID * 3.
87  */
88 #define MAX_WID 	198
89 
90 
91 /*
92  * Hack -- This is used to make sure that every player that has a structure
93  * dedicated to them is actually connected
94  */
95 #define NOT_CONNECTED	(-1)
96 
97 /*
98  * Maximum length for names and passwords
99  *
100  */
101 #define MAX_NAME_LEN    	15
102 #define MAX_PASS_LEN    	40
103 
104 /*
105  * Maximum number of players playing at once.
106  *
107  * This limit has never been stretched, and it would be interesting to see
108  * what happens when 100 or so players play at once.
109  */
110 #define MAX_PLAYERS	1000
111 
112 /*
113  * Maximum amount of Angband windows.
114  */
115 #define ANGBAND_TERM_MAX 8
116 
117 /*
118  * Maximum amount of starting equipment
119  */
120 #define MAX_START_ITEMS 6
121 
122 
123 
124 
125 
126 /*
127  * Maximum array bounds for entity list arrays
128  */
129 #define MAX_O_IDX	32768 /* Max size for "o_list[]" */
130 #define MAX_M_IDX	32768 /* Max size for "m_list[]" */
131 
132 #define MAX_FLVR_IDX	330 /* Max size for flv_x_char[]/attr[] */
133 
134 /*
135  * Number of tval/min-sval/max-sval slots per ego_item
136  */
137 #define EGO_TVALS_MAX 3
138 
139 /*
140  * Hack -- Maximum number of item testers and TVals in them (server/defines.h)
141  */
142 #define MAX_ITEM_TESTERS	16
143 #define MAX_ITH_TVAL    	16
144 
145 /*
146  * Hack -- Maximum number of quests
147  */
148 #define MAX_Q_IDX	4
149 
150 /*
151  * Maximum number of high scores in the high score file
152  */
153 #define MAX_HISCORES	100
154 
155 
156 /*
157  * Maximum dungeon level.  The player can never reach this level
158  * in the dungeon, and this value is used for various calculations
159  * involving object and monster creation.  It must be at least 100.
160  * Setting it below 128 may prevent the creation of some objects.
161  */
162 #define MAX_DEPTH	128
163 
164 /* The number of wilderness levels we have allocated.
165 */
166 #define MAX_WILD        4096
167 
168 /*
169  * Maximum number of special pre-designed static levels.
170  */
171 #define MAX_SPECIAL_LEVELS 10
172 
173 /*
174  * Maximum size of the "lite" array (see "cave.c")
175  * Note that the "lite radius" will NEVER exceed 5, and even if the "lite"
176  * was rectangular, we would never require more than 128 entries in the array.
177  */
178 #define LITE_MAX 128
179 
180 /*
181  * Maximum size of the "view" array (see "cave.c")
182  * Note that the "view radius" will NEVER exceed 20, and even if the "view"
183  * was octagonal, we would never require more than 1520 entries in the array.
184  */
185 #define VIEW_MAX 1536
186 
187 /*
188  * Maximum size of the "temp" array (see "cave.c")
189  * We must be as large as "VIEW_MAX" and "LITE_MAX" for proper functioning
190  * of "update_view()" and "update_lite()".  We must also be as large as the
191  * largest illuminatable room, but no room is larger than 800 grids.  We
192  * must also be large enough to allow "good enough" use as a circular queue,
193  * to calculate monster flow, but note that the flow code is "paranoid".
194  */
195 #define TEMP_MAX 1536
196 
197 
198 /*
199  * OPTION: Maximum number of macros (see "io.c")
200  * Default: assume at most 256 macros are used
201  */
202 #define MACRO_MAX	256
203 
204 /*
205  * OPTION: Maximum number of "quarks" (see "io.c")
206  * Default: assume at most 512 different inscriptions are used
207  */
208 #define QUARK_MAX	5656
209 
210 /*
211  * OPTION: Maximum number of messages to remember (see "io.c")
212  * Default: assume maximal memorization of 2048 total messages
213  */
214 #define MESSAGE_MAX	2048
215 
216 /*
217  * OPTION: Maximum space for the message text buffer (see "io.c")
218  * Default: assume that each of the 2048 messages is repeated an
219  * average of three times, and has an average length of 48
220  */
221 #define MESSAGE_BUF	32768
222 
223 
224 /*
225  * Maximum value storable in a "byte" (hard-coded)
226  */
227 #define MAX_UCHAR       255
228 
229 /*
230  * Maximum value storable in a "s16b" (hard-coded)
231  */
232 #define MAX_SHORT       32767
233 
234 /*** Ligthing modes ***/
235 #define LIGHTING_TORCH 0
236 #define LIGHTING_LOS   1
237 #define LIGHTING_LITE  2
238 #define LIGHTING_DARK  3
239 #define LIGHTING_MAX   4
240 
241 /*
242  * RLE encoding modes
243  */
244 #define RLE_NONE 0
245 #define RLE_CLASSIC 1
246 #define RLE_LARGE 2
247 #define RLE_COLOR 3
248 
249 /*
250  * Party commands
251  */
252 #define PARTY_CREATE	1
253 #define PARTY_ADD	2
254 #define PARTY_DELETE	3
255 #define PARTY_REMOVE_ME	4
256 #define PARTY_HOSTILE	5
257 #define PARTY_PEACE	6
258 
259 /*
260  * Dungeon master commands
261  */
262 #define MASTER_MAX_HOOKS	4 /* Total number of hooks per DM */
263 
264 /*
265  * Methods of leaving a level
266  */
267 #define LEVEL_UP	0
268 #define LEVEL_DOWN	1
269 #define LEVEL_RAND	2
270 #define LEVEL_GHOST	3
271 #define	LEVEL_OUTSIDE   4
272 #define LEVEL_OUTSIDE_RAND 5
273 
274 /*
275  * Maximum channel name length
276  */
277 #define MAX_CHAN_LEN 12
278 
279 /*
280  * Default chat channel
281  */
282 #define DEFAULT_CHANNEL "#public"
283 #define MAX_CHANNELS 255
284 
285 /*** Option Definitions ***/
286 #define MAX_OPTIONS 256
287 
288 /*
289  * Maximum possible number of stats.
290  */
291 #define A_CAP	16
292 
293 
294 /*
295  * Store constants
296  */
297 #define STORE_INVEN_MAX	48		/* Max number of discrete objs in inven */
298 #define STORE_CHOICES	32		/* Number of items to choose stock from */
299 #define STORE_OBJ_LEVEL	7		/* Magic Level for normal stores */
300 #define STORE_TURNOVER	9		/* Normal shop turnover, per day */
301 #define STORE_MIN_KEEP	12		/* Min slots to "always" keep full */
302 #define STORE_MAX_KEEP	36		/* Max slots to "always" keep full */
303 #define STORE_SHUFFLE	35		/* 1/Chance (per day) of an owner changing */
304 #define STORE_TURNS	250		/* Number of turns between turnovers */
305 /* MAngband-specific: */
306 #define	STORE_NPC	0x01
307 #define	STORE_PC	0x02
308 #define	STORE_HOME	0x04
309 #define	STORE_OWN	0x08
310 
311 
312 
313 /*
314  * Maximum number of players spells
315  */
316 #define PY_MAX_SPELLS 64
317 
318 
319 /*
320  * Number of spells per book
321  */
322 #define SPELLS_PER_BOOK 20
323 
324 /*
325  * Spell "realms"
326  */
327 #define MAX_SPELL_REALMS 3
328 
329 /*
330  * Ghost spell "realm"
331  */
332 #define GHOST_REALM	2
333 
334 
335 /*
336  * Player constants
337  */
338 #define PY_MAX_EXP	99999999L	/* Maximum exp */
339 #define PY_MAX_GOLD	999999999L	/* Maximum gold */
340 #define PY_MAX_LEVEL	50      	/* Maximum level */
341 /*
342  * Flags for player_type.spell_flags[]
343  */
344 #define PY_SPELL_LEARNED    0x01 /* Spell has been learned */
345 #define PY_SPELL_WORKED     0x02 /* Spell has been successfully tried */
346 #define PY_SPELL_FORGOTTEN  0x04 /* Spell has been forgotten */
347 /*
348  * MAngband-specific spell_flags[]
349  */
350 #define PY_SPELL_AIM    	0x10 /* Spell requires a target */
351 #define PY_SPELL_ITEM   	0x20 /* Spell requires an item */
352 #define PY_SPELL_PROJECT	0x40 /* Spell could be projected */
353 
354 /* Offset for projected spells*/
355 #define SPELL_PROJECTED (PY_MAX_SPELLS*2)
356 
357 
358 /*
359  * MAngband-specific item targeting flags
360  */
361 #define ITEM_ASK_AIM	0x10 /* Object requires a target */
362 #define ITEM_ASK_ITEM	0x20 /* Object requires an item */
363 
364 
365 /*** Custom commands ***/
366 #define MAX_SCHEMES	30
367 #define MAX_CUSTOM_COMMANDS	63
368 
369 #define COMMAND_TEST_ALIVE	0x00000001	/* Test if player is alive */
370 #define COMMAND_TEST_DEAD	0x00000002	/* Test if player is dead */
371 #define COMMAND_TEST_SPELL	0x00000004	/* Test if player class is spell-able (by TV) */
372 #define COMMAND_ITEM_QUICK	0x00000008	/* Do not interact with player, while selecting item */
373 
374 #define COMMAND_ITEM_AMMOUNT	0x00000010	/* Allow player to specify ammount from item stack */
375 #define COMMAND_ITEM_INVEN	0x00000020	/* Select item from inventory */
376 #define COMMAND_ITEM_EQUIP	0x00000040	/* Select item from equipment */
377 #define COMMAND_ITEM_FLOOR	0x00000080	/* Select item from floor */
378 
379 #define COMMAND_ITEM_RESET	0x00000100	/* Item sets its own "Second" and "Target" needs */
380 #define COMMAND_SECOND_INVEN	0x00000200	/* Select second item from inventory */
381 #define COMMAND_SECOND_EQUIP	0x00000400	/* Select second item from equipment */
382 #define COMMAND_SECOND_FLOOR	0x00000800	/* Select second item from floor */
383 
384 #define COMMAND_TARGET_DIR	0x00001000	/* Pick direction */
385 #define COMMAND_TARGET_ALLOW	0x00002000	/* Pick direction OR target */
386 #define COMMAND_TARGET_FRIEND	0x00004000	/* Allow friendly targeting */
387 #define COMMAND_TARGET_XXX2	0x00008000	/* XXX Unused */
388 
389 #define COMMAND_SPELL_BOOK	0x00010000	/* Choose a spell from TV book */
390 #define COMMAND_SPELL_CUSTOM	0x00020000	/* Choose a spell from an offset */
391 #define COMMAND_SPELL_RESET	0x00040000	/* Set its own "Second" and "Target" needs */
392 #define COMMAND_SPELL_INDEX	0x00080000	/* XXX Unused */
393 
394 #define COMMAND_NEED_VALUE	0x00100000	/* Ask for s32b value */
395 #define COMMAND_NEED_CONFIRM	0x00200000	/* Ask for confirmation */
396 #define COMMAND_NEED_CHAR	0x00400000	/* Ask for "char" */
397 #define COMMAND_NEED_STRING	0x00800000	/* Ask for "string" (60 chars) */
398 
399 #define COMMAND_NEED_SPELL		(COMMAND_SPELL_BOOK   | \
400 								 COMMAND_SPELL_CUSTOM | \
401 								 COMMAND_SPELL_RESET  | \
402 								 COMMAND_SPELL_INDEX)
403 
404 #define COMMAND_NEED_ITEM	(COMMAND_ITEM_INVEN | \
405 								 COMMAND_ITEM_EQUIP | \
406 								 COMMAND_ITEM_FLOOR | \
407 								 COMMAND_ITEM_AMMOUNT)
408 #define COMMAND_NEED_SECOND     (COMMAND_SECOND_INVEN | \
409 								 COMMAND_SECOND_EQUIP | \
410 								 COMMAND_SECOND_FLOOR)
411 #define COMMAND_NEED_TARGET     (COMMAND_TARGET_DIR    | \
412 								 COMMAND_TARGET_ALLOW  | \
413 								 COMMAND_TARGET_FRIEND | \
414 								 COMMAND_TARGET_XXX2)
415 
416 #define COMMAND_SPECIAL_FILE	0x01000000	/* Begin file perusal with mode "tval" */
417 #define COMMAND_INTERACTIVE	0x02000000	/* Begin interactive mode "tval" */
418 #define COMMAND_PROMPT_ITEM	0x04000000	/* Auto-modify prompt using "item" and "value" */
419 #define COMMAND_STORE   	0x08000000	/* This command will only work is stores */
420 
421 #define COMMAND_ITEM_STORE	0x10000000	/* Select item from store */
422 #define COMMAND_SECOND_VALUE	0x20000000	/* Put second item into value */
423 #define COMMAND_SECOND_DIR	0x40000000	/* Put second item into dir */
424 #define COMMAND_SECOND_CHAR	0x80000000	/* Put second item into entry[0] */
425 
426 /* Keen observer might notice that flags bellow collide with
427  * the ones already defined above.
428  * It's OK, as they are for the COMMAND_INTERACTIVE subset,
429  * which is almost an it's own thing and ignores most of the
430  * regular flags. */
431 #define COMMAND_INTERACTIVE_ANYKEY 0x10000000 /* Quit on anykey. */
432 
433 /*
434  * Max number of data streams
435  */
436 #define MAX_STREAMS 20
437 /* Stream Flags */
438 #define SF_NONE 	0x00	/* No special flags */
439 #define SF_TRANSPARENT	0x01	/* Stream has secondary layer */
440 #define SF_OVERLAYED	0x02	/* Stream shouldn't be 'memorized' */
441 #define SF_NEXT_GROUP	0x04	/* Stream does not belong to previous group */
442 #define SF_AUTO 	0x08	/* Stream is auto-subscribed to */
443 #define SF_KEEP_X	0x10	/* Stream respects window's X offset */
444 #define SF_KEEP_Y	0x20	/* Stream respects window's Y offset */
445 #define SF_MAXBUFFER	0x40	/* Be prepared to receive max_rows */
446 #define SF_HIDE 	0x80	/* Hide stream subscription from UI */
447 
448 /*** Indicators ***/
449 #define INDITYPE_TINY   	0
450 #define INDITYPE_NORMAL 	1
451 #define INDITYPE_LARGE  	2
452 #define INDITYPE_STRING 	3
453 
454 #define IN_FILTER_SPELL_BOOK	0x10000000 /* Do not show if class is magic-less */
455 
456 #define IN_STOP_ONCE        	0x01000000 /* Only display one value */
457 #define IN_STOP_STRIDE      	0x02000000 /* Stop parsing if striding test failed */
458 #define IN_STOP_EMPTY       	0x04000000 /* Stop parsing if coffer is empty */
459 #define IN_AUTO_CUT         	0x08000000 /* Squeeze indicator into terminal */
460 
461 #define IN_STRIDE_EMPTY     	0x00100000 /* Step over empty values */
462 #define IN_STRIDE_LARGER    	0x00200000 /* Step over to next coffer it's lower then current */
463 #define IN_STRIDE_POSITIVE  	0x00400000 /* Step over values > 0 */
464 #define IN_STRIDE_NONZERO   	0x00800000 /* Step over values != 0 */
465 
466 #define IN_STRIDE_LESSER    	0x00010000 /* Step over values < next coffer */
467 #define IN_STRIDE_NOT       	0x00080000 /* Invert ALL the tests ("if not") */
468 
469 #define IN_VT_CR            	0x00000100 /* Do a carriage return on Vertical Tab */
470 #define IN_VT_LF            	0x00000200 /* Do a line feed  on Vertical Tab */
471 #define IN_VT_FF            	0x00000400 /* Do a form feed  on Vertical Tab */
472 #define IN_VT_COLOR_SET     	0x00000800 /* Readout next character as color on Vertical Tab */
473 
474 #define IN_VT_COLOR_RESET   	0x00001000 /* Reset color on Vertical Tab */
475 #define IN_VT_STRIDE_FLIP   	0x00002000 /* Enable/Disable striding on Vertical Tab */
476 #define IN_VT_DEC_VALUE     	0x00004000 /* Decrease value on Vertical Tab */
477 #define IN_VT_XXX_XXX_1     	0x00008000 /* Unused effect of Vertical Tab */
478 
479 #define IN_VT_COFFER_RESET  	0x00040000 /* Reset coffer back to 0 on Vertical Tab */
480 
481 #define IN_TEXT_LABEL       	0x00000001 /* Pick a string by value */
482 #define IN_TEXT_PRINTF      	0x00000002 /* Display value via sprintf format */
483 #define IN_TEXT_STAT        	0x00000004 /* Hack: Display in 18/XXX format */
484 #define IN_TEXT_CUT         	0x00000008 /* Display a string from prompt and cut it */
485 #define IN_TEXT_LIKERT      	0x00000010 /* Hack: Display in "likert" format */
486 
487 
488 /*
489  * Number of keymap modes
490  */
491 #define KEYMAP_MODES	2
492 #define KEYMAP_MODE_ORIG	0	/* Mode for original keyset commands */
493 #define KEYMAP_MODE_ROGUE	1	/* Mode for roguelike keyset commands */
494 
495 
496 
497 
498 /*** General flag values ***/
499 
500 /*
501  * Bit flags for the "target_set" function
502  *
503  *	KILL: Target monsters
504  *	LOOK: Describe grid fully
505  *	XTRA: Currently unused flag
506  *	GRID: Select from all grids
507  *  FRND: (MAngband-specific) Target friendly players
508  *  READ: (MAngband-specific) Keep reading recalls
509  */
510 #define TARGET_KILL		0x01
511 #define TARGET_LOOK		0x02
512 #define TARGET_XTRA		0x04
513 #define TARGET_GRID		0x08
514 #define TARGET_FRND		0x40
515 #define TARGET_READ		0x80
516 
517 
518 
519 
520 
521 /*
522  * Bit flags for the "p_ptr->notice" variable
523  */
524 #define PN_COMBINE	0x00000001L	/* Combine the pack */
525 #define PN_REORDER	0x00000002L	/* Reorder the pack */
526 /* xxx (many) */
527 
528 
529 /*
530  * Bit flags for the "p_ptr->update" variable
531  */
532 #define PU_BONUS	0x00000001L	/* Calculate bonuses */
533 #define PU_TORCH	0x00000002L	/* Calculate torch radius */
534 /* xxx (many) */
535 #define PU_HP   	0x00000010L	/* Calculate chp and mhp */
536 #define PU_MANA 	0x00000020L	/* Calculate csp and msp */
537 #define PU_SPELLS	0x00000040L	/* Calculate spells */
538 /* xxx (many) */
539 /* xxx (many) */
540 #define PU_UN_VIEW	0x00010000L	/* Forget view */
541 #define PU_UN_LITE	0x00020000L	/* Forget lite */
542 /* xxx (many) */
543 #define PU_VIEW 	0x00100000L	/* Update view */
544 #define PU_LITE 	0x00200000L	/* Update lite */
545 /* xxx */
546 #define PU_MONSTERS	0x01000000L	/* Update monsters */
547 #define PU_DISTANCE	0x02000000L	/* Update distances */
548 /* xxx */
549 #define PU_FLOW		0x10000000L	/* Update flow */
550 /* xxx (many) */
551 
552 
553 /*
554  * Bit flags for the "p_ptr->redraw" variable
555  */
556 #define PR_MISC 	0x00000001L	/* Display Race/Class */
557 #define PR_TITLE	0x00000002L	/* Display Title */
558 #define PR_LEV  	0x00000004L	/* Display Level */
559 #define PR_EXP  	0x00000008L	/* Display Experience */
560 #define PR_STATS	0x00000010L	/* Display Stats */
561 #define PR_ARMOR	0x00000020L	/* Display Armor */
562 #define PR_HP   	0x00000040L	/* Display Hitpoints */
563 #define PR_MANA 	0x00000080L	/* Display Mana */
564 #define PR_GOLD 	0x00000100L	/* Display Gold */
565 #define PR_DEPTH	0x00000200L	/* Display Depth */
566 /* XXXX #define PR_HISTORY	0x00000400L	// Display History */
567 #define PR_HEALTH	0x00000800L	/* Display Health Bar */
568 #define PR_CUT  	0x00001000L	/* Display Extra (Cut) */
569 #define PR_STUN 	0x00002000L	/* Display Extra (Stun) */
570 #define PR_HUNGER	0x00004000L	/* Display Extra (Hunger) */
571 #define PR_VARIOUS	0x00008000L	/* Display Various info (age, etc.) */
572 #define PR_BLIND	0x00010000L	/* Display Extra (Blind) */
573 #define PR_CONFUSED	0x00020000L	/* Display Extra (Confused) */
574 #define PR_AFRAID	0x00040000L	/* Display Extra (Afraid) */
575 #define PR_POISONED	0x00080000L	/* Display Extra (Poisoned) */
576 #define PR_STATE	0x00100000L	/* Display Extra (State) */
577 #define PR_SPEED	0x00200000L	/* Display Extra (Speed) */
578 #define PR_STUDY	0x00400000L	/* Display Extra (Study) */
579 #define PR_PLUSSES	0x00800000L	/* Display Plusses to Hit/Damage */
580 /*xxx*/
581 #define PR_MAP  	0x04000000L	/* Display Map */
582 #define PR_WIPE 	0x08000000L	/* Hack -- Total Redraw */
583 #define PR_SKILLS	0x10000000L	/* Display Skills */
584 #define PR_OFLAGS	0x20000000L	/* Display Object/Resistance Flags  */
585 #define PR_EQUIPPY	0x20000000L	/* Display Equppy (Note! in MAngband it's same as OFLAGS)  */
586 #define PR_CURSOR	0x40000000L	/* Display Cursor  */
587 #define PR_FLOOR	0x80000000L	/* Display floor object */
588 /* xxx */
589 #define PR_OPPOSE_ELEMENTS	0x01000000L	/* Display temp. resists */
590 #define PR_LAG_METER	0x02000000L	/* Display lag meter */
591 
592 /* Display Basic Info */
593 #define PR_BASIC \
594 	(PR_MISC | PR_TITLE | PR_STATS | PR_LEV |\
595 	 PR_EXP | PR_GOLD | PR_ARMOR | PR_HP |\
596 	 PR_MANA | PR_DEPTH | PR_HEALTH)
597 
598 /* Display Extra Info */
599 #define PR_EXTRA \
600 	(PR_CUT | PR_STUN | PR_HUNGER | PR_BLIND |\
601 	 PR_CONFUSED | PR_AFRAID | PR_POISONED | PR_STATE |\
602 	 PR_SPEED | PR_STUDY | PR_OPPOSE_ELEMENTS)
603 
604 /* Display Status Line */
605 #define PR_STATUS \
606 	(PR_STUN | PR_HUNGER | PR_BLIND | PR_DEPTH |\
607 	 PR_CONFUSED | PR_AFRAID | PR_POISONED | PR_STATE |\
608 	 PR_SPEED | PR_STUDY | PR_OPPOSE_ELEMENTS)
609 
610 /* Display Compact Player Info (Side Panel) */
611 #define PR_COMPACT \
612 	(PR_MISC | PR_TITLE | PR_STATS | PR_LEV |\
613 	 PR_EXP | PR_GOLD | PR_ARMOR | PR_HP |\
614 	 PR_MANA | PR_HEALTH | PR_CUT)
615 
616 /*
617  * Bit flags for the "p_ptr->window" variable (etc)
618  */
619 #define PW_INVEN            0x00000001L /* Display inven/equip */
620 #define PW_EQUIP            0x00000002L /* Display equip/inven */
621 #define PW_PLAYER_0         0x00000004L /* Display player (basic) */
622 #define PW_PLAYER_1         0x00000008L /* Display player (extra) */
623 #define PW_PLAYER_2         0x00000010L /* Display player (compact) */
624 #define PW_MAP              0x00000020L /* Display dungeon map */
625 #define PW_MESSAGE          0x00000040L /* Display messages */
626 #define PW_OVERHEAD         0x00000080L /* Display overhead view */
627 #define PW_MONSTER          0x00000100L /* Display monster recall */
628 #define PW_OBJECT           0x00000200L /* Display object recall */
629 #define PW_MONLIST          0x00000400L /* Display monster list */
630 #define PW_STATUS           0x00000800L /* Display status */
631 #define PW_MESSAGE_CHAT     0x00001000L /* MAngband-specific: Chat */
632 #define PW_SPELL            0x00002000L /* Older angband: Spell list */
633 #define PW_BORG_1           0x00004000L /* Display borg messages */
634 #define PW_BORG_2           0x00008000L /* Display borg status */
635 #define PW_SPECIAL_INFO     0x00008000L /* Display special info (instead of borg status) */
636 #define PW_PLAYER_3         0x00004000L /* Display player (history) (instead of borg messages) */
637 #define PW_STORE            0x00010000L /* Display shop */
638 #define PW_ITEMLIST         0x00020000L /* Display item list */
639 
640 #define PW_PLAYER           (PW_PLAYER_0 | PW_PLAYER_2) /* Display player (basic + compact) */
641 
642 
643 
644 
645 /*** Macro Definitions ***/
646 
647 /*
648  * Hack -- Old-style names
649  */
650 #define term_screen	(ang_term[0])
651 #define term_mirror	(ang_term[1])
652 #define term_recall	(ang_term[2])
653 #define term_choice	(ang_term[3])
654 
655 
656 /* Is string empty? Beats calling strlen */
657 #define STRZERO(S) \
658 	((S)[0] == '\0')
659 
660 /* Given an array, determine how many elements are in the array. */
661 #define N_ELEMENTS(a) (sizeof(a) / sizeof((a)[0]))
662 
663 
664 /*** Color constants ***/
665 
666 
667 /*
668  * Angband "attributes" (with symbols, and base (R,G,B) codes)
669  *
670  * The "(R,G,B)" codes are given in "fourths" of the "maximal" value,
671  * and should "gamma corrected" on most (non-Macintosh) machines.
672  */
673 #define TERM_DARK		0	/* 'd' */	/* 0,0,0 */
674 #define TERM_WHITE		1	/* 'w' */	/* 4,4,4 */
675 #define TERM_SLATE		2	/* 's' */	/* 2,2,2 */
676 #define TERM_ORANGE		3	/* 'o' */	/* 4,2,0 */
677 #define TERM_RED		4	/* 'r' */	/* 3,0,0 */
678 #define TERM_GREEN		5	/* 'g' */	/* 0,2,1 */
679 #define TERM_BLUE		6	/* 'b' */	/* 0,0,4 */
680 #define TERM_UMBER		7	/* 'u' */	/* 2,1,0 */
681 #define TERM_L_DARK		8	/* 'D' */	/* 1,1,1 */
682 #define TERM_L_WHITE		9	/* 'W' */	/* 3,3,3 */
683 #define TERM_VIOLET		10	/* 'v' */	/* 4,0,4 */
684 #define TERM_YELLOW		11	/* 'y' */	/* 4,4,0 */
685 #define TERM_L_RED		12	/* 'R' */	/* 4,0,0 */
686 #define TERM_L_GREEN		13	/* 'G' */	/* 0,4,0 */
687 #define TERM_L_BLUE		14	/* 'B' */	/* 0,4,4 */
688 #define TERM_L_UMBER		15	/* 'U' */	/* 3,2,1 */
689 
690 
691 #define MSG_GENERIC		0
692 /* Angband, gameplay-specific, might be tied to sounds */
693 #define MSG_HIT              1
694 #define MSG_MISS             2
695 #define MSG_FLEE             3
696 #define MSG_DROP             4
697 #define MSG_KILL             5
698 #define MSG_LEVEL            6
699 #define MSG_DEATH            7
700 #define MSG_STUDY            8
701 #define MSG_TELEPORT         9
702 #define MSG_SHOOT           10
703 #define MSG_QUAFF           11
704 #define MSG_ZAP_ROD         12
705 #define MSG_WALK            13
706 #define MSG_TPOTHER         14
707 #define MSG_HITWALL         15
708 #define MSG_EAT             16
709 #define MSG_STORE1          17
710 #define MSG_STORE2          18
711 #define MSG_STORE3          19
712 #define MSG_STORE4          20
713 #define MSG_DIG             21
714 #define MSG_OPENDOOR        22
715 #define MSG_SHUTDOOR        23
716 #define MSG_TPLEVEL         24
717 #define MSG_BELL            25
718 #define MSG_NOTHING_TO_OPEN 26
719 #define MSG_LOCKPICK_FAIL   27
720 #define MSG_STAIRS_DOWN     28
721 #define MSG_HITPOINT_WARN   29
722 #define MSG_ACT_ARTIFACT    30
723 #define MSG_USE_STAFF       31
724 #define MSG_DESTROY         32
725 #define MSG_MON_HIT         33
726 #define MSG_MON_TOUCH       34
727 #define MSG_MON_PUNCH       35
728 #define MSG_MON_KICK        36
729 #define MSG_MON_CLAW        37
730 #define MSG_MON_BITE        38
731 #define MSG_MON_STING       39
732 #define MSG_MON_BUTT        40
733 #define MSG_MON_CRUSH       41
734 #define MSG_MON_ENGULF      42
735 #define MSG_MON_CRAWL       43
736 #define MSG_MON_DROOL       44
737 #define MSG_MON_SPIT        45
738 #define MSG_MON_GAZE        46
739 #define MSG_MON_WAIL        47
740 #define MSG_MON_SPORE       48
741 #define MSG_MON_BEG         49
742 #define MSG_MON_INSULT      50
743 #define MSG_MON_MOAN        51
744 #define MSG_RECOVER         52
745 #define MSG_BLIND           53
746 #define MSG_CONFUSED        54
747 #define MSG_POISONED        55
748 #define MSG_AFRAID          56
749 #define MSG_PARALYZED       57
750 #define MSG_DRUGGED         58
751 #define MSG_SPEED           59
752 #define MSG_SLOW            60
753 #define MSG_SHIELD          61
754 #define MSG_BLESSED         62
755 #define MSG_HERO            63
756 #define MSG_BERSERK         64
757 #define MSG_PROT_EVIL       65
758 #define MSG_INVULN          66
759 #define MSG_SEE_INVIS       67
760 #define MSG_INFRARED        68
761 #define MSG_RES_ACID        69
762 #define MSG_RES_ELEC        70
763 #define MSG_RES_FIRE        71
764 #define MSG_RES_COLD        72
765 #define MSG_RES_POIS        73
766 #define MSG_STUN            74
767 #define MSG_CUT             75
768 #define MSG_STAIRS_UP       76
769 #define MSG_STORE_ENTER     77
770 #define MSG_STORE_LEAVE     78
771 #define MSG_STORE_HOME      79
772 #define MSG_MONEY1          80
773 #define MSG_MONEY2          81
774 #define MSG_MONEY3          82
775 #define MSG_SHOOT_HIT       83
776 #define MSG_STORE5          84
777 #define MSG_LOCKPICK        85
778 #define MSG_DISARM          86
779 #define MSG_IDENT_BAD       87
780 #define MSG_IDENT_EGO       88
781 #define MSG_IDENT_ART       89
782 #define MSG_BR_ELEMENTS     90
783 #define MSG_BR_FROST        91
784 #define MSG_BR_ELEC         92
785 #define MSG_BR_ACID         93
786 #define MSG_BR_GAS          94
787 #define MSG_BR_FIRE         95
788 #define MSG_BR_CONF         96
789 #define MSG_BR_DISENCHANT   97
790 #define MSG_BR_CHAOS        98
791 #define MSG_BR_SHARDS       99
792 #define MSG_BR_SOUND        100
793 #define MSG_BR_LIGHT        101
794 #define MSG_BR_DARK         102
795 #define MSG_BR_NETHER       103
796 #define MSG_BR_NEXUS        104
797 #define MSG_BR_TIME         105
798 #define MSG_BR_INERTIA      106
799 #define MSG_BR_GRAVITY      107
800 #define MSG_BR_PLASMA       108
801 #define MSG_BR_FORCE        109
802 #define MSG_SUM_MONSTER     110
803 #define MSG_SUM_ANGEL       111
804 #define MSG_SUM_UNDEAD      112
805 #define MSG_SUM_ANIMAL      113
806 #define MSG_SUM_SPIDER      114
807 #define MSG_SUM_HOUND       115
808 #define MSG_SUM_HYDRA       116
809 #define MSG_SUM_DEMON       117
810 #define MSG_SUM_DRAGON      118
811 #define MSG_SUM_HI_UNDEAD   119
812 #define MSG_SUM_HI_DRAGON   120
813 #define MSG_SUM_HI_DEMON    121
814 #define MSG_SUM_WRAITH      122
815 #define MSG_SUM_UNIQUE      123
816 #define MSG_WIELD           124
817 #define MSG_CURSED          125
818 #define MSG_PSEUDOID        126
819 #define MSG_HUNGRY          127
820 #define MSG_NOTICE          128
821 #define MSG_AMBIENT_DAY     129
822 #define MSG_AMBIENT_NITE    130
823 #define MSG_AMBIENT_DNG1    131
824 #define MSG_AMBIENT_DNG2    132
825 #define MSG_AMBIENT_DNG3    133
826 #define MSG_AMBIENT_DNG4    134
827 #define MSG_AMBIENT_DNG5    135
828 #define MSG_CREATE_TRAP     136
829 #define MSG_SHRIEK          137
830 #define MSG_CAST_FEAR       138
831 #define MSG_HIT_GOOD        139
832 #define MSG_HIT_GREAT       140
833 #define MSG_HIT_SUPERB      141
834 #define MSG_HIT_HI_GREAT    142
835 #define MSG_HIT_HI_SUPERB   143
836 #define MSG_SPELL           144
837 #define MSG_PRAYER          145
838 #define MSG_KILL_UNIQUE     146
839 #define MSG_KILL_KING       147
840 #define MSG_DRAIN_STAT      148
841 #define MSG_MULTIPLY        149
842 
843 #define MSG_MAX_ANGBAND     150
844 
845 /* MAngband-specific: */
846 #define MSG_TALK            151
847 #define MSG_YELL            152
848 #define MSG_SOCIAL          153
849 #define MSG_PY_SPELL        154
850 #define MSG_PY_PRAYER       155
851 #define MSG_PY_MISC         156
852 #define MSG_MON_OTHER       157
853 
854 #define MSG_MAX             158
855 
856 /* Client-side and system messages: */
857 #define MSG_LOCAL		255
858 #define MSG_WHISPER		256
859 #define MSG_CHAT		257
860 
861 
862 /*** Hack ***/
863 
864 #define CURSOR_HACK 2
865 
866 /*
867  * Hack -- attempt to reduce various values
868  */
869 #ifdef ANGBAND_LITE
870 # undef MACRO_MAX
871 # define MACRO_MAX	128
872 # undef QUARK_MAX
873 # define QUARK_MAX	128
874 # undef MESSAGE_MAX
875 # define MESSAGE_MAX	128
876 # undef MESSAGE_BUF
877 # define MESSAGE_BUF	4096
878 #endif
879 
880 
881 /** Pathfinder constants **/
882 
883 /* Maximum size around the player to consider in the pathfinder */
884 #define MAX_PF_RADIUS 50
885 
886 /* Maximum distance to consider in the pathfinder */
887 #define MAX_PF_LENGTH 250
888 
889 
890 /*** Monster blow constants ***/
891 
892 #define MONSTER_BLOW_MAX 4
893 
894 
895 /*
896  * Available graphic modes
897  */
898 #define GRAPHICS_NONE           0
899 #define GRAPHICS_PLAIN          1
900 #define GRAPHICS_TRANSPARENT    2
901 #define GRAPHICS_LIGHTMAP       3
902 
903