OSDN Git Service

ascii_to_zenkakuの全角マイナス記号を適切なものに修正
[hengband/hengband.git] / src / defines.h
index 27a9c47..423550a 100644 (file)
@@ -1,42 +1,39 @@
-/* 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.
+/*!
+ *  @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
  */
 
 
@@ -57,7 +54,7 @@
 #define FAKE_VERSION   0
 #define FAKE_VER_MAJOR 12
 #define FAKE_VER_MINOR 1
-#define FAKE_VER_PATCH 3
+#define FAKE_VER_PATCH 4
 
 
 /*
@@ -76,7 +73,7 @@
 #define H_VER_MAJOR 2
 #define H_VER_MINOR 1
 #define H_VER_PATCH 2
-#define H_VER_EXTRA 2
+#define H_VER_EXTRA 4
 
 
 #define ANGBAND_2_8_1
 /*
  * 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 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_XXXX1               4
-#define EGO_XXXX2               5
-#define EGO_XXXX3               6
+#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_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_BR_FIRE             38
 #define ACT_BR_COLD             39
 #define ACT_BR_DRAGON           40
-/* 33 - 50 unused */
+#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_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
 #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 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 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_HIDE_TYPE           73     /* Hide "pval" description */
 #define TR_SHOW_MODS           74     /* Always show Tohit/Todam */
 #define TR_SLAY_GOOD           75
-#define TR_LEVITATION             76     /* Feather Falling */
-#define TR_LITE                77     /* Permanent Light */
+#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_FIXED_FLAVOR        117
 #define TR_ADD_L_CURSE         118
 #define TR_ADD_H_CURSE         119
-
-#define TR_FLAG_MAX            120
-#define TR_FLAG_SIZE           4
+#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_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 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 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
@@ -4482,10 +4509,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")
  *
@@ -4560,11 +4607,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
@@ -4703,6 +4750,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
@@ -5429,6 +5477,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
 
 
 /*
@@ -5638,3 +5687,37 @@ extern int PlayerUID;
 #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