From 234c87b2f5661ab48c3bebc8f5f41167294fa570 Mon Sep 17 00:00:00 2001 From: deskull Date: Tue, 27 Aug 2019 23:18:46 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20tot=5Fdam=5Faux=5Fsnipe()?= =?utf8?q?=20=E3=81=AB=20player=5Ftype=20*=20=E5=BC=95=E6=95=B0=E3=82=92?= =?utf8?q?=E8=BF=BD=E5=8A=A0=EF=BC=8E=20/=20Add=20player=5Ftype=20*=20argu?= =?utf8?q?ment=20to=20tot=5Fdam=5Faux=5Fsnipe().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/combat/shoot.c | 2 +- src/snipe.c | 20 ++++++++++---------- src/snipe.h | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/combat/shoot.c b/src/combat/shoot.c index 871689fe5..6b0afec8b 100644 --- a/src/combat/shoot.c +++ b/src/combat/shoot.c @@ -325,7 +325,7 @@ static MULTIPLY tot_dam_aux_shot(object_type *o_ptr, HIT_POINT tdam, monster_typ } /* Sniper */ - if (snipe_type) mult = tot_dam_aux_snipe(mult, m_ptr, snipe_type); + if (snipe_type) mult = tot_dam_aux_snipe(p_ptr, mult, m_ptr, snipe_type); /* Return the total damage */ return (tdam * mult / 10); diff --git a/src/snipe.c b/src/snipe.c index 5c2576d5f..04d79f16a 100644 --- a/src/snipe.c +++ b/src/snipe.c @@ -383,7 +383,7 @@ static int get_snipe_power(COMMAND_CODE *sn, bool only_browse) * @param m_ptr 目標となるモンスターの構造体参照ポインタ * @return スレイの倍率(/10倍) */ -MULTIPLY tot_dam_aux_snipe(MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_type) +MULTIPLY tot_dam_aux_snipe(player_type *sniper_ptr, MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_type) { monster_race *r_ptr = &r_info[m_ptr->r_idx]; bool seen = is_seen(m_ptr); @@ -393,7 +393,7 @@ MULTIPLY tot_dam_aux_snipe(MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_t case SP_LITE: if (r_ptr->flags3 & (RF3_HURT_LITE)) { - MULTIPLY n = 20 + p_ptr->concent; + MULTIPLY n = 20 + sniper_ptr->concent; if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE); if (mult < n) mult = n; } @@ -405,7 +405,7 @@ MULTIPLY tot_dam_aux_snipe(MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_t } else { - MULTIPLY n = 15 + (p_ptr->concent * 3); + MULTIPLY n = 15 + (sniper_ptr->concent * 3); if (mult < n) mult = n; } break; @@ -416,7 +416,7 @@ MULTIPLY tot_dam_aux_snipe(MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_t } else { - MULTIPLY n = 15 + (p_ptr->concent * 3); + MULTIPLY n = 15 + (sniper_ptr->concent * 3); if (mult < n) mult = n; } break; @@ -427,20 +427,20 @@ MULTIPLY tot_dam_aux_snipe(MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_t } else { - MULTIPLY n = 18 + (p_ptr->concent * 4); + MULTIPLY n = 18 + (sniper_ptr->concent * 4); if (mult < n) mult = n; } break; case SP_KILL_WALL: if (r_ptr->flags3 & RF3_HURT_ROCK) { - MULTIPLY n = 15 + (p_ptr->concent * 2); + MULTIPLY n = 15 + (sniper_ptr->concent * 2); if (seen) r_ptr->r_flags3 |= RF3_HURT_ROCK; if (mult < n) mult = n; } else if (r_ptr->flags3 & RF3_NONLIVING) { - MULTIPLY n = 15 + (p_ptr->concent * 2); + MULTIPLY n = 15 + (sniper_ptr->concent * 2); if (seen) r_ptr->r_flags3 |= RF3_NONLIVING; if (mult < n) mult = n; } @@ -448,7 +448,7 @@ MULTIPLY tot_dam_aux_snipe(MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_t case SP_EVILNESS: if (r_ptr->flags3 & RF3_GOOD) { - MULTIPLY n = 15 + (p_ptr->concent * 4); + MULTIPLY n = 15 + (sniper_ptr->concent * 4); if (seen) r_ptr->r_flags3 |= RF3_GOOD; if (mult < n) mult = n; } @@ -456,11 +456,11 @@ MULTIPLY tot_dam_aux_snipe(MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_t case SP_HOLYNESS: if (r_ptr->flags3 & RF3_EVIL) { - MULTIPLY n = 12 + (p_ptr->concent * 3); + MULTIPLY n = 12 + (sniper_ptr->concent * 3); if (seen) r_ptr->r_flags3 |= RF3_EVIL; if (r_ptr->flags3 & (RF3_HURT_LITE)) { - n += (p_ptr->concent * 3); + n += (sniper_ptr->concent * 3); if (seen) r_ptr->r_flags3 |= (RF3_HURT_LITE); } if (mult < n) mult = n; diff --git a/src/snipe.h b/src/snipe.h index 76530cf54..00cbdcdd0 100644 --- a/src/snipe.h +++ b/src/snipe.h @@ -21,7 +21,7 @@ /* snipe.c */ extern void reset_concentration(player_type *creature_ptr, bool msg); extern void display_snipe_list(void); -extern MULTIPLY tot_dam_aux_snipe(MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_type); +extern MULTIPLY tot_dam_aux_snipe(player_type *sniper_ptr, 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(player_type *creature_ptr, int tdam); -- 2.11.0