/* File: defines.h */
+/*
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
+ *
+ * This software may be copied and distributed for educational, research,
+ * and not for profit purposes provided that this copyright and statement
+ * are included in all such copies. Other copyrights may also apply.
+ */
+
/* Purpose: global constants and macro definitions */
*/
#define VERSION_NAME "Hengband"
-
-/*
- * Current version number of Angband: 2.8.1
- */
-#define VERSION_MAJOR 2
-#define VERSION_MINOR 8
-#define VERSION_PATCH 1
-
-#define SAVEFILE_VERSION 3
+/* Savefile version for Hengband 1.1.1 and later */
+#define H_VER_MAJOR 1
+#define H_VER_MINOR 5
+#define H_VER_PATCH 0
+#define H_VER_EXTRA 0
/* Added for ZAngband */
#define FAKE_VERSION 0
#define FAKE_VER_MAJOR 11
-#define FAKE_VER_MINOR 0
-#define FAKE_VER_PATCH 9
+#define FAKE_VER_MINOR 5
+#define FAKE_VER_PATCH 2
#define ANGBAND_2_8_1
#define ZANGBAND
/*
- * This value is not currently used
- */
-#define VERSION_EXTRA 0
-
-
-#ifdef JP
- /*
- * ÆüËܸìÈǤΥС¼¥¸¥ç¥ó
- */
-#define JVERSION_MAJOR 0
-#define JVERSION_MINOR 9
-#define JVERSION_PATCH 4
-#define JVERSION_EXTRA 0
-
-#endif
-/*
* Number of grids in each block (vertically)
* Probably hard-coded to 11, see "generate.c"
*/
/*
* Quest constants
*/
-#define MAX_MON_QUEST 10
-#define MAX_ITEM_QUEST 5
-
#define MIN_RANDOM_QUEST 40
#define MAX_RANDOM_QUEST 49
#define MAX_BLDG 32
/*
- * Total number of stores (see "store.c", etc)
+ * Store types
*/
-#define MAX_STORES_PER_TOWN 12
-#define MAX_STORE_TYPES 10
-
#define STORE_GENERAL 0
#define STORE_ARMOURY 1
#define STORE_WEAPON 2
/*
* Maximum number of high scores in the high score file
*/
-#define MAX_HISCORES 100
+#define MAX_HISCORES 999
/*
/*
+ * Maximum number of saved floors.
+ */
+#define MAX_SAVED_FLOORS 20
+
+
+/*
* Maximum size of the "lite" array (see "cave.c")
- * Note that the "lite radius" will NEVER exceed 5, and even if the "lite"
- * was rectangular, we would never require more than 128 entries in the array.
+ * Note that the "lite radius" will NEVER exceed 14, and we would
+ * never require more than 581 entries in the array for circular "lite".
*/
-#define LITE_MAX 512
+#define LITE_MAX 600
/*
* Maximum size of the "view" array (see "cave.c")
* OPTION: Maximum number of "quarks" (see "io.c")
* Default: assume at most 512 different inscriptions are used
*/
-#define QUARK_MAX 2048
+#define QUARK_MAX 768
/* Was 512... 256 quarks added for random artifacts */
-/* Was 768... increased greatly for auto inscription (by Mogami) */
/*
* OPTION: Maximum number of messages to remember (see "io.c")
#define MAX_NLEN 160
/*
+ * Special internal key
+ */
+#define SPECIAL_KEY_QUEST 255
+#define SPECIAL_KEY_BUILDING 254
+#define SPECIAL_KEY_STORE 253
+#define SPECIAL_KEY_QUIT 252
+
+/*
* Store constants
*/
#define STORE_INVEN_MAX 24 /* Max number of discrete objs in inven */
/*
+ * Random energy
+ */
+#define ENERGY_NEED() (randnor(100, 31))
+
+/*
* Misc constants
*/
-#define TOWN_DAWN 10000 /* Number of turns from dawn to dawn XXX */
-#define BREAK_GLYPH 550 /* Rune of protection resistance */
-#define BREAK_MINOR_GLYPH 299 /* For explosive runes */
-#define BTH_PLUS_ADJ 3 /* Adjust BTH per plus-to-hit */
-#define MON_MULT_ADJ 8 /* High value slows multiplication */
-#define MON_SUMMON_ADJ 2 /* Adjust level of summoned creatures */
-#define MON_DRAIN_LIFE 2 /* Percent of player exp drained per hit */
-#define USE_DEVICE 3 /* x> Harder devices x< Easier devices */
+#define TOWN_DAWN 10000 /* Number of ticks from dawn to dawn XXX */
+#define TURNS_PER_TICK 10L /* Number of energy-gain-turns per ticks */
+#define BREAK_GLYPH 550 /* Rune of protection resistance */
+#define BREAK_MINOR_GLYPH 299 /* For explosive runes */
+#define BTH_PLUS_ADJ 3 /* Adjust BTH per plus-to-hit */
+#define MON_MULT_ADJ 8 /* High value slows multiplication */
+#define MON_SUMMON_ADJ 2 /* Adjust level of summoned creatures */
+#define MON_DRAIN_LIFE 2 /* Percent of player exp drained per hit */
+#define USE_DEVICE 3 /* x> Harder devices x< Easier devices */
/* "Biases" for random artifact gen */
/*
* Commands
*/
-#define PET_DISMISS 1
-#define PET_TARGET 2
-#define PET_STAY_CLOSE 3
-#define PET_FOLLOW_ME 4
-#define PET_SEEK_AND_DESTROY 5
-#define PET_ALLOW_SPACE 6
-#define PET_STAY_AWAY 7
-#define PET_OPEN_DOORS 8
-#define PET_TAKE_ITEMS 9
-#define PET_TELEPORT 10
-#define PET_ATTACK_SPELL 11
-#define PET_SUMMON_SPELL 12
-#define PET_BALL_SPELL 13
-#define PET_RIDING 14
-#define PET_NAME 15
-#define PET_RYOUTE 16
+#define PET_DISMISS 1
+#define PET_TARGET 2
+#define PET_STAY_CLOSE 3
+#define PET_FOLLOW_ME 4
+#define PET_SEEK_AND_DESTROY 5
+#define PET_ALLOW_SPACE 6
+#define PET_STAY_AWAY 7
+#define PET_OPEN_DOORS 8
+#define PET_TAKE_ITEMS 9
+#define PET_TELEPORT 10
+#define PET_ATTACK_SPELL 11
+#define PET_SUMMON_SPELL 12
+#define PET_BALL_SPELL 13
+#define PET_RIDING 14
+#define PET_NAME 15
+#define PET_RYOUTE 16
/*
* Follow distances
/*
* Player "food" crucial values
*/
-#define PY_FOOD_MAX 15000 /* Food value (Bloated) */
+#define PY_FOOD_MAX 15000 /* Food value (Bloated) */
#define PY_FOOD_FULL 10000 /* Food value (Normal) */
#define PY_FOOD_ALERT 2000 /* Food value (Hungry) */
#define PY_FOOD_WEAK 1000 /* Food value (Weak) */
-#define PY_FOOD_FAINT 500 /* Food value (Fainting) */
-#define PY_FOOD_STARVE 100 /* Food value (Starving) */
+#define PY_FOOD_FAINT 500 /* Food value (Fainting) */
+#define PY_FOOD_STARVE 100 /* Food value (Starving) */
/*
* Player regeneration constants
*/
-#define PY_REGEN_NORMAL 197 /* Regen factor*2^16 when full */
-#define PY_REGEN_WEAK 98 /* Regen factor*2^16 when weak */
-#define PY_REGEN_FAINT 33 /* Regen factor*2^16 when fainting */
+#define PY_REGEN_NORMAL 197 /* Regen factor*2^16 when full */
+#define PY_REGEN_WEAK 98 /* Regen factor*2^16 when weak */
+#define PY_REGEN_FAINT 33 /* Regen factor*2^16 when fainting */
#define PY_REGEN_HPBASE 1442 /* Min amount hp regen*2^16 */
-#define PY_REGEN_MNBASE 524 /* Min amount mana regen*2^16 */
+#define PY_REGEN_MNBASE 524 /* Min amount mana regen*2^16 */
/*
* Possible realms that can be chosen;
#define CH_ARCANE 0x40
#define CH_ENCHANT 0x80
#define CH_DAEMON 0x100
+#define CH_CRUSADE 0x200
#define CH_MUSIC 0x10000
#define CH_HISSATSU 0x20000
#define REALM_ARCANE 7
#define REALM_ENCHANT 8
#define REALM_DAEMON 9
-#define MAX_MAGIC 9
-#define MIN_TECHNIC 15
+#define REALM_CRUSADE 10
+#define MAX_MAGIC 10
+#define MIN_TECHNIC 16
#define REALM_MUSIC 16
#define REALM_HISSATSU 17
#define MAX_REALM 17
-#define VALID_REALM (MAX_REALM + MAX_MAGIC - MIN_TECHNIC)
-#define NUM_TECHNIC (MAX_REALM - MIN_TECHNIC)
+#define VALID_REALM (MAX_REALM + MAX_MAGIC - MIN_TECHNIC + 1)
+#define NUM_TECHNIC (MAX_REALM - MIN_TECHNIC + 1)
#define is_magic(A) ((A) < MAX_MAGIC + 1 ? TRUE : FALSE)
#define tval2realm(A) ((A) - TV_LIFE_BOOK + 1)
-#define technic2magic(A) (is_magic(A) ? (A) : (A) - MIN_TECHNIC + MAX_MAGIC)
+#define technic2magic(A) (is_magic(A) ? (A) : (A) - MIN_TECHNIC + 1 + MAX_MAGIC)
+#define is_good_realm(REALM) ((REALM) == REALM_LIFE || (REALM) == REALM_CRUSADE)
/*
* Magic-books for the realms
/*
- * A "stack" of items is limited to less than 100 items (hard-coded).
- */
-#define MAX_STACK_SIZE 100
-
-
-
-/*
* Indexes of the various "stats" (hard-coded by savefiles, etc).
*/
#define A_STR 0
#define CLASS_MIRROR_MASTER 25
#define CLASS_NINJA 26
-#define SEIKAKU_FUTUU 0
-#define SEIKAKU_CHIKARA 1
-#define SEIKAKU_KIREMONO 2
-#define SEIKAKU_SHIAWASE 3
-#define SEIKAKU_SUBASI 4
-#define SEIKAKU_INOCHI 5
-#define SEIKAKU_COMBAT 6
-#define SEIKAKU_NAMAKE 7
-#define SEIKAKU_SEXY 8
-#define SEIKAKU_LUCKY 9
-#define SEIKAKU_GAMAN 10
-#define SEIKAKU_MUNCHKIN 11
+#define SEIKAKU_FUTUU 0
+#define SEIKAKU_CHIKARA 1
+#define SEIKAKU_KIREMONO 2
+#define SEIKAKU_SHIAWASE 3
+#define SEIKAKU_SUBASI 4
+#define SEIKAKU_INOCHI 5
+#define SEIKAKU_COMBAT 6
+#define SEIKAKU_NAMAKE 7
+#define SEIKAKU_SEXY 8
+#define SEIKAKU_LUCKY 9
+#define SEIKAKU_GAMAN 10
+#define SEIKAKU_MUNCHKIN 11
/*** Screen Locations ***/
#define ROW_STATE 20
#define COL_STATE 7 /* <state> */
-#define ROW_SPEED 23
-#define COL_SPEED 58 /* "Slow (-NN)" or "Fast (+NN)" */
+#define ROW_SPEED (-1)
+#define COL_SPEED (-24) /* "Slow (-NN)" or "Fast (+NN)" */
-#define ROW_STUDY 23
-#define COL_STUDY 68 /* "Study" */
+#define ROW_STUDY (-1)
+#define COL_STUDY (-13) /* "Study" */
-#define ROW_DEPTH 23
-#define COL_DEPTH 72 /* "Lev NNN" / "NNNN ft" */
+#define ROW_DEPTH (-1)
+#define COL_DEPTH (-8) /* "Lev NNN" / "NNNN ft" */
-#define ROW_STATBAR 23
+#define ROW_STATBAR (-1)
#define COL_STATBAR 0
+#define MAX_COL_STATBAR (-26)
/*** Terrain Feature Indexes (see "lib/edit/f_info.txt") ***/
#define FEAT_GRASS 0x59
#define FEAT_TRAP_TRAPS 0x5A
+#define FEAT_TRAP_ALARM 0x5B
+#define FEAT_TRAP_OPEN 0x5C
#define FEAT_FLOWER 0x5D
#define FEAT_DEEP_GRASS 0x5E
/* for mirror master */
#define FEAT_MIRROR 0xc3
+/* unknown grid (not detected) */
+#define FEAT_UNDETECTD 0xc4
+
+/* special traps */
+#define FEAT_TRAP_ARMAGEDDON 0xc5
+#define FEAT_TRAP_PIRANHA 0xc6
/*
* Wilderness terrains
/* Lites */
#define ART_GALADRIEL 1
#define ART_ELENDIL 2
-#define ART_THRAIN 3
+#define ART_JUDGE 3
#define ART_EDISON 7
#define ART_PALANTIR 15
#define ART_STONE_LORE 17
#define ART_NIGHT 215
/* Rings */
-#define ART_BARAHIR 8
+#define ART_FRAKIR 8
#define ART_TULKAS 9
#define ART_NARYA 10
#define ART_NENYA 11
#define ART_SOULKEEPER 19
#define ART_ISILDUR 20
#define ART_ROHIRRIM 21
-#define ART_BELEGENNON 22
-#define ART_CELEBORN 23
+#define ART_LOHENGRIN 22
+#define ART_JULIAN 23
#define ART_ARVEDUI 24
#define ART_CASPANION 25
+#define ART_GILES 168
#define ART_MORLOK 203
#define ART_VETERAN 206
#define ART_YENDOR 141
#define ART_YATA 151
#define ART_EARENDIL 186
-#define ART_HERCULES 197
+#define ART_PERSEUS 197
/* Helms and Crowns */
-#define ART_MORGOTH 34
+#define ART_INDRA 33
+#define ART_CHAOS 34
#define ART_BERUTHIEL 35
#define ART_THRANDUIL 36
#define ART_THENGEL 37
#define ART_DOR 39
#define ART_HOLHENNETH 40
#define ART_TERROR 41
-#define ART_GONDOR 42
+#define ART_AMBER 42
#define ART_NUMENOR 132
#define ART_STONEMASK 146
#define ART_CORWIN 55
#define ART_PAURAEGEN 56
#define ART_PAURNEN 57
-#define ART_CAMLOST 58
+#define ART_THANOS 58
#define ART_FINGOLFIN 59
#define ART_PAURNIMMEN 185
/* Boots */
#define ART_FEANOR 60
-#define ART_DAL 61
+#define ART_FLORA 61
#define ART_THROR 62
#define ART_SHIVA_BOOTS 63
+#define ART_GLASS 165
#define ART_GETA 210
/* Digging */
/* Swords */
#define ART_MAEDHROS 64
-#define ART_ANGRIST 65
+#define ART_CAINE 65
#define ART_NARTHANC 66
#define ART_NIMTHANC 67
#define ART_DETHANC 68
#define ART_RILIA 69
-#define ART_BELANGIL 70
+#define ART_FIONA 70
#define ART_CALRIS 71
#define ART_GRAYSWANDIR 72
#define ART_GLAMDRING 73
-#define ART_AEGLIN 74
+#define ART_NOTHUNG 74
#define ART_ORCRIST 75
#define ART_GURTHANG 76
#define ART_ZARCUTHRA 77
-#define ART_MORMEGIL 78
+#define ART_TWILIGHT 78
#define ART_GONDRICAM 79
#define ART_CRISDURIAN 80
-#define ART_GROO 81
+#define ART_AGLARANG 81
#define ART_RINGIL 82
#define ART_ANDURIL 83
-#define ART_ANGUIREL 84
+#define ART_WEREWINDLE 84
#define ART_CHAINSWORD 85
#define ART_FORASGIL 86
#define ART_CARETH 87
#define ART_STING 88
-#define ART_HARADEKKET 89
-#define ART_GILETTAR 90
+#define ART_SOULSWORD 89
+#define ART_MERLIN 90
#define ART_DOOMCALLER 91
#define ART_VORPAL_BLADE 92
+#define ART_SLAYER 123
#define ART_KUSANAGI 128
#define ART_HURIN 133
#define ART_AZAGHAL 135
#define ART_FALIS 155
#define ART_HRUNTING 156
#define ART_ANUBIS 158
+#define ART_GURENKI 160
+#define ART_TAILBITER 167
#define ART_MUSASI_KATANA 171
#define ART_MUSASI_WAKIZASI 172
#define ART_QUICKTHORN 174
#define ART_ARUNRUTH 184
#define ART_HAKABUSA 189
#define ART_STORMBRINGER 190
+#define ART_NARSIL 191
#define ART_KANNU 193
#define ART_GRIMTOOTH 196
#define ART_KAMUI 198
#define ART_GOURYU 207
+#define ART_EOWYN 216
/* Polearms */
#define ART_THEODEN 93
#define ART_OSONDIR 95
#define ART_TIL 96
#define ART_RUNESPEAR 97
-#define ART_OROME 98
-#define ART_NIMLOTH 99
+#define ART_DESTINY 98
+#define ART_HAGEN 99
#define ART_EORLINGAS 100
#define ART_DURIN 101
#define ART_EONWE 102
#define ART_BALLI 103
#define ART_LOTHARANG 104
-#define ART_MUNDWINE 105
+#define ART_DWARVES_AXE 105
#define ART_BARUKKHELED 106
#define ART_WRATH 107
#define ART_ULMO 108
#define ART_AULE 117
#define ART_NAR 118
#define ART_ERIRIL 119
-#define ART_OLORIN 120
+#define ART_GANDALF 120
#define ART_DEATHWREAKER 121
#define ART_TURMIL 122
#define ART_MJOLLNIR 136
#define ART_SHUTEN_DOJI 194
#define ART_G_HAMMER 195
#define ART_AEGISFANG 208
-#define ART_VIOLET 209
+#define ART_HERMIT 209
#define ART_GOTHMOG 212
#define ART_JIZO 213
#define ART_FUNDIN 214
#define EGO_SLAYING 49
#define EGO_AGILITY 50
#define EGO_POWER 51
-#define EGO_2HAND 52
+#define EGO_2WEAPON 52
#define EGO_MAGIC_MASTERY 53
#define EGO_WEAKNESS 54
#define EGO_CLUMSINESS 55
#define EGO_WEST 68
#define EGO_ATTACKS 69
#define EGO_SLAYING_WEAPON 70
-#define EGO_FORCE_WEPON 71
+#define EGO_FORCE_WEAPON 71
#define EGO_BRAND_ACID 72
#define EGO_BRAND_ELEC 73
#define EGO_BRAND_FIRE 74
#define EGO_TRUMP 98
#define EGO_PATTERN 99
#define EGO_DIGGING 100
-/* xxx */
+#define EGO_SLAY_HUMAN 101
#define EGO_MORGUL 102
-/* xxx */
+#define EGO_KILL_HUMAN 103
/* Bows */
#define EGO_ACCURACY 104
#define TV_ARCANE_BOOK 96
#define TV_ENCHANT_BOOK 97
#define TV_DAEMON_BOOK 98
+#define TV_CRUSADE_BOOK 99
#define TV_MUSIC_BOOK 105
#define TV_HISSATSU_BOOK 106
#define TV_GOLD 127 /* Gold can only be picked up by players */
#define SV_PHOTO 50
/* The "sval" codes for TV_CORPSE */
-#define SV_SKELETON 0
-#define SV_CORPSE 1
+#define SV_SKELETON 0
+#define SV_CORPSE 1
/* The "sval" codes for TV_SHOT/TV_ARROW/TV_BOLT */
#define SV_AMMO_LIGHT 0 /* pebbles */
#define SV_STAFF_DESTRUCTION 29
#define SV_STAFF_ANIMATE_DEAD 30
#define SV_STAFF_MSTORM 31
+#define SV_STAFF_NOTHING 32
/* The "sval" codes for TV_WAND */
#define SV_POTION_TSUYOSHI 65
#define SV_POTION_POLYMORPH 66
+/* The "sval" codes for TV_FLASK */
+#define SV_FLASK_OIL 0
+
/* The "sval" codes for TV_FOOD */
#define SV_FOOD_POISON 0
#define SV_FOOD_BLINDNESS 1
#define CAVE_VIEW 0x0020 /* view flag */
#define CAVE_TEMP 0x0040 /* temp flag */
#define CAVE_XTRA 0x0080 /* misc flag */
+#define CAVE_MNLT 0x0100 /* Illuminated by monster */
-#define CAVE_MNLT 0x0100 /* Illuminated by monster */
+#define CAVE_XXX0 0x8000 /* Now unused */
+
+/* Used only while cave generation */
#define CAVE_FLOOR 0x0200
#define CAVE_EXTRA 0x0400
#define CAVE_INNER 0x0800
#define CAVE_OUTER 0x1000
#define CAVE_SOLID 0x2000
#define CAVE_VAULT 0x4000
-#define CAVE_TRAP 0x8000
+#define CAVE_MASK (CAVE_FLOOR | CAVE_EXTRA | CAVE_INNER | CAVE_OUTER | CAVE_SOLID | CAVE_VAULT)
+
+/* Used only after cave generation */
+#define CAVE_XXXX1 0x0200
+#define CAVE_XXXX2 0x0400
+#define CAVE_XXXX3 0x0800
+#define CAVE_OBJECT 0x1000 /* mirror */
+#define CAVE_UNSAFE 0x2000 /* Might have trap */
+#define CAVE_IN_DETECT 0x4000 /* trap detected area (inner circle only) */
-#define CAVE_MASK (CAVE_FLOOR | CAVE_EXTRA | CAVE_INNER | CAVE_OUTER | CAVE_SOLID)
/*
* Bit flags for the "project()" function
* KILL: Affect each monster in the "blast area" in some way
* HIDE: Hack -- disable "visual" feedback from projection
*/
-#define PROJECT_JUMP 0x01
-#define PROJECT_BEAM 0x02
-#define PROJECT_THRU 0x04
-#define PROJECT_STOP 0x08
-#define PROJECT_GRID 0x10
-#define PROJECT_ITEM 0x20
-#define PROJECT_KILL 0x40
-#define PROJECT_HIDE 0x80
-#define PROJECT_DISI 0x100
-#define PROJECT_PLAYER 0x200
-#define PROJECT_MONSTER 0x400
-#define PROJECT_NO_REF 0x800
-#define PROJECT_NO_HANGEKI 0x1000
-#define PROJECT_PATH 0x2000
+#define PROJECT_JUMP 0x01
+#define PROJECT_BEAM 0x02
+#define PROJECT_THRU 0x04
+#define PROJECT_STOP 0x08
+#define PROJECT_GRID 0x10
+#define PROJECT_ITEM 0x20
+#define PROJECT_KILL 0x40
+#define PROJECT_HIDE 0x80
+#define PROJECT_DISI 0x100
+#define PROJECT_PLAYER 0x200
+#define PROJECT_MONSTER 0x400
+#define PROJECT_REFLECTABLE 0x800
+#define PROJECT_NO_HANGEKI 0x1000
+#define PROJECT_PATH 0x2000
+#define PROJECT_FAST 0x4000
/*
* Bit flags for the "enchant()" function
/*
+ * Bit flags for control of get_check_strict()
+ */
+#define CHECK_OKAY_CANCEL 0x01
+#define CHECK_NO_ESCAPE 0x02
+#define CHECK_NO_HISTORY 0x04
+#define CHECK_DEFAULT_Y 0x08
+
+
+/*
* Some bit-flags for the "smart" field
*/
#define SM_RES_ACID 0x00000001
*/
#define PN_COMBINE 0x00000001L /* Combine the pack */
#define PN_REORDER 0x00000002L /* Reorder the pack */
+#define PN_AUTODESTROY 0x00000004L /* Auto-destroy marked item */
/* xxx (many) */
#define PR_STUN 0x00002000L /* Display Extra (Stun) */
#define PR_HUNGER 0x00004000L /* Display Extra (Hunger) */
#define PR_STATUS 0x00008000L /* Display Status Bar */
-#define PR_DUNGEON 0x00010000L /* Display Extra (Blind) */
+#define PR_XXX0 0x00010000L /* (unused) */
#define PR_UHEALTH 0x00020000L /* Display Uma Health Bar */
-#define PR_XXX1 0x00040000L /* Display Extra (Afraid) */
-#define PR_XXX2 0x00080000L /* Display Extra (Poisoned) */
+#define PR_XXX1 0x00040000L /* (unused) */
+#define PR_XXX2 0x00080000L /* (unused) */
#define PR_STATE 0x00100000L /* Display Extra (State) */
#define PR_SPEED 0x00200000L /* Display Extra (Speed) */
#define PR_STUDY 0x00400000L /* Display Extra (Study) */
#define PW_BORG_1 0x00004000L /* Display borg messages */
#define PW_BORG_2 0x00008000L /* Display borg status */
+/*
+ * Bit flags for the place_monster_???() (etc)
+ */
+#define PM_ALLOW_SLEEP 0x00000001
+#define PM_ALLOW_GROUP 0x00000002
+#define PM_FORCE_FRIENDLY 0x00000004
+#define PM_FORCE_PET 0x00000008
+#define PM_NO_KAGE 0x00000010
+#define PM_NO_PET 0x00000020
+#define PM_ALLOW_UNIQUE 0x00000040
+#define PM_IGNORE_TERRAIN 0x00000080
+#define PM_HASTE 0x00000100
/*
* prevents the player from getting more than one at a time.
*/
#define ATTACK_CONFUSE 0x00000001
-#define ATTACK_BLKBRTH 0x00000002
-#define ATTACK_FLEE 0x00000004
-#define ATTACK_SUPERSHOT 0x00000008
+#define ATTACK_XXX1 0x00000002
+#define ATTACK_XXX2 0x00000004
+#define ATTACK_XXX3 0x00000008
#define ATTACK_ACID 0x00000010
#define ATTACK_ELEC 0x00000020
#define ATTACK_FIRE 0x00000040
#define SUMMON_MANES 60
#define SUMMON_LOUSE 61
#define SUMMON_GUARDIANS 62
+#define SUMMON_KNIGHTS 63
+#define SUMMON_EAGLES 64
+#define SUMMON_PIRANHAS 65
+#define SUMMON_ARMAGE_GOOD 66
+#define SUMMON_ARMAGE_EVIL 67
/*
#define GF_SUPER_RAY 111
#define GF_STAR_HEAL 112
#define GF_WATER_FLOW 113
+#define GF_CRUSADE 114
+#define GF_STASIS_EVIL 115
+#define GF_WOUNDS 116
-#define MAX_GF 113
+#define MAX_GF 117
/*
* Some things which induce learning
/*
- * Hack -- first "normal" artifact in the artifact list. All of
- * the artifacts with indexes from 1 to 15 are "special" (lights,
- * rings, amulets), and the ones from 16 to 127 are "normal".
- */
-#define ART_MIN_NORMAL 19
-
-/*
* Game generated inscription indices. These are stored in the object,
* and are used to index the string array from tables.c.
*/
#define CHEST_BIRD_STORM 0x0100
#define CHEST_H_SUMMON 0x0200
#define CHEST_RUNES_OF_EVIL 0x0400
-
+#define CHEST_ALARM 0x0800
/*
#define IDENT_KNOWN 0x08 /* Item abilities are known */
#define IDENT_STOREB 0x10 /* Item is storebought !!!! */
#define IDENT_MENTAL 0x20 /* Item information is known */
+#if 0
#define IDENT_CURSED 0x40 /* Item is temporarily cursed */
+#endif
#define IDENT_BROKEN 0x80 /* Item is permanently worthless */
+/*
+ * How object is marked (flags in object_type.mark)
+ * OM_FOUND --- original boolean flag
+ * OM_NOMSG --- temporary flag to suppress messages which were
+ * already printed in auto_pickup_items().
+ */
+#define OM_FOUND 0x01 /* original boolean flag */
+#define OM_NOMSG 0x02 /* temporary flag to suppress messages */
+#define OM_NO_QUERY 0x04 /* Query for auto-pick was already answered as 'No' */
+#define OM_AUTODESTROY 0x08 /* Destroy later to avoid illegal inventry shift */
+
/*
* Special Monster Flags (all temporary)
/*
- * As of 2.7.8, the "object flags" are valid for all objects, and as
- * of 2.7.9, these flags are not actually stored with the object.
+ * Object flags
*
- * Note that "flags1" contains all flags dependant on "pval" (including
- * stat bonuses, but NOT stat sustainers), plus all "extra attack damage"
- * flags (SLAY_XXX and BRAND_XXX).
+ * Old variables for object flags such as flags1, flags2, and flags3
+ * are obsolated. Now single array flgs[TR_FLAG_SIZE] contains all
+ * object flags. And each flag is refered by single index number
+ * instead of a bit mask.
*
- * Note that "flags2" contains all "resistances" (including "Stat Sustainers",
- * actual immunities, and resistances). Note that "Hold Life" is really an
- * "immunity" to ExpLoss, and "Free Action" is "immunity to paralysis".
+ * Therefore it's very easy to add a lot of new flags; no one need to
+ * worry about in which variable a new flag should be put, nor to
+ * modify a huge number of files all over the source directory at once
+ * to add new flag variables such as flags4, flags5, etc...
*
- * Note that "flags3" contains everything else -- including the three "CURSED"
- * flags, and the "BLESSED" flag, several "item display" parameters, some new
- * flags for powerful Bows, and flags which affect the player in a "general"
- * way (LITE, TELEPATHY, SEE_INVIS, SLOW_DIGEST, REGEN, FEATHER), including
- * all the "general" curses (TELEPORT, AGGRAVATE, EXP_DRAIN). It also has
- * four new flags called "ITEM_IGNORE_XXX" which lets an item specify that
- * it can not be affected by various forms of destruction. This is NOT as
- * powerful as actually granting resistance/immunity to the wearer.
- */
-
-#define TR1_STR 0x00000001L /* STR += "pval" */
-#define TR1_INT 0x00000002L /* INT += "pval" */
-#define TR1_WIS 0x00000004L /* WIS += "pval" */
-#define TR1_DEX 0x00000008L /* DEX += "pval" */
-#define TR1_CON 0x00000010L /* CON += "pval" */
-#define TR1_CHR 0x00000020L /* CHR += "pval" */
-#define TR1_MAGIC_MASTERY 0x00000040L /* Later */
-#define TR1_FORCE_WEPON 0x00000080L /* Later */
-#define TR1_STEALTH 0x00000100L /* Stealth += "pval" */
-#define TR1_SEARCH 0x00000200L /* Search += "pval" */
-#define TR1_INFRA 0x00000400L /* Infra += "pval" */
-#define TR1_TUNNEL 0x00000800L /* Tunnel += "pval" */
-#define TR1_SPEED 0x00001000L /* Speed += "pval" */
-#define TR1_BLOWS 0x00002000L /* Blows += "pval" */
-#define TR1_CHAOTIC 0x00004000L
-#define TR1_VAMPIRIC 0x00008000L
-#define TR1_SLAY_ANIMAL 0x00010000L
-#define TR1_SLAY_EVIL 0x00020000L
-#define TR1_SLAY_UNDEAD 0x00040000L
-#define TR1_SLAY_DEMON 0x00080000L
-#define TR1_SLAY_ORC 0x00100000L
-#define TR1_SLAY_TROLL 0x00200000L
-#define TR1_SLAY_GIANT 0x00400000L
-#define TR1_SLAY_DRAGON 0x00800000L
-#define TR1_KILL_DRAGON 0x01000000L /* Execute Dragon */
-#define TR1_VORPAL 0x02000000L /* Later */
-#define TR1_IMPACT 0x04000000L /* Cause Earthquakes */
-#define TR1_BRAND_POIS 0x08000000L
-#define TR1_BRAND_ACID 0x10000000L
-#define TR1_BRAND_ELEC 0x20000000L
-#define TR1_BRAND_FIRE 0x40000000L
-#define TR1_BRAND_COLD 0x80000000L
-
-#define TR2_SUST_STR 0x00000001L
-#define TR2_SUST_INT 0x00000002L
-#define TR2_SUST_WIS 0x00000004L
-#define TR2_SUST_DEX 0x00000008L
-#define TR2_SUST_CON 0x00000010L
-#define TR2_SUST_CHR 0x00000020L
-#define TR2_RIDING 0x00000040L /* Later */
-#define TR2_XXX2 0x00000080L /* Later */
-#define TR2_IM_ACID 0x00000100L
-#define TR2_IM_ELEC 0x00000200L
-#define TR2_IM_FIRE 0x00000400L
-#define TR2_IM_COLD 0x00000800L
-#define TR2_THROW 0x00001000L /* Later */
-#define TR2_REFLECT 0x00002000L /* Reflect 'bolts' */
-#define TR2_FREE_ACT 0x00004000L /* Free Action */
-#define TR2_HOLD_LIFE 0x00008000L /* Hold Life */
-#define TR2_RES_ACID 0x00010000L
-#define TR2_RES_ELEC 0x00020000L
-#define TR2_RES_FIRE 0x00040000L
-#define TR2_RES_COLD 0x00080000L
-#define TR2_RES_POIS 0x00100000L
-#define TR2_RES_FEAR 0x00200000L /* Added for Zangband */
-#define TR2_RES_LITE 0x00400000L
-#define TR2_RES_DARK 0x00800000L
-#define TR2_RES_BLIND 0x01000000L
-#define TR2_RES_CONF 0x02000000L
-#define TR2_RES_SOUND 0x04000000L
-#define TR2_RES_SHARDS 0x08000000L
-#define TR2_RES_NETHER 0x10000000L
-#define TR2_RES_NEXUS 0x20000000L
-#define TR2_RES_CHAOS 0x40000000L
-#define TR2_RES_DISEN 0x80000000L
-
-
-#define TR3_SH_FIRE 0x00000001L /* Immolation (Fire) */
-#define TR3_SH_ELEC 0x00000002L /* Electric Sheath */
-#define TR3_QUESTITEM 0x00000004L /* quest level item -KMW- */
-#define TR3_SH_COLD 0x00000008L /* cold aura */
-#define TR3_NO_TELE 0x00000010L /* Anti-teleportation */
-#define TR3_NO_MAGIC 0x00000020L /* Anti-magic */
-#define TR3_DEC_MANA 0x00000040L /* ??? */
-#define TR3_TY_CURSE 0x00000080L /* The Ancient Curse */
-#define TR3_XXX1 0x00000100L
-#define TR3_HIDE_TYPE 0x00000200L /* Hide "pval" description */
-#define TR3_SHOW_MODS 0x00000400L /* Always show Tohit/Todam */
-#define TR3_INSTA_ART 0x00000800L /* Item must be an artifact */
-#define TR3_FEATHER 0x00001000L /* Feather Falling */
-#define TR3_LITE 0x00002000L /* Permanent Light */
-#define TR3_SEE_INVIS 0x00004000L /* See Invisible */
-#define TR3_TELEPATHY 0x00008000L /* Telepathy */
-#define TR3_SLOW_DIGEST 0x00010000L /* Item slows down digestion */
-#define TR3_REGEN 0x00020000L /* Item induces regeneration */
-#define TR3_XTRA_MIGHT 0x00040000L /* Bows get extra multiplier */
-#define TR3_XTRA_SHOTS 0x00080000L /* Bows get extra shots */
-#define TR3_IGNORE_ACID 0x00100000L /* Item ignores Acid Damage */
-#define TR3_IGNORE_ELEC 0x00200000L /* Item ignores Elec Damage */
-#define TR3_IGNORE_FIRE 0x00400000L /* Item ignores Fire Damage */
-#define TR3_IGNORE_COLD 0x00800000L /* Item ignores Cold Damage */
-#define TR3_ACTIVATE 0x01000000L /* Item can be activated */
-#define TR3_DRAIN_EXP 0x02000000L /* Item drains Experience */
-#define TR3_TELEPORT 0x04000000L /* Item teleports player */
-#define TR3_AGGRAVATE 0x08000000L /* Item aggravates monsters */
-#define TR3_BLESSED 0x10000000L /* Item is Blessed */
-#define TR3_CURSED 0x20000000L /* Item is Cursed */
-#define TR3_HEAVY_CURSE 0x40000000L /* Item is Heavily Cursed */
-#define TR3_PERMA_CURSE 0x80000000L /* Item is Perma Cursed */
-
-
-/*
- * Hack -- flag set 1 -- mask for "pval-dependant" flags.
- * Note that all "pval" dependant flags must be in "flags1".
- */
-#define TR1_PVAL_MASK \
- (TR1_STR | TR1_INT | TR1_WIS | TR1_DEX | \
- TR1_CON | TR1_CHR | \
- TR1_MAGIC_MASTERY | TR1_STEALTH | TR1_SEARCH | TR1_INFRA | \
- TR1_TUNNEL | TR1_SPEED | TR1_BLOWS)
-
+ * All management of flags is now treated using a set of macros
+ * instead of bit operations.
+ * Note: These macros are using division, modulo, and bit shift
+ * operations, and it seems that these operations are rather slower
+ * than original bit operation. But since index numbers are almost
+ * always given as constant, such slow operations are performed in the
+ * compile time. So there is no problem on the speed.
+ *
+ * Exceptions of new flag management is a set of flags to control
+ * object generation and the curse flags. These are not yet rewritten
+ * in new index form; maybe these have no merit of rewriting.
+ */
+
+#define have_flag(ARRAY, INDEX) !!((ARRAY)[(INDEX)/32] & (1L << ((INDEX)%32)))
+#define add_flag(ARRAY, INDEX) ((ARRAY)[(INDEX)/32] |= (1L << ((INDEX)%32)))
+#define remove_flag(ARRAY, INDEX) ((ARRAY)[(INDEX)/32] &= ~(1L << ((INDEX)%32)))
+#define is_pval_flag(INDEX) ((TR_STR <= (INDEX) && (INDEX) <= TR_MAGIC_MASTERY) || (TR_STEALTH <= (INDEX) && (INDEX) <= TR_BLOWS))
+#define have_pval_flags(ARRAY) !!((ARRAY)[0] & (0x00003f7f))
+
+
+#define TR_STR 0 /* STR += "pval" */
+#define TR_INT 1 /* INT += "pval" */
+#define TR_WIS 2 /* WIS += "pval" */
+#define TR_DEX 3 /* DEX += "pval" */
+#define TR_CON 4 /* CON += "pval" */
+#define TR_CHR 5 /* CHR += "pval" */
+#define TR_MAGIC_MASTERY 6 /* Later */
+#define TR_FORCE_WEAPON 7 /* Later */
+#define TR_STEALTH 8 /* Stealth += "pval" */
+#define TR_SEARCH 9 /* Search += "pval" */
+#define TR_INFRA 10 /* Infra += "pval" */
+#define TR_TUNNEL 11 /* Tunnel += "pval" */
+#define TR_SPEED 12 /* Speed += "pval" */
+#define TR_BLOWS 13 /* Blows += "pval" */
+#define TR_CHAOTIC 14
+#define TR_VAMPIRIC 15
+#define TR_SLAY_ANIMAL 16
+#define TR_SLAY_EVIL 17
+#define TR_SLAY_UNDEAD 18
+#define TR_SLAY_DEMON 19
+#define TR_SLAY_ORC 20
+#define TR_SLAY_TROLL 21
+#define TR_SLAY_GIANT 22
+#define TR_SLAY_DRAGON 23
+#define TR_KILL_DRAGON 24 /* Execute Dragon */
+#define TR_VORPAL 25 /* Later */
+#define TR_IMPACT 26 /* Cause Earthquakes */
+#define TR_BRAND_POIS 27
+#define TR_BRAND_ACID 28
+#define TR_BRAND_ELEC 29
+#define TR_BRAND_FIRE 30
+#define TR_BRAND_COLD 31
+
+#define TR_SUST_STR 32
+#define TR_SUST_INT 33
+#define TR_SUST_WIS 34
+#define TR_SUST_DEX 35
+#define TR_SUST_CON 36
+#define TR_SUST_CHR 37
+#define TR_RIDING 38
+#define TR_EASY_SPELL 39
+#define TR_IM_ACID 40
+#define TR_IM_ELEC 41
+#define TR_IM_FIRE 42
+#define TR_IM_COLD 43
+#define TR_THROW 44 /* Later */
+#define TR_REFLECT 45 /* Reflect 'bolts' */
+#define TR_FREE_ACT 46 /* Free Action */
+#define TR_HOLD_LIFE 47 /* Hold Life */
+#define TR_RES_ACID 48
+#define TR_RES_ELEC 49
+#define TR_RES_FIRE 50
+#define TR_RES_COLD 51
+#define TR_RES_POIS 52
+#define TR_RES_FEAR 53 /* Added for Zangband */
+#define TR_RES_LITE 54
+#define TR_RES_DARK 55
+#define TR_RES_BLIND 56
+#define TR_RES_CONF 57
+#define TR_RES_SOUND 58
+#define TR_RES_SHARDS 59
+#define TR_RES_NETHER 60
+#define TR_RES_NEXUS 61
+#define TR_RES_CHAOS 62
+#define TR_RES_DISEN 63
+
+#define TR_SH_FIRE 64 /* Immolation (Fire) */
+#define TR_SH_ELEC 65 /* Electric Sheath */
+#define TR_SLAY_HUMAN 66 /* Slay human */
+#define TR_SH_COLD 67 /* cold aura */
+#define TR_NO_TELE 68 /* Anti-teleportation */
+#define TR_NO_MAGIC 69 /* Anti-magic */
+#define TR_DEC_MANA 70 /* ??? */
+#define TR_TY_CURSE 71 /* The Ancient Curse */
+#define TR_WARNING 72 /* Warning */
+#define TR_HIDE_TYPE 73 /* Hide "pval" description */
+#define TR_SHOW_MODS 74 /* Always show Tohit/Todam */
+#define TR_XXX1 75 /* XXX1 */
+#define TR_FEATHER 76 /* Feather Falling */
+#define TR_LITE 77 /* Permanent Light */
+#define TR_SEE_INVIS 78 /* See Invisible */
+#define TR_TELEPATHY 79 /* Telepathy */
+#define TR_SLOW_DIGEST 80 /* Item slows down digestion */
+#define TR_REGEN 81 /* Item induces regeneration */
+#define TR_XTRA_MIGHT 82 /* Bows get extra multiplier */
+#define TR_XTRA_SHOTS 83 /* Bows get extra shots */
+#define TR_IGNORE_ACID 84 /* Item ignores Acid Damage */
+#define TR_IGNORE_ELEC 85 /* Item ignores Elec Damage */
+#define TR_IGNORE_FIRE 86 /* Item ignores Fire Damage */
+#define TR_IGNORE_COLD 87 /* Item ignores Cold Damage */
+#define TR_ACTIVATE 88 /* Item can be activated */
+#define TR_DRAIN_EXP 89 /* Item drains Experience */
+#define TR_TELEPORT 90 /* Item teleports player */
+#define TR_AGGRAVATE 91 /* Item aggravates monsters */
+#define TR_BLESSED 92 /* Item is Blessed */
+#define TR_ES_ATTACK 93 /* Fake flag for Smith */
+#define TR_ES_AC 94 /* Fake flag for Smith */
+#define TR_XXX5 95
+
+#define TR_KILL_ANIMAL 96
+#define TR_KILL_EVIL 97
+#define TR_KILL_UNDEAD 98
+#define TR_KILL_DEMON 99
+#define TR_KILL_ORC 100
+#define TR_KILL_TROLL 101
+#define TR_KILL_GIANT 102
+#define TR_KILL_HUMAN 103
+#define TR_ESP_ANIMAL 104
+#define TR_ESP_UNDEAD 105
+#define TR_ESP_DEMON 106
+#define TR_ESP_ORC 107
+#define TR_ESP_TROLL 108
+#define TR_ESP_GIANT 109
+#define TR_ESP_DRAGON 110
+#define TR_ESP_HUMAN 111
+#define TR_ESP_EVIL 112
+#define TR_ESP_GOOD 113
+#define TR_ESP_NONLIVING 114
+#define TR_ESP_UNIQUE 115
+#define TR_FULL_NAME 116
+
+#define TR_FLAG_MAX 117
+#define TR_FLAG_SIZE 4
+
+
+#define TRG_INSTA_ART 0x00000001L /* Item must be an artifact */
+#define TRG_QUESTITEM 0x00000002L /* quest level item -KMW- */
+#define TRG_XTRA_POWER 0x00000004L /* Extra power */
+#define TRG_ONE_SUSTAIN 0x00000008L /* One sustain */
+#define TRG_XTRA_RES_OR_POWER 0x00000010L /* Extra resistance or power */
+#define TRG_XTRA_H_RES 0x00000020L /* Extra high resistance */
+#define TRG_XTRA_E_RES 0x00000040L /* Extra element resistance */
+#define TRG_XTRA_L_RES 0x00000080L /* Extra lordly resistance */
+#define TRG_XTRA_D_RES 0x00000100L /* Extra dragon resistance */
+#define TRG_XTRA_RES 0x00000200L /* Extra resistance */
+#define TRG_CURSED 0x00000400L /* Item is Cursed */
+#define TRG_HEAVY_CURSE 0x00000800L /* Item is Heavily Cursed */
+#define TRG_PERMA_CURSE 0x00001000L /* Item is Perma Cursed */
+#define TRG_RANDOM_CURSE0 0x00002000L /* Item is Random Cursed */
+#define TRG_RANDOM_CURSE1 0x00004000L /* Item is Random Cursed */
+#define TRG_RANDOM_CURSE2 0x00008000L /* Item is Random Cursed */
+
+
+#define MAX_CURSE 17
+
+#define TRC_CURSED 0x00000001L
+#define TRC_HEAVY_CURSE 0x00000002L
+#define TRC_PERMA_CURSE 0x00000004L
+#define TRC_XXX1 0x00000008L
+#define TRC_TY_CURSE 0x00000010L
+#define TRC_AGGRAVATE 0x00000020L
+#define TRC_DRAIN_EXP 0x00000040L
+#define TRC_SLOW_REGEN 0x00000080L
+#define TRC_ADD_L_CURSE 0x00000100L
+#define TRC_ADD_H_CURSE 0x00000200L
+#define TRC_CALL_ANIMAL 0x00000400L
+#define TRC_CALL_DEMON 0x00000800L
+#define TRC_CALL_DRAGON 0x00001000L
+#define TRC_COWARDICE 0x00002000L
+#define TRC_TELEPORT 0x00004000L
+#define TRC_LOW_MELEE 0x00008000L
+#define TRC_LOW_AC 0x00010000L
+#define TRC_LOW_MAGIC 0x00020000L
+#define TRC_FAST_DIGEST 0x00040000L
+#define TRC_DRAIN_HP 0x00080000L
+#define TRC_DRAIN_MANA 0x00100000L
+
+#define TRC_TELEPORT_SELF 0x00000001L
+#define TRC_CHAINSWORD 0x00000002L
+
+#define TRC_SPECIAL_MASK \
+ (TRC_TY_CURSE | TRC_AGGRAVATE)
+
+#define TRC_HEAVY_MASK \
+ (TRC_TY_CURSE | TRC_AGGRAVATE | TRC_DRAIN_EXP | TRC_ADD_H_CURSE | \
+ TRC_CALL_DEMON | TRC_CALL_DRAGON | TRC_TELEPORT)
+
+#define TRC_P_FLAG_MASK \
+ (TRC_TELEPORT_SELF | TRC_CHAINSWORD | \
+ TRC_TY_CURSE | TRC_DRAIN_EXP | TRC_ADD_L_CURSE | TRC_ADD_H_CURSE | \
+ TRC_CALL_ANIMAL | TRC_CALL_DEMON | TRC_CALL_DRAGON | TRC_COWARDICE | \
+ TRC_TELEPORT | TRC_DRAIN_HP | TRC_DRAIN_MANA)
/*** Monster blow constants ***/
#define RBM_INSULT 22
#define RBM_MOAN 23
#define RBM_SHOW 24
+#define RBM_SHOOT 25
/*
#define RF1_FORCE_MAXHP 0x00000200 /* Start with max hitpoints */
#define RF1_FORCE_SLEEP 0x00000400 /* Start out sleeping */
#define RF1_FORCE_EXTRA 0x00000800 /* Start out something */
-#define RF1_FRIEND 0x00001000 /* Arrive with a friend */
+#define RF1_XXX1 0x00001000 /* XXX */
#define RF1_FRIENDS 0x00002000 /* Arrive with some friends */
#define RF1_ESCORT 0x00004000 /* Arrive with an escort */
#define RF1_ESCORTS 0x00008000 /* Arrive with some escorts */
#define RF1_DROP_4D2 0x08000000 /* Drop 4d2 items/gold */
#define RF1_DROP_GOOD 0x10000000 /* Drop good items */
#define RF1_DROP_GREAT 0x20000000 /* Drop great items */
-#define RF1_DROP_USEFUL 0x40000000 /* Drop "useful" items */
-#define RF1_DROP_CHOSEN 0x80000000 /* Drop "chosen" items */
+#define RF1_XXX2 0x40000000 /* XXX */
+#define RF1_XXX3 0x80000000 /* XXX */
/*
* New monster race bit flags
#define RF2_BRAIN_4 0x08000000
#define RF2_BRAIN_5 0x10000000
#define RF2_BRAIN_6 0x20000000
-#define RF2_BRAIN_7 0x40000000
+#define RF2_HUMAN 0x40000000
#define RF2_QUANTUM 0x80000000 /* Monster has quantum behavior */
/*
#define RF4_XXX1 0x00000002 /* XXX */
#define RF4_DISPEL 0x00000004 /* Dispel magic */
#define RF4_ROCKET 0x00000008 /* TY: Rocket */
-#define RF4_ARROW_1 0x00000010 /* Fire an arrow (light) */
-#define RF4_ARROW_2 0x00000020 /* Fire an arrow (heavy) */
-#define RF4_ARROW_3 0x00000040 /* Fire missiles (light) */
-#define RF4_ARROW_4 0x00000080 /* Fire missiles (heavy) */
+#define RF4_SHOOT 0x00000010 /* Fire missiles */
+#define RF4_XXX2 0x00000020
+#define RF4_XXX3 0x00000040
+#define RF4_XXX4 0x00000080
#define RF4_BR_ACID 0x00000100 /* Breathe Acid */
#define RF4_BR_ELEC 0x00000200 /* Breathe Elec */
#define RF4_BR_FIRE 0x00000400 /* Breathe Fire */
#define RF7_CAN_FLY 0x00000004 /* Monster can fly */
#define RF7_FRIENDLY 0x00000008 /* Monster is friendly */
#define RF7_UNIQUE_7 0x00000010 /* Is a "Nazgul" unique */
-#define RF7_UNIQUE2 0x00000020 /* uso unique */
-#define RF7_RIDING 0x00000040 /* Can riding */
+#define RF7_UNIQUE2 0x00000020 /* Fake unique */
+#define RF7_RIDING 0x00000040 /* Good for riding */
#define RF7_KAGE 0x00000080 /* Is kage */
#define RF7_HAS_LITE_1 0x00000100 /* Monster carries light */
#define RF7_SELF_LITE_1 0x00000200 /* Monster lights itself */
#define RF7_HAS_LITE_2 0x00000400 /* Monster carries light */
#define RF7_SELF_LITE_2 0x00000800 /* Monster lights itself */
-#define RF7_GUARDIAN 0x00001000
-#define RF7_CHAMELEON 0x00002000
-#define RF7_KILL_EXP 0x00004000
+#define RF7_GUARDIAN 0x00001000 /* Guardian of a dungeon */
+#define RF7_CHAMELEON 0x00002000 /* Chameleon can change */
+#define RF7_KILL_EXP 0x00004000 /* No exp until you kill it */
+#define RF7_TANUKI 0x00008000 /* Tanuki disguise */
/*
* Monster race flags
* Hack -- "bolt" spells that may hurt fellow monsters
*/
#define RF4_BOLT_MASK \
- (RF4_ROCKET | RF4_ARROW_1 | RF4_ARROW_2 | RF4_ARROW_3 | RF4_ARROW_4)
+ (RF4_ROCKET | RF4_SHOOT)
#define RF5_BOLT_MASK \
(RF5_BO_ACID | RF5_BO_ELEC | RF5_BO_FIRE | RF5_BO_COLD | \
/*
+ * Hack -- 'ball' spells with radius 4 that may hurt friends
+ */
+#define RF4_BIG_BALL_MASK \
+ (RF4_BA_CHAO)
+
+#define RF5_BIG_BALL_MASK \
+ (RF5_BA_LITE | RF5_BA_DARK | RF5_BA_WATE | RF5_BA_MANA)
+
+#define RF6_BIG_BALL_MASK \
+ 0L
+
+
+/*
* Hack -- 'breath' spells that may hurt friends
*/
#define RF4_BREATH_MASK \
* Hack -- "attack" spells
*/
#define RF4_ATTACK_MASK \
- (RF4_SHRIEK | RF4_DISPEL | RF4_ROCKET | RF4_ARROW_1 | RF4_ARROW_2 | \
- RF4_ARROW_3 | RF4_ARROW_4 | RF4_BR_ACID | RF4_BR_ELEC | RF4_BR_FIRE | \
+ (RF4_SHRIEK | RF4_DISPEL | RF4_ROCKET | RF4_SHOOT | \
+ RF4_BR_ACID | RF4_BR_ELEC | RF4_BR_FIRE | \
RF4_BR_COLD | RF4_BR_POIS | RF4_BR_NETH | RF4_BR_LITE | RF4_BR_DARK | \
RF4_BR_CONF | RF4_BR_SOUN | RF4_BR_CHAO | RF4_BR_DISE | RF4_BR_NEXU | \
RF4_BR_TIME | RF4_BR_INER | RF4_BR_GRAV | RF4_BR_SHAR | RF4_BR_PLAS | \
* Hack -- "indirect" spells
*/
#define RF4_INDIRECT_MASK \
- (RF4_SHRIEK | RF4_XXX1)
+ (RF4_SHRIEK | RF4_XXX1 | RF4_XXX2 | RF4_XXX3 | RF4_XXX4)
#define RF5_INDIRECT_MASK \
0L
* Hack -- "no magic" spells
*/
#define RF4_NOMAGIC_MASK \
- (RF4_SHRIEK | RF4_ROCKET | RF4_ARROW_1 | RF4_ARROW_2 | \
- RF4_ARROW_3 | RF4_ARROW_4 | RF4_BR_ACID | RF4_BR_ELEC | \
+ (RF4_SHRIEK | RF4_ROCKET | RF4_SHOOT | \
+ RF4_BR_ACID | RF4_BR_ELEC | \
RF4_BR_FIRE | RF4_BR_COLD | RF4_BR_POIS | RF4_BR_NETH | \
RF4_BR_LITE | RF4_BR_DARK | RF4_BR_CONF | RF4_BR_SOUN | \
RF4_BR_CHAO | RF4_BR_DISE | RF4_BR_NEXU | RF4_BR_SHAR | \
#define is_friendly(A) \
(bool)(((A)->smart & SM_FRIENDLY) ? TRUE : FALSE)
+#define is_friendly_idx(IDX) \
+ (bool)((IDX) > 0 && is_friendly(&m_list[(IDX)]))
+
#define is_pet(A) \
(bool)(((A)->smart & SM_PET) ? TRUE : FALSE)
* Cursed items.
*/
#define cursed_p(T) \
- ((T)->ident & (IDENT_CURSED))
+ ((T)->curse_flags)
/*
(cave[Y][X].feat == FEAT_FLOWER) || \
(cave[Y][X].feat == FEAT_GRASS) || \
(cave[Y][X].feat == FEAT_DIRT)) && \
- !(cave[Y][X].info & CAVE_TRAP) && \
+ !(cave[Y][X].info & CAVE_OBJECT) && \
(cave[Y][X].o_idx == 0))
(cave[Y][X].feat == FEAT_DEEP_GRASS) || \
(cave[Y][X].feat == FEAT_FLOWER) || \
(cave[Y][X].feat == FEAT_DIRT)) && \
- !(cave[Y][X].info & CAVE_TRAP) && \
+ !(cave[Y][X].info & CAVE_OBJECT) && \
(cave[Y][X].o_idx == 0) && \
(cave[Y][X].m_idx == 0))
((cave[Y][X].feat <= FEAT_PATTERN_XTRA2) && (cave[Y][X].feat >= FEAT_PATTERN_START))
/*
+ * Does the grid stop disintegration?
+ */
+#define cave_stop_disintegration(Y,X) \
+ (((cave[Y][X].feat >= FEAT_PERM_EXTRA) && \
+ (cave[Y][X].feat <= FEAT_PERM_SOLID)) || \
+ (cave[Y][X].feat == FEAT_MOUNTAIN) || \
+ ((cave[Y][X].feat >= FEAT_SHOP_HEAD) && \
+ (cave[Y][X].feat <= FEAT_SHOP_TAIL)) || \
+ ((cave[Y][X].feat >= FEAT_BLDG_HEAD) && \
+ (cave[Y][X].feat <= FEAT_BLDG_TAIL)) || \
+ (cave[Y][X].feat == FEAT_MUSEUM))
+
+
+/*
* Determine if a "legal" grid is within "los" of the player
*
* Note the use of comparison to zero to force a "boolean" result
#define BACT_POKER 43
#define BACT_IDENT_ONE 44
#define BACT_RECHARGE_ALL 45
-#define MAX_BACT 46
+#define BACT_EVAL_AC 46
+#define MAX_BACT 47
/*
* Quest status
#define NIKKI_GAMESTART 19
#define NIKKI_WIZ_TELE 20
#define NIKKI_NAMED_PET 21
+#define NIKKI_PAT_TELE 22
#define MAX_MANE 16
#define MAX_MONSPELLS 96
+#define EATER_EXT 36
+#define EATER_CHARGE 0x10000L
+#define EATER_ROD_CHARGE 0x10L
+
#define MAX_KUBI 20
#define DETECT_RAD_DEFAULT 30
#define MS_XXX1 1
#define MS_DISPEL 2
#define MS_ROCKET 3
-#define MS_ARROW_1 4
-#define MS_ARROW_2 5
-#define MS_ARROW_3 6
-#define MS_ARROW_4 7
+#define MS_SHOOT 4
+#define MS_XXX2 5
+#define MS_XXX3 6
+#define MS_XXX4 7
#define MS_BR_ACID 8
#define MS_BR_ELEC 9
#define MS_BR_FIRE 10
#define MON_WOLF 54
#define MON_FANG 55
#define MON_LOUSE 69
+#define MON_PIRANHA 70
#define MON_COPPER_COINS 85
#define MON_NOV_PALADIN 97
#define MON_GREEN_G 100
#define MON_ENERGY_VOR 359
#define MON_JADE_MONK 370
#define MON_HAGEN 383
+#define MON_MENELDOR 384
#define MON_PHANTOM_B 385
+#define MON_GWAIHIR 410
#define MON_ANGEL 417
#define MON_ADAMANT_COINS 423
#define MON_BARNEY 441
#define MON_ARCHANGEL 456
+#define MON_THORONDOR 468
#define MON_GHOST 477
#define MON_NINJA 485
#define MON_IVORY_MONK 492
#define MON_BANOR 933
#define MON_LUPART 934
#define MON_KENSHIROU 936
+#define MON_W_KNIGHT 938
#define MON_PLANETAR 942
#define MON_SOLAR 943
#define MON_BIKETAL 945
#define MON_TOPAZ_MONK 1047
#define MON_LOUSY 1063
#define MON_JIZOTAKO 1065
+#define MON_TANUKI 1067
#define MAX_AUTOPICK 1009
-#define DO_AUTOPICK 0x01
-#define DO_AUTODESTROY 0x02
-#define DO_DISPLAY 0x04
-#define DONT_AUTOPICK 0x08
-#define ITEM_DISPLAY 0x10
+#define DO_AUTOPICK 0x01
+#define DO_AUTODESTROY 0x02
+#define DO_DISPLAY 0x04
+#define DONT_AUTOPICK 0x08
+#define ITEM_DISPLAY 0x10
+#define DO_QUERY_AUTOPICK 0x20
+
#define MAGIC_GLOVE_REDUCE_MANA 0x0001
#define MAGIC_FAIL_5PERCENT 0x0002
#define HISSATSU_IAI 100
+/*
+ * Special essence id for Weapon smith
+ */
+#define MIN_SPECIAL_ESSENCE 200
+
+#define ESSENCE_ATTACK (MIN_SPECIAL_ESSENCE + 0)
+#define ESSENCE_AC (MIN_SPECIAL_ESSENCE + 1)
+#define ESSENCE_TMP_RES_ACID (MIN_SPECIAL_ESSENCE + 2)
+#define ESSENCE_TMP_RES_ELEC (MIN_SPECIAL_ESSENCE + 3)
+#define ESSENCE_TMP_RES_FIRE (MIN_SPECIAL_ESSENCE + 4)
+#define ESSENCE_TMP_RES_COLD (MIN_SPECIAL_ESSENCE + 5)
+#define ESSENCE_SH_FIRE (MIN_SPECIAL_ESSENCE + 6)
+#define ESSENCE_SH_ELEC (MIN_SPECIAL_ESSENCE + 7)
+#define ESSENCE_SH_COLD (MIN_SPECIAL_ESSENCE + 8)
+#define ESSENCE_RESISTANCE (MIN_SPECIAL_ESSENCE + 9)
+#define ESSENCE_SUSTAIN (MIN_SPECIAL_ESSENCE + 10)
+#define ESSENCE_SLAY_GLOVE (MIN_SPECIAL_ESSENCE + 11)
-#define ESSENCE_STR 1
-#define ESSENCE_INT 2
-#define ESSENCE_WIS 3
-#define ESSENCE_DEX 4
-#define ESSENCE_CON 5
-#define ESSENCE_CHR 6
-#define ESSENCE_MAGIC_MASTERY 7
-#define ESSENCE_STEALTH 9
-#define ESSENCE_SEARCH 10
-#define ESSENCE_INFRA 11
-#define ESSENCE_TUNNEL 12
-#define ESSENCE_SPEED 13
-#define ESSENCE_BLOWS 14
-#define ESSENCE_CHAOTIC 15
-#define ESSENCE_VAMPIRIC 16
-#define ESSENCE_S_ANIMAL 17
-#define ESSENCE_S_EVIL 18
-#define ESSENCE_S_UNDEAD 19
-#define ESSENCE_S_DEMON 20
-#define ESSENCE_S_ORC 21
-#define ESSENCE_S_TROLL 22
-#define ESSENCE_S_GIANT 23
-#define ESSENCE_S_DRAGON 24
-#define ESSENCE__K__DRAGON 25
-#define ESSENCE_EARTHQUAKE 27
-#define ESSENCE_B_POIS 28
-#define ESSENCE_B_ACID 29
-#define ESSENCE_B_ELEC 30
-#define ESSENCE_B_FIRE 31
-#define ESSENCE_B_COLD 32
-#define ESSENCE_S_STR 33
-#define ESSENCE_IM_ACID 41
-#define ESSENCE_REFLECT 46
-#define ESSENCE_FREE_ACT 47
-#define ESSENCE_HOLD_LIFE 48
-#define ESSENCE_RES_ACID 49
-#define ESSENCE_RES_ELEC 50
-#define ESSENCE_RES_FIRE 51
-#define ESSENCE_RES_COLD 52
-#define ESSENCE_RES_POIS 53
-#define ESSENCE_RES_FEAR 54
-#define ESSENCE_RES_LITE 55
-#define ESSENCE_RES_DARK 56
-#define ESSENCE_RES_BLIND 57
-#define ESSENCE_RES_CONF 58
-#define ESSENCE_RES_SOUND 59
-#define ESSENCE_RES_SHARDS 60
-#define ESSENCE_RES_NETHER 61
-#define ESSENCE_RES_NEXUS 62
-#define ESSENCE_RES_CHAOS 63
-#define ESSENCE_RES_DISEN 64
-#define ESSENCE__SH__FIRE 65
-#define ESSENCE__SH__ELEC 66
-#define ESSENCE__SH__COLD 68
-#define ESSENCE_NO_MAGIC 70
-#define ESSENCE_FEATHER 77
-#define ESSENCE_LITE 78
-#define ESSENCE_SEE_INVIS 79
-#define ESSENCE_TELEPATHY 80
-#define ESSENCE_SLOW_DIGEST 81
-#define ESSENCE_REGEN 82
-#define ESSENCE_TELEPROT 91
-#define ESSENCE_ATTACK 97
-#define ESSENCE_AC 98
-#define ESSENCE_TMP_RES_ACID 99
-#define ESSENCE_TMP_RES_ELEC 100
-#define ESSENCE_TMP_RES_FIRE 101
-#define ESSENCE_TMP_RES_COLD 102
-#define ESSENCE_SH_FIRE 103
-#define ESSENCE_SH_ELEC 104
-#define ESSENCE_SH_COLD 105
-#define ESSENCE_RESISTANCE 106
-#define ESSENCE_SUSTAIN 107
-#define ESSENCE_SLAY_GLOVE 108
-
-#define MAX_ESSENCE 108
-
-#define ESSENCE_MASK1 0xFCFD5F7F
-#define ESSENCE_MASK2 0xFFFFE000
-#define ESSENCE_MASK3 0x0003F020
#define DUNGEON_MODE_NONE 0
#define DUNGEON_MODE_AND 1
#define DUNGEON_DARKNESS 19
+/*
+ * Flags for change floor mode
+ */
+#define CFM_UP 0x0001 /* Move up */
+#define CFM_DOWN 0x0002 /* Move down */
+#define CFM_LONG_STAIRS 0x0004 /* Randomly occurred long stairs/shaft */
+#define CFM_XXX 0x0008 /* XXX */
+#define CFM_SHAFT 0x0010 /* Shaft */
+#define CFM_RAND_PLACE 0x0020 /* Arrive at random grid */
+#define CFM_RAND_CONNECT 0x0040 /* Connect with random stairs */
+#define CFM_CLEAR_ALL 0x0080 /* Reach to the surface/Recall/Alter reality */
+#define CFM_NO_RETURN 0x0100 /* Flee from random quest etc... */
+
+
+/*
+ * Flags for save/load temporal saved floor file
+ */
+#define SLF_SECOND 0x0001 /* Called from another save/load function */
+#define SLF_NO_KILL 0x0002 /* Don't kill temporal files */
+
+
+/*
+ * Flags for wr_item()/rd_item()
+ */
+#define SAVE_ITEM_PVAL 0x00000001
+#define SAVE_ITEM_DISCOUNT 0x00000002
+#define SAVE_ITEM_NUMBER 0x00000004
+#define SAVE_ITEM_NAME1 0x00000008
+#define SAVE_ITEM_NAME2 0x00000010
+#define SAVE_ITEM_TIMEOUT 0x00000020
+#define SAVE_ITEM_TO_H 0x00000040
+#define SAVE_ITEM_TO_D 0x00000080
+#define SAVE_ITEM_TO_A 0x00000100
+#define SAVE_ITEM_AC 0x00000200
+#define SAVE_ITEM_DD 0x00000400
+#define SAVE_ITEM_DS 0x00000800
+#define SAVE_ITEM_IDENT 0x00001000
+#define SAVE_ITEM_MARKED 0x00002000
+#define SAVE_ITEM_ART_FLAGS0 0x00004000
+#define SAVE_ITEM_ART_FLAGS1 0x00008000
+#define SAVE_ITEM_ART_FLAGS2 0x00010000
+#define SAVE_ITEM_ART_FLAGS3 0x00020000
+#define SAVE_ITEM_CURSE_FLAGS 0x00040000
+#define SAVE_ITEM_HELD_M_IDX 0x00080000
+#define SAVE_ITEM_XTRA1 0x00100000
+#define SAVE_ITEM_XTRA2 0x00200000
+#define SAVE_ITEM_XTRA3 0x00400000
+#define SAVE_ITEM_XTRA4 0x00800000
+#define SAVE_ITEM_XTRA5 0x01000000
+#define SAVE_ITEM_FEELING 0x02000000
+#define SAVE_ITEM_INSCRIPTION 0x04000000
+#define SAVE_ITEM_ART_NAME 0x08000000
+
+
+/*
+ * Flags for wr_monster()/rd_monster()
+ */
+#define SAVE_MON_AP_R_IDX 0x00000001
+#define SAVE_MON_SUB_ALIGN 0x00000002
+#define SAVE_MON_CSLEEP 0x00000004
+#define SAVE_MON_FAST 0x00000008
+#define SAVE_MON_SLOW 0x00000010
+#define SAVE_MON_STUNNED 0x00000020
+#define SAVE_MON_CONFUSED 0x00000040
+#define SAVE_MON_MONFEAR 0x00000080
+#define SAVE_MON_TARGET_Y 0x00000100
+#define SAVE_MON_TARGET_X 0x00000200
+#define SAVE_MON_INVULNER 0x00000400
+#define SAVE_MON_SMART 0x00000800
+#define SAVE_MON_EXP 0x00001000
+#define SAVE_MON_MFLAG2 0x00002000
+#define SAVE_MON_NICKNAME 0x00004000
+
+
+/*
+ * Constant for kinds of mimic
+ */
#define MIMIC_NONE 0
#define MIMIC_DEMON 1
#define MIMIC_DEMON_LORD 2
#define prace_is_(A) (!p_ptr->mimic_form && (p_ptr->prace == A))
+/* Sub-alignment flags for neutral monsters */
+#define SUB_ALIGN_NEUTRAL 0x0000
+#define SUB_ALIGN_EVIL 0x0001
+#define SUB_ALIGN_GOOD 0x0002
/*
* World Score -- internet resource value
#define MAX_MACRO_TRIG 200
#define SCREEN_BUF_SIZE 65536 /* max screen dump buffer size */
+