From 8aa20bbb1b0e96f70517a3727ed6c00ac467f62f Mon Sep 17 00:00:00 2001 From: Hourier Date: Mon, 6 Jan 2020 22:42:10 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20fire=5Fmeteor()=20?= =?utf8?q?=E3=81=ABplayer=5Ftype=20*=20=E5=BC=95=E6=95=B0=E3=82=92?= =?utf8?q?=E8=BF=BD=E5=8A=A0=20/=20Added=20player=5Ftype=20*=20argument=20?= =?utf8?q?to=20fire=5Fmeteor()?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/chest.c | 6 +++--- src/spells.h | 2 +- src/spells2.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/chest.c b/src/chest.c index f7532d6e5..48a9b3576 100644 --- a/src/chest.c +++ b/src/chest.c @@ -216,7 +216,7 @@ void chest_trap(player_type *target_ptr, POSITION y, POSITION x, OBJECT_IDX o_id msg_print(_("鳥の群れがあなたを取り巻いた!", "A storm of birds swirls around you!")); for (i = 0; i < randint1(3) + 3; i++) - (void)fire_meteor(-1, GF_FORCE, y, x, o_ptr->pval / 5, 7); + (void)fire_meteor(target_ptr, -1, GF_FORCE, y, x, o_ptr->pval / 5, 7); for (i = 0; i < randint1(5) + o_ptr->pval / 5; i++) { @@ -233,7 +233,7 @@ void chest_trap(player_type *target_ptr, POSITION y, POSITION x, OBJECT_IDX o_id msg_print(_("炎と硫黄の雲の中に悪魔が姿を現した!", "Demons materialize in clouds of fire and brimstone!")); for (i = 0; i < randint1(3) + 2; i++) { - (void)fire_meteor(-1, GF_FIRE, y, x, 10, 5); + (void)fire_meteor(target_ptr, -1, GF_FIRE, y, x, 10, 5); (void)summon_specific(0, y, x, mon_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)); } } @@ -303,7 +303,7 @@ void chest_trap(player_type *target_ptr, POSITION y, POSITION x, OBJECT_IDX o_id (void)do_dec_stat(target_ptr, A_WIS); (void)do_dec_stat(target_ptr, A_CHR); } - else (void)fire_meteor(-1, GF_NETHER, y, x, 150, 1); + else (void)fire_meteor(target_ptr, -1, GF_NETHER, y, x, 150, 1); } } } diff --git a/src/spells.h b/src/spells.h index 57890aa0a..edf17b3c4 100644 --- a/src/spells.h +++ b/src/spells.h @@ -201,7 +201,7 @@ extern bool fire_ball(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, HIT extern bool fire_breath(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad); extern bool fire_rocket(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad); extern bool fire_ball_hide(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad); -extern bool fire_meteor(MONSTER_IDX who, EFFECT_ID typ, POSITION x, POSITION y, HIT_POINT dam, POSITION rad); +extern bool fire_meteor(player_type *caster_ptr, MONSTER_IDX who, EFFECT_ID typ, POSITION x, POSITION y, HIT_POINT dam, POSITION rad); extern bool fire_bolt(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam); extern bool fire_blast(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID ds, int num, int dev); extern void call_chaos(player_type *caster_ptr); diff --git a/src/spells2.c b/src/spells2.c index 26ded3490..cf837966a 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -2151,12 +2151,12 @@ bool fire_ball_hide(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, HIT_P * Option to hurt the player. * */ -bool fire_meteor(MONSTER_IDX who, EFFECT_ID typ, POSITION y, POSITION x, HIT_POINT dam, POSITION rad) +bool fire_meteor(player_type *caster_ptr, MONSTER_IDX who, EFFECT_ID typ, POSITION y, POSITION x, HIT_POINT dam, POSITION rad) { BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL; /* Analyze the "target" and the caster. */ - return (project(p_ptr, who, rad, y, x, dam, typ, flg, -1)); + return (project(caster_ptr, who, rad, y, x, dam, typ, flg, -1)); } -- 2.11.0