OSDN Git Service

#37785 全突然変異消去処理の統合し、HP回復量ペナルティの再計算バグを修正。 / Unify losing process of all mutation...
authorDeskull <desull@users.sourceforge.jp>
Mon, 22 Jan 2018 16:32:05 +0000 (01:32 +0900)
committerDeskull <desull@users.sourceforge.jp>
Mon, 22 Jan 2018 16:32:05 +0000 (01:32 +0900)
src/cmd6.c
src/do-spell.c
src/externs.h
src/mutation.c

index cf7b16b..d48f345 100644 (file)
@@ -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
                        {
index 7d848c0..03ec074 100644 (file)
@@ -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)
        {
index 9417dce..434c1b2 100644 (file)
@@ -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);
index 19307e5..2139cfd 100644 (file)
@@ -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 出力先ファイルポインタ