OSDN Git Service

[Refactor] #38997 death_ray()、wall_to_mud()、destroy_door()、disarm_trap()、wizard_lock...
authorHourier <hourier@users.sourceforge.jp>
Mon, 6 Jan 2020 14:40:09 +0000 (23:40 +0900)
committerHourier <hourier@users.sourceforge.jp>
Mon, 6 Jan 2020 14:40:09 +0000 (23:40 +0900)
src/cmd/cmd-activate.c
src/cmd/cmd-zaprod.c
src/cmd/cmd-zapwand.c
src/racial.c
src/realm-arcane.c
src/realm-crusade.c
src/realm-death.c
src/realm-nature.c
src/spells.h
src/spells2.c

index 5ff13c0..a6a7178 100644 (file)
@@ -1510,7 +1510,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        {
                msg_print(_("鼓動している...", "It pulsates..."));
                if (!get_aim_dir(&dir)) return FALSE;
-               wall_to_mud(dir, 20 + randint1(30));
+               wall_to_mud(user_ptr, dir, 20 + randint1(30));
                break;
        }
 
index d801722..144a66b 100644 (file)
@@ -133,13 +133,13 @@ int rod_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION d
        case SV_ROD_TELEPORT_AWAY:
        {
                int distance = MAX_SIGHT * (powerful ? 8 : 5);
-               if (teleport_monster(dir, distance)) ident = TRUE;
+               if (teleport_monster(creature_ptr, dir, distance)) ident = TRUE;
                break;
        }
 
        case SV_ROD_DISARMING:
        {
-               if (disarm_trap(dir)) ident = TRUE;
+               if (disarm_trap(creature_ptr, dir)) ident = TRUE;
                if (powerful && disarm_traps_touch()) ident = TRUE;
                break;
        }
@@ -243,7 +243,7 @@ int rod_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION d
        case SV_ROD_STONE_TO_MUD:
        {
                HIT_POINT dam = powerful ? 40 + randint1(60) : 20 + randint1(30);
-               if (wall_to_mud(dir, dam)) ident = TRUE;
+               if (wall_to_mud(creature_ptr, dir, dam)) ident = TRUE;
                break;
        }
 
index 8989746..f7fe8f0 100644 (file)
@@ -78,20 +78,20 @@ bool wand_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION
                case SV_WAND_TELEPORT_AWAY:
                {
                        int distance = MAX_SIGHT * (powerful ? 8 : 5);
-                       if (teleport_monster(dir, distance)) ident = TRUE;
+                       if (teleport_monster(creature_ptr, dir, distance)) ident = TRUE;
                        break;
                }
 
                case SV_WAND_DISARMING:
                {
-                       if (disarm_trap(dir)) ident = TRUE;
+                       if (disarm_trap(creature_ptr, dir)) ident = TRUE;
                        if (powerful && disarm_traps_touch()) ident = TRUE;
                        break;
                }
 
                case SV_WAND_TRAP_DOOR_DEST:
                {
-                       if (destroy_door(dir)) ident = TRUE;
+                       if (destroy_door(creature_ptr, dir)) ident = TRUE;
                        if (powerful && destroy_doors_touch()) ident = TRUE;
                        break;
                }
@@ -99,7 +99,7 @@ bool wand_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION
                case SV_WAND_STONE_TO_MUD:
                {
                        HIT_POINT dam = powerful ? 40 + randint1(60) : 20 + randint1(30);
-                       if (wall_to_mud(dir, dam)) ident = TRUE;
+                       if (wall_to_mud(creature_ptr, dir, dam)) ident = TRUE;
                        break;
                }
 
index f5c6a08..52550c8 100644 (file)
@@ -702,7 +702,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
 
                case RACE_HALF_GIANT:
                        if (!get_aim_dir(&dir)) return FALSE;
-                       (void)wall_to_mud(dir, 20 + randint1(30));
+                       (void)wall_to_mud(creature_ptr, dir, 20 + randint1(30));
                        break;
 
                case RACE_HALF_TITAN:
index 9f23b63..283254b 100644 (file)
@@ -60,7 +60,7 @@ concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                        {
                                if (!get_aim_dir(&dir)) return NULL;
 
-                               wizard_lock(dir);
+                               wizard_lock(caster_ptr, dir);
                        }
                }
                break;
@@ -140,7 +140,7 @@ concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                        {
                                if (!get_aim_dir(&dir)) return NULL;
 
-                               destroy_door(dir);
+                               destroy_door(caster_ptr, dir);
                        }
                }
                break;
@@ -372,7 +372,7 @@ concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                        {
                                if (!get_aim_dir(&dir)) return NULL;
 
-                               wall_to_mud(dir, 20 + randint1(30));
+                               wall_to_mud(caster_ptr, dir, 20 + randint1(30));
                        }
                }
                break;
index d1a2a5b..e27e275 100644 (file)
@@ -285,7 +285,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
                        {
                                if (!get_aim_dir(&dir)) return NULL;
 
-                               destroy_door(dir);
+                               destroy_door(caster_ptr, dir);
                        }
                }
                break;
index 81aa793..7438fb7 100644 (file)
@@ -520,7 +520,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                        {
                                if (!get_aim_dir(&dir)) return NULL;
 
-                               death_ray(dir, plev);
+                               death_ray(caster_ptr, dir, plev);
                        }
                }
                break;
index 1259a56..2a7cae0 100644 (file)
@@ -203,7 +203,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                        {
                                if (!get_aim_dir(&dir)) return NULL;
 
-                               wall_to_mud(dir, 20 + randint1(30));
+                               wall_to_mud(caster_ptr, dir, 20 + randint1(30));
                        }
                }
                break;
index df45b3d..6dfe8ef 100644 (file)
@@ -209,12 +209,12 @@ extern bool fire_beam(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, HIT
 extern bool fire_bolt_or_beam(player_type *caster_ptr, PERCENTAGE prob, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam);
 extern bool lite_line(player_type *caster_ptr, DIRECTION dir, HIT_POINT dam);
 extern bool hypodynamic_bolt(player_type *caster_ptr, DIRECTION dir, HIT_POINT dam);
-extern bool death_ray(DIRECTION dir, PLAYER_LEVEL plev);
-extern bool wall_to_mud(DIRECTION dir, HIT_POINT dam);
-extern bool destroy_door(DIRECTION dir);
-extern bool disarm_trap(DIRECTION dir);
-extern bool wizard_lock(DIRECTION dir);
-extern bool teleport_monster(DIRECTION dir, int distance);
+extern bool death_ray(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev);
+extern bool wall_to_mud(player_type *caster_ptr, DIRECTION dir, HIT_POINT dam);
+extern bool destroy_door(player_type *caster_ptr, DIRECTION dir);
+extern bool disarm_trap(player_type *caster_ptr, DIRECTION dir);
+extern bool wizard_lock(player_type *caster_ptr, DIRECTION dir);
+extern bool teleport_monster(player_type *caster_ptr, DIRECTION dir, int distance);
 extern bool door_creation(player_type *caster_ptr, POSITION y, POSITION x);
 extern bool trap_creation(player_type *caster_ptr, POSITION y, POSITION x);
 extern bool tree_creation(player_type *caster_ptr, POSITION y, POSITION x);
index 3923751..12c442d 100644 (file)
@@ -2432,10 +2432,10 @@ bool hypodynamic_bolt(player_type *caster_ptr, DIRECTION dir, HIT_POINT dam)
  * @param dam 威力
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool wall_to_mud(DIRECTION dir, HIT_POINT dam)
+bool wall_to_mud(player_type *caster_ptr, DIRECTION dir, HIT_POINT dam)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
-       return (project_hook(p_ptr, GF_KILL_WALL, dir, dam, flg));
+       return (project_hook(caster_ptr, GF_KILL_WALL, dir, dam, flg));
 }
 
 
@@ -2445,10 +2445,10 @@ bool wall_to_mud(DIRECTION dir, HIT_POINT dam)
  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool wizard_lock(DIRECTION dir)
+bool wizard_lock(player_type *caster_ptr, DIRECTION dir)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
-       return (project_hook(p_ptr, GF_JAM_DOOR, dir, 20 + randint1(30), flg));
+       return (project_hook(caster_ptr, GF_JAM_DOOR, dir, 20 + randint1(30), flg));
 }
 
 
@@ -2458,10 +2458,10 @@ bool wizard_lock(DIRECTION dir)
  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool destroy_door(DIRECTION dir)
+bool destroy_door(player_type *caster_ptr, DIRECTION dir)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
-       return (project_hook(p_ptr, GF_KILL_DOOR, dir, 0, flg));
+       return (project_hook(caster_ptr, GF_KILL_DOOR, dir, 0, flg));
 }
 
 
@@ -2471,10 +2471,10 @@ bool destroy_door(DIRECTION dir)
  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool disarm_trap(DIRECTION dir)
+bool disarm_trap(player_type *caster_ptr, DIRECTION dir)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
-       return (project_hook(p_ptr, GF_KILL_TRAP, dir, 0, flg));
+       return (project_hook(caster_ptr, GF_KILL_TRAP, dir, 0, flg));
 }
 
 
@@ -2485,10 +2485,10 @@ bool disarm_trap(DIRECTION dir)
  * @param plev プレイヤーレベル(効力はplev*200)
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool death_ray(DIRECTION dir, PLAYER_LEVEL plev)
+bool death_ray(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev)
 {
        BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
-       return (project_hook(p_ptr, GF_DEATH_RAY, dir, plev * 200, flg));
+       return (project_hook(caster_ptr, GF_DEATH_RAY, dir, plev * 200, flg));
 }
 
 
@@ -2499,10 +2499,10 @@ bool death_ray(DIRECTION dir, PLAYER_LEVEL plev)
  * @param distance 移動距離
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool teleport_monster(DIRECTION dir, int distance)
+bool teleport_monster(player_type *caster_ptr, DIRECTION dir, int distance)
 {
        BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL;
-       return (project_hook(p_ptr, GF_AWAY_ALL, dir, distance, flg));
+       return (project_hook(caster_ptr, GF_AWAY_ALL, dir, distance, flg));
 }