OSDN Git Service

Add Doxygen comment to quest definition in defines.h.
[hengband/hengband.git] / src / defines.h
index 17eef8d..dfa80e5 100644 (file)
-/* 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 */
-
-
-/*
- * Do not edit this file unless you know *exactly* what you are doing.
- *
- * Some of the values in this file were chosen to preserve game balance,
- * while others are hard-coded based on the format of old save-files, the
- * definition of arrays in various places, mathematical properties, fast
- * computation, storage limits, or the format of external text files.
- *
- * Changing some of these values will induce crashes or memory errors or
- * savefile mis-reads.  Most of the comments in this file are meant as
- * reminders, not complete descriptions, and even a complete knowledge
- * of the source may not be sufficient to fully understand the effects
- * of changing certain definitions.
- *
- * Lastly, note that the code does not always use the symbolic constants
- * below, and sometimes uses various hard-coded values that may not even
- * be defined in this file, but which may be related to definitions here.
- * This is of course bad programming practice, but nobody is perfect...
- *
- * For example, there are MANY things that depend on the screen being
- * 80x24, with the top line used for messages, the bottom line being
- * used for status, and exactly 22 lines used to show the dungeon.
- * Just because your screen can hold 46 lines does not mean that the
- * game will work if you try to use 44 lines to show the dungeon.
- *
- * You have been warned.
- */
-
-
-/*
- * Name of the version/variant
- */
-#define VERSION_NAME "Hengband"
-
-
-/*
- * "Program Version Number" of the game
- *
+/*!
+ *  @file defines.h
+ *  @brief 主要なマクロ定義ヘッダ / Purpose: global constants and macro definitions
+ *  @date 2014/01/02
+ *  @author
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
+ *\n
+ * This software may be copied and distributed for educational, research,\n
+ * and not for profit purposes provided that this copyright and statement\n
+ * are included in all such copies.  Other copyrights may also apply.\n
+ *  @details
+ * Do not edit this file unless you know *exactly* what you are doing.\n
+ *\n
+ * Some of the values in this file were chosen to preserve game balance,\n
+ * while others are hard-coded based on the format of old save-files, the\n
+ * definition of arrays in various places, mathematical properties, fast\n
+ * computation, storage limits, or the format of external text files.\n
+ *\n
+ * Changing some of these values will induce crashes or memory errors or\n
+ * savefile mis-reads.  Most of the comments in this file are meant as\n
+ * reminders, not complete descriptions, and even a complete knowledge\n
+ * of the source may not be sufficient to fully understand the effects\n
+ * of changing certain definitions.\n
+ *\n
+ * Lastly, note that the code does not always use the symbolic constants\n
+ * below, and sometimes uses various hard-coded values that may not even\n
+ * be defined in this file, but which may be related to definitions here.\n
+ * This is of course bad programming practice, but nobody is perfect...\n
+ *\n
+ * For example, there are MANY things that depend on the screen being\n
+ * 80x24, with the top line used for messages, the bottom line being\n
+ * used for status, and exactly 22 lines used to show the dungeon.\n
+ * Just because your screen can hold 46 lines does not mean that the\n
+ * game will work if you try to use 44 lines to show the dungeon.\n
+ *\n
+ * You have been warned.\n
+ */
+
+#define VERSION_NAME "Hengband" /*!< バリアント名称 / Name of the version/variant */
+
+/*!
+ * @brief ゲームのバージョン番号定義 / "Program Version Number" of the game
+ * @details
+ * 本FAKE_VERSIONそのものは未使用である。Zangと整合性を合わせるための疑似的処理のためFAKE_VER_MAJORは実値-10が該当のバージョン番号となる。
+ * <pre>
  * 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)".
+ * </pre>
  */
 #define FAKE_VERSION   0
-#define FAKE_VER_MAJOR 11
-#define FAKE_VER_MINOR 7
-#define FAKE_VER_PATCH 0
 
+#define FAKE_VER_MAJOR 12 /*!< ゲームのバージョン番号定義(メジャー番号 + 10) */
+#define FAKE_VER_MINOR 1 /*!< ゲームのバージョン番号定義(マイナー番号) */
+#define FAKE_VER_PATCH 5 /*!< ゲームのバージョン番号定義(パッチ番号) */
 
-/*
- * "Savefile Version Number" for Hengband 1.1.1 and later
- *
+
+/*!
+ * @brief セーブファイル上のバージョン定義(メジャー番号) / "Savefile Version Number" for Hengband 1.1.1 and later
+ * @details
+ * <pre>
  * 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.
+ * </pre>
  */
-#define H_VER_MAJOR 1
-#define H_VER_MINOR 7
-#define H_VER_PATCH 1
-#define H_VER_EXTRA 6
-
+#define H_VER_MAJOR 2
+#define H_VER_MINOR 1 /*!< セーブファイル上のバージョン定義(マイナー番号) */
+#define H_VER_PATCH 2 /*!< セーブファイル上のバージョン定義(パッチ番号) */
+#define H_VER_EXTRA 4 /*!< セーブファイル上のバージョン定義(エクストラ番号) */
 
-#define ANGBAND_2_8_1
-#define ZANGBAND
+#define ANGBAND_2_8_1 /*!< Angband 2.8.1以降から有効な処理分岐を定義 */
+#define ZANGBAND /*!< Zangband 以降から有効な処理分岐を定義 */
 
-/*
- * Number of grids in each block (vertically)
- * Probably hard-coded to 11, see "generate.c"
+/*!
+ * @brief generate.cで用いられる基本的なブロック数単位(垂直方向)
+ * Number of grids in each block (vertically) Probably hard-coded to 11, see "generate.c"
  */
 #define BLOCK_HGT      11
 
-/*
- * Number of grids in each block (horizontally)
- * Probably hard-coded to 11, see "generate.c"
+/*!
+ * @brief generate.cで用いられる基本的なブロック数単位(水平方向)
+ * Number of grids in each block (horizontally) Probably hard-coded to 11, see "generate.c"
  */
 #define BLOCK_WID      11
 
-
-/*
- * Number of grids in each panel (vertically)
- * Must be a multiple of BLOCK_HGT
+/*!
+ * @brief 表示上の基本的なパネル単位(垂直方向、BLOCK_HGTの倍数で設定すること)
+ * Number of grids in each panel (vertically) Must be a multiple of BLOCK_HGT
  */
 #define PANEL_HGT      11
 
-/*
- * Number of grids in each panel (horizontally)
- * Must be a multiple of BLOCK_WID
+/*!
+ * @brief 表示上の基本的なパネル単位(水平方向、BLOCK_WIDの倍数で設定すること)
+ * Number of grids in each panel (horizontally) Must be a multiple of BLOCK_WID
  */
 #define PANEL_WID      33
 
-
-/*
- * Number of grids used to display the dungeon (vertically).
- * Must be a multiple of 11, probably hard-coded to 22.
+/*!
+ * @brief 表示上の基本的なブロック単位(垂直方向、PANEL_HGTの倍数で設定すること)
+ * Number of grids used to display the dungeon (vertically). Must be a multiple of 11, probably hard-coded to 22.
  */
 #define SCREEN_HGT      22
 
-/*
- * Number of grids used to display the dungeon (horizontally).
- * Must be a multiple of 33, probably hard-coded to 66.
+/*!
+ * @brief 表示上の基本的なブロック単位(水平方向、PANEL_WIDの倍数で設定すること)
+ * Number of grids used to display the dungeon (horizontally). Must be a multiple of 33, probably hard-coded to 66.
  */
 #define SCREEN_WID      66
 
-
-/*
- * Maximum dungeon height in grids, must be a multiple of SCREEN_HGT,
- * probably hard-coded to SCREEN_HGT * 3.
+/*!
+ * @brief 表示上のダンジョンの最大垂直サイズ(SCREEN_HGTの3倍が望ましい)
+ * Maximum dungeon height in grids, must be a multiple of SCREEN_HGT, probably hard-coded to SCREEN_HGT * 3.
  */
 #define MAX_HGT         66
 
-/*
- * Maximum dungeon width in grids, must be a multiple of SCREEN_WID,
- * probably hard-coded to SCREEN_WID * 3.
+/*!
+ * @brief 表示上のダンジョンの最大水平サイズ(SCREEN_WIDの3倍が望ましい)
+ * Maximum dungeon width in grids, must be a multiple of SCREEN_WID, probably hard-coded to SCREEN_WID * 3.
  */
 #define MAX_WID         198
 
-
 /*
  * Quest constants
  */
-#define MIN_RANDOM_QUEST    40
-#define MAX_RANDOM_QUEST    49
+#define MIN_RANDOM_QUEST    40 /*<! ランダムクエストを割り当てるクエストIDの開始値 */
+#define MAX_RANDOM_QUEST    49 /*<! ランダムクエストを割り当てるクエストIDの終了値 */
 
-/* Check is the quest index is "fixed" */
+/*!
+ * @brief 該当IDが固定クエストかどうかを判定する / Check is the quest index is "fixed"
+ * @param Q_IDX クエストID
+ * @return 固定クエストならばTRUEを返す
+ */
 #define is_fixed_quest_idx(Q_IDX) (((Q_IDX) < MIN_RANDOM_QUEST) || ((Q_IDX) > MAX_RANDOM_QUEST))
 
-#define QUEST_OBERON         8
-#define QUEST_SERPENT        9
+#define QUEST_TOWER1         5 /*<! 塔クエスト(第1階層)に割り振るクエストID */
+#define QUEST_TOWER2         6 /*<! 塔クエスト(第2階層)に割り振るクエストID */
+#define QUEST_TOWER3         7 /*<! 塔クエスト(第3階層)に割り振るクエストID */
+#define QUEST_OBERON         8 /*<! オベロン打倒クエストに割り振るクエストID */
+#define QUEST_SERPENT        9 /*<! サーペント打倒クエストに割り振るクエストID */
 
 /*
  * Arena constants
  */
-#define MAX_ARENA_MONS         38      /* -KMW- */
+#define MAX_ARENA_MONS         41      /* -KMW- */
 #define ARENA_DEFEATED_OLD_VER (-(MAX_SHORT))
 
 
 /*
  * Misc constants
  */
-#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 MAX_DAYS          20000    /* Maximum days */
-#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    /*!< 1日分のターン / Number of ticks from dawn to dawn XXX */
+#define TURNS_PER_TICK    10L      /*!< Number of energy-gain-turns per ticks */
+#define MAX_DAYS          20000    /*!< 内部処理中で保持される最大日数 / Maximum days */
+#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 */
 
-#define BIAS_ELEC            1
-#define BIAS_POIS            2
-#define BIAS_FIRE            3
-#define BIAS_COLD            4
-#define BIAS_ACID            5
-#define BIAS_STR             6
-#define BIAS_INT             7
-#define BIAS_WIS             8
-#define BIAS_DEX             9
-#define BIAS_CON            10
-#define BIAS_CHR            11
-#define BIAS_CHAOS          12
-#define BIAS_PRIESTLY       13
-#define BIAS_NECROMANTIC    14
-#define BIAS_LAW            15
-#define BIAS_ROGUE          16
-#define BIAS_MAGE           17
-#define BIAS_WARRIOR        18
-#define BIAS_RANGER         19
-
+#define BIAS_ELEC            1 /*!< ランダムアーティファクトバイアス:電撃 */
+#define BIAS_POIS            2 /*!< ランダムアーティファクトバイアス:毒 */
+#define BIAS_FIRE            3 /*!< ランダムアーティファクトバイアス:火炎 */
+#define BIAS_COLD            4 /*!< ランダムアーティファクトバイアス:冷気 */
+#define BIAS_ACID            5 /*!< ランダムアーティファクトバイアス:酸 */
+#define BIAS_STR             6 /*!< ランダムアーティファクトバイアス:腕力 */
+#define BIAS_INT             7 /*!< ランダムアーティファクトバイアス:知力 */
+#define BIAS_WIS             8 /*!< ランダムアーティファクトバイアス:賢さ */
+#define BIAS_DEX             9 /*!< ランダムアーティファクトバイアス:器用さ */
+#define BIAS_CON            10 /*!< ランダムアーティファクトバイアス:耐久 */
+#define BIAS_CHR            11 /*!< ランダムアーティファクトバイアス:魅力 */
+#define BIAS_CHAOS          12 /*!< ランダムアーティファクトバイアス:混沌 */
+#define BIAS_PRIESTLY       13 /*!< ランダムアーティファクトバイアス:プリースト系 */
+#define BIAS_NECROMANTIC    14 /*!< ランダムアーティファクトバイアス:死霊 */
+#define BIAS_LAW            15 /*!< ランダムアーティファクトバイアス:法 */
+#define BIAS_ROGUE          16 /*!< ランダムアーティファクトバイアス:盗賊系 */
+#define BIAS_MAGE           17 /*!< ランダムアーティファクトバイアス:メイジ系 */
+#define BIAS_WARRIOR        18 /*!< ランダムアーティファクトバイアス:戦士系 */
+#define BIAS_RANGER         19 /*!< ランダムアーティファクトバイアス:レンジャー系 */
+#define MAX_BIAS            20 /*!< ランダムアーティファクトバイアス:最大数 */
 
 /*** Pet constants ***/
 
 #define GREAT_OBJ       10
 
 /*
- * There is a 1/50 (2%) chance of inflating the requested monster_level
+ * There is a 1/25 (4%) chance of inflating the requested monster_level
  * during the creation of a monsters (see "get_mon_num()" in "monster.c").
  * Lower values yield harder monsters more often.
  */
-#define NASTY_MON       50              /* 1/chance of inflated monster level */
+#define NASTY_MON_BASE     25
+#define NASTY_MON_MAX      3
+#define NASTY_MON_PLUS_MAX 25
 
 /* 1/x chance of hurting even if invulnerable! */
 #define PENETRATE_INVULNERABILITY 13
 #define CH_DAEMON       0x100
 #define CH_CRUSADE      0x200
 
-#define CH_MUSIC        0x10000
-#define CH_HISSATSU     0x20000
+#define CH_MUSIC        0x08000        /* This is 16th bit */
+#define CH_HISSATSU     0x10000
+#define CH_HEX          0x20000
 
 
 /*
 #define MIN_TECHNIC        16
 #define REALM_MUSIC        16
 #define REALM_HISSATSU     17
-#define MAX_REALM          17
+#define REALM_HEX          18
+#define MAX_REALM          18
 
 #define VALID_REALM        (MAX_REALM + MAX_MAGIC - MIN_TECHNIC + 1)
 #define NUM_TECHNIC        (MAX_REALM - MIN_TECHNIC + 1)
 #define RACE_DEMON              32
 #define RACE_DUNADAN            33
 #define RACE_S_FAIRY            34
-#define RACE_KUTA               35
+#define RACE_KUTAR              35
 #define RACE_ANDROID            36
 
 /*
 #define ART_PALANTIR             15
 #define ART_STONE_LORE           17
 #define ART_FLY_STONE            147
-
+#define ART_ORB_OF_FATE          245 
 /* Amulets */
 #define ART_CARLAMMAS            4
 #define ART_INGWE                5
 #define ART_GHB                 192
 #define ART_DASAI               200
 #define ART_KESHO               204
+#define ART_MILIM               246
 
 /* Shields */
 #define ART_THORIN              30
 #define ART_LUTHIEN             49
 #define ART_TUOR                50
 #define ART_MOOK                205
+#define ART_HEAVENLY_MAIDEN     233
 
 /* Gloves */
 #define ART_CAMBELEG            52
 #define ART_KAMUI               198
 #define ART_GOURYU              207
 #define ART_EOWYN               216
+#define ART_NANACHO             248
+#define ART_ROBINTON            251
 
 /* Polearms */
 #define ART_THEODEN             93
 /* xxx */
 
 /* Body Armor */
-#define EGO_RESIST_ACID         4
-#define EGO_RESIST_ELEC         5
-#define EGO_RESIST_FIRE         6
-#define EGO_RESIST_COLD         7
+#define EGO_A_MORGUL            4
+#define EGO_A_DEMON             5
+#define EGO_DRUID               6
+#define EGO_OLOG                7
 #define EGO_RESISTANCE          8
 #define EGO_ELVENKIND           9
 #define EGO_DWARVEN             10
 #define EGO_PERMANENCE          11
 #define EGO_YOIYAMI             12
-/* xxx */
+#define EGO_URUKISH             13
 /* xxx */
 /* xxx */
 
 #define EGO_ENDURANCE           20
 #define EGO_REFLECTION          21
 #define EGO_NIGHT_DAY           22
+#define EGO_S_PROTECTION        238
+#define EGO_S_DWARVEN           239
 
 /* Crowns and Helms */
 #define EGO_DARK                23
-#define EGO_INTELLIGENCE        24
-#define EGO_WISDOM              25
-#define EGO_BEAUTY              26
+#define EGO_BRILLIANCE          24
+#define EGO_H_PROTECTION        25
+#define EGO_H_DEMON             26
 #define EGO_MAGI                27
 #define EGO_MIGHT               28
 #define EGO_LORDLINESS          29
 #define EGO_TELEPATHY           33
 #define EGO_REGENERATION        34
 #define EGO_TELEPORTATION       35
-#define EGO_STUPIDITY           36
-#define EGO_NAIVETY             37
-#define EGO_UGLINESS            38
+#define EGO_FOOL                36
+#define EGO_BASILISK            37
+#define EGO_ANCIENT_CURSE       38
 #define EGO_SICKLINESS          39
 
 /* Cloaks */
 #define EGO_AURA_ELEC           47
 #define EGO_AURA_COLD          128
 #define EGO_BAT                129
+#define EGO_NAZGUL             240
 
 /* Gloves */
 #define EGO_FREE_ACTION         48
 #define EGO_CHAOTIC             77
 #define EGO_SHARPNESS           78
 #define EGO_EARTHQUAKES         79
-#define EGO_SLAY_ANIMAL         80
-#define EGO_SLAY_EVIL           81
-#define EGO_SLAY_UNDEAD         82
-#define EGO_SLAY_DEMON          83
-#define EGO_SLAY_ORC            84
-#define EGO_SLAY_TROLL          85
-#define EGO_SLAY_GIANT          86
-#define EGO_SLAY_DRAGON         87
+#define EGO_XXX_1               80
+#define EGO_XXX_2               81
+#define EGO_XXX_3               82
+#define EGO_XXX_4               83
+#define EGO_XXX_5               84
+#define EGO_XXX_6               85
+#define EGO_XXX_7               86
+#define EGO_WEIRD               87
 #define EGO_KILL_ANIMAL         88
 #define EGO_KILL_EVIL           89
 #define EGO_KILL_UNDEAD         90
 #define EGO_TRUMP               98
 #define EGO_PATTERN             99
 #define EGO_DIGGING             100
-#define EGO_SLAY_HUMAN          101
+#define EGO_DEMON               101
 #define EGO_MORGUL              102
 #define EGO_KILL_HUMAN          103
 
 #define EGO_AMU_SLOW_D          210
 #define EGO_AMU_INFRA           211
 #define EGO_AMU_SEE_INVIS       212
-#define EGO_AMU_HOLD_LIFE       213
+#define EGO_AMU_HOLD_EXP        213
 #define EGO_AMU_DRAIN_EXP       214
 #define EGO_AMU_FOOL            215
 #define EGO_AMU_AGGRAVATE       216
 #define EGO_AMU_GREAT           235
 #define EGO_AMU_DETECTION       236
 #define EGO_AMU_NAIVETY         237
+// MAX 240
 
 /* Activation effects for random artifacts */
 #define ACT_SUNLIGHT            1
 #define ACT_DRAIN_2             13
 #define ACT_VAMPIRE_1           14
 #define ACT_BO_MISS_2           15
-#define ACT_BA_FIRE_2           16
+#define ACT_BA_FIRE_3           16
 #define ACT_BA_COLD_3           17
 #define ACT_BA_ELEC_3           18
 #define ACT_WHIRLWIND           19
 #define ACT_DISP_EVIL           23
 #define ACT_BA_MISS_3           24
 #define ACT_DISP_GOOD           25
-/* 26 - 50 unused */
+#define ACT_BO_MANA             26
+#define ACT_BA_FIRE_2           27
+#define ACT_BA_WATER            28
+#define ACT_BA_STAR             29
+#define ACT_BA_DARK             30
+#define ACT_BA_MANA             31
+#define ACT_PESTICIDE           32
+#define ACT_BLINDING_LIGHT      33
+#define ACT_BIZARRE             34
+#define ACT_CAST_BA_STAR        35
+#define ACT_BLADETURNER         36
+#define ACT_BA_ACID_1           37
+#define ACT_BR_FIRE             38
+#define ACT_BR_COLD             39
+#define ACT_BR_DRAGON           40
+#define ACT_BA_FIRE_4           41
+#define ACT_BA_NUKE_1           42
+/* 42 - 50 unused */
 #define ACT_CONFUSE             51
 #define ACT_SLEEP               52
 #define ACT_QUAKE               53
 #define ACT_BANISH_EVIL         56
 #define ACT_GENOCIDE            57
 #define ACT_MASS_GENO           58
+#define ACT_SCARE_AREA          59
+#define ACT_AGGRAVATE           60
 /* 59 - 64 unused */
 #define ACT_CHARM_ANIMAL        65
 #define ACT_CHARM_UNDEAD        66
 #define ACT_SUMMON_ELEMENTAL    72
 #define ACT_SUMMON_DEMON        73
 #define ACT_SUMMON_UNDEAD       74
-/* 75 - 80 unused */
+#define ACT_SUMMON_HOUND        75
+#define ACT_SUMMON_DAWN         76
+#define ACT_SUMMON_OCTOPUS      77
+/* 76 - 80 unused */
+#define ACT_CHOIR_SINGS         80
 #define ACT_CURE_LW             81
 #define ACT_CURE_MW             82
 #define ACT_CURE_POISON         83
-#define ACT_REST_LIFE           84
+#define ACT_REST_EXP            84
 #define ACT_REST_ALL            85
 #define ACT_CURE_700            86
 #define ACT_CURE_1000           87
-/* 88 - 90 unused */
+#define ACT_CURING              88
+#define ACT_CURE_MANA_FULL      89
+/* 90 unused */
 #define ACT_ESP                 91
 #define ACT_BERSERK             92
 #define ACT_PROT_EVIL           93
 #define ACT_XTRA_SPEED          96
 #define ACT_WRAITH              97
 #define ACT_INVULN              98
-/* 99 - 110 unused */
+#define ACT_HELO                99
+#define ACT_HELO_SPEED          100
+#define ACT_RESIST_ACID         101
+#define ACT_RESIST_FIRE         102
+#define ACT_RESIST_COLD         103
+#define ACT_RESIST_ELEC         104
+#define ACT_RESIST_POIS         105
+/* 106 - 110 unused */
 #define ACT_LIGHT               111
 #define ACT_MAP_LIGHT           112
 #define ACT_DETECT_ALL          113
 #define ACT_DIM_DOOR            124
 #define ACT_TELEPORT            125
 #define ACT_RECALL              126
+#define ACT_JUDGE               127
+#define ACT_TELEKINESIS         128
+#define ACT_DETECT_UNIQUE       129
+#define ACT_ESCAPE              130
+#define ACT_DISP_CURSE_XTRA     131
+#define ACT_BRAND_FIRE_BOLTS    132
+#define ACT_RECHARGE_XTRA       133
+#define ACT_LORE                134
+#define ACT_SHIKOFUMI           135
+#define ACT_PHASE_DOOR          136
+#define ACT_DETECT_ALL_MONS     137
+#define ACT_ULTIMATE_RESIST     138
 /* 127 -> unused */
+#define ACT_FALLING_STAR        246
+#define ACT_STRAIN_HASTE        247
+#define ACT_TELEPORT_LEVEL      248
+#define ACT_GRAND_CROSS         249
+#define ACT_CAST_OFF            250
+#define ACT_FISHING             251
+#define ACT_INROU               252
+#define ACT_MURAMASA            253
+#define ACT_BLOODY_MOON         254
+#define ACT_CRIMSON             255
 
 /*** Object "tval" and "sval" codes ***/
 
 #define TV_CRUSADE_BOOK 99
 #define TV_MUSIC_BOOK   105
 #define TV_HISSATSU_BOOK 106
+#define TV_HEX_BOOK     107
 #define TV_GOLD         127     /* Gold can only be picked up by players */
 
 #define TV_EQUIP_BEGIN    TV_SHOT
 #define SV_LIGHT_XBOW                   23     /* (x3) */
 #define SV_HEAVY_XBOW                   24     /* (x4) */
 #define SV_CRIMSON                      50     /* (x0) */
+#define SV_HARP                         51     /* (x0) */
 #define SV_NAMAKE_BOW                   63     /* (x3) */
 
 /* The "sval" codes for TV_DIGGING */
 #define SV_SCROLL_ARTIFACT              52
 #define SV_SCROLL_RESET_RECALL          53
 #define SV_SCROLL_SUMMON_KIN            54
+#define SV_SCROLL_AMUSEMENT             55
+#define SV_SCROLL_STAR_AMUSEMENT        56
 
 /* The "sval" codes for TV_POTION */
 #define SV_POTION_WATER                  0
 #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_KNOWN      0x0200    /* Directly viewed or map detected flag */
 #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 PW_EQUIP        0x00000002L     /* Display equip/inven */
 #define PW_SPELL        0x00000004L     /* Display spell list */
 #define PW_PLAYER       0x00000008L     /* Display character */
+#define PW_MONSTER_LIST 0x00000010L     /* Display monster list */
 /* xxx */
 /* xxx */
 #define PW_MESSAGE      0x00000040L     /* Display messages */
 #define ACTION_KATA     6
 #define ACTION_SING     7
 #define ACTION_HAYAGAKE 8
+#define ACTION_SPELL    9
 
 
 /* Empty hand status */
 #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_HOLD_EXP            47     /* Hold EXP */
 #define TR_RES_ACID            48
 #define TR_RES_ELEC            49
 #define TR_RES_FIRE            50
 #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_LEVITATION             76     /* Feather Falling */
-#define TR_LITE                77     /* Permanent Light */
+#define TR_SLAY_GOOD           75
+#define TR_LEVITATION          76     /* Feather Falling */
+#define TR_LITE_1              77     /* Light Radius 1*/
 #define TR_SEE_INVIS           78     /* See Invisible */
 #define TR_TELEPATHY           79     /* Telepathy */
 #define TR_SLOW_DIGEST         80     /* Item slows down digestion */
 #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_GOOD           95
 
 #define TR_KILL_ANIMAL         96
 #define TR_KILL_EVIL           97
 #define TR_ESP_UNIQUE          115
 #define TR_FULL_NAME           116
 #define TR_FIXED_FLAVOR        117
-
-#define TR_FLAG_MAX            118
-#define TR_FLAG_SIZE           4
+#define TR_ADD_L_CURSE         118
+#define TR_ADD_H_CURSE         119
+#define TR_DRAIN_HP            120
+#define TR_DRAIN_MANA          121
+#define TR_LITE_2                         122
+#define TR_LITE_3                         123
+#define TR_LITE_M1                        124    /* Permanent decrease Light Area (-1) */
+#define TR_LITE_M2                        125    /* Permanent decrease Light Area (-1) */
+#define TR_LITE_M3                        126    /* Permanent decrease Light Area (-1) */
+#define TR_LITE_FUEL              127    /* Lights need Fuels */
+
+#define TR_CALL_ANIMAL         128
+#define TR_CALL_DEMON          129
+#define TR_CALL_DRAGON         130
+#define TR_CALL_UNDEAD         131
+#define TR_COWARDICE           132
+#define TR_LOW_MELEE           133
+#define TR_LOW_AC              134
+#define TR_LOW_MAGIC           135
+#define TR_FAST_DIGEST         136
+#define TR_SLOW_REGEN          137
+
+#define TR_FLAG_MAX            138
+#define TR_FLAG_SIZE           5
 
 
 #define TRG_INSTA_ART           0x00000001L     /* Item must be an artifact */
 #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 TRG_XTRA_DICE           0x00010000L     /* Extra dice */
+#define TRG_POWERFUL            0x00020000L     /* Item has good value even if Cursed */
 
 
-#define MAX_CURSE 17
+#define MAX_CURSE 18
 
 #define TRC_CURSED              0x00000001L
 #define TRC_HEAVY_CURSE         0x00000002L
 #define TRC_FAST_DIGEST         0x00040000L
 #define TRC_DRAIN_HP            0x00080000L
 #define TRC_DRAIN_MANA          0x00100000L
+#define TRC_CALL_UNDEAD         0x00200000L
 
 #define TRC_TELEPORT_SELF       0x00000001L
 #define TRC_CHAINSWORD          0x00000002L
 
 #define TRC_HEAVY_MASK   \
        (TRC_TY_CURSE | TRC_AGGRAVATE | TRC_DRAIN_EXP | TRC_ADD_H_CURSE | \
-        TRC_CALL_DEMON | TRC_CALL_DRAGON | TRC_TELEPORT)
+        TRC_CALL_DEMON | TRC_CALL_DRAGON | TRC_CALL_UNDEAD | 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)
+        TRC_TELEPORT | TRC_DRAIN_HP | TRC_DRAIN_MANA | TRC_CALL_UNDEAD)
 
 
 
 #define RBE_EXP_80      28
 #define RBE_DISEASE     29
 #define RBE_TIME        30
-#define RBE_EXP_VAMP    31
+#define RBE_DR_LIFE     31
 #define RBE_DR_MANA     32
 #define RBE_SUPERHURT   33
+#define RBE_INERTIA     34
+#define RBE_STUN        35
 
 
 /*** Monster flag values (hard-coded) ***/
 #define RF5_CAUSE_3         0x00004000  /* Cause Critical Wound */
 #define RF5_CAUSE_4         0x00008000  /* Cause Mortal Wound */
 #define RF5_BO_ACID         0x00010000  /* Acid Bolt */
-#define RF5_BO_ELEC         0x00020000  /* Elec Bolt (unused) */
+#define RF5_BO_ELEC         0x00020000  /* Elec Bolt */
 #define RF5_BO_FIRE         0x00040000  /* Fire Bolt */
 #define RF5_BO_COLD         0x00080000  /* Cold Bolt */
 #define RF5_BA_LITE         0x00100000  /* StarBurst */
 #define RF7_SELF_LITE_2         0x00000800  /* Monster lights itself */
 #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_XXXX4XXX            0x00004000  /* Now Empty */
 #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 RF9_EAT_LOSE_STR        0x02000000
 #define RF9_EAT_LOSE_INT        0x04000000
 #define RF9_EAT_LOSE_WIS        0x08000000
-#define RF9_EAT_LOSE_DEX        0x01000000
+#define RF9_EAT_LOSE_DEX        0x10000000
 #define RF9_EAT_LOSE_CON        0x20000000
 #define RF9_EAT_LOSE_CHR        0x40000000
 #define RF9_EAT_DRAIN_MANA      0x80000000
 #define RF4_RIDING_MASK \
        (RF4_SHRIEK)
 
-#define RF5_RIDING_MASK 0L
+#define RF5_RIDING_MASK 0UL
 
 #define RF6_RIDING_MASK \
        (RF6_BLINK | RF6_TPORT | RF6_TRAPS | RF6_DARKNESS | RF6_SPECIAL)
         RF5_BO_NETH | RF5_BO_WATE | RF5_BO_MANA | RF5_BO_PLAS | \
         RF5_BO_ICEE | RF5_MISSILE)
 
-#define RF6_BOLT_MASK 0L
+#define RF6_BOLT_MASK 0UL
 
 /*
  * Hack -- "beam" spells that may hurt fellow monsters
  * Currently "beam" spells are included in "attack"
  */
-#define RF4_BEAM_MASK 0L
+#define RF4_BEAM_MASK 0UL
 
-#define RF5_BEAM_MASK 0L
+#define RF5_BEAM_MASK 0UL
 
 #define RF6_BEAM_MASK (RF6_PSY_SPEAR)
 
 #define RF5_BIG_BALL_MASK \
        (RF5_BA_LITE | RF5_BA_DARK | RF5_BA_WATE | RF5_BA_MANA)
 
-#define RF6_BIG_BALL_MASK 0L
+#define RF6_BIG_BALL_MASK 0UL
 
 /*
  * Hack -- "breath" spells that may hurt friends
         RF4_BR_GRAV | RF4_BR_PLAS | RF4_BR_WALL | RF4_BR_MANA | \
         RF4_BR_NUKE | RF4_BR_DISI)
 
-#define RF5_BREATH_MASK 0L
+#define RF5_BREATH_MASK 0UL
 
-#define RF6_BREATH_MASK 0L
+#define RF6_BREATH_MASK 0UL
 
 /*
  * Hack -- "summon" spells
  * Currently "summon" spells are included in "intelligent" and "indirect"
  */
-#define RF4_SUMMON_MASK 0L
+#define RF4_SUMMON_MASK 0UL
 
-#define RF5_SUMMON_MASK 0L
+#define RF5_SUMMON_MASK 0UL
 
 #define RF6_SUMMON_MASK \
        (RF6_S_KIN | RF6_S_CYBER | RF6_S_MONSTER | RF6_S_MONSTERS | RF6_S_ANT | \
 #define get_feat_mimic(C) \
        (f_info[(C)->mimic ? (C)->mimic : (C)->feat].mimic)
 
-#define update_playtime() \
-{\
-       u32b tmp;\
-       tmp = time(NULL);\
-       playtime += (tmp - start_time);\
-       start_time = tmp;\
-}
-
 /*
  * Hack -- Prepare to use the "Secure" routines
  */
@@ -4419,10 +4506,30 @@ extern int PlayerUID;
  */
 #define is_ascii_graphics(A) (!((A) & 0x80))
 
+/*** Music constants ***/
+
+#define MUSIC_BASIC_DEFAULT    0
+#define MUSIC_BASIC_GAMEOVER   1
+#define MUSIC_BASIC_EXIT       2
+#define MUSIC_BASIC_TOWN       3
+#define MUSIC_BASIC_FIELD1     4
+#define MUSIC_BASIC_FIELD2     5
+#define MUSIC_BASIC_FIELD3     6
+#define MUSIC_BASIC_DUN_LOW    7
+#define MUSIC_BASIC_DUN_MED    8
+#define MUSIC_BASIC_DUN_HIGH   9
+#define MUSIC_BASIC_DUN_FEEL1 10
+#define MUSIC_BASIC_DUN_FEEL2 11
+#define MUSIC_BASIC_WINNER    12
+#define MUSIC_BASIC_BUILD     13
+#define MUSIC_BASIC_WILD      14
+#define MUSIC_BASIC_QUEST     15
+#define MUSIC_BASIC_ARENA     16
+#define MUSIC_BASIC_BATTLE    17
+#define MUSIC_BASIC_MAX       18 /*!< BGM定義の最大数 */
 
 /*** Sound constants ***/
 
-
 /*
  * Mega-Hack -- some primitive sound support (see "main-win.c")
  *
@@ -4497,11 +4604,11 @@ extern int PlayerUID;
 /*
  * Mega-Hack -- maximum known sounds
  */
-#define SOUND_MAX 66
+#define SOUND_MAX 66 /*!< 効果音定義の最大数 */
 
-#define MAX_VIRTUE 18
+#define MAX_VIRTUE 18 /*!< 徳定義の最大数 */
 
-#define V_COMPASSION       1
+#define V_COMPASSION    1
 #define V_HONOUR           2
 #define V_JUSTICE          3
 #define V_SACRIFICE        4
@@ -4588,19 +4695,21 @@ extern int PlayerUID;
 #define BACT_POKER                  43
 #define BACT_IDENT_ONE              44
 #define BACT_RECHARGE_ALL           45
-#define BACT_EVAL_AC               46
-#define MAX_BACT                    47
+#define BACT_EVAL_AC                   46
+#define BACT_BROKEN_WEAPON          47
+#define MAX_BACT                    48
 
 /*
  * Quest status
  */
-#define QUEST_STATUS_UNTAKEN         0
-#define QUEST_STATUS_TAKEN           1
-#define QUEST_STATUS_COMPLETED       2
-#define QUEST_STATUS_REWARDED        3
-#define QUEST_STATUS_FINISHED        4
-#define QUEST_STATUS_FAILED          5
-#define QUEST_STATUS_FAILED_DONE     6
+#define QUEST_STATUS_UNTAKEN              0
+#define QUEST_STATUS_TAKEN                1
+#define QUEST_STATUS_COMPLETED            2
+#define QUEST_STATUS_REWARDED             3
+#define QUEST_STATUS_FINISHED             4
+#define QUEST_STATUS_FAILED               5
+#define QUEST_STATUS_FAILED_DONE          6
+#define QUEST_STATUS_STAGE_COMPLETED      7
 
 /*
  * Quest type
@@ -4612,15 +4721,17 @@ extern int PlayerUID;
 #define QUEST_TYPE_KILL_NUMBER               5
 #define QUEST_TYPE_KILL_ALL                  6
 #define QUEST_TYPE_RANDOM                    7
+#define QUEST_TYPE_TOWER                     8
 
 /*
  * Initialization flags
  */
-#define INIT_SHOW_TEXT          0x01
-#define INIT_ASSIGN             0x02
-#define INIT_CREATE_DUNGEON     0x04
-#define INIT_ONLY_FEATURES      0x08
-#define INIT_ONLY_BUILDINGS     0x10
+#define INIT_NAME_ONLY          0x01
+#define INIT_SHOW_TEXT          0x02
+#define INIT_ASSIGN             0x04
+#define INIT_CREATE_DUNGEON     0x08
+#define INIT_ONLY_FEATURES      0x10
+#define INIT_ONLY_BUILDINGS     0x20
 
 /*
  * Quest flags
@@ -4628,6 +4739,7 @@ extern int PlayerUID;
 #define QUEST_FLAG_SILENT  0x01 /* no messages fro completion */
 #define QUEST_FLAG_PRESET  0x02 /* quest is outside the main dungeon */
 #define QUEST_FLAG_ONCE    0x04 /* quest is marked finished after leaving */
+#define QUEST_FLAG_TOWER   0x08 /* Tower quest is special */
 
 /*
  * Available graphic modes
@@ -4635,6 +4747,7 @@ extern int PlayerUID;
 #define GRAPHICS_NONE       0
 #define GRAPHICS_ORIGINAL   1
 #define GRAPHICS_ADAM_BOLT  2
+#define GRAPHICS_HENGBAND   3
 
 /*
  * Modes for the random name generator
@@ -4867,6 +4980,7 @@ extern int PlayerUID;
 #define MON_BEGGAR        12
 #define MON_LEPER         13
 #define MON_BLACK_MARKET  14
+#define MON_LION_HEART    19
 #define MON_GHB           39
 #define MON_NOV_PRIEST    45
 #define MON_GRIP          53
@@ -4891,6 +5005,7 @@ extern int PlayerUID;
 #define MON_BLUE_HORROR   189
 #define MON_GOLD_COINS    195
 #define MON_VORPAL_BUNNY  205
+#define MON_MASTER_YEEK   224
 #define MON_PRIEST        225
 #define MON_D_ELF_PRIEST  226
 #define MON_TIGER         230
@@ -4902,9 +5017,13 @@ extern int PlayerUID;
 #define MON_UMBER_HULK    283
 #define MON_ORC_CAPTAIN   285
 #define MON_BERSERKER     293
+#define MON_IMP           296
 #define MON_SHAGRAT       314
 #define MON_GORBAG        315
 #define MON_STONE_GIANT   321
+#define MON_LIZARD_KING   332
+#define MON_WYVERN        334
+#define MON_SABRE_TIGER   339
 #define MON_D_ELF_LORD    348
 #define MON_FIRE_VOR      354
 #define MON_WATER_VOR     355
@@ -4924,6 +5043,7 @@ extern int PlayerUID;
 #define MON_GWAIHIR       410
 #define MON_ANGEL         417
 #define MON_ADAMANT_COINS 423
+#define MON_COLBRAN       435
 #define MON_SPIRIT_NAGA   436
 #define MON_GACHAPIN      441
 #define MON_BASILISK      453
@@ -4933,6 +5053,7 @@ extern int PlayerUID;
 #define MON_SHADOW_DRAKE  471
 #define MON_GHOST         477
 #define MON_OGRE_SHAMAN   479
+#define MON_GHOUL_KING    483
 #define MON_NINJA         485
 #define MON_BICLOPS       490
 #define MON_IVORY_MONK    492
@@ -4959,11 +5080,14 @@ extern int PlayerUID;
 #define MON_MANDOR        598
 #define MON_SHIM_VOR      600
 #define MON_SERAPH        605
+#define MON_BARON_HELL    609
 #define MON_KAVLAX        616
 #define MON_ETTIN         621
 #define MON_VAMPIRE_LORD  623
 #define MON_JUBJUB        640
+#define MON_G_C_DRAKE     646
 #define MON_CLUB_DEMON    648
+#define MON_F_ANGEL       652
 #define MON_D_ELF_SORC    657
 #define MON_MASTER_LICH   658
 #define MON_RINALDO       660
@@ -4973,12 +5097,14 @@ extern int PlayerUID;
 #define MON_JACK_SHADOWS  670
 #define MON_LLOIGOR       682
 #define MON_DREADMASTER   690
+#define MON_DROLEM        691
 #define MON_DAWN          693
 #define MON_NAZGUL        696
 #define MON_SMAUG         697
 #define MON_STORMBRINGER  698
 #define MON_ULTRA_PALADIN 699
 #define MON_G_TITAN       702
+#define MON_S_TYRANNO     705
 #define MON_FAFNER        712
 #define MON_G_BALROG      720
 #define MON_TIME_HOUND    725
@@ -5000,6 +5126,7 @@ extern int PlayerUID;
 #define MON_BRAND         773
 #define MON_SHADOWLORD    774
 #define MON_ARCHLICH      776
+#define MON_JABBERWOCK    778
 #define MON_CHAOS_HOUND   779
 #define MON_ULT_BEHOLDER  781
 #define MON_SHAMBLER      786
@@ -5054,8 +5181,10 @@ extern int PlayerUID;
 #define MON_D_ELF_SHADE   886
 #define MON_MANA_HOUND    887
 #define MON_VENOM_WYRM    890
+#define MON_TROLL_KING    894
 #define MON_BAZOOKER      896
 #define MON_SHARD_VOR     897
+#define MON_ELF_LORD      900
 #define MON_MASTER_MYS    916
 #define MON_G_MASTER_MYS  917
 #define MON_IE            921
@@ -5101,13 +5230,18 @@ extern int PlayerUID;
 #define MON_CHAMELEON     1040
 #define MON_CHAMELEON_K   1041
 #define MON_TOPAZ_MONK    1047
+#define MON_M_MINDCRAFTER 1056
+#define MON_ELDER_VAMPIRE 1058
 #define MON_NOBORTA       1059
 #define MON_MORI_TROLL    1060
 #define MON_BARNEY        1061
 #define MON_GROO          1062
 #define MON_LOUSY         1063
+#define MON_WYRM_SPACE    1064
 #define MON_JIZOTAKO      1065
 #define MON_TANUKI        1067
+#define MON_HATOPOPPO     1083
+#define MON_KOGAN         1096
 
 /* Maximum "Nazguls" number */
 #define MAX_NAZGUL_NUM 5
@@ -5240,7 +5374,7 @@ extern int PlayerUID;
 #define DF1_GLASS_DOOR          0x00000200L
 #define DF1_CAVE                0x00000400L
 #define DF1_CAVERN              0x00000800L
-#define DF1_XXX12               0x00001000L
+#define DF1_ARCADE              0x00001000L
 #define DF1_XXX13               0x00002000L
 #define DF1_XXX14               0x00004000L
 #define DF1_XXX15               0x00008000L
@@ -5340,6 +5474,7 @@ extern int PlayerUID;
 #define SAVE_ITEM_FEELING      0x02000000
 #define SAVE_ITEM_INSCRIPTION  0x04000000
 #define SAVE_ITEM_ART_NAME     0x08000000
+#define SAVE_ITEM_ART_FLAGS4   0x10000000
 
 
 /*
@@ -5389,13 +5524,13 @@ extern int PlayerUID;
 #define IS_FAST() (p_ptr->fast || music_singing(MUSIC_SPEED) || music_singing(MUSIC_SHERO))
 #define IS_INVULN() (p_ptr->invuln || music_singing(MUSIC_INVULN))
 #define IS_HERO() (p_ptr->hero || music_singing(MUSIC_HERO) || music_singing(MUSIC_SHERO))
-#define IS_BLESSED() (p_ptr->blessed || music_singing(MUSIC_BLESS))
+#define IS_BLESSED() (p_ptr->blessed || music_singing(MUSIC_BLESS) || hex_spelling(HEX_BLESS))
 #define IS_OPPOSE_ACID() (p_ptr->oppose_acid || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
 #define IS_OPPOSE_ELEC() (p_ptr->oppose_elec || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
 #define IS_OPPOSE_FIRE() (p_ptr->oppose_fire || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
 #define IS_OPPOSE_COLD() (p_ptr->oppose_cold || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
 #define IS_OPPOSE_POIS() (p_ptr->oppose_pois || music_singing(MUSIC_RESIST) || (p_ptr->special_defense & KATA_MUSOU))
-#define IS_TIM_ESP() (p_ptr->tim_esp || music_singing(MUSIC_MIND))
+#define IS_TIM_ESP() (p_ptr->tim_esp || music_singing(MUSIC_MIND) || (p_ptr->concent >= CONCENT_TELE_THRESHOLD))
 #define IS_TIM_STEALTH() (p_ptr->tim_stealth || music_singing(MUSIC_STEALTH))
 
 /* Multishadow effects is determined by turn */
@@ -5498,3 +5633,88 @@ extern int PlayerUID;
 
 #define CONCENT_RADAR_THRESHOLD 2
 #define CONCENT_TELE_THRESHOLD  5
+
+/* Hex */
+#define hex_spelling_any() \
+       ((p_ptr->realm1 == REALM_HEX) && (p_ptr->magic_num1[0]))
+#define hex_spelling(X) \
+       ((p_ptr->realm1 == REALM_HEX) && (p_ptr->magic_num1[0] & (1L << (X))))
+/* 1st book */
+#define HEX_BLESS             0
+#define HEX_CURE_LIGHT        1
+#define HEX_DEMON_AURA        2
+#define HEX_STINKING_MIST     3
+#define HEX_XTRA_MIGHT        4
+#define HEX_CURSE_WEAPON      5
+#define HEX_DETECT_EVIL       6
+#define HEX_PATIENCE          7
+/* 2nd book */
+#define HEX_ICE_ARMOR         8
+#define HEX_CURE_SERIOUS      9
+#define HEX_INHAIL           10
+#define HEX_VAMP_MIST        11
+#define HEX_RUNESWORD        12
+#define HEX_CONFUSION        13
+#define HEX_BUILDING         14
+#define HEX_ANTI_TELE        15
+/* 3rd book */
+#define HEX_SHOCK_CLOAK      16
+#define HEX_CURE_CRITICAL    17
+#define HEX_RECHARGE         18
+#define HEX_RAISE_DEAD       19
+#define HEX_CURSE_ARMOUR     20
+#define HEX_SHADOW_CLOAK     21
+#define HEX_PAIN_TO_MANA     22
+#define HEX_EYE_FOR_EYE      23
+/* 4th book */
+#define HEX_ANTI_MULTI       24
+#define HEX_RESTORE          25
+#define HEX_DRAIN_CURSE      26
+#define HEX_VAMP_BLADE       27
+#define HEX_STUN_MONSTERS    28
+#define HEX_SHADOW_MOVE      29
+#define HEX_ANTI_MAGIC       30
+#define HEX_REVENGE          31
+
+/*
+  Language selection macro
+*/
+#ifdef JP
+#define _(JAPANESE,ENGLISH) (JAPANESE)
+#else
+#define _(JAPANESE,ENGLISH) (ENGLISH)
+#endif
+
+/* Lite flag macro */
+#define have_lite_flag(ARRAY) \
+       (have_flag(ARRAY, TR_LITE_1) || have_flag(ARRAY, TR_LITE_2) || have_flag(ARRAY, TR_LITE_3))
+
+#define have_dark_flag(ARRAY) \
+       (have_flag(ARRAY, TR_LITE_M1) || have_flag(ARRAY, TR_LITE_M2) || have_flag(ARRAY, TR_LITE_M3))
+
+/* Spell Type flag */
+#define MONSTER_TO_PLAYER     0x01
+#define MONSTER_TO_MONSTER    0x02
+
+/* summoning number */
+#define S_NUM_6     (easy_band ? 2 : 6)
+#define S_NUM_4     (easy_band ? 1 : 4)
+
+/* monster spell number */
+#define RF4_SPELL_START 32 * 3
+#define RF5_SPELL_START 32 * 4
+#define RF6_SPELL_START 32 * 5
+
+#define RF4_SPELL_SIZE 32
+#define RF5_SPELL_SIZE 32
+#define RF6_SPELL_SIZE 32
+
+/* Spell Damage Calc Flag*/
+#define DAM_ROLL 1
+#define DAM_MAX 2
+#define DAM_MIN 3
+#define DICE_NUM 4
+#define DICE_SIDE 5
+#define DICE_MULT 6
+#define DICE_DIV 7
+#define BASE_DAM 8