OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / spells2.c
index 1cbf7ba..6dd8ead 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "angband.h"
 #include "grid.h"
+#include "trap.h"
 
 
 /*!
@@ -905,7 +906,7 @@ bool detect_all(POSITION range)
  * this is done in two passes. -- JDL
  * </pre>
  */
-bool project_hack(int typ, HIT_POINT dam)
+bool project_hack(EFFECT_ID typ, HIT_POINT dam)
 {
        int     i, x, y;
        int     flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE;
@@ -1537,9 +1538,10 @@ bool probing(void)
  * "earthquake" by using the "full" to select "destruction".
  * </pre>
  */
-bool destroy_area(int y1, int x1, int r, bool in_generate)
+bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
 {
-       int       y, x, k, t;
+       POSITION y, x;
+       int k, t;
        cave_type *c_ptr;
        bool      flag = FALSE;
 
@@ -1630,7 +1632,7 @@ bool destroy_area(int y1, int x1, int r, bool in_generate)
                        /* During generation, destroyed artifacts are "preserved" */
                        if (preserve_mode || in_generate)
                        {
-                               s16b this_o_idx, next_o_idx = 0;
+                               OBJECT_IDX this_o_idx, next_o_idx = 0;
 
                                /* Scan all objects in the grid */
                                for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
@@ -1770,7 +1772,6 @@ bool destroy_area(int y1, int x1, int r, bool in_generate)
                /* Hack -- Affect player */
                if (flag)
                {
-                       /* Message */
                        msg_print(_("燃えるような閃光が発生した!", "There is a searing blast of light!"));
 
                        /* Blind the player */
@@ -1833,9 +1834,10 @@ bool destroy_area(int y1, int x1, int r, bool in_generate)
  * This has allowed massive simplification of the "monster" code.
  * </pre>
  */
-bool earthquake_aux(int cy, int cx, int r, MONSTER_IDX m_idx)
+bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
 {
-       int             i, t, y, x, yy, xx, dy, dx;
+       int i, t;
+       POSITION y, x, yy, xx, dy, dx;
        int             damage = 0;
        int             sn = 0;
        POSITION        sy = 0, sx = 0;
@@ -2111,7 +2113,6 @@ bool earthquake_aux(int cy, int cx, int r, MONSTER_IDX m_idx)
                                        /* Delete (not kill) "dead" monsters */
                                        if (m_ptr->hp < 0)
                                        {
-                                               /* Message */
                                                if (!ignore_unview || is_seen(m_ptr)) 
                                                        msg_format(_("%^sは岩石に埋もれてしまった!", "%^s is embedded in the rock!"), m_name);
 
@@ -2297,7 +2298,7 @@ bool earthquake_aux(int cy, int cx, int r, MONSTER_IDX m_idx)
  * @param cx 中心X座標
  * @param r 効果半径
  */
-bool earthquake(int cy, int cx, int r)
+bool earthquake(POSITION cy, POSITION cx, POSITION r)
 {
        return earthquake_aux(cy, cx, r, 0);
 }
@@ -2384,8 +2385,8 @@ static void cave_temp_room_lite(void)
        /* Clear them all */
        for (i = 0; i < temp_n; i++)
        {
-               int y = temp_y[i];
-               int x = temp_x[i];
+               POSITION y = temp_y[i];
+               POSITION x = temp_x[i];
 
                cave_type *c_ptr = &cave[y][x];
 
@@ -2470,8 +2471,8 @@ static void cave_temp_room_unlite(void)
        /* Clear them all */
        for (i = 0; i < temp_n; i++)
        {
-               int y = temp_y[i];
-               int x = temp_x[i];
+               POSITION y = temp_y[i];
+               POSITION x = temp_x[i];
                int j;
 
                cave_type *c_ptr = &cave[y][x];
@@ -2543,11 +2544,11 @@ static void cave_temp_room_unlite(void)
  * @param pass_bold 地形条件を返す関数ポインタ
  * @return 該当地形の数
  */
-static int next_to_open(int cy, int cx, bool (*pass_bold)(int, int))
+static int next_to_open(POSITION cy, POSITION cx, bool (*pass_bold)(POSITION, POSITION))
 {
        int i;
 
-       int y, x;
+       POSITION y, x;
 
        int len = 0;
        int blen = 0;
@@ -2584,12 +2585,10 @@ static int next_to_open(int cy, int cx, bool (*pass_bold)(int, int))
  * @param pass_bold 地形条件を返す関数ポインタ
  * @return 該当地形の数
  */
-static int next_to_walls_adj(int cy, int cx, bool (*pass_bold)(int, int))
+static int next_to_walls_adj(POSITION cy, POSITION cx, bool (*pass_bold)(POSITION, POSITION))
 {
-       int i;
-
-       int y, x;
-
+       DIRECTION i;
+       POSITION y, x;
        int c = 0;
 
        for (i = 0; i < 8; i++)
@@ -2612,7 +2611,7 @@ static int next_to_walls_adj(int cy, int cx, bool (*pass_bold)(int, int))
  * @param pass_bold 地形条件を返す関数ポインタ
  * @return 該当地形の数
  */
-static void cave_temp_room_aux(int y, int x, bool only_room, bool (*pass_bold)(int, int))
+static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pass_bold)(POSITION, POSITION))
 {
        cave_type *c_ptr;
 
@@ -2664,7 +2663,7 @@ static void cave_temp_room_aux(int y, int x, bool only_room, bool (*pass_bold)(i
  * @param x 指定X座標
  * @return 光を通すならばtrueを返す。
  */
-static bool cave_pass_lite_bold(int y, int x)
+static bool cave_pass_lite_bold(POSITION y, POSITION x)
 {
        return cave_los_bold(y, x);
 }
@@ -2675,7 +2674,7 @@ static bool cave_pass_lite_bold(int y, int x)
  * @param x 指定X座標
  * @return なし
  */
-static void cave_temp_lite_room_aux(int y, int x)
+static void cave_temp_lite_room_aux(POSITION y, POSITION x)
 {
        cave_temp_room_aux(y, x, FALSE, cave_pass_lite_bold);
 }
@@ -2686,7 +2685,7 @@ static void cave_temp_lite_room_aux(int y, int x)
  * @param x 指定X座標
  * @return 射線を通すならばtrueを返す。
  */
-static bool cave_pass_dark_bold(int y, int x)
+static bool cave_pass_dark_bold(POSITION y, POSITION x)
 {
        return cave_have_flag_bold(y, x, FF_PROJECT);
 }
@@ -2698,7 +2697,7 @@ static bool cave_pass_dark_bold(int y, int x)
  * @param x 指定X座標
  * @return なし
  */
-static void cave_temp_unlite_room_aux(int y, int x)
+static void cave_temp_unlite_room_aux(POSITION y, POSITION x)
 {
        cave_temp_room_aux(y, x, TRUE, cave_pass_dark_bold);
 }
@@ -2710,9 +2709,10 @@ static void cave_temp_unlite_room_aux(int y, int x)
  * @param x1 指定X座標
  * @return なし
  */
-void lite_room(int y1, int x1)
+void lite_room(POSITION y1, POSITION x1)
 {
-       int i, x, y;
+       int i;
+       POSITION x, y;
 
        /* Add the initial grid */
        cave_temp_lite_room_aux(y1, x1);
@@ -2754,9 +2754,10 @@ void lite_room(int y1, int x1)
  * @param x1 指定X座標
  * @return なし
  */
-void unlite_room(int y1, int x1)
+void unlite_room(POSITION y1, POSITION x1)
 {
-       int i, x, y;
+       int i;
+       POSITION x, y;
 
        /* Add the initial grid */
        cave_temp_unlite_room_aux(y1, x1);
@@ -2794,7 +2795,7 @@ void unlite_room(int y1, int x1)
  * @param rad 効果半径
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool lite_area(HIT_POINT dam, int rad)
+bool lite_area(HIT_POINT dam, POSITION rad)
 {
        BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
 
@@ -2827,7 +2828,7 @@ bool lite_area(HIT_POINT dam, int rad)
  * @param rad 効果半径
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool unlite_area(HIT_POINT dam, int rad)
+bool unlite_area(HIT_POINT dam, POSITION rad)
 {
        BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
 
@@ -2863,9 +2864,9 @@ bool unlite_area(HIT_POINT dam, int rad)
  * Affect grids, objects, and monsters
  * </pre>
  */
-bool fire_ball(int typ, int dir, HIT_POINT dam, int rad)
+bool fire_ball(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
 {
-       int tx, ty;
+       POSITION tx, ty;
 
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
 
@@ -2900,9 +2901,9 @@ bool fire_ball(int typ, int dir, HIT_POINT dam, int rad)
 * Affect grids, objects, and monsters
 * </pre>
 */
-bool fire_breath(int typ, int dir, HIT_POINT dam, int rad)
+bool fire_breath(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
 {
-       fire_ball(typ, dir, dam, -rad);
+       return fire_ball(typ, dir, dam, -rad);
 }
 
 
@@ -2920,7 +2921,7 @@ bool fire_breath(int typ, int dir, HIT_POINT dam, int rad)
  * Affect grids, objects, and monsters
  * </pre>
  */
-bool fire_rocket(int typ, int dir, HIT_POINT dam, int rad)
+bool fire_rocket(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
 {
        int tx, ty;
 
@@ -2956,7 +2957,7 @@ bool fire_rocket(int typ, int dir, HIT_POINT dam, int rad)
  * Affect grids, objects, and monsters
  * </pre>
  */
-bool fire_ball_hide(int typ, int dir, HIT_POINT dam, int rad)
+bool fire_ball_hide(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
 {
        int tx, ty;
 
@@ -3016,7 +3017,7 @@ bool fire_meteor(MONSTER_IDX who, EFFECT_ID typ, POSITION y, POSITION x, HIT_POI
  * @param dev 回数分散
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool fire_blast(int typ, int dir, int dd, int ds, int num, int dev)
+bool fire_blast(EFFECT_ID typ, DIRECTION dir, int dd, int ds, int num, int dev)
 {
        int ly, lx, ld;
        int ty, tx, y, x;
@@ -3074,12 +3075,12 @@ bool fire_blast(int typ, int dir, int dd, int ds, int num, int dev)
  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool teleport_swap(int dir)
+bool teleport_swap(DIRECTION dir)
 {
-       int tx, ty;
-       cave_type * c_ptr;
-       monster_type * m_ptr;
-       monster_race * r_ptr;
+       POSITION tx, ty;
+       cave_type* c_ptr;
+       monster_type* m_ptr;
+       monster_race* r_ptr;
 
        if ((dir == 5) && target_okay())
        {
@@ -3148,7 +3149,7 @@ bool teleport_swap(int dir)
  * @param flg フラグ
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool project_hook(int typ, int dir, HIT_POINT dam, BIT_FLAGS flg)
+bool project_hook(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg)
 {
        int tx, ty;
 
@@ -3183,7 +3184,7 @@ bool project_hook(int typ, int dir, HIT_POINT dam, BIT_FLAGS flg)
  * Affect monsters and grids (not objects).
  * </pre>
  */
-bool fire_bolt(int typ, int dir, HIT_POINT dam)
+bool fire_bolt(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_GRID;
        if (typ != GF_ARROW) flg |= PROJECT_REFLECTABLE;
@@ -3203,7 +3204,7 @@ bool fire_bolt(int typ, int dir, HIT_POINT dam)
  * Affect monsters, grids and objects.
  * </pre>
  */
-bool fire_beam(int typ, int dir, HIT_POINT dam)
+bool fire_beam(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM;
        return (project_hook(typ, dir, dam, flg));
@@ -3223,7 +3224,7 @@ bool fire_beam(int typ, int dir, HIT_POINT dam)
  * Affect monsters, grids and objects.
  * </pre>
  */
-bool fire_bolt_or_beam(int prob, int typ, int dir, HIT_POINT dam)
+bool fire_bolt_or_beam(PERCENTAGE prob, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam)
 {
        if (randint0(100) < prob)
        {
@@ -3241,7 +3242,7 @@ bool fire_bolt_or_beam(int prob, int typ, int dir, HIT_POINT dam)
  * @param dam 威力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool lite_line(int dir, HIT_POINT dam)
+bool lite_line(DIRECTION dir, HIT_POINT dam)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_KILL;
        return (project_hook(GF_LITE_WEAK, dir, dam, flg));
@@ -3253,7 +3254,7 @@ bool lite_line(int dir, HIT_POINT dam)
  * @param dam 威力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool hypodynamic_bolt(int dir, HIT_POINT dam)
+bool hypodynamic_bolt(DIRECTION dir, HIT_POINT dam)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_HYPODYNAMIA, dir, dam, flg));
@@ -3265,7 +3266,7 @@ bool hypodynamic_bolt(int dir, HIT_POINT dam)
  * @param dam 威力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool wall_to_mud(int dir, HIT_POINT dam)
+bool wall_to_mud(DIRECTION dir, HIT_POINT dam)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
        return (project_hook(GF_KILL_WALL, dir, dam, flg));
@@ -3276,7 +3277,7 @@ bool wall_to_mud(int dir, HIT_POINT dam)
  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool wizard_lock(int dir)
+bool wizard_lock(DIRECTION dir)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
        return (project_hook(GF_JAM_DOOR, dir, 20 + randint1(30), flg));
@@ -3287,7 +3288,7 @@ bool wizard_lock(int dir)
  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool destroy_door(int dir)
+bool destroy_door(DIRECTION dir)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
        return (project_hook(GF_KILL_DOOR, dir, 0, flg));
@@ -3298,7 +3299,7 @@ bool destroy_door(int dir)
  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool disarm_trap(int dir)
+bool disarm_trap(DIRECTION dir)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
        return (project_hook(GF_KILL_TRAP, dir, 0, flg));
@@ -3310,7 +3311,7 @@ bool disarm_trap(int dir)
  * @param dam 威力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool heal_monster(int dir, HIT_POINT dam)
+bool heal_monster(DIRECTION dir, HIT_POINT dam)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_HEAL, dir, dam, flg));
@@ -3322,7 +3323,7 @@ bool heal_monster(int dir, HIT_POINT dam)
  * @param power 効力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool speed_monster(int dir, int power)
+bool speed_monster(DIRECTION dir, int power)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_SPEED, dir, power, flg));
@@ -3334,7 +3335,7 @@ bool speed_monster(int dir, int power)
  * @param power 効力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool slow_monster(int dir, int power)
+bool slow_monster(DIRECTION dir, int power)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_SLOW, dir, power, flg));
@@ -3346,7 +3347,7 @@ bool slow_monster(int dir, int power)
  * @param power 効力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool sleep_monster(int dir, int power)
+bool sleep_monster(DIRECTION dir, int power)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_SLEEP, dir, power, flg));
@@ -3358,7 +3359,7 @@ bool sleep_monster(int dir, int power)
  * @return 作用が実際にあった場合TRUEを返す
  * @details 威力はプレイヤーレベル*2に固定
  */
-bool stasis_monster(int dir)
+bool stasis_monster(DIRECTION dir)
 {
        return (fire_ball_hide(GF_STASIS, dir, p_ptr->lev*2, 0));
 }
@@ -3369,7 +3370,7 @@ bool stasis_monster(int dir)
  * @return 作用が実際にあった場合TRUEを返す
  * @details 威力はプレイヤーレベル*2に固定
  */
-bool stasis_evil(int dir)
+bool stasis_evil(DIRECTION dir)
 {
        return (fire_ball_hide(GF_STASIS_EVIL, dir, p_ptr->lev*2, 0));
 }
@@ -3380,7 +3381,7 @@ bool stasis_evil(int dir)
  * @param plev プレイヤーレベル(=効力)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool confuse_monster(int dir, int plev)
+bool confuse_monster(DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_CONF, dir, plev, flg));
@@ -3392,7 +3393,7 @@ bool confuse_monster(int dir, int plev)
  * @param plev プレイヤーレベル(=効力)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool stun_monster(int dir, int plev)
+bool stun_monster(DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_STUN, dir, plev, flg));
@@ -3404,7 +3405,7 @@ bool stun_monster(int dir, int plev)
  * @param power 効力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool poly_monster(int dir, int power)
+bool poly_monster(DIRECTION dir, int power)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        bool tester = (project_hook(GF_OLD_POLY, dir, power, flg));
@@ -3418,7 +3419,7 @@ bool poly_monster(int dir, int power)
  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool clone_monster(int dir)
+bool clone_monster(DIRECTION dir)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_OLD_CLONE, dir, 0, flg));
@@ -3430,7 +3431,7 @@ bool clone_monster(int dir)
  * @param plev プレイヤーレベル(=効力)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool fear_monster(int dir, int plev)
+bool fear_monster(DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_TURN_ALL, dir, plev, flg));
@@ -3442,7 +3443,7 @@ bool fear_monster(int dir, int plev)
  * @param plev プレイヤーレベル(効力はplev*200)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool death_ray(int dir, int plev)
+bool death_ray(DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
        return (project_hook(GF_DEATH_RAY, dir, plev * 200, flg));
@@ -3454,7 +3455,7 @@ bool death_ray(int dir, int plev)
  * @param distance 移動距離
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool teleport_monster(int dir, int distance)
+bool teleport_monster(DIRECTION dir, int distance)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL;
        return (project_hook(GF_AWAY_ALL, dir, distance, flg));
@@ -3476,7 +3477,7 @@ bool door_creation(void)
  * @param x 起点X座標
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool trap_creation(int y, int x)
+bool trap_creation(POSITION y, POSITION x)
 {
        BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
        return (project(0, 1, y, x, 0, GF_MAKE_TRAP, flg, -1));
@@ -3572,7 +3573,7 @@ bool animate_dead(MONSTER_IDX who, POSITION y, POSITION x)
 void call_chaos(void)
 {
        int Chaos_type, dummy, dir;
-       int plev = p_ptr->lev;
+       PLAYER_LEVEL plev = p_ptr->lev;
        bool line_chaos = FALSE;
 
        int hurt_types[31] =
@@ -4017,7 +4018,7 @@ bool deathray_monsters(void)
  * @param plev パワー
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool charm_monster(int dir, int plev)
+bool charm_monster(DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
        return (project_hook(GF_CHARM, dir, plev, flg));
@@ -4029,7 +4030,7 @@ bool charm_monster(int dir, int plev)
  * @param plev パワー
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool control_one_undead(int dir, int plev)
+bool control_one_undead(DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
        return (project_hook(GF_CONTROL_UNDEAD, dir, plev, flg));
@@ -4041,7 +4042,7 @@ bool control_one_undead(int dir, int plev)
  * @param plev パワー
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool control_one_demon(int dir, int plev)
+bool control_one_demon(DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
        return (project_hook(GF_CONTROL_DEMON, dir, plev, flg));
@@ -4053,7 +4054,7 @@ bool control_one_demon(int dir, int plev)
  * @param plev パワー
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool charm_animal(int dir, int plev)
+bool charm_animal(DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
        return (project_hook(GF_CONTROL_ANIMAL, dir, plev, flg));
@@ -4120,7 +4121,7 @@ bool kawarimi(bool success)
  */
 bool rush_attack(bool *mdeath)
 {
-       int dir;
+       DIRECTION dir;
        int tx, ty;
        int tm_idx = 0;
        u16b path_g[32];
@@ -4237,7 +4238,7 @@ bool rush_attack(bool *mdeath)
  */
 void remove_all_mirrors(bool explode)
 {
-       int x, y;
+       POSITION x, y;
 
        for (x = 0; x < cur_wid; x++)
        {
@@ -4260,7 +4261,7 @@ void remove_all_mirrors(bool explode)
  * @param dir 発動の方向ID
  * @return なし
  */
-void ring_of_power(int dir)
+void ring_of_power(DIRECTION dir)
 {
        /* Pick a random effect */
        switch (randint1(10))
@@ -4268,7 +4269,6 @@ void ring_of_power(int dir)
        case 1:
        case 2:
        {
-               /* Message */
                msg_print(_("あなたは悪性のオーラに包み込まれた。", "You are surrounded by a malignant aura."));
                sound(SOUND_EVIL);
 
@@ -4290,7 +4290,6 @@ void ring_of_power(int dir)
 
        case 3:
        {
-               /* Message */
                msg_print(_("あなたは強力なオーラに包み込まれた。", "You are surrounded by a powerful aura."));
 
                /* Dispel monsters */
@@ -4322,3 +4321,1004 @@ void ring_of_power(int dir)
        }
 }
 
+/*!
+* @brief 運命の輪、並びにカオス的な効果の発動
+* @param spell ランダムな効果を選択するための基準ID
+* @return なし
+*/
+void wild_magic(int spell)
+{
+       int counter = 0;
+       int type = SUMMON_MOLD + randint0(6);
+
+       if (type < SUMMON_MOLD) type = SUMMON_MOLD;
+       else if (type > SUMMON_MIMIC) type = SUMMON_MIMIC;
+
+       switch (randint1(spell) + randint1(8) + 1)
+       {
+       case 1:
+       case 2:
+       case 3:
+               teleport_player(10, TELEPORT_PASSIVE);
+               break;
+       case 4:
+       case 5:
+       case 6:
+               teleport_player(100, TELEPORT_PASSIVE);
+               break;
+       case 7:
+       case 8:
+               teleport_player(200, TELEPORT_PASSIVE);
+               break;
+       case 9:
+       case 10:
+       case 11:
+               unlite_area(10, 3);
+               break;
+       case 12:
+       case 13:
+       case 14:
+               lite_area(damroll(2, 3), 2);
+               break;
+       case 15:
+               destroy_doors_touch();
+               break;
+       case 16: case 17:
+               wall_breaker();
+       case 18:
+               sleep_monsters_touch();
+               break;
+       case 19:
+       case 20:
+               trap_creation(p_ptr->y, p_ptr->x);
+               break;
+       case 21:
+       case 22:
+               door_creation();
+               break;
+       case 23:
+       case 24:
+       case 25:
+               aggravate_monsters(0);
+               break;
+       case 26:
+               earthquake(p_ptr->y, p_ptr->x, 5);
+               break;
+       case 27:
+       case 28:
+               (void)gain_random_mutation(0);
+               break;
+       case 29:
+       case 30:
+               apply_disenchant(1);
+               break;
+       case 31:
+               lose_all_info();
+               break;
+       case 32:
+               fire_ball(GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
+               break;
+       case 33:
+               wall_stone();
+               break;
+       case 34:
+       case 35:
+               while (counter++ < 8)
+               {
+                       (void)summon_specific(0, p_ptr->y, p_ptr->x, (dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
+               }
+               break;
+       case 36:
+       case 37:
+               activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
+               break;
+       case 38:
+               (void)summon_cyber(-1, p_ptr->y, p_ptr->x);
+               break;
+       default:
+       {
+               int count = 0;
+               (void)activate_ty_curse(FALSE, &count);
+               break;
+       }
+       }
+
+       return;
+}
+
+/*!
+* @brief カオス魔法「流星群」の処理としてプレイヤーを中心に隕石落下処理を10+1d10回繰り返す。
+* / Drop 10+1d10 meteor ball at random places near the player
+* @param dam ダメージ
+* @param rad 効力の半径
+* @return なし
+*/
+void cast_meteor(HIT_POINT dam, POSITION rad)
+{
+       int i;
+       int b = 10 + randint1(10);
+
+       for (i = 0; i < b; i++)
+       {
+               POSITION y = 0, x = 0;
+               int count;
+
+               for (count = 0; count <= 20; count++)
+               {
+                       int dy, dx, d;
+
+                       x = p_ptr->x - 8 + randint0(17);
+                       y = p_ptr->y - 8 + randint0(17);
+
+                       dx = (p_ptr->x > x) ? (p_ptr->x - x) : (x - p_ptr->x);
+                       dy = (p_ptr->y > y) ? (p_ptr->y - y) : (y - p_ptr->y);
+
+                       /* Approximate distance */
+                       d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
+
+                       if (d >= 9) continue;
+
+                       if (!in_bounds(y, x) || !projectable(p_ptr->y, p_ptr->x, y, x)
+                               || !cave_have_flag_bold(y, x, FF_PROJECT)) continue;
+
+                       /* Valid position */
+                       break;
+               }
+
+               if (count > 20) continue;
+
+               project(0, rad, y, x, dam, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
+       }
+}
+
+
+/*!
+* @brief 破邪魔法「神の怒り」の処理としてターゲットを指定した後分解のボールを最大20回発生させる。
+* @param dam ダメージ
+* @param rad 効力の半径
+* @return ターゲットを指定し、実行したならばTRUEを返す。
+*/
+bool cast_wrath_of_the_god(HIT_POINT dam, POSITION rad)
+{
+       POSITION x, y, tx, ty;
+       POSITION nx, ny;
+       DIRECTION dir;
+       int i;
+       int b = 10 + randint1(10);
+
+       if (!get_aim_dir(&dir)) return FALSE;
+
+       /* Use the given direction */
+       tx = p_ptr->x + 99 * ddx[dir];
+       ty = p_ptr->y + 99 * ddy[dir];
+
+       /* Hack -- Use an actual "target" */
+       if ((dir == 5) && target_okay())
+       {
+               tx = target_col;
+               ty = target_row;
+       }
+
+       x = p_ptr->x;
+       y = p_ptr->y;
+
+       while (1)
+       {
+               /* Hack -- Stop at the target */
+               if ((y == ty) && (x == tx)) break;
+
+               ny = y;
+               nx = x;
+               mmove2(&ny, &nx, p_ptr->y, p_ptr->x, ty, tx);
+
+               /* Stop at maximum range */
+               if (MAX_RANGE <= distance(p_ptr->y, p_ptr->x, ny, nx)) break;
+
+               /* Stopped by walls/doors */
+               if (!cave_have_flag_bold(ny, nx, FF_PROJECT)) break;
+
+               /* Stopped by monsters */
+               if ((dir != 5) && cave[ny][nx].m_idx != 0) break;
+
+               /* Save the new location */
+               x = nx;
+               y = ny;
+       }
+       tx = x;
+       ty = y;
+
+       for (i = 0; i < b; i++)
+       {
+               int count = 20, d = 0;
+
+               while (count--)
+               {
+                       int dx, dy;
+
+                       x = tx - 5 + randint0(11);
+                       y = ty - 5 + randint0(11);
+
+                       dx = (tx > x) ? (tx - x) : (x - tx);
+                       dy = (ty > y) ? (ty - y) : (y - ty);
+
+                       /* Approximate distance */
+                       d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
+                       /* Within the radius */
+                       if (d < 5) break;
+               }
+
+               if (count < 0) continue;
+
+               /* Cannot penetrate perm walls */
+               if (!in_bounds(y, x) ||
+                       cave_stop_disintegration(y, x) ||
+                       !in_disintegration_range(ty, tx, y, x))
+                       continue;
+
+               project(0, rad, y, x, dam, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
+       }
+
+       return TRUE;
+}
+
+/*!
+* @brief 「ワンダー」のランダムな効果を決定して処理する。
+* @param dir 方向ID
+* @return なし
+* @details
+* This spell should become more useful (more controlled) as the\n
+* player gains experience levels.  Thus, add 1/5 of the player's\n
+* level to the die roll.  This eliminates the worst effects later on,\n
+* while keeping the results quite random.  It also allows some potent\n
+* effects only at high level.
+*/
+void cast_wonder(DIRECTION dir)
+{
+       PLAYER_LEVEL plev = p_ptr->lev;
+       int die = randint1(100) + plev / 5;
+       int vir = virtue_number(V_CHANCE);
+
+       if (vir)
+       {
+               if (p_ptr->virtues[vir - 1] > 0)
+               {
+                       while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
+               }
+               else
+               {
+                       while (randint1(400) < (0 - p_ptr->virtues[vir - 1])) die--;
+               }
+       }
+
+       if (die < 26)
+               chg_virtue(V_CHANCE, 1);
+
+       if (die > 100)
+       {
+               msg_print(_("あなたは力がみなぎるのを感じた!", "You feel a surge of power!"));
+       }
+
+       if (die < 8) clone_monster(dir);
+       else if (die < 14) speed_monster(dir, plev);
+       else if (die < 26) heal_monster(dir, damroll(4, 6));
+       else if (die < 31) poly_monster(dir, plev);
+       else if (die < 36)
+               fire_bolt_or_beam(beam_chance() - 10, GF_MISSILE, dir,
+                       damroll(3 + ((plev - 1) / 5), 4));
+       else if (die < 41) confuse_monster(dir, plev);
+       else if (die < 46) fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
+       else if (die < 51) (void)lite_line(dir, damroll(6, 8));
+       else if (die < 56)
+               fire_bolt_or_beam(beam_chance() - 10, GF_ELEC, dir,
+                       damroll(3 + ((plev - 5) / 4), 8));
+       else if (die < 61)
+               fire_bolt_or_beam(beam_chance() - 10, GF_COLD, dir,
+                       damroll(5 + ((plev - 5) / 4), 8));
+       else if (die < 66)
+               fire_bolt_or_beam(beam_chance(), GF_ACID, dir,
+                       damroll(6 + ((plev - 5) / 4), 8));
+       else if (die < 71)
+               fire_bolt_or_beam(beam_chance(), GF_FIRE, dir,
+                       damroll(8 + ((plev - 5) / 4), 8));
+       else if (die < 76) hypodynamic_bolt(dir, 75);
+       else if (die < 81) fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
+       else if (die < 86) fire_ball(GF_ACID, dir, 40 + plev, 2);
+       else if (die < 91) fire_ball(GF_ICE, dir, 70 + plev, 3);
+       else if (die < 96) fire_ball(GF_FIRE, dir, 80 + plev, 3);
+       else if (die < 101) hypodynamic_bolt(dir, 100 + plev);
+       else if (die < 104)
+       {
+               earthquake(p_ptr->y, p_ptr->x, 12);
+       }
+       else if (die < 106)
+       {
+               (void)destroy_area(p_ptr->y, p_ptr->x, 13 + randint0(5), FALSE);
+       }
+       else if (die < 108)
+       {
+               symbol_genocide(plev + 50, TRUE);
+       }
+       else if (die < 110) dispel_monsters(120);
+       else /* RARE */
+       {
+               dispel_monsters(150);
+               slow_monsters(plev);
+               sleep_monsters(plev);
+               hp_player(300);
+       }
+}
+
+
+/*!
+* @brief 「悪霊召喚」のランダムな効果を決定して処理する。
+* @param dir 方向ID
+* @return なし
+*/
+void cast_invoke_spirits(DIRECTION dir)
+{
+       PLAYER_LEVEL plev = p_ptr->lev;
+       int die = randint1(100) + plev / 5;
+       int vir = virtue_number(V_CHANCE);
+
+       if (vir)
+       {
+               if (p_ptr->virtues[vir - 1] > 0)
+               {
+                       while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
+               }
+               else
+               {
+                       while (randint1(400) < (0 - p_ptr->virtues[vir - 1])) die--;
+               }
+       }
+
+       msg_print(_("あなたは死者たちの力を招集した...", "You call on the power of the dead..."));
+       if (die < 26)
+               chg_virtue(V_CHANCE, 1);
+
+       if (die > 100)
+       {
+               msg_print(_("あなたはおどろおどろしい力のうねりを感じた!", "You feel a surge of eldritch force!"));
+       }
+
+       if (die < 8)
+       {
+               msg_print(_("なんてこった!あなたの周りの地面から朽ちた人影が立ち上がってきた!",
+                       "Oh no! Mouldering forms rise from the earth around you!"));
+
+               (void)summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+               chg_virtue(V_UNLIFE, 1);
+       }
+       else if (die < 14)
+       {
+               msg_print(_("名状し難い邪悪な存在があなたの心を通り過ぎて行った...", "An unnamable evil brushes against your mind..."));
+
+               set_afraid(p_ptr->afraid + randint1(4) + 4);
+       }
+       else if (die < 26)
+       {
+               msg_print(_("あなたの頭に大量の幽霊たちの騒々しい声が押し寄せてきた...",
+                       "Your head is invaded by a horde of gibbering spectral voices..."));
+
+               set_confused(p_ptr->confused + randint1(4) + 4);
+       }
+       else if (die < 31)
+       {
+               poly_monster(dir, plev);
+       }
+       else if (die < 36)
+       {
+               fire_bolt_or_beam(beam_chance() - 10, GF_MISSILE, dir,
+                       damroll(3 + ((plev - 1) / 5), 4));
+       }
+       else if (die < 41)
+       {
+               confuse_monster(dir, plev);
+       }
+       else if (die < 46)
+       {
+               fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
+       }
+       else if (die < 51)
+       {
+               (void)lite_line(dir, damroll(6, 8));
+       }
+       else if (die < 56)
+       {
+               fire_bolt_or_beam(beam_chance() - 10, GF_ELEC, dir,
+                       damroll(3 + ((plev - 5) / 4), 8));
+       }
+       else if (die < 61)
+       {
+               fire_bolt_or_beam(beam_chance() - 10, GF_COLD, dir,
+                       damroll(5 + ((plev - 5) / 4), 8));
+       }
+       else if (die < 66)
+       {
+               fire_bolt_or_beam(beam_chance(), GF_ACID, dir,
+                       damroll(6 + ((plev - 5) / 4), 8));
+       }
+       else if (die < 71)
+       {
+               fire_bolt_or_beam(beam_chance(), GF_FIRE, dir,
+                       damroll(8 + ((plev - 5) / 4), 8));
+       }
+       else if (die < 76)
+       {
+               hypodynamic_bolt(dir, 75);
+       }
+       else if (die < 81)
+       {
+               fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
+       }
+       else if (die < 86)
+       {
+               fire_ball(GF_ACID, dir, 40 + plev, 2);
+       }
+       else if (die < 91)
+       {
+               fire_ball(GF_ICE, dir, 70 + plev, 3);
+       }
+       else if (die < 96)
+       {
+               fire_ball(GF_FIRE, dir, 80 + plev, 3);
+       }
+       else if (die < 101)
+       {
+               hypodynamic_bolt(dir, 100 + plev);
+       }
+       else if (die < 104)
+       {
+               earthquake(p_ptr->y, p_ptr->x, 12);
+       }
+       else if (die < 106)
+       {
+               (void)destroy_area(p_ptr->y, p_ptr->x, 13 + randint0(5), FALSE);
+       }
+       else if (die < 108)
+       {
+               symbol_genocide(plev + 50, TRUE);
+       }
+       else if (die < 110)
+       {
+               dispel_monsters(120);
+       }
+       else
+       { /* RARE */
+               dispel_monsters(150);
+               slow_monsters(plev);
+               sleep_monsters(plev);
+               hp_player(300);
+       }
+
+       if (die < 31)
+       {
+               msg_print(_("陰欝な声がクスクス笑う。「もうすぐおまえは我々の仲間になるだろう。弱き者よ。」",
+                       "Sepulchral voices chuckle. 'Soon you will join us, mortal.'"));
+       }
+}
+
+/*!
+* @brief トランプ領域の「シャッフル」の効果をランダムに決めて処理する。
+* @return なし
+*/
+void cast_shuffle(void)
+{
+       PLAYER_LEVEL plev = p_ptr->lev;
+       DIRECTION dir;
+       int die;
+       int vir = virtue_number(V_CHANCE);
+       int i;
+
+       /* Card sharks and high mages get a level bonus */
+       if ((p_ptr->pclass == CLASS_ROGUE) ||
+               (p_ptr->pclass == CLASS_HIGH_MAGE) ||
+               (p_ptr->pclass == CLASS_SORCERER))
+               die = (randint1(110)) + plev / 5;
+       else
+               die = randint1(120);
+
+
+       if (vir)
+       {
+               if (p_ptr->virtues[vir - 1] > 0)
+               {
+                       while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
+               }
+               else
+               {
+                       while (randint1(400) < (0 - p_ptr->virtues[vir - 1])) die--;
+               }
+       }
+
+       msg_print(_("あなたはカードを切って一枚引いた...", "You shuffle the deck and draw a card..."));
+
+       if (die < 30)
+               chg_virtue(V_CHANCE, 1);
+
+       if (die < 7)
+       {
+               msg_print(_("なんてこった!《死》だ!", "Oh no! It's Death!"));
+
+               for (i = 0; i < randint1(3); i++)
+                       activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
+       }
+       else if (die < 14)
+       {
+               msg_print(_("なんてこった!《悪魔》だ!", "Oh no! It's the Devil!"));
+               summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+       }
+       else if (die < 18)
+       {
+               int count = 0;
+               msg_print(_("なんてこった!《吊られた男》だ!", "Oh no! It's the Hanged Man."));
+               activate_ty_curse(FALSE, &count);
+       }
+       else if (die < 22)
+       {
+               msg_print(_("《不調和の剣》だ。", "It's the swords of discord."));
+               aggravate_monsters(0);
+       }
+       else if (die < 26)
+       {
+               msg_print(_("《愚者》だ。", "It's the Fool."));
+               do_dec_stat(A_INT);
+               do_dec_stat(A_WIS);
+       }
+       else if (die < 30)
+       {
+               msg_print(_("奇妙なモンスターの絵だ。", "It's the picture of a strange monster."));
+               trump_summoning(1, FALSE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), (32 + randint1(6)), PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
+       }
+       else if (die < 33)
+       {
+               msg_print(_("《月》だ。", "It's the Moon."));
+               unlite_area(10, 3);
+       }
+       else if (die < 38)
+       {
+               msg_print(_("《運命の輪》だ。", "It's the Wheel of Fortune."));
+               wild_magic(randint0(32));
+       }
+       else if (die < 40)
+       {
+               msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
+               teleport_player(10, TELEPORT_PASSIVE);
+       }
+       else if (die < 42)
+       {
+               msg_print(_("《正義》だ。", "It's Justice."));
+               set_blessed(p_ptr->lev, FALSE);
+       }
+       else if (die < 47)
+       {
+               msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
+               teleport_player(100, TELEPORT_PASSIVE);
+       }
+       else if (die < 52)
+       {
+               msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
+               teleport_player(200, TELEPORT_PASSIVE);
+       }
+       else if (die < 60)
+       {
+               msg_print(_("《塔》だ。", "It's the Tower."));
+               wall_breaker();
+       }
+       else if (die < 72)
+       {
+               msg_print(_("《節制》だ。", "It's Temperance."));
+               sleep_monsters_touch();
+       }
+       else if (die < 80)
+       {
+               msg_print(_("《塔》だ。", "It's the Tower."));
+
+               earthquake(p_ptr->y, p_ptr->x, 5);
+       }
+       else if (die < 82)
+       {
+               msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
+               trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), SUMMON_MOLD, 0L);
+       }
+       else if (die < 84)
+       {
+               msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
+               trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), SUMMON_BAT, 0L);
+       }
+       else if (die < 86)
+       {
+               msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
+               trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), SUMMON_VORTEX, 0L);
+       }
+       else if (die < 88)
+       {
+               msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
+               trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (dun_level * 3 / 2), SUMMON_COIN_MIMIC, 0L);
+       }
+       else if (die < 96)
+       {
+               msg_print(_("《恋人》だ。", "It's the Lovers."));
+
+               if (get_aim_dir(&dir))
+                       charm_monster(dir, MIN(p_ptr->lev, 20));
+       }
+       else if (die < 101)
+       {
+               msg_print(_("《隠者》だ。", "It's the Hermit."));
+               wall_stone();
+       }
+       else if (die < 111)
+       {
+               msg_print(_("《審判》だ。", "It's the Judgement."));
+               do_cmd_rerate(FALSE);
+               lose_all_mutations();
+       }
+       else if (die < 120)
+       {
+               msg_print(_("《太陽》だ。", "It's the Sun."));
+               chg_virtue(V_KNOWLEDGE, 1);
+               chg_virtue(V_ENLIGHTEN, 1);
+               wiz_lite(FALSE);
+       }
+       else
+       {
+               msg_print(_("《世界》だ。", "It's the World."));
+               if (p_ptr->exp < PY_MAX_EXP)
+               {
+                       s32b ee = (p_ptr->exp / 25) + 1;
+                       if (ee > 5000) ee = 5000;
+                       msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
+                       gain_exp(ee);
+               }
+       }
+}
+
+bool_hack life_stream(bool_hack message, bool_hack virtue)
+{
+       if(virtue)
+       {
+               chg_virtue(V_VITALITY, 1);
+               chg_virtue(V_UNLIFE, -5);
+       }
+       if(message)
+       {
+               msg_print(_("体中に生命力が満ちあふれてきた!", "You feel life flow through your body!"));
+       }
+       restore_level();
+       (void)set_poisoned(0);
+       (void)set_blind(0);
+       (void)set_confused(0);
+       (void)set_image(0);
+       (void)set_stun(0);
+       (void)set_cut(0);
+       (void)restore_all_status();
+       (void)set_shero(0, TRUE);
+       update_stuff();
+       hp_player(5000);
+
+       return TRUE;
+}
+
+bool_hack heroism(int base)
+{
+       bool_hack ident = FALSE;
+       if(set_afraid(0)) ident = TRUE;
+       if(set_hero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
+       if(hp_player(10)) ident = TRUE;
+       return ident;
+}
+
+bool_hack berserk(int base)
+{
+       bool_hack ident = FALSE;
+       if (set_afraid(0)) ident = TRUE;
+       if (set_shero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
+       if (hp_player(30)) ident = TRUE;
+       return ident;
+}
+
+bool_hack cure_light_wounds(DICE_NUMBER dice, DICE_SID sides)
+{
+       bool_hack ident = FALSE;
+       if (hp_player(damroll(dice, sides))) ident = TRUE;
+       if (set_blind(0)) ident = TRUE;
+       if (set_cut(p_ptr->cut - 10)) ident = TRUE;
+       if (set_shero(0, TRUE)) ident = TRUE;
+       return ident;
+}
+
+bool_hack cure_serious_wounds(DICE_NUMBER dice, DICE_SID sides)
+{
+       bool_hack ident = FALSE;
+       if (hp_player(damroll(dice, sides))) ident = TRUE;
+       if (set_blind(0)) ident = TRUE;
+       if (set_confused(0)) ident = TRUE;
+       if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
+       if (set_shero(0, TRUE)) ident = TRUE;
+       return ident;
+}
+
+bool_hack cure_critical_wounds(HIT_POINT pow)
+{
+       bool_hack ident = FALSE;
+       if (hp_player(pow)) ident = TRUE;
+       if (set_blind(0)) ident = TRUE;
+       if (set_confused(0)) ident = TRUE;
+       if (set_poisoned(0)) ident = TRUE;
+       if (set_stun(0)) ident = TRUE;
+       if (set_cut(0)) ident = TRUE;
+       if (set_shero(0, TRUE)) ident = TRUE;
+       return ident;
+}
+
+bool_hack true_healing(HIT_POINT pow)
+{
+       bool_hack ident = FALSE;
+       if (hp_player(pow)) ident = TRUE;
+       if (set_blind(0)) ident = TRUE;
+       if (set_confused(0)) ident = TRUE;
+       if (set_poisoned(0)) ident = TRUE;
+       if (set_stun(0)) ident = TRUE;
+       if (set_cut(0)) ident = TRUE;
+       if (set_image(0)) ident = TRUE;
+       return ident;
+}
+
+bool_hack restore_mana(bool_hack magic_eater)
+{
+       bool_hack ident = FALSE;
+
+       if (p_ptr->pclass == CLASS_MAGIC_EATER && magic_eater)
+       {
+               int i;
+               for (i = 0; i < EATER_EXT * 2; i++)
+               {
+                       p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i] * EATER_CHARGE / 3;
+                       if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i] * EATER_CHARGE) p_ptr->magic_num1[i] = p_ptr->magic_num2[i] * EATER_CHARGE;
+               }
+               for (; i < EATER_EXT * 3; i++)
+               {
+                       KIND_OBJECT_IDX k_idx = lookup_kind(TV_ROD, i - EATER_EXT * 2);
+                       p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? EATER_ROD_CHARGE * 3 : p_ptr->magic_num2[i] * EATER_ROD_CHARGE / 3)*k_info[k_idx].pval;
+                       if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
+               }
+               msg_print(_("頭がハッキリとした。", "You feel your head clear."));
+               p_ptr->window |= (PW_PLAYER);
+               ident = TRUE;
+       }
+       else if (p_ptr->csp < p_ptr->msp)
+       {
+               p_ptr->csp = p_ptr->msp;
+               p_ptr->csp_frac = 0;
+               msg_print(_("頭がハッキリとした。", "You feel your head clear."));
+               p_ptr->redraw |= (PR_MANA);
+               p_ptr->window |= (PW_PLAYER);
+               p_ptr->window |= (PW_SPELL);
+               ident = TRUE;
+       }
+
+       return ident;
+}
+
+bool restore_all_status(void)
+{
+       bool ident = FALSE; 
+       if (do_res_stat(A_STR)) ident = TRUE;
+       if (do_res_stat(A_INT)) ident = TRUE;
+       if (do_res_stat(A_WIS)) ident = TRUE;
+       if (do_res_stat(A_DEX)) ident = TRUE;
+       if (do_res_stat(A_CON)) ident = TRUE;
+       if (do_res_stat(A_CHR)) ident = TRUE;
+       return ident;
+}
+
+/*!
+ * @brief 口を使う継続的な処理を中断する
+ * @return なし
+ */
+void stop_mouth(void)
+{
+       if (music_singing_any()) stop_singing();
+       if (hex_spelling_any()) stop_hex_spell_all();
+}
+
+
+bool_hack vampirism(void)
+{
+       DIRECTION dir;
+       POSITION x, y;
+       int dummy;
+       cave_type *c_ptr;
+
+       if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
+       {
+               msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
+               return FALSE;
+       }
+
+       /* Only works on adjacent monsters */
+       if (!get_rep_dir2(&dir)) return FALSE;
+       y = p_ptr->y + ddy[dir];
+       x = p_ptr->x + ddx[dir];
+       c_ptr = &cave[y][x];
+
+       stop_mouth();
+
+       if (!(c_ptr->m_idx))
+       {
+               msg_print(_("何もない場所に噛みついた!", "You bite into thin air!"));
+               return FALSE;
+       }
+
+       msg_print(_("あなたはニヤリとして牙をむいた...", "You grin and bare your fangs..."));
+
+       dummy = p_ptr->lev * 2;
+
+       if (hypodynamic_bolt(dir, dummy))
+       {
+               if (p_ptr->food < PY_FOOD_FULL)
+                       /* No heal if we are "full" */
+                       (void)hp_player(dummy);
+               else
+                       msg_print(_("あなたは空腹ではありません。", "You were not hungry."));
+
+               /* Gain nutritional sustenance: 150/hp drained */
+               /* A Food ration gives 5000 food points (by contrast) */
+               /* Don't ever get more than "Full" this way */
+               /* But if we ARE Gorged,  it won't cure us */
+               dummy = p_ptr->food + MIN(5000, 100 * dummy);
+               if (p_ptr->food < PY_FOOD_MAX)   /* Not gorged already */
+                       (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
+       }
+       else
+               msg_print(_("げぇ!ひどい味だ。", "Yechh. That tastes foul."));
+       return TRUE;
+}
+
+bool panic_hit(void)
+{
+       DIRECTION dir;
+       POSITION x, y;
+
+       if (!get_rep_dir2(&dir)) return FALSE;
+       y = p_ptr->y + ddy[dir];
+       x = p_ptr->x + ddx[dir];
+       if (cave[y][x].m_idx)
+       {
+               py_attack(y, x, 0);
+               if (randint0(p_ptr->skill_dis) < 7)
+                       msg_print(_("うまく逃げられなかった。", "You failed to run away."));
+               else
+                       teleport_player(30, 0L);
+               return TRUE;
+       }
+       else
+       {
+               msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
+               msg_print(NULL);
+               return FALSE;
+       }
+
+}
+
+/*!
+* @brief 超能力者のサイコメトリー処理/ Forcibly pseudo-identify an object in the inventory (or on the floor)
+* @return なし
+* @note
+* currently this function allows pseudo-id of any object,
+* including silly ones like potions & scrolls, which always
+* get '{average}'. This should be changed, either to stop such
+* items from being pseudo-id'd, or to allow psychometry to
+* detect whether the unidentified potion/scroll/etc is
+* good (Cure Light Wounds, Restore Strength, etc) or
+* bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
+*/
+bool psychometry(void)
+{
+       OBJECT_IDX      item;
+       object_type     *o_ptr;
+       char            o_name[MAX_NLEN];
+       byte            feel;
+       cptr            q, s;
+       bool okay = FALSE;
+
+       item_tester_no_ryoute = TRUE;
+       /* Get an item */
+       q = _("どのアイテムを調べますか?", "Meditate on which item? ");
+       s = _("調べるアイテムがありません。", "You have nothing appropriate.");
+
+       if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
+
+       /* Get the item (in the pack) */
+       if (item >= 0)
+       {
+               o_ptr = &inventory[item];
+       }
+
+       /* Get the item (on the floor) */
+       else
+       {
+               o_ptr = &o_list[0 - item];
+       }
+
+       /* It is fully known, no information needed */
+       if (object_is_known(o_ptr))
+       {
+               msg_print(_("何も新しいことは判らなかった。", "You cannot find out anything more about that."));
+               return TRUE;
+       }
+
+       /* Check for a feeling */
+       feel = value_check_aux1(o_ptr);
+
+       /* Get an object description */
+       object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+
+       /* Skip non-feelings */
+       if (!feel)
+       {
+               msg_format(_("%sからは特に変わった事は感じとれなかった。", "You do not perceive anything unusual about the %s."), o_name);
+               return TRUE;
+       }
+
+#ifdef JP
+       msg_format("%sは%sという感じがする...",
+               o_name, game_inscriptions[feel]);
+#else
+       msg_format("You feel that the %s %s %s...",
+               o_name, ((o_ptr->number == 1) ? "is" : "are"),
+               game_inscriptions[feel]);
+#endif
+
+
+       /* We have "felt" it */
+       o_ptr->ident |= (IDENT_SENSE);
+
+       /* "Inscribe" it */
+       o_ptr->feeling = feel;
+
+       /* Player touches it */
+       o_ptr->marked |= OM_TOUCHED;
+
+       /* Combine / Reorder the pack (later) */
+       p_ptr->notice |= (PN_COMBINE | PN_REORDER);
+
+       /* Window stuff */
+       p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
+
+       /* Valid "tval" codes */
+       switch (o_ptr->tval)
+       {
+       case TV_SHOT:
+       case TV_ARROW:
+       case TV_BOLT:
+       case TV_BOW:
+       case TV_DIGGING:
+       case TV_HAFTED:
+       case TV_POLEARM:
+       case TV_SWORD:
+       case TV_BOOTS:
+       case TV_GLOVES:
+       case TV_HELM:
+       case TV_CROWN:
+       case TV_SHIELD:
+       case TV_CLOAK:
+       case TV_SOFT_ARMOR:
+       case TV_HARD_ARMOR:
+       case TV_DRAG_ARMOR:
+       case TV_CARD:
+       case TV_RING:
+       case TV_AMULET:
+       case TV_LITE:
+       case TV_FIGURINE:
+               okay = TRUE;
+               break;
+       }
+
+       /* Auto-inscription/destroy */
+       autopick_alter_item(item, (bool)(okay && destroy_feeling));
+
+       /* Something happened */
+       return (TRUE);
+}