OSDN Git Service

自動拾い関係の関数の名前を統一的に改名。全て「autopick」のキーワードを含むようにした。
[hengband/hengband.git] / src / defines.h
index c477219..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 3
 
-/* 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_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 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 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 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 ***/
 
 
 
 /*
+ * Determine if a "feature" is a "floor"
+ */
+#define feat_floor(F) \
+       (!((F) & 0x20))
+
+
+/*
  * Determine if a "legal" grid is a "floor" grid
  *
  * Line 1 -- forbid doors, rubble, seams, walls
  * -KMW-
  */
 #define cave_floor_bold(Y,X) \
-       (!(cave[Y][X].feat & 0x20))
+       (feat_floor(cave[(Y)][(X)].feat))
 
 
 /*
  * Grid based version of "cave_floor_bold()"
  */
 #define cave_floor_grid(C) \
-    (!((C)->feat & 0x20))
+       (feat_floor((C)->feat))
 
 
 /*
  * 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() \
 {\
@@ -4426,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
@@ -4918,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
@@ -4967,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
@@ -5149,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 */
 
 
 /*
@@ -5211,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
 
 
 /*
@@ -5248,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