OSDN Git Service

#37353 SINGING_COUNTを定義。 / Define SINGING_COUNT.
[hengband/hengband.git] / src / spells2.c
index e69dd23..02526df 100644 (file)
@@ -1890,7 +1890,7 @@ bool detect_traps(POSITION range, bool known)
 
        if (known) p_ptr->dtrap = TRUE;
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 0) detect = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
 
        /* Describe */
        if (detect)
@@ -1912,7 +1912,7 @@ bool detect_doors(POSITION range)
 {
        bool detect = detect_feat_flag(range, FF_DOOR, TRUE);
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 0) detect = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
 
        /* Describe */
        if (detect)
@@ -1934,7 +1934,7 @@ bool detect_stairs(POSITION range)
 {
        bool detect = detect_feat_flag(range, FF_STAIRS, TRUE);
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 0) detect = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
 
        /* Describe */
        if (detect)
@@ -1956,7 +1956,7 @@ bool detect_treasure(POSITION range)
 {
        bool detect = detect_feat_flag(range, FF_HAS_GOLD, TRUE);
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 6) detect = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
 
        /* Describe */
        if (detect)
@@ -2015,7 +2015,7 @@ bool detect_objects_gold(POSITION range)
                }
        }
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 6) detect = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
 
        /* Describe */
        if (detect)
@@ -2079,7 +2079,7 @@ bool detect_objects_normal(POSITION range)
                }
        }
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 6) detect = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
 
        /* Describe */
        if (detect)
@@ -2194,7 +2194,8 @@ bool detect_objects_magic(POSITION range)
  */
 bool detect_monsters_normal(POSITION range)
 {
-       int i, y, x;
+       MONSTER_IDX i;
+       POSITION y, x;
 
        bool flag = FALSE;
 
@@ -2233,7 +2234,7 @@ bool detect_monsters_normal(POSITION range)
                }
        }
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 3) flag = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
 
        /* Describe */
        if (flag)
@@ -2254,7 +2255,8 @@ bool detect_monsters_normal(POSITION range)
  */
 bool detect_monsters_invis(POSITION range)
 {
-       int i, y, x;
+       MONSTER_IDX i;
+       POSITION y, x;
        bool flag = FALSE;
 
        if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
@@ -2299,7 +2301,7 @@ bool detect_monsters_invis(POSITION range)
                }
        }
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 3) flag = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
 
        /* Describe */
        if (flag)
@@ -2319,7 +2321,8 @@ bool detect_monsters_invis(POSITION range)
  */
 bool detect_monsters_evil(POSITION range)
 {
-       int i, y, x;
+       MONSTER_IDX i;
+       POSITION y, x;
        bool flag = FALSE;
 
        if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
@@ -2388,8 +2391,9 @@ bool detect_monsters_evil(POSITION range)
  */
 bool detect_monsters_nonliving(POSITION range)
 {
-       int     i, y, x;
-       bool    flag = FALSE;
+       MONSTER_IDX i;
+       POSITION y, x;
+       bool flag = FALSE;
 
        if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
 
@@ -2563,7 +2567,7 @@ bool detect_monsters_string(POSITION range, cptr Match)
                }
        }
 
-       if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 3) flag = FALSE;
+       if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
 
        /* Describe */
        if (flag)
@@ -2700,7 +2704,7 @@ bool detect_all(POSITION range)
  * this is done in two passes. -- JDL
  * </pre>
  */
-bool project_hack(int typ, int dam)
+bool project_hack(int typ, HIT_POINT dam)
 {
        int     i, x, y;
        int     flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE;
@@ -2802,7 +2806,7 @@ bool turn_undead(void)
  * @brief 視界内のアンデッド・モンスターにダメージを与える処理 / Dispel undead monsters
  * @return 効力があった場合TRUEを返す
  */
-bool dispel_undead(int dam)
+bool dispel_undead(HIT_POINT dam)
 {
        bool tester = (project_hack(GF_DISP_UNDEAD, dam));
        if (tester)
@@ -2814,7 +2818,7 @@ bool dispel_undead(int dam)
  * @brief 視界内の邪悪なモンスターにダメージを与える処理 / Dispel evil monsters
  * @return 効力があった場合TRUEを返す
  */
-bool dispel_evil(int dam)
+bool dispel_evil(HIT_POINT dam)
 {
        return (project_hack(GF_DISP_EVIL, dam));
 }
@@ -2823,7 +2827,7 @@ bool dispel_evil(int dam)
  * @brief 視界内の善良なモンスターにダメージを与える処理 / Dispel good monsters
  * @return 効力があった場合TRUEを返す
  */
-bool dispel_good(int dam)
+bool dispel_good(HIT_POINT dam)
 {
        return (project_hack(GF_DISP_GOOD, dam));
 }
@@ -2832,7 +2836,7 @@ bool dispel_good(int dam)
  * @brief 視界内のあらゆるモンスターにダメージを与える処理 / Dispel all monsters
  * @return 効力があった場合TRUEを返す
  */
-bool dispel_monsters(int dam)
+bool dispel_monsters(HIT_POINT dam)
 {
        return (project_hack(GF_DISP_ALL, dam));
 }
@@ -2841,7 +2845,7 @@ bool dispel_monsters(int dam)
  * @brief 視界内の生命のあるモンスターにダメージを与える処理 / Dispel 'living' monsters
  * @return 効力があった場合TRUEを返す
  */
-bool dispel_living(int dam)
+bool dispel_living(HIT_POINT dam)
 {
        return (project_hack(GF_DISP_LIVING, dam));
 }
@@ -2850,7 +2854,7 @@ bool dispel_living(int dam)
  * @brief 視界内の悪魔系モンスターにダメージを与える処理 / Dispel 'living' monsters
  * @return 効力があった場合TRUEを返す
  */
-bool dispel_demons(int dam)
+bool dispel_demons(HIT_POINT dam)
 {
        return (project_hack(GF_DISP_DEMON, dam));
 }
@@ -3122,7 +3126,7 @@ bool mass_genocide(int power, bool player_cast)
  */
 bool mass_genocide_undead(int power, bool player_cast)
 {
-       POSITION i;
+       MONSTER_IDX i;
        bool result = FALSE;
 
        /* Prevent mass genocide in quest levels */
@@ -3165,9 +3169,9 @@ bool mass_genocide_undead(int power, bool player_cast)
  */
 bool probing(void)
 {
-       int     i, speed;
-       int cu, cv;
-       bool    probe = FALSE;
+       int i, speed;
+       bool_hack cu, cv;
+       bool probe = FALSE;
        char buf[256];
        cptr align;
 
@@ -4118,7 +4122,7 @@ void discharge_minion(void)
        }
        for (i = 1; i < m_max; i++)
        {
-               int dam;
+               HIT_POINT dam;
                monster_type *m_ptr = &m_list[i];
                monster_race *r_ptr;
 
@@ -4588,9 +4592,9 @@ void unlite_room(int y1, int x1)
  * @param rad 効果半径
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool lite_area(int dam, int rad)
+bool lite_area(HIT_POINT dam, int rad)
 {
-       int flg = PROJECT_GRID | PROJECT_KILL;
+       BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
 
        if (d_info[dungeon_type].flags1 & DF1_DARKNESS)
        {
@@ -4621,9 +4625,9 @@ bool lite_area(int dam, int rad)
  * @param rad 効果半径
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool unlite_area(int dam, int rad)
+bool unlite_area(HIT_POINT dam, int rad)
 {
-       int flg = PROJECT_GRID | PROJECT_KILL;
+       BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
 
        /* Hack -- Message */
        if (!p_ptr->blind)
@@ -4657,11 +4661,11 @@ bool unlite_area(int dam, int rad)
  * Affect grids, objects, and monsters
  * </pre>
  */
-bool fire_ball(int typ, int dir, int dam, int rad)
+bool fire_ball(int typ, int dir, HIT_POINT dam, int rad)
 {
        int tx, ty;
 
-       int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
 
        if (typ == GF_CONTROL_LIVING) flg|= PROJECT_HIDE;
        /* Use the given direction */
@@ -4696,11 +4700,11 @@ bool fire_ball(int typ, int dir, int dam, int rad)
  * Affect grids, objects, and monsters
  * </pre>
  */
-bool fire_rocket(int typ, int dir, int dam, int rad)
+bool fire_rocket(int typ, int dir, HIT_POINT dam, int rad)
 {
        int tx, ty;
 
-       int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
 
        /* Use the given direction */
        tx = p_ptr->x + 99 * ddx[dir];
@@ -4732,11 +4736,11 @@ bool fire_rocket(int typ, int dir, int dam, int rad)
  * Affect grids, objects, and monsters
  * </pre>
  */
-bool fire_ball_hide(int typ, int dir, int dam, int rad)
+bool fire_ball_hide(int typ, int dir, HIT_POINT dam, int rad)
 {
        int tx, ty;
 
-       int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE;
 
        /* Use the given direction */
        tx = p_ptr->x + 99 * ddx[dir];
@@ -4773,9 +4777,9 @@ bool fire_ball_hide(int typ, int dir, int dam, int rad)
  * Option to hurt the player.
  * </pre>
  */
-bool fire_meteor(int who, int typ, int y, int x, int dam, int rad)
+bool fire_meteor(MONSTER_IDX who, EFFECT_ID typ, POSITION y, POSITION x, HIT_POINT dam, POSITION rad)
 {
-       int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
 
        /* Analyze the "target" and the caster. */
        return (project(who, rad, y, x, dam, typ, flg, -1));
@@ -4798,7 +4802,7 @@ bool fire_blast(int typ, int dir, int dd, int ds, int num, int dev)
        int ty, tx, y, x;
        int i;
 
-       int flg = PROJECT_FAST | PROJECT_THRU | PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE | PROJECT_GRID;
+       BIT_FLAGS flg = PROJECT_FAST | PROJECT_THRU | PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE | PROJECT_GRID;
 
        /* Assume okay */
        bool result = TRUE;
@@ -4924,7 +4928,7 @@ bool teleport_swap(int dir)
  * @param flg フラグ
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool project_hook(int typ, int dir, int dam, int flg)
+bool project_hook(int typ, int dir, HIT_POINT dam, BIT_FLAGS flg)
 {
        int tx, ty;
 
@@ -4959,9 +4963,9 @@ bool project_hook(int typ, int dir, int dam, int flg)
  * Affect monsters and grids (not objects).
  * </pre>
  */
-bool fire_bolt(int typ, int dir, int dam)
+bool fire_bolt(int typ, int dir, HIT_POINT dam)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_GRID;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_GRID;
        if (typ != GF_ARROW) flg |= PROJECT_REFLECTABLE;
        return (project_hook(typ, dir, dam, flg));
 }
@@ -4979,9 +4983,9 @@ bool fire_bolt(int typ, int dir, int dam)
  * Affect monsters, grids and objects.
  * </pre>
  */
-bool fire_beam(int typ, int dir, int dam)
+bool fire_beam(int typ, int dir, HIT_POINT dam)
 {
-       int flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM;
+       BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM;
        return (project_hook(typ, dir, dam, flg));
 }
 
@@ -4999,7 +5003,7 @@ bool fire_beam(int typ, int dir, int dam)
  * Affect monsters, grids and objects.
  * </pre>
  */
-bool fire_bolt_or_beam(int prob, int typ, int dir, int dam)
+bool fire_bolt_or_beam(int prob, int typ, int dir, HIT_POINT dam)
 {
        if (randint0(100) < prob)
        {
@@ -5017,9 +5021,9 @@ bool fire_bolt_or_beam(int prob, int typ, int dir, int dam)
  * @param dam 威力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool lite_line(int dir, int dam)
+bool lite_line(int dir, HIT_POINT dam)
 {
-       int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_KILL;
+       BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_KILL;
        return (project_hook(GF_LITE_WEAK, dir, dam, flg));
 }
 
@@ -5029,9 +5033,9 @@ bool lite_line(int dir, int dam)
  * @param dam 威力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool drain_life(int dir, int dam)
+bool drain_life(int dir, HIT_POINT dam)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_DRAIN, dir, dam, flg));
 }
 
@@ -5041,9 +5045,9 @@ bool drain_life(int dir, int dam)
  * @param dam 威力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool wall_to_mud(int dir, int dam)
+bool wall_to_mud(int dir, HIT_POINT dam)
 {
-       int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
+       BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
        return (project_hook(GF_KILL_WALL, dir, dam, flg));
 }
 
@@ -5054,7 +5058,7 @@ bool wall_to_mud(int dir, int dam)
  */
 bool wizard_lock(int dir)
 {
-       int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
+       BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
        return (project_hook(GF_JAM_DOOR, dir, 20 + randint1(30), flg));
 }
 
@@ -5065,7 +5069,7 @@ bool wizard_lock(int dir)
  */
 bool destroy_door(int dir)
 {
-       int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
+       BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
        return (project_hook(GF_KILL_DOOR, dir, 0, flg));
 }
 
@@ -5076,7 +5080,7 @@ bool destroy_door(int dir)
  */
 bool disarm_trap(int dir)
 {
-       int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
+       BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
        return (project_hook(GF_KILL_TRAP, dir, 0, flg));
 }
 
@@ -5086,9 +5090,9 @@ bool disarm_trap(int dir)
  * @param dam 威力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool heal_monster(int dir, int dam)
+bool heal_monster(int dir, HIT_POINT dam)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_HEAL, dir, dam, flg));
 }
 
@@ -5100,7 +5104,7 @@ bool heal_monster(int dir, int dam)
  */
 bool speed_monster(int dir, int power)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_SPEED, dir, power, flg));
 }
 
@@ -5112,7 +5116,7 @@ bool speed_monster(int dir, int power)
  */
 bool slow_monster(int dir, int power)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_SLOW, dir, power, flg));
 }
 
@@ -5124,7 +5128,7 @@ bool slow_monster(int dir, int power)
  */
 bool sleep_monster(int dir, int power)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_SLEEP, dir, power, flg));
 }
 
@@ -5158,7 +5162,7 @@ bool stasis_evil(int dir)
  */
 bool confuse_monster(int dir, int plev)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_CONF, dir, plev, flg));
 }
 
@@ -5170,7 +5174,7 @@ bool confuse_monster(int dir, int plev)
  */
 bool stun_monster(int dir, int plev)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_STUN, dir, plev, flg));
 }
 
@@ -5182,7 +5186,7 @@ bool stun_monster(int dir, int plev)
  */
 bool poly_monster(int dir, int power)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        bool tester = (project_hook(GF_OLD_POLY, dir, power, flg));
        if (tester)
                chg_virtue(V_CHANCE, 1);
@@ -5196,7 +5200,7 @@ bool poly_monster(int dir, int power)
  */
 bool clone_monster(int dir)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_CLONE, dir, 0, flg));
 }
 
@@ -5208,7 +5212,7 @@ bool clone_monster(int dir)
  */
 bool fear_monster(int dir, int plev)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_TURN_ALL, dir, plev, flg));
 }
 
@@ -5220,7 +5224,7 @@ bool fear_monster(int dir, int plev)
  */
 bool death_ray(int dir, int plev)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_DEATH_RAY, dir, plev * 200, flg));
 }
 
@@ -5232,7 +5236,7 @@ bool death_ray(int dir, int plev)
  */
 bool teleport_monster(int dir, int distance)
 {
-       int flg = PROJECT_BEAM | PROJECT_KILL;
+       BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL;
        return (project_hook(GF_AWAY_ALL, dir, distance, flg));
 }
 
@@ -5242,7 +5246,7 @@ bool teleport_monster(int dir, int distance)
  */
 bool door_creation(void)
 {
-       int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
+       BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
        return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_DOOR, flg, -1));
 }
 
@@ -5254,7 +5258,7 @@ bool door_creation(void)
  */
 bool trap_creation(int y, int x)
 {
-       int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
+       BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
        return (project(0, 1, y, x, 0, GF_MAKE_TRAP, flg, -1));
 }
 
@@ -5264,7 +5268,7 @@ bool trap_creation(int y, int x)
  */
 bool tree_creation(void)
 {
-       int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
+       BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
        return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_TREE, flg, -1));
 }
 
@@ -5274,7 +5278,7 @@ bool tree_creation(void)
  */
 bool glyph_creation(void)
 {
-       int flg = PROJECT_GRID | PROJECT_ITEM;
+       BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM;
        return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_GLYPH, flg, -1));
 }
 
@@ -5284,7 +5288,7 @@ bool glyph_creation(void)
  */
 bool wall_stone(void)
 {
-       int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
+       BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
 
        bool dummy = (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_STONE_WALL, flg, -1));
 
@@ -5303,7 +5307,7 @@ bool wall_stone(void)
  */
 bool destroy_doors_touch(void)
 {
-       int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
+       BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
        return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_KILL_DOOR, flg, -1));
 }
 
@@ -5313,7 +5317,7 @@ bool destroy_doors_touch(void)
  */
 bool disarm_traps_touch(void)
 {
-       int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
+       BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
        return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_KILL_TRAP, flg, -1));
 }
 
@@ -5323,7 +5327,7 @@ bool disarm_traps_touch(void)
  */
 bool sleep_monsters_touch(void)
 {
-       int flg = PROJECT_KILL | PROJECT_HIDE;
+       BIT_FLAGS flg = PROJECT_KILL | PROJECT_HIDE;
        return (project(0, 1, p_ptr->y, p_ptr->x, p_ptr->lev, GF_OLD_SLEEP, flg, -1));
 }
 
@@ -5335,9 +5339,9 @@ bool sleep_monsters_touch(void)
  * @param x 起点X座標
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool animate_dead(int who, int y, int x)
+bool animate_dead(MONSTER_IDX who, POSITION y, POSITION x)
 {
-       int flg = PROJECT_ITEM | PROJECT_HIDE;
+       BIT_FLAGS flg = PROJECT_ITEM | PROJECT_HIDE;
        return (project(who, 5, y, x, 0, GF_ANIM_DEAD, flg, -1));
 }
 
@@ -5408,7 +5412,7 @@ bool activate_ty_curse(bool stop_ty, int *count)
 {
        int     i = 0;
 
-       int flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
+       BIT_FLAGS flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
 
        do
        {
@@ -5424,7 +5428,7 @@ bool activate_ty_curse(bool stop_ty, int *count)
                case 30: case 31:
                        if (!(*count))
                        {
-                               int dam = damroll(10, 10);
+                               HIT_POINT dam = damroll(10, 10);
                                msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
                                project(0, 8, p_ptr->y, p_ptr->x, dam, GF_MANA, flg, -1);
                                take_hit(DAMAGE_NOESCAPE, dam, _("純粋な魔力の解放", "released pure mana"), -1);
@@ -5518,12 +5522,12 @@ bool activate_ty_curse(bool stop_ty, int *count)
  * @param can_pet プレイヤーのペットとなる可能性があるならばTRUEにする
  * @return 作用が実際にあった場合TRUEを返す
  */
-int activate_hi_summon(int y, int x, bool can_pet)
+int activate_hi_summon(POSITION y, POSITION x, bool can_pet)
 {
        int i;
        int count = 0;
-       int summon_lev;
-       u32b mode = PM_ALLOW_GROUP;
+       DEPTH summon_lev;
+       BIT_FLAGS mode = PM_ALLOW_GROUP;
        bool pet = FALSE;
 
        if (can_pet)
@@ -5607,12 +5611,12 @@ int activate_hi_summon(int y, int x, bool can_pet)
  * @param x 召喚位置X座標
  * @return 作用が実際にあった場合TRUEを返す
  */
-int summon_cyber(int who, int y, int x)
+int summon_cyber(MONSTER_IDX who, POSITION y, POSITION x)
 {
        int i;
        int max_cyber = (easy_band ? 1 : (dun_level / 50) + randint1(2));
        int count = 0;
-       u32b mode = PM_ALLOW_GROUP;
+       BIT_FLAGS mode = PM_ALLOW_GROUP;
 
        /* Summoned by a monster */
        if (who > 0)
@@ -5684,7 +5688,7 @@ void wall_breaker(void)
  * @param dam 効力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool confuse_monsters(int dam)
+bool confuse_monsters(HIT_POINT dam)
 {
        return (project_hack(GF_OLD_CONF, dam));
 }
@@ -5695,7 +5699,7 @@ bool confuse_monsters(int dam)
  * @param dam 効力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool charm_monsters(int dam)
+bool charm_monsters(HIT_POINT dam)
 {
        return (project_hack(GF_CHARM, dam));
 }
@@ -5706,7 +5710,7 @@ bool charm_monsters(int dam)
  * @param dam 効力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool charm_animals(int dam)
+bool charm_animals(HIT_POINT dam)
 {
        return (project_hack(GF_CONTROL_ANIMAL, dam));
 }
@@ -5717,7 +5721,7 @@ bool charm_animals(int dam)
  * @param dam 効力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool stun_monsters(int dam)
+bool stun_monsters(HIT_POINT dam)
 {
        return (project_hack(GF_STUN, dam));
 }
@@ -5728,7 +5732,7 @@ bool stun_monsters(int dam)
  * @param dam 効力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool stasis_monsters(int dam)
+bool stasis_monsters(HIT_POINT dam)
 {
        return (project_hack(GF_STASIS, dam));
 }
@@ -5739,7 +5743,7 @@ bool stasis_monsters(int dam)
  * @param dam 効力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool mindblast_monsters(int dam)
+bool mindblast_monsters(HIT_POINT dam)
 {
        return (project_hack(GF_PSI, dam));
 }
@@ -5761,7 +5765,7 @@ bool banish_monsters(int dist)
  * @param dam 効力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool turn_evil(int dam)
+bool turn_evil(HIT_POINT dam)
 {
        return (project_hack(GF_TURN_EVIL, dam));
 }
@@ -5772,7 +5776,7 @@ bool turn_evil(int dam)
  * @param dam 効力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool turn_monsters(int dam)
+bool turn_monsters(HIT_POINT dam)
 {
        return (project_hack(GF_TURN_ALL, dam));
 }
@@ -5795,7 +5799,7 @@ bool deathray_monsters(void)
  */
 bool charm_monster(int dir, int plev)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
        return (project_hook(GF_CHARM, dir, plev, flg));
 }
 
@@ -5807,7 +5811,7 @@ bool charm_monster(int dir, int plev)
  */
 bool control_one_undead(int dir, int plev)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
        return (project_hook(GF_CONTROL_UNDEAD, dir, plev, flg));
 }
 
@@ -5819,7 +5823,7 @@ bool control_one_undead(int dir, int plev)
  */
 bool control_one_demon(int dir, int plev)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
        return (project_hook(GF_CONTROL_DEMON, dir, plev, flg));
 }
 
@@ -5831,7 +5835,7 @@ bool control_one_demon(int dir, int plev)
  */
 bool charm_animal(int dir, int plev)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
        return (project_hook(GF_CONTROL_ANIMAL, dir, plev, flg));
 }
 
@@ -5843,7 +5847,7 @@ bool charm_animal(int dir, int plev)
  */
 bool charm_living(int dir, int plev)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL;
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
        return (project_hook(GF_CONTROL_LIVING, dir, plev, flg));
 }