OSDN Git Service

[Refactor] #38997 cast_meteor() に player_type * 引数を追加. / Add player_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Sun, 15 Dec 2019 16:13:36 +0000 (01:13 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 15 Dec 2019 16:13:36 +0000 (01:13 +0900)
src/realm-chaos.c
src/realm-trump.c
src/spells.h
src/spells2.c

index f8f2c2e..87773d4 100644 (file)
@@ -492,7 +492,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               cast_meteor(dam, rad);
+                               cast_meteor(caster_ptr, dam, rad);
                        }
                }
                break;
index c41dcc0..daa5005 100644 (file)
@@ -562,7 +562,7 @@ concptr do_trump_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
 
                        if (cast)
                        {
-                               cast_meteor(dam, rad);
+                               cast_meteor(caster_ptr, dam, rad);
                        }
                }
                break;
index b0828e2..8906346 100644 (file)
@@ -250,7 +250,7 @@ extern bool rush_attack(player_type *attacker_ptr, bool *mdeath);
 extern void remove_all_mirrors(bool explode);
 extern void ring_of_power(player_type *caster_ptr, DIRECTION dir);
 extern void wild_magic(player_type *caster_ptr, int spell);
-extern void cast_meteor(HIT_POINT dam, POSITION rad);
+extern void cast_meteor(player_type *caster_ptr, HIT_POINT dam, POSITION rad);
 extern bool cast_wrath_of_the_god(player_type *caster_ptr, HIT_POINT dam, POSITION rad);
 extern void cast_wonder(player_type *caster_ptr, DIRECTION dir);
 extern void cast_invoke_spirits(player_type *caster_ptr, DIRECTION dir);
index a2763eb..f4fcecd 100644 (file)
@@ -3297,7 +3297,7 @@ void wild_magic(player_type *caster_ptr, int spell)
 * @param rad 効力の半径
 * @return なし
 */
-void cast_meteor(HIT_POINT dam, POSITION rad)
+void cast_meteor(player_type *caster_ptr, HIT_POINT dam, POSITION rad)
 {
        int i;
        int b = 10 + randint1(10);
@@ -3311,18 +3311,18 @@ void cast_meteor(HIT_POINT dam, POSITION rad)
                {
                        int dy, dx, d;
 
-                       x = p_ptr->x - 8 + randint0(17);
-                       y = p_ptr->y - 8 + randint0(17);
+                       x = caster_ptr->x - 8 + randint0(17);
+                       y = caster_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);
+                       dx = (caster_ptr->x > x) ? (caster_ptr->x - x) : (x - caster_ptr->x);
+                       dy = (caster_ptr->y > y) ? (caster_ptr->y - y) : (y - caster_ptr->y);
 
                        /* Approximate distance */
                        d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
 
                        if (d >= 9) continue;
 
-                       if (!in_bounds(p_ptr->current_floor_ptr, y, x) || !projectable(p_ptr->current_floor_ptr, p_ptr->y, p_ptr->x, y, x)
+                       if (!in_bounds(caster_ptr->current_floor_ptr, y, x) || !projectable(caster_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x, y, x)
                                || !cave_have_flag_bold(y, x, FF_PROJECT)) continue;
 
                        /* Valid position */
@@ -3331,7 +3331,7 @@ void cast_meteor(HIT_POINT dam, POSITION rad)
 
                if (count > 20) continue;
 
-               project(p_ptr, 0, rad, y, x, dam, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
+               project(caster_ptr, 0, rad, y, x, dam, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
        }
 }