OSDN Git Service

自動拾い関係の関数の名前を統一的に改名。全て「autopick」のキーワードを含むようにした。
[hengband/hengband.git] / src / defines.h
index 65f31a4..94a4643 100644 (file)
  */
 #define VERSION_NAME "Hengband"
 
-/* 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 2
 
-/* Added for ZAngband */
+/*
+ * "Program Version Number" of the game
+ *
+ * FAKE_VER_MAJOR=1,2 were reserved for ZAngband version 1.x.x/2.x.x .
+ *
+ * Program Version of Hengband version is
+ *   "(FAKE_VER_MAJOR-10).(FAKE_VER_MINOR).(FAKE_VER_PATCH)".
+ */
 #define FAKE_VERSION   0
 #define FAKE_VER_MAJOR 11
-#define FAKE_VER_MINOR 5
-#define FAKE_VER_PATCH 2
+#define FAKE_VER_MINOR 7
+#define FAKE_VER_PATCH 0
+
+
+/*
+ * "Savefile Version Number" for Hengband 1.1.1 and later
+ *
+ * First three digits may be same as the Program Version.  But not
+ * always same.  It means that newer version may preserves lower
+ * compatibility with the older version.
+ *
+ * For example, newer Hengband 1.4.4 creates savefiles marked with
+ * Savefile Version 1.4.0.0 .  It means that Hengband 1.4.0 can load a
+ * savefile of Hengband 1.4.4 (lower compatibility!).
+ *
+ * Upper compatibility is always guaranteed.
+ */
+#define H_VER_MAJOR 1
+#define H_VER_MINOR 7
+#define H_VER_PATCH 0
+#define H_VER_EXTRA 1
+
 
 #define ANGBAND_2_8_1
 #define ZANGBAND
 #define LITE_MAX 600
 
 /*
+ * Maximum size of the "mon_lite" array (see "cave.c")
+ * Note that the "view radius" will NEVER exceed 20, monster illumination
+ * flags are dependent on CAVE_VIEW, and even if the "view" was octagonal,
+ * we would never require more than 1520 entries in the array.
+ */
+#define MON_LITE_MAX 1536
+
+/*
  * Maximum size of the "view" array (see "cave.c")
  * Note that the "view radius" will NEVER exceed 20, and even if the "view"
  * was octagonal, we would never require more than 1520 entries in the array.
  * must also be large enough to allow "good enough" use as a circular queue,
  * to calculate monster flow, but note that the flow code is "paranoid".
  */
-#define TEMP_MAX 1536
+#define TEMP_MAX 2298
+
+/*
+ * Maximum size of the "redraw" array (see "cave.c")
+ * We must be large for proper functioning of delayed redrawing.
+ * We must also be as large as two times of the largest view area.
+ * Note that maximum view grids are 1149 entries.
+ */
+#define REDRAW_MAX 2298
 
 
 /*
 #define FEAT_MIRROR             0xc3
 
 /* unknown grid (not detected)  */
-#define FEAT_UNDETECT         0xc4
+#define FEAT_UNDETECTED         0xc4
 
 /* special traps */
 #define FEAT_TRAP_ARMAGEDDON    0xc5
 #define ART_MAGATAMA             149
 #define ART_INROU                166
 #define ART_NIGHT                215
+#define ART_SACRED_KNIGHTS       217
+#define ART_HELL                 218
+#define ART_CHARMED              219
+#define ART_GOGO                 220
 
 /* Rings */
 #define ART_FRAKIR               8
 #define TV_STAFF        55
 #define TV_WAND         65
 #define TV_ROD          66
-#define TV_PARCHEMENT   69
+#define TV_PARCHMENT    69
 #define TV_SCROLL       70
 #define TV_POTION       75
 #define TV_FLASK        77
 #define TV_HISSATSU_BOOK 106
 #define TV_GOLD         127     /* Gold can only be picked up by players */
 
+#define TV_EQUIP_BEGIN    TV_SHOT
+#define TV_EQUIP_END      TV_CARD
+#define TV_MISSILE_BEGIN  TV_SHOT
+#define TV_MISSILE_END    TV_BOLT
+#define TV_WEARABLE_BEGIN TV_BOW
+#define TV_WEARABLE_END   TV_CARD
+#define TV_WEAPON_BEGIN   TV_BOW
+#define TV_WEAPON_END     TV_SWORD
+#define TV_ARMOR_BEGIN    TV_BOOTS
+#define TV_ARMOR_END      TV_DRAG_ARMOR
+
 /* Any subvalue */
 #define SV_ANY                                         255
 
 #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_XXX0       0x8000    /* Now unused */
+#define CAVE_MNLT       0x0100    /* Illuminated by monster */
+#define CAVE_MNDK       0x8000    /* Darken by monster */
 
 /* Used only while cave generation */
 #define CAVE_FLOOR      0x0200
 
 /* Used only after cave generation */
 #define CAVE_XXXX1      0x0200
-#define CAVE_XXXX2      0x0400
-#define CAVE_XXXX3      0x0800
-#define CAVE_OBJECT  0x1000    /* mirror */
+#define CAVE_NOTE       0x0400    /* Flag for delayed visual update (needs note_spot()) */
+#define CAVE_REDRAW     0x0800    /* Flag for delayed visual update (needs lite_spot()) */
+#define CAVE_OBJECT     0x1000    /* Mirror, glyph, etc. */
 #define CAVE_UNSAFE     0x2000    /* Might have trap */
 #define CAVE_IN_DETECT  0x4000    /* trap detected area (inner circle only) */
 
 
-/* Room types for generate_lake() */
-#define GEN_LAKE_TYPE_LAVA        1
-#define GEN_LAKE_TYPE_WATER       2
-#define GEN_LAKE_TYPE_CAVE        3
-#define GEN_LAKE_TYPE_EARTH_VAULT 4
-#define GEN_LAKE_TYPE_AIR_VAULT   5
-#define GEN_LAKE_TYPE_WATER_VAULT 6
-#define GEN_LAKE_TYPE_FIRE_VAULT  7
-
-
-/* Room types for room_build() */
-#define ROOM_BUILD_TYPE_NORMAL         1
-#define ROOM_BUILD_TYPE_OVERLAP        2
-#define ROOM_BUILD_TYPE_CROSS          3
-#define ROOM_BUILD_TYPE_INNER_FEAT     4
-#define ROOM_BUILD_TYPE_NEST           5
-#define ROOM_BUILD_TYPE_PIT            6
-#define ROOM_BUILD_TYPE_LESSER_VAULT   7
-#define ROOM_BUILD_TYPE_GREATER_VAULT  8
-#define ROOM_BUILD_TYPE_FRACAVE        9
-#define ROOM_BUILD_TYPE_RANDOM_VAULT  10
-#define ROOM_BUILD_TYPE_OVAL          11
-#define ROOM_BUILD_TYPE_CRYPT         12
-#define ROOM_BUILD_TYPE_TRAP_PIT      13
-#define ROOM_BUILD_TYPE_TRAP          14
-
-
 /*
  * Bit flags for the "project()" function
  *
  *   ITEM: Affect each object in the "blast area" in some way
  *   KILL: Affect each monster in the "blast area" in some way
  *   HIDE: Hack -- disable "visual" feedback from projection
+ *   DISI: Disintegrate non-permanent features
+ *   PLAYER: Main target is player (used for riding player)
+ *   AIMED: Target is only player or monster, so don't affect another.
+ *          Depend on PROJECT_PLAYER.
+ *          (used for minimum (rad == 0) balls on riding player)
+ *   REFLECTABLE: Refrectable spell attacks (used for "bolts")
+ *   NO_HANGEKI: Avoid counter attacks of monsters
+ *   PATH: Only used for printing project path
+ *   FAST: Hide "visual" of flying bolts until blast
  */
 #define PROJECT_JUMP        0x01
 #define PROJECT_BEAM        0x02
 #define PROJECT_HIDE        0x80
 #define PROJECT_DISI        0x100
 #define PROJECT_PLAYER      0x200
-#define PROJECT_MONSTER     0x400
+#define PROJECT_AIMED       0x400
 #define PROJECT_REFLECTABLE 0x800
 #define PROJECT_NO_HANGEKI  0x1000
 #define PROJECT_PATH        0x2000
 #define PU_VIEW         0x00100000L     /* Update view */
 #define PU_LITE         0x00200000L     /* Update lite */
 #define PU_MON_LITE     0x00400000L     /* Monster illumination */
-/* xxx */
+#define PU_DELAY_VIS    0x00800000L     /* Mega-Hack -- Delayed visual update */
 #define PU_MONSTERS     0x01000000L     /* Update monsters */
 #define PU_DISTANCE     0x02000000L     /* Update distances */
 /* xxx */
 #define PM_ALLOW_UNIQUE   0x00000040
 #define PM_IGNORE_TERRAIN 0x00000080
 #define PM_HASTE          0x00000100
+#define PM_KAGE           0x00000200
 
 
 /* Bit flags for monster_desc() */
 #define MD_ASSUME_VISIBLE 0x00000080 /* Assume the monster is visible */
 #define MD_TRUE_NAME      0x00000100 /* Chameleon's true name */
 #define MD_IGNORE_HALLU   0x00000200 /* Ignore hallucination, and penetrate shape change */
-#define MD_ASSUME_OUTSIDE 0x00000400 /* Assume this monster pet waiting outside the floor */
 
 /*
  * Bit flags for the "p_ptr->special_attack" variable. -LM-
 #define ACTION_SING     7
 #define ACTION_HAYAGAKE 8
 
+
+/* Empty hand status */
+#define EMPTY_HAND_NONE 0x0000 /* Both hands are used */
+#define EMPTY_HAND_LARM 0x0001 /* Left hand is empty */
+#define EMPTY_HAND_RARM 0x0002 /* Right hand is empty */
+
 /*** General index values ***/
 
 
  * 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().
+ *              already printed in autopick_pickup_items().
  */
 #define OM_FOUND        0x01    /* original boolean flag */
 #define OM_NOMSG        0x02    /* temporary flag to suppress messages */
 #define RF3_HURT_ROCK       0x00002000  /* Hurt by rock remover */
 #define RF3_HURT_FIRE       0x00004000  /* Hurt badly by fire */
 #define RF3_HURT_COLD       0x00008000  /* Hurt badly by cold */
-#define RF3_IM_ACID         0x00010000  /* Resist acid a lot */
-#define RF3_IM_ELEC         0x00020000  /* Resist elec a lot */
-#define RF3_IM_FIRE         0x00040000  /* Resist fire a lot */
-#define RF3_IM_COLD         0x00080000  /* Resist cold a lot */
-#define RF3_IM_POIS         0x00100000  /* Resist poison a lot */
-#define RF3_RES_TELE        0x00200000  /* Resist teleportation */
-#define RF3_RES_NETH        0x00400000  /* Resist nether a lot */
-#define RF3_RES_WATE        0x00800000  /* Resist water */
-#define RF3_RES_PLAS        0x01000000  /* Resist plasma */
-#define RF3_RES_NEXU        0x02000000  /* Resist nexus */
-#define RF3_RES_DISE        0x04000000  /* Resist disenchantment */
-#define RF3_RES_ALL         0x08000000  /* Resist all */
+#define RF3_XXX16           0x00010000
+#define RF3_XXX17           0x00020000
+#define RF3_XXX18           0x00040000
+#define RF3_XXX19           0x00080000
+#define RF3_XXX20           0x00100000
+#define RF3_XXX21           0x00200000
+#define RF3_XXX22           0x00400000
+#define RF3_XXX23           0x00800000
+#define RF3_XXX24           0x01000000
+#define RF3_XXX25           0x02000000
+#define RF3_XXX26           0x04000000
+#define RF3_XXX27           0x08000000
 #define RF3_NO_FEAR         0x10000000  /* Cannot be scared */
 #define RF3_NO_STUN         0x20000000  /* Cannot be stunned */
-#define RF3_NO_CONF         0x40000000  /* Cannot be confused */
+#define RF3_NO_CONF         0x40000000  /* Cannot be confused and resist confusion */
 #define RF3_NO_SLEEP        0x80000000  /* Cannot be slept */
 
 /*
 #define RF7_CAN_SWIM            0x00000002  /* Monster can swim */
 #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_NAZGUL              0x00000010  /* Is a "Nazgul" unique */
 #define RF7_UNIQUE2             0x00000020  /* Fake unique */
 #define RF7_RIDING              0x00000040  /* Good for riding */
 #define RF7_KAGE                0x00000080  /* Is kage */
 #define RF7_CHAMELEON           0x00002000  /* Chameleon can change */
 #define RF7_KILL_EXP            0x00004000  /* No exp until you kill it */
 #define RF7_TANUKI              0x00008000  /* Tanuki disguise */
+#define RF7_HAS_DARK_1          0x00010000  /* Monster carries darkness */
+#define RF7_SELF_DARK_1         0x00020000  /* Monster darkens itself */
+#define RF7_HAS_DARK_2          0x00040000  /* Monster carries darkness */
+#define RF7_SELF_DARK_2         0x00080000  /* Monster darkens itself */
 
 /*
  * Monster race flags
 /*
  * Monster drop info
  */
-
 #define RF9_DROP_CORPSE         0x00000001
 #define RF9_DROP_SKELETON       0x00000002
 #define RF9_EAT_BLIND           0x00000004
 #define RF9_EAT_LOSE_CHR        0x40000000
 #define RF9_EAT_DRAIN_MANA      0x80000000
 
+/*
+ * Monster bit flags of racial resistances
+ * Note: Resist confusion was merged to RFR_NO_CONF
+ */
+#define RFR_IM_ACID         0x00000001  /* Resist acid */
+#define RFR_IM_ELEC         0x00000002  /* Resist elec */
+#define RFR_IM_FIRE         0x00000004  /* Resist fire */
+#define RFR_IM_COLD         0x00000008  /* Resist cold */
+#define RFR_IM_POIS         0x00000010  /* Resist poison */
+#define RFR_RES_LITE        0x00000020  /* Resist lite */
+#define RFR_RES_DARK        0x00000040  /* Resist dark */
+#define RFR_RES_NETH        0x00000080  /* Resist nether */
+#define RFR_RES_WATE        0x00000100  /* Resist water */
+#define RFR_RES_PLAS        0x00000200  /* Resist plasma */
+#define RFR_RES_SHAR        0x00000400  /* Resist shards */
+#define RFR_RES_SOUN        0x00000800  /* Resist sound */
+#define RFR_RES_CHAO        0x00001000  /* Resist chaos */
+#define RFR_RES_NEXU        0x00002000  /* Resist nexus */
+#define RFR_RES_DISE        0x00004000  /* Resist disenchantment */
+#define RFR_RES_WALL        0x00008000  /* Resist force */
+#define RFR_RES_INER        0x00010000  /* Resist inertia */
+#define RFR_RES_TIME        0x00020000  /* Resist time */
+#define RFR_RES_GRAV        0x00040000  /* Resist gravity */
+#define RFR_RES_ALL         0x00080000  /* Resist all */
+#define RFR_RES_TELE        0x00100000  /* Resist teleportation */
+#define RFR_XXX21           0x00200000
+#define RFR_XXX22           0x00400000
+#define RFR_XXX23           0x00800000
+#define RFR_XXX24           0x01000000
+#define RFR_XXX25           0x02000000
+#define RFR_XXX26           0x04000000
+#define RFR_XXX27           0x08000000
+#define RFR_XXX28           0x10000000
+#define RFR_XXX29           0x20000000
+#define RFR_XXX30           0x40000000
+#define RFR_XXX31           0x80000000
+
 
 /*
  * Hack -- choose "intelligent" spells when desperate
 #define RF6_NOMAGIC_MASK \
        (RF6_BREATH_MASK | RF6_SPECIAL)
 
+/*
+ * Hack -- "torch" masks
+ */
+#define RF7_LITE_MASK \
+       (RF7_HAS_LITE_1 | RF7_SELF_LITE_1 | RF7_HAS_LITE_2 | RF7_SELF_LITE_2)
+
+#define RF7_DARK_MASK \
+       (RF7_HAS_DARK_1 | RF7_SELF_DARK_1 | RF7_HAS_DARK_2 | RF7_SELF_DARK_2)
+
+#define RF7_HAS_LD_MASK \
+       (RF7_HAS_LITE_1 | RF7_HAS_LITE_2 | RF7_HAS_DARK_1 | RF7_HAS_DARK_2)
+
+#define RF7_SELF_LD_MASK \
+       (RF7_SELF_LITE_1 | RF7_SELF_LITE_2 | RF7_SELF_DARK_1 | RF7_SELF_DARK_2)
+
+/*
+ * Hack -- effective elemental and poison immunity mask
+ */
+#define RFR_EFF_IM_ACID_MASK  (RFR_IM_ACID | RFR_RES_ALL)
+#define RFR_EFF_IM_ELEC_MASK  (RFR_IM_ELEC | RFR_RES_ALL)
+#define RFR_EFF_IM_FIRE_MASK  (RFR_IM_FIRE | RFR_RES_ALL)
+#define RFR_EFF_IM_COLD_MASK  (RFR_IM_COLD | RFR_RES_ALL)
+#define RFR_EFF_IM_POIS_MASK  (RFR_IM_POIS | RFR_RES_ALL)
+#define RFR_EFF_RES_SHAR_MASK (RFR_RES_SHAR | RFR_RES_ALL)
+#define RFR_EFF_RES_CHAO_MASK (RFR_RES_CHAO | RFR_RES_ALL)
+#define RFR_EFF_RES_NEXU_MASK (RFR_RES_NEXU | RFR_RES_ALL)
+
 
 #define MR1_SINKA 0x01
 
 #define is_hostile(A) \
         (bool)((is_friendly(A) || is_pet(A)) ? FALSE : TRUE)
 
+/* Hack -- Determine monster race appearance index is same as race index */
+#define is_original_ap(A) \
+        (bool)(((A)->ap_r_idx == (A)->r_idx) ? TRUE : FALSE)
+
+
+/*** Option Definitions ***/
+
+
+#define OPT_PAGE_INPUT          1
+#define OPT_PAGE_OUTPUT         2
+#define OPT_PAGE_GAMEPLAY       3
+#define OPT_PAGE_DISTURBANCE    4
+#define OPT_PAGE_EFFICIENCY     5
+#define OPT_PAGE_BIRTH          6
+#define OPT_PAGE_AUTODESTROY    7
+#define OPT_PAGE_PLAYRECORD    10
+
+#define OPT_PAGE_JAPANESE_ONLY 99
+
 
 /*** Macro Definitions ***/
 
    ((X) >= panel_col_min) && ((X) <= panel_col_max))
 
 
+/*
+ * Determine if player is on this grid
+ */
+#define player_bold(Y,X) \
+       (((Y) == py) && ((X) == px))
+
+
+/*
+ * Grid based version of "player_bold()"
+ */
+#define player_grid(C) \
+       ((C) == &cave[py][px])
+
+
+/*
+ * Determine if a "feature" is a "floor"
+ */
+#define feat_floor(F) \
+       (!((F) & 0x20))
+
 
 /*
  * Determine if a "legal" grid is a "floor" grid
  * -KMW-
  */
 #define cave_floor_bold(Y,X) \
-       (!(cave[Y][X].feat & 0x20))
+       (feat_floor(cave[(Y)][(X)].feat))
 
 
 /*
 #define cave_empty_bold(Y,X) \
     (cave_floor_bold(Y,X) && \
      !(cave[Y][X].m_idx) && \
-     !(((Y) == py) && ((X) == px)))
+     !player_bold(Y,X))
 
 
 /*
 #define cave_empty_bold2(Y,X) \
     (((cave_floor_bold(Y,X) && (cave[Y][X].feat != FEAT_DARK_PIT)) || (character_dungeon && (cave[Y][X].feat == FEAT_TREES)))&& \
      !(cave[Y][X].m_idx) && \
-     !(((Y) == py) && ((X) == px)))
+     !player_bold(Y,X))
 
 
 /*
 #define cave_perma_bold(Y,X) \
        (((cave[Y][X].feat >= FEAT_PERM_EXTRA) && \
          (cave[Y][X].feat <= FEAT_PERM_SOLID)) || \
-        ((cave[Y][X].feat == FEAT_LESS) || \
-         (cave[Y][X].feat == FEAT_MORE) || \
-         (cave[Y][X].feat == FEAT_ENTRANCE)) || \
-        ((cave[Y][X].feat == FEAT_LESS_LESS) || \
-         (cave[Y][X].feat == FEAT_MORE_MORE)) || \
-        ((cave[Y][X].feat >= FEAT_BLDG_HEAD) && \
-         (cave[Y][X].feat <= FEAT_BLDG_TAIL)) || \
+        (cave[Y][X].feat == FEAT_LESS) || \
+        (cave[Y][X].feat == FEAT_MORE) || \
+        (cave[Y][X].feat == FEAT_ENTRANCE) || \
+        (cave[Y][X].feat == FEAT_LESS_LESS) || \
+        (cave[Y][X].feat == FEAT_MORE_MORE) || \
+        (cave[Y][X].feat == FEAT_MOUNTAIN) || \
+        ((cave[Y][X].feat >= FEAT_QUEST_ENTER) && \
+         (cave[Y][X].feat <= FEAT_QUEST_UP)) || \
+        ((cave[Y][X].feat >= FEAT_PATTERN_START) && \
+         (cave[Y][X].feat <= FEAT_PATTERN_XTRA2)) || \
         ((cave[Y][X].feat >= FEAT_SHOP_HEAD) && \
          (cave[Y][X].feat <= FEAT_SHOP_TAIL)) || \
-         (cave[Y][X].feat == FEAT_MUSEUM))
+        (cave[Y][X].feat == FEAT_MUSEUM) || \
+        ((cave[Y][X].feat >= FEAT_BLDG_HEAD) && \
+         (cave[Y][X].feat <= FEAT_BLDG_TAIL)))
 
 
 /*
  * Grid based version of "cave_floor_bold()"
  */
 #define cave_floor_grid(C) \
-    (!((C)->feat & 0x20))
+       (feat_floor((C)->feat))
 
 
 /*
 #define cave_empty_grid(C) \
     (cave_floor_grid(C) && \
      !((C)->m_idx) && \
-     !((C) == &cave[py][px]))
+     !player_grid(C))
 
 /*
  * Grid based version of "cave_empty_bold()"
 #define cave_empty_grid2(C) \
     ((cave_floor_grid(C) || ((C)->feat == FEAT_TREES)) && \
      !((C)->m_idx) && \
-     !((C) == &cave[py][px]))
+     !player_grid(C))
 
 /*
  * Grid based version of "cave_empty_bold()"
     (((C)->feat == FEAT_FLOOR) && \
      !((C)->o_idx) && \
      !((C)->m_idx) && \
-     !((C) == &cave[py][px]))
+     !player_grid(C))
 
 
 /*
 #define cave_perma_grid(C) \
        ((((C)->feat >= FEAT_PERM_EXTRA) && \
          ((C)->feat <= FEAT_PERM_SOLID)) || \
-         ((C)->feat == FEAT_LESS) || \
-         ((C)->feat == FEAT_MORE) || \
-         ((C)->feat == FEAT_ENTRANCE) || \
-         ((C)->feat == FEAT_LESS_LESS) || \
-         ((C)->feat == FEAT_MORE_MORE) || \
-         ((C)->feat == FEAT_MOUNTAIN) || \
+        ((C)->feat == FEAT_LESS) || \
+        ((C)->feat == FEAT_MORE) || \
+        ((C)->feat == FEAT_ENTRANCE) || \
+        ((C)->feat == FEAT_LESS_LESS) || \
+        ((C)->feat == FEAT_MORE_MORE) || \
+        ((C)->feat == FEAT_MOUNTAIN) || \
         (((C)->feat >= FEAT_QUEST_ENTER) && \
          ((C)->feat <= FEAT_QUEST_UP)) || \
         (((C)->feat >= FEAT_PATTERN_START) && \
          ((C)->feat <= FEAT_PATTERN_XTRA2)) || \
         (((C)->feat >= FEAT_SHOP_HEAD) && \
          ((C)->feat <= FEAT_SHOP_TAIL)) || \
-         ((C)->feat == FEAT_MUSEUM) || \
+        ((C)->feat == FEAT_MUSEUM) || \
         (((C)->feat >= FEAT_BLDG_HEAD) && \
          ((C)->feat <= FEAT_BLDG_TAIL)))
 
  * Determine if a "boundary" grid is "floor mimic"
  */
 #define boundary_floor_bold(Y,X) \
-    ((cave[(Y)][(X)].feat == FEAT_PERM_SOLID) && \
-      cave[(Y)][(X)].mimic && \
-    !(cave[(Y)][(X)].mimic & 0x20))
+       ((cave[(Y)][(X)].feat == FEAT_PERM_SOLID) && \
+         cave[(Y)][(X)].mimic && feat_floor(cave[(Y)][(X)].mimic))
 
 #define boundary_floor_grid(C) \
-    (((C)->feat == FEAT_PERM_SOLID) && \
-      (C)->mimic && \
-    !((C)->mimic & 0x20))
+       (((C)->feat == FEAT_PERM_SOLID) && \
+         (C)->mimic && feat_floor((C)->mimic))
+
+/*
+ * Get feature mimic from f_info[] (applying "mimic" field)
+ */
+#define get_feat_mimic(C) \
+       (f_info[(C)->mimic ? (C)->mimic : (C)->feat].mimic)
 
 #define update_playtime() \
 {\
@@ -4342,7 +4497,7 @@ extern int PlayerUID;
 #define BACT_GREET_KING              4
 #define BACT_KING_LEGENDS            5
 #define BACT_QUEST                   6
-#define BACT_GOLD                    7
+#define BACT_XXX_UNUSED              7
 #define BACT_POSTER                  8
 #define BACT_ARENA_RULES             9
 #define BACT_ARENA                  10
@@ -4834,8 +4989,10 @@ extern int PlayerUID;
 #define MON_SHARD_VOR     897
 #define MON_MASTER_MYS    916
 #define MON_G_MASTER_MYS  917
+#define MON_IE            921
 #define MON_TSUCHINOKO    926
 #define MON_GCWADL        929
+#define MON_LOCKE_CLONE   930
 #define MON_CALDARM       931
 #define MON_BANORLUPART   932
 #define MON_BANOR         933
@@ -4883,7 +5040,9 @@ extern int PlayerUID;
 #define MON_JIZOTAKO      1065
 #define MON_TANUKI        1067
 
-#define MAX_AUTOPICK 1009
+/* Maximum "Nazguls" number */
+#define MAX_NAZGUL_NUM 5
+
 #define DO_AUTOPICK       0x01
 #define DO_AUTODESTROY    0x02
 #define DO_DISPLAY        0x04
@@ -5065,8 +5224,9 @@ extern int PlayerUID;
 #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_SAVE_FLOORS  0x0080  /* Save floors */
 #define CFM_NO_RETURN    0x0100  /* Flee from random quest etc... */
+#define CFM_FIRST_FLOOR  0x0200  /* Create exit from the dungeon */
 
 
 /*
@@ -5127,6 +5287,7 @@ extern int PlayerUID;
 #define SAVE_MON_EXP          0x00001000
 #define SAVE_MON_MFLAG2       0x00002000
 #define SAVE_MON_NICKNAME     0x00004000
+#define SAVE_MON_PARENT       0x00008000
 
 
 /*
@@ -5164,17 +5325,38 @@ extern int PlayerUID;
 #define IS_TIM_ESP() (p_ptr->tim_esp || music_singing(MUSIC_MIND))
 #define IS_TIM_STEALTH() (p_ptr->tim_stealth || music_singing(MUSIC_STEALTH))
 
+/* Is "teleport level" ineffective to this target? */
+#define TELE_LEVEL_IS_INEFF(TARGET) \
+       (p_ptr->inside_arena || p_ptr->inside_battle || \
+        (p_ptr->inside_quest && !random_quest_number(dun_level)) || \
+        (((TARGET) <= 0) && (quest_number(dun_level) || (dun_level >= d_info[dungeon_type].maxdepth)) && \
+         (dun_level >= 1) && ironman_downward))
+
+
 /*
- * World Score -- internet resource value
+ * Max numbers of macro trigger names
  */
-#define HTTP_PROXY ""                   /* Default proxy url */
-#define HTTP_PROXY_PORT 0               /* Default proxy port */
-#define HTTP_TIMEOUT    20              /* Timeout length (second) */
-#define SCORE_SERVER "www.kmc.gr.jp"    /* Default score server url */
-#define SCORE_PORT 80                   /* Default score server port */
-
 #define MAX_MACRO_MOD 12
 #define MAX_MACRO_TRIG 200
 
-#define SCREEN_BUF_SIZE 65536           /* max screen dump buffer size */
+/* Max size of screen dump buffer */
+#define SCREEN_BUF_SIZE 65536
+
+
+/*
+ * Special key code used for inkey_special()
+ */
+#define SKEY_MOD_MASK     0x0f00
+#define SKEY_MOD_SHIFT    0x0100
+#define SKEY_MOD_CONTROL  0x0200
+
+#define SKEY_MASK         0xf000
+#define SKEY_DOWN        0xf001
+#define SKEY_LEFT        0xf002
+#define SKEY_RIGHT       0xf003
+#define SKEY_UP          0xf004
+#define SKEY_PGUP        0xf005
+#define SKEY_PGDOWN      0xf006
+#define SKEY_TOP         0xf007
+#define SKEY_BOTTOM      0xf008