OSDN Git Service

#37287 #37353 (2.2.0.89) BACT_IDX, BACT_RESTRICT_IDX 型を定義し、型の置換を継続中。LNK4075を修正。 ...
[hengband/hengband.git] / src / do-spell.c
index 741d836..1cd3674 100644 (file)
@@ -62,7 +62,7 @@ static cptr info_duration(int base, int sides)
  * @param range 効果範囲
  * @return フォーマットに従い整形された文字列
  */
-static cptr info_range(int range)
+static cptr info_range(POSITION range)
 {
        return format(_("範囲:%d", "range %d"), range);
 }
@@ -96,7 +96,7 @@ static cptr info_delay(int base, int sides)
  * @param dam 固定値
  * @return フォーマットに従い整形された文字列
  */
-static cptr info_multi_damage(int dam)
+static cptr info_multi_damage(HIT_POINT dam)
 {
        return format(_("損傷:各%d", "dam %d each"), dam);
 }
@@ -193,11 +193,11 @@ static int beam_chance(void)
  * @param mode モンスター生成条件フラグ
  * @return モンスターが(敵対も含めて)召還されたならばTRUEを返す。
  */
-static bool trump_summoning(int num, bool pet, int y, int x, int lev, int type, u32b mode)
+static bool trump_summoning(int num, bool pet, POSITION y, POSITION x, DEPTH lev, int type, BIT_FLAGS mode)
 {
-       int plev = p_ptr->lev;
+       PLAYER_LEVEL plev = p_ptr->lev;
 
-       int who;
+       MONSTER_IDX who;
        int i;
        bool success = FALSE;
 
@@ -487,7 +487,7 @@ static void cast_invoke_spirits(int dir)
  * @param spell 基準となる引数ID
  * @return なし
  */
-static void wild_magic(int spell)
+static void wild_magic(SPELL_IDX spell)
 {
        int counter = 0;
        int type = SUMMON_MOLD + randint0(6);
@@ -775,7 +775,7 @@ static void cast_shuffle(void)
  * @param rad 効力の半径
  * @return なし
  */
-static void cast_meteor(int dam, int rad)
+static void cast_meteor(HIT_POINT dam, int rad)
 {
        int i;
        int b = 10 + randint1(10);
@@ -820,7 +820,7 @@ static void cast_meteor(int dam, int rad)
  * @param rad 効力の半径
  * @return ターゲットを指定し、実行したならばTRUEを返す。
  */
-static bool cast_wrath_of_the_god(int dam, int rad)
+static bool cast_wrath_of_the_god(HIT_POINT dam, int rad)
 {
        int x, y, tx, ty;
        int nx, ny;
@@ -926,8 +926,8 @@ static bool item_tester_offer(object_type *o_ptr)
  */
 static bool cast_summon_greater_demon(void)
 {
-       int plev = p_ptr->lev;
-       int item;
+       PLAYER_LEVEL plev = p_ptr->lev;
+       OBJECT_IDX item;
        cptr q, s;
        int summon_lev;
        object_type *o_ptr;
@@ -986,7 +986,7 @@ static bool cast_summon_greater_demon(void)
  * @param song 魔法効果のID
  * @return なし
  */
-static void start_singing(int spell, int song)
+static void start_singing(SPELL_IDX spell, MAGIC_NUM1 song)
 {
        /* Remember the song index */
        p_ptr->magic_num1[0] = song;
@@ -1048,7 +1048,7 @@ void stop_singing(void)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_life_spell(int spell, int mode)
+static cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -1575,7 +1575,7 @@ static cptr do_life_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_sorcery_spell(int spell, int mode)
+static cptr do_sorcery_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -1608,7 +1608,7 @@ static cptr do_sorcery_spell(int spell, int mode)
                if (desc) return _("近距離のテレポートをする。", "Teleport short distance.");
     
                {
-                       int range = 10;
+                       POSITION range = 10;
 
                        if (info) return info_range(range);
 
@@ -1678,7 +1678,7 @@ static cptr do_sorcery_spell(int spell, int mode)
                if (desc) return _("遠距離のテレポートをする。", "Teleport long distance.");
     
                {
-                       int range = plev * 5;
+                       POSITION range = plev * 5;
 
                        if (info) return info_range(range);
 
@@ -1963,7 +1963,7 @@ static cptr do_sorcery_spell(int spell, int mode)
                if (desc) return _("短距離内の指定した場所にテレポートする。", "Teleport to given location.");
     
                {
-                       int range = plev / 2 + 10;
+                       POSITION range = plev / 2 + 10;
 
                        if (info) return info_range(range);
 
@@ -2123,7 +2123,7 @@ static cptr do_sorcery_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_nature_spell(int spell, int mode)
+static cptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -2161,7 +2161,7 @@ static cptr do_nature_spell(int spell, int mode)
                {
                        int dice = 3 + (plev - 1) / 5;
                        int sides = 4;
-                       int range = plev / 6 + 2;
+                       POSITION range = plev / 6 + 2;
 
                        if (info) return format("%s%dd%d %s%d", s_dam, dice, sides, s_rng, range);
 
@@ -2605,7 +2605,7 @@ static cptr do_nature_spell(int spell, int mode)
                if (desc) return _("巨大な冷気の球を放つ。", "Fires a huge ball of cold.");
     
                {
-                       int dam = 70 + plev * 3 / 2;
+                       HIT_POINT dam = 70 + plev * 3 / 2;
                        int rad = plev / 12 + 1;
 
                        if (info) return info_damage(0, 0, dam);
@@ -2624,7 +2624,7 @@ static cptr do_nature_spell(int spell, int mode)
                if (desc) return _("巨大な電撃の球を放つ。", "Fires a huge electric ball.");
     
                {
-                       int dam = 90 + plev * 3 / 2;
+                       HIT_POINT dam = 90 + plev * 3 / 2;
                        int rad = plev / 12 + 1;
 
                        if (info) return info_damage(0, 0, dam);
@@ -2643,7 +2643,7 @@ static cptr do_nature_spell(int spell, int mode)
                if (desc) return _("巨大な水の球を放つ。", "Fires a huge ball of water.");
     
                {
-                       int dam = 100 + plev * 3 / 2;
+                       HIT_POINT dam = 100 + plev * 3 / 2;
                        int rad = plev / 12 + 1;
 
                        if (info) return info_damage(0, 0, dam);
@@ -2662,7 +2662,7 @@ static cptr do_nature_spell(int spell, int mode)
                        "Generates ball of light centered on you. Maps and lights whole dungeon level. Knows all objects location.");
     
                {
-                       int dam = 150;
+                       HIT_POINT dam = 150;
                        int rad = 8;
 
                        if (info) return info_damage(0, 0, dam/2);
@@ -2728,7 +2728,7 @@ static cptr do_nature_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_chaos_spell(int spell, int mode)
+static cptr do_chaos_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -2892,7 +2892,7 @@ static cptr do_chaos_spell(int spell, int mode)
                if (desc) return _("遠距離のテレポートをする。", "Teleport long distance.");
     
                {
-                       int range = plev * 5;
+                       POSITION range = plev * 5;
 
                        if (info) return info_range(range);
 
@@ -2944,7 +2944,7 @@ static cptr do_chaos_spell(int spell, int mode)
                if (desc) return _("自分を中心とした轟音の球を発生させる。", "Generates a ball of sound centered on you.");
     
                {
-                       int dam = 60 + plev;
+                       HIT_POINT dam = 60 + plev;
                        int rad = plev / 10 + 2;
 
                        if (info) return info_damage(0, 0, dam/2);
@@ -2981,7 +2981,7 @@ static cptr do_chaos_spell(int spell, int mode)
                if (desc) return _("炎の球を放つ。", "Fires a ball of fire.");
     
                {
-                       int dam = plev + 55;
+                       HIT_POINT dam = plev + 55;
                        int rad = 2;
 
                        if (info) return info_damage(0, 0, dam);
@@ -3033,7 +3033,7 @@ static cptr do_chaos_spell(int spell, int mode)
                if (desc) return _("巨大なカオスの球を放つ。", "Fires a huge ball of chaos.");
     
                {
-                       int dam = plev * 2 + 99;
+                       HIT_POINT dam = plev * 2 + 99;
                        int rad = plev / 5;
 
                        if (info) return info_damage(0, 0, dam);
@@ -3104,7 +3104,7 @@ static cptr do_chaos_spell(int spell, int mode)
                if (desc) return _("巨大な分解の球を放つ。", "Fires a huge ball of disintegration.");
     
                {
-                       int dam = plev + 70;
+                       HIT_POINT dam = plev + 70;
                        int rad = 3 + plev / 40;
 
                        if (info) return info_damage(0, 0, dam);
@@ -3140,7 +3140,7 @@ static cptr do_chaos_spell(int spell, int mode)
                if (desc) return _("ロケットを発射する。", "Fires a magic rocket.");
     
                {
-                       int dam = 120 + plev * 2;
+                       HIT_POINT dam = 120 + plev * 2;
                        int rad = 2;
 
                        if (info) return info_damage(0, 0, dam);
@@ -3222,7 +3222,7 @@ static cptr do_chaos_spell(int spell, int mode)
                if (desc) return _("自分の周辺に隕石を落とす。", "Makes meteor balls fall down to nearby random locations.");
     
                {
-                       int dam = plev * 2;
+                       HIT_POINT dam = plev * 2;
                        int rad = 2;
 
                        if (info) return info_multi_damage(dam);
@@ -3239,7 +3239,7 @@ static cptr do_chaos_spell(int spell, int mode)
                if (desc) return _("自分を中心とした超巨大な炎の球を発生させる。", "Generate a huge ball of fire centered on you.");
     
                {
-                       int dam = 300 + 3 * plev;
+                       HIT_POINT dam = 300 + 3 * plev;
                        int rad = 8;
 
                        if (info) return info_damage(0, 0, dam/2);
@@ -3283,7 +3283,7 @@ static cptr do_chaos_spell(int spell, int mode)
                if (desc) return _("非常に強力で巨大な純粋な魔力の球を放つ。", "Fires an extremely powerful huge ball of pure mana.");
     
                {
-                       int dam = 300 + plev * 4;
+                       HIT_POINT dam = 300 + plev * 4;
                        int rad = 4;
 
                        if (info) return info_damage(0, 0, dam);
@@ -3302,7 +3302,7 @@ static cptr do_chaos_spell(int spell, int mode)
                if (desc) return _("非常に強力なカオスの球を放つ。", "Fires an extremely powerful ball of chaos.");
     
                {
-                       int dam = p_ptr->chp;
+                       HIT_POINT dam = p_ptr->chp;
                        int rad = 2;
 
                        if (info) return info_damage(0, 0, dam);
@@ -3341,7 +3341,7 @@ static cptr do_chaos_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_death_spell(int spell, int mode)
+static cptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -3437,7 +3437,7 @@ static cptr do_death_spell(int spell, int mode)
                if (desc) return _("毒の球を放つ。", "Fires a ball of poison.");
     
                {
-                       int dam = 10 + plev / 2;
+                       HIT_POINT dam = 10 + plev / 2;
                        int rad = 2;
 
                        if (info) return info_damage(0, 0, dam);
@@ -3576,7 +3576,7 @@ static cptr do_death_spell(int spell, int mode)
                if (desc) return _("自分を中心とした毒の球を発生させる。", "Generate a ball of poison centered on you.");
     
                {
-                       int dam = (30 + plev) * 2;
+                       HIT_POINT dam = (30 + plev) * 2;
                        int rad = plev / 10 + 2;
 
                        if (info) return info_damage(0, 0, dam/2);
@@ -3632,7 +3632,7 @@ static cptr do_death_spell(int spell, int mode)
 
                        if (cast)
                        {
-                               int dam = base + damroll(dice, sides);
+                               HIT_POINT dam = base + damroll(dice, sides);
 
                                if (!get_aim_dir(&dir)) return NULL;
 
@@ -3786,7 +3786,7 @@ static cptr do_death_spell(int spell, int mode)
                        "Fires 3 bolts. Each of the bolts absorbs some HP from a monster and gives them to you.");
     
                {
-                       int dam = 100;
+                       HIT_POINT dam = 100;
 
                        if (info) return format("%s3*%d", s_dam, dam);
 
@@ -3829,7 +3829,7 @@ static cptr do_death_spell(int spell, int mode)
                if (desc) return _("巨大な暗黒の球を放つ。", "Fires a huge ball of darkness.");
     
                {
-                       int dam = 100 + plev * 2;
+                       HIT_POINT dam = 100 + plev * 2;
                        int rad = 4;
 
                        if (info) return info_damage(0, 0, dam);
@@ -3971,7 +3971,7 @@ static cptr do_death_spell(int spell, int mode)
                        "Fires a powerful ball of evil power. Hurts good monsters greatly.");
     
                {
-                       int dam = 666;
+                       HIT_POINT dam = 666;
                        int rad = 3;
 
                        if (info) return info_damage(0, 0, dam);
@@ -4014,7 +4014,7 @@ static cptr do_death_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_trump_spell(int spell, int mode)
+static cptr do_trump_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -4033,7 +4033,7 @@ static cptr do_trump_spell(int spell, int mode)
                if (desc) return _("近距離のテレポートをする。", "Teleport short distance.");
     
                {
-                       int range = 10;
+                       POSITION range = 10;
 
                        if (info) return info_range(range);
 
@@ -4094,7 +4094,7 @@ static cptr do_trump_spell(int spell, int mode)
                if (desc) return _("遠距離のテレポートをする。", "Teleport long distance.");
     
                {
-                       int range = plev * 4;
+                       POSITION range = plev * 4;
 
                        if (info) return info_range(range);
 
@@ -4279,7 +4279,7 @@ static cptr do_trump_spell(int spell, int mode)
                if (desc) return _("短距離内の指定した場所にテレポートする。", "Teleport to given location.");
     
                {
-                       int range = plev / 2 + 10;
+                       POSITION range = plev / 2 + 10;
 
                        if (info) return info_range(range);
 
@@ -4571,7 +4571,7 @@ static cptr do_trump_spell(int spell, int mode)
                if (desc) return _("自分の周辺に隕石を落とす。", "Makes meteor balls fall down to nearby random locations.");
     
                {
-                       int dam = plev * 2;
+                       HIT_POINT dam = plev * 2;
                        int rad = 2;
 
                        if (info) return info_multi_damage(dam);
@@ -4660,7 +4660,7 @@ static cptr do_trump_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_arcane_spell(int spell, int mode)
+static cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -4742,7 +4742,7 @@ static cptr do_arcane_spell(int spell, int mode)
                if (desc) return _("近距離のテレポートをする。", "Teleport short distance.");
     
                {
-                       int range = 10;
+                       POSITION range = 10;
 
                        if (info) return info_range(range);
 
@@ -4984,7 +4984,7 @@ static cptr do_arcane_spell(int spell, int mode)
                if (desc) return _("遠距離のテレポートをする。", "Teleport long distance.");
     
                {
-                       int range = plev * 5;
+                       POSITION range = plev * 5;
 
                        if (info) return info_range(range);
 
@@ -5126,7 +5126,7 @@ static cptr do_arcane_spell(int spell, int mode)
                if (desc) return _("炎、電撃、冷気、酸のどれかの球を放つ。", "Fires a ball of some elements.");
     
                {
-                       int dam = 75 + plev;
+                       HIT_POINT dam = 75 + plev;
                        int rad = 2;
 
                        if (info) return info_damage(0, 0, dam);
@@ -5221,7 +5221,7 @@ static cptr do_arcane_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_craft_spell(int spell, int mode)
+static cptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -5754,7 +5754,7 @@ static cptr do_craft_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_daemon_spell(int spell, int mode)
+static cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -5992,7 +5992,7 @@ static cptr do_daemon_spell(int spell, int mode)
                if (desc) return _("炎の球を放つ。", "Fires a ball of fire.");
     
                {
-                       int dam = plev + 55;
+                       HIT_POINT dam = plev + 55;
                        int rad = 2;
 
                        if (info) return info_damage(0, 0, dam);
@@ -6023,7 +6023,7 @@ static cptr do_daemon_spell(int spell, int mode)
                if (desc) return _("大きな地獄の球を放つ。", "Fires a huge ball of nether.");
     
                {
-                       int dam = plev * 3 / 2 + 100;
+                       HIT_POINT dam = plev * 3 / 2 + 100;
                        int rad = plev / 20 + 2;
 
                        if (info) return info_damage(0, 0, dam);
@@ -6120,7 +6120,7 @@ static cptr do_daemon_spell(int spell, int mode)
                        "Generates a ball of fire centered on you which transforms floors to magma.");
     
                {
-                       int dam = (55 + plev) * 2;
+                       HIT_POINT dam = (55 + plev) * 2;
                        int rad = 3;
 
                        if (info) return info_damage(0, 0, dam/2);
@@ -6138,7 +6138,7 @@ static cptr do_daemon_spell(int spell, int mode)
                if (desc) return _("プラズマの球を放つ。", "Fires a ball of plasma.");
     
                {
-                       int dam = plev * 3 / 2 + 80;
+                       HIT_POINT dam = plev * 3 / 2 + 80;
                        int rad = 2 + plev / 40;
 
                        if (info) return info_damage(0, 0, dam);
@@ -6193,7 +6193,7 @@ static cptr do_daemon_spell(int spell, int mode)
                if (desc) return _("因果混乱の球を放つ。", "Fires a ball of nexus.");
     
                {
-                       int dam = 100 + plev * 2;
+                       HIT_POINT dam = 100 + plev * 2;
                        int rad = 4;
 
                        if (info) return info_damage(0, 0, dam);
@@ -6263,7 +6263,7 @@ static cptr do_daemon_spell(int spell, int mode)
                        "Generate balls of chaos, confusion and charm centered on you.");
     
                {
-                       int dam = 50 + plev;
+                       HIT_POINT dam = 50 + plev;
                        int power = 20 + plev;
                        int rad = 3 + plev / 20;
 
@@ -6308,7 +6308,7 @@ static cptr do_daemon_spell(int spell, int mode)
                if (desc) return _("超巨大な地獄の球を放つ。", "Generate a huge ball of nether.");
     
                {
-                       int dam = plev * 15;
+                       HIT_POINT dam = plev * 15;
                        int rad = plev / 5;
 
                        if (info) return info_damage(0, 0, dam);
@@ -6328,7 +6328,7 @@ static cptr do_daemon_spell(int spell, int mode)
                        "Puts blood curse which damages and causes various effects on a monster. You also take damage.");
     
                {
-                       int dam = 600;
+                       HIT_POINT dam = 600;
                        int rad = 0;
 
                        if (info) return info_damage(0, 0, dam);
@@ -6370,7 +6370,7 @@ static cptr do_daemon_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_crusade_spell(int spell, int mode)
+static cptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -6468,7 +6468,7 @@ static cptr do_crusade_spell(int spell, int mode)
                if (desc) return _("中距離のテレポートをする。", "Teleport medium distance.");
     
                {
-                       int range = 25 + plev / 2;
+                       POSITION range = 25 + plev / 2;
 
                        if (info) return info_range(range);
 
@@ -6631,7 +6631,7 @@ static cptr do_crusade_spell(int spell, int mode)
                if (desc) return _("強力な電撃のボルトを放つ。", "Fires a powerful bolt of lightning.");
     
                {
-                       int dam = plev * 5;
+                       HIT_POINT dam = plev * 5;
 
                        if (info) return info_damage(0, 0, dam);
 
@@ -6763,7 +6763,7 @@ static cptr do_crusade_spell(int spell, int mode)
                if (desc) return _("巨大な閃光の球を放つ。", "Fires a huge ball of powerful light.");
     
                {
-                       int dam = 100 + plev * 2;
+                       HIT_POINT dam = 100 + plev * 2;
                        int rad = 4;
 
                        if (info) return info_damage(0, 0, dam);
@@ -6896,7 +6896,7 @@ static cptr do_crusade_spell(int spell, int mode)
                if (desc) return _("ターゲットの周囲に分解の球を多数落とす。", "Drops many balls of disintegration near the target.");
     
                {
-                       int dam = plev * 3 + 25;
+                       HIT_POINT dam = plev * 3 + 25;
                        int rad = 2;
 
                        if (info) return info_multi_damage(dam);
@@ -6983,7 +6983,7 @@ static cptr do_crusade_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST / SPELL_FAIL / SPELL_CONT / SPELL_STOP)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST / SPELL_FAIL / SPELL_CONT / SPELL_STOP 時はNULL文字列を返す。
  */
-static cptr do_music_spell(int spell, int mode)
+static cptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -7900,7 +7900,7 @@ static cptr do_music_spell(int spell, int mode)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_CAST)
  * @return SPELL_NAME / SPELL_DESC 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
  */
-static cptr do_hissatsu_spell(int spell, int mode)
+static cptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -8176,7 +8176,7 @@ static cptr do_hissatsu_spell(int spell, int mode)
                                int i;
                                POSITION ty = y, tx = x;
                                POSITION oy = y, ox = x;
-                               IDX m_idx = cave[y][x].m_idx;
+                               MONSTER_IDX m_idx = cave[y][x].m_idx;
                                monster_type *m_ptr = &m_list[m_idx];
                                char m_name[80];
        
@@ -8523,9 +8523,9 @@ static cptr do_hissatsu_spell(int spell, int mode)
 
                        for (i = 0; i < 3; i++)
                        {
-                               int y, x;
-                               int ny, nx;
-                               int m_idx;
+                               POSITION y, x;
+                               POSITION ny, nx;
+                               MONSTER_IDX m_idx;
                                cave_type *c_ptr;
                                monster_type *m_ptr;
        
@@ -8873,7 +8873,7 @@ static bool item_tester_hook_cursed(object_type *o_ptr)
  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST / SPELL_CONT / SPELL_STOP)
  * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST / SPELL_CONT / SPELL_STOP 時はNULL文字列を返す。
  */
-static cptr do_hex_spell(int spell, int mode)
+static cptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
 {
        bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
@@ -8962,7 +8962,7 @@ static cptr do_hex_spell(int spell, int mode)
                if (desc) return _("装備している武器を呪う。", "Curses your weapon.");
                if (cast)
                {
-                       int item;
+                       OBJECT_IDX item;
                        cptr q, s;
                        char o_name[MAX_NLEN];
                        object_type *o_ptr;
@@ -9054,7 +9054,7 @@ static cptr do_hex_spell(int spell, int mode)
                if (cast)
                {
                        int a = 3 - (p_ptr->pspeed - 100) / 10;
-                       int r = 3 + randint1(3) + MAX(0, MIN(3, a));
+                       MAGIC_NUM2 r = 3 + randint1(3) + MAX(0, MIN(3, a));
 
                        if (p_ptr->magic_num2[2] > 0)
                        {
@@ -9268,7 +9268,7 @@ static cptr do_hex_spell(int spell, int mode)
                if (desc) return _("装備している防具に呪いをかける。", "Curse a piece of armour that you wielding.");
                if (cast)
                {
-                       int item;
+                       OBJECT_IDX item;
                        cptr q, s;
                        char o_name[MAX_NLEN];
                        object_type *o_ptr;
@@ -9478,7 +9478,7 @@ static cptr do_hex_spell(int spell, int mode)
                if (desc) return _("呪われた武器の呪いを吸収して魔力を回復する。", "Drains curse on your weapon and heals SP a little.");
                if (cast)
                {
-                       int item;
+                       OBJECT_IDX item;
                        cptr s, q;
                        u32b f[TR_FLAG_SIZE];
                        object_type *o_ptr;
@@ -9618,7 +9618,7 @@ static cptr do_hex_spell(int spell, int mode)
                if (info) return info_damage(0, 0, power);
                if (cast)
                {
-                       int r;
+                       MAGIC_NUM2 r;
                        int a = 3 - (p_ptr->pspeed - 100) / 10;
                        r = 1 + randint1(2) + MAX(0, MIN(3, a));
 
@@ -9696,7 +9696,7 @@ static cptr do_hex_spell(int spell, int mode)
  * @param mode 求める処理
  * @return 各領域魔法に各種テキストを求めた場合は文字列参照ポインタ、そうでない場合はNULLポインタを返す。
  */
-cptr do_spell(int realm, int spell, int mode)
+cptr do_spell(REALM_IDX realm, SPELL_IDX spell, BIT_FLAGS mode)
 {
        switch (realm)
        {