From ad84175cccb34e874c12527c3bdddebd2b2305b5 Mon Sep 17 00:00:00 2001 From: deskull Date: Tue, 27 Aug 2019 23:12:55 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20boost=5Fconcentration=5Fda?= =?utf8?q?mage()=20=E3=81=AB=20player=5Ftype=20*=20=E5=BC=95=E6=95=B0?= =?utf8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=EF=BC=8E=20/=20Add=20player=5Ftype?= =?utf8?q?=20*=20argument=20to=20boost=5Fconcentration=5Fdamage().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/combat/shoot.c | 2 +- src/object-flavor.c | 2 +- src/snipe.c | 4 ++-- src/snipe.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/combat/shoot.c b/src/combat/shoot.c index 31fe43c86..871689fe5 100644 --- a/src/combat/shoot.c +++ b/src/combat/shoot.c @@ -664,7 +664,7 @@ void exe_fire(INVENTORY_IDX item, object_type *j_ptr, SPELL_IDX snipe_type) int tdam = tdam_base; /* Get extra damage from concentration */ - if (p_ptr->concent) tdam = boost_concentration_damage(tdam); + if (p_ptr->concent) tdam = boost_concentration_damage(p_ptr, tdam); /* Handle unseen monster */ if (!visible) diff --git a/src/object-flavor.c b/src/object-flavor.c index ec578c096..51ffb3412 100644 --- a/src/object-flavor.c +++ b/src/object-flavor.c @@ -2477,7 +2477,7 @@ void object_desc(char *buf, object_type *o_ptr, BIT_FLAGS mode) avgdam /= (100 * 10); /* Get extra damage from concentration */ - if (p_ptr->concent) avgdam = boost_concentration_damage(avgdam); + if (p_ptr->concent) avgdam = boost_concentration_damage(p_ptr, avgdam); if (avgdam < 0) avgdam = 0; diff --git a/src/snipe.c b/src/snipe.c index 9ea2e5d26..5c2576d5f 100644 --- a/src/snipe.c +++ b/src/snipe.c @@ -151,9 +151,9 @@ void reset_concentration(player_type *creature_ptr, bool msg) * @param tdam 算出中のダメージ * @return 集中度修正を加えたダメージ */ -int boost_concentration_damage(int tdam) +int boost_concentration_damage(player_type *creature_ptr, int tdam) { - tdam *= (10 + p_ptr->concent); + tdam *= (10 + creature_ptr->concent); tdam /= 10; return (tdam); diff --git a/src/snipe.h b/src/snipe.h index 85873b812..76530cf54 100644 --- a/src/snipe.h +++ b/src/snipe.h @@ -24,4 +24,4 @@ extern void display_snipe_list(void); extern MULTIPLY tot_dam_aux_snipe(MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_type); extern void do_cmd_snipe(void); extern void do_cmd_snipe_browse(void); -extern int boost_concentration_damage(int tdam); +extern int boost_concentration_damage(player_type *creature_ptr, int tdam); -- 2.11.0