From 972d4bd3038b400b2115a2264101b6c1f74ea347 Mon Sep 17 00:00:00 2001 From: Deskull Date: Tue, 23 Jan 2018 01:32:05 +0900 Subject: [PATCH] =?utf8?q?#37785=20=E5=85=A8=E7=AA=81=E7=84=B6=E5=A4=89?= =?utf8?q?=E7=95=B0=E6=B6=88=E5=8E=BB=E5=87=A6=E7=90=86=E3=81=AE=E7=B5=B1?= =?utf8?q?=E5=90=88=E3=81=97=E3=80=81HP=E5=9B=9E=E5=BE=A9=E9=87=8F?= =?utf8?q?=E3=83=9A=E3=83=8A=E3=83=AB=E3=83=86=E3=82=A3=E3=81=AE=E5=86=8D?= =?utf8?q?=E8=A8=88=E7=AE=97=E3=83=90=E3=82=B0=E3=82=92=E4=BF=AE=E6=AD=A3?= =?utf8?q?=E3=80=82=20/=20Unify=20losing=20process=20of=20all=20mutation?= =?utf8?q?=20and=20fix=20bugs=20of=20recalculating=20hit-point=20regenerat?= =?utf8?q?ion=20rate=20penalty.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cmd6.c | 16 ++-------------- src/do-spell.c | 8 +------- src/externs.h | 1 + src/mutation.c | 13 +++++++++++++ 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/src/cmd6.c b/src/cmd6.c index cf7b16b5d..d48f3452a 100644 --- a/src/cmd6.c +++ b/src/cmd6.c @@ -1184,15 +1184,7 @@ static void do_cmd_quaff_potion_aux(int item) do_cmd_rerate(FALSE); get_max_stats(); p_ptr->update |= PU_BONUS; - if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) - { - chg_virtue(V_CHANCE, -5); - msg_print(_("全ての突然変異が治った。", "You are cured of all mutations.")); - p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0; - p_ptr->update |= PU_BONUS; - handle_stuff(); - mutant_regenerate_mod = calc_mutant_regenerate_mod(); - } + lose_all_mutations(); ident = TRUE; break; @@ -1217,11 +1209,7 @@ static void do_cmd_quaff_potion_aux(int item) case SV_POTION_POLYMORPH: if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23)) { - chg_virtue(V_CHANCE, -5); - msg_print(_("全ての突然変異が治った。", "You are cured of all mutations.")); - p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0; - p_ptr->update |= PU_BONUS; - handle_stuff(); + lose_all_mutations(); } else { diff --git a/src/do-spell.c b/src/do-spell.c index 7d848c010..03ec074c4 100644 --- a/src/do-spell.c +++ b/src/do-spell.c @@ -740,13 +740,7 @@ static void cast_shuffle(void) { msg_print(_("《審判》だ。", "It's the Judgement.")); do_cmd_rerate(FALSE); - if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) - { - msg_print(_("全ての突然変異が治った。", "You are cured of all mutations.")); - p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0; - p_ptr->update |= PU_BONUS; - handle_stuff(); - } + lose_all_mutations(); } else if (die < 120) { diff --git a/src/externs.h b/src/externs.h index 9417dce6c..434c1b27c 100644 --- a/src/externs.h +++ b/src/externs.h @@ -1597,6 +1597,7 @@ extern MULTIPLY mult_hissatsu(MULTIPLY mult, BIT_FLAGS *flgs, monster_type *m_pt extern int count_bits(BIT_FLAGS x); extern bool gain_random_mutation(int choose_mut); extern bool lose_mutation(int choose_mut); +extern void lose_all_mutations(void); extern void dump_mutations(FILE *OutFile); extern void do_cmd_knowledge_mutations(void); extern int calc_mutant_regenerate_mod(void); diff --git a/src/mutation.c b/src/mutation.c index 19307e5c1..2139cfdd1 100644 --- a/src/mutation.c +++ b/src/mutation.c @@ -1478,6 +1478,19 @@ bool lose_mutation(int choose_mut) } } +void lose_all_mutations(void) +{ + if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) + { + chg_virtue(V_CHANCE, -5); + msg_print(_("全ての突然変異が治った。", "You are cured of all mutations.")); + p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0; + p_ptr->update |= PU_BONUS; + handle_stuff(); + mutant_regenerate_mod = calc_mutant_regenerate_mod(); + } +} + /*! * @brief ファイルポインタを通じて突然変異の一覧を出力する * @param OutFile 出力先ファイルポインタ -- 2.11.0