OSDN Git Service

[Refactor] #37353 癒し系の効果をtrue_healing()にまとめる。
[hengband/hengband.git] / src / cmd-quaff.c
index df0be25..f4fb7da 100644 (file)
@@ -335,41 +335,23 @@ void do_cmd_quaff_potion_aux(int item)
                        break;\r
 \r
                case SV_POTION_CURE_LIGHT:\r
-                       ident = cure_light_wound(2, 8);\r
+                       ident = cure_light_wounds(2, 8);\r
                        break;\r
 \r
                case SV_POTION_CURE_SERIOUS:\r
-                       ident = cure_light_wound(4, 8);\r
+                       ident = cure_serious_wounds(4, 8);\r
                        break;\r
 \r
                case SV_POTION_CURE_CRITICAL:\r
-                       if (hp_player(damroll(6, 8))) ident = TRUE;\r
-                       if (set_blind(0)) ident = TRUE;\r
-                       if (set_confused(0)) ident = TRUE;\r
-                       if (set_poisoned(0)) ident = TRUE;\r
-                       if (set_stun(0)) ident = TRUE;\r
-                       if (set_cut(0)) ident = TRUE;\r
-                       if (set_shero(0,TRUE)) ident = TRUE;\r
+                       ident = cure_critical_wounds(damroll(6, 8));\r
                        break;\r
 \r
                case SV_POTION_HEALING:\r
-                       if (hp_player(300)) ident = TRUE;\r
-                       if (set_blind(0)) ident = TRUE;\r
-                       if (set_confused(0)) ident = TRUE;\r
-                       if (set_poisoned(0)) ident = TRUE;\r
-                       if (set_stun(0)) ident = TRUE;\r
-                       if (set_cut(0)) ident = TRUE;\r
-                       if (set_shero(0,TRUE)) ident = TRUE;\r
+                       ident = cure_critical_wounds(300);\r
                        break;\r
 \r
                case SV_POTION_STAR_HEALING:\r
-                       if (hp_player(1200)) ident = TRUE;\r
-                       if (set_blind(0)) ident = TRUE;\r
-                       if (set_confused(0)) ident = TRUE;\r
-                       if (set_poisoned(0)) ident = TRUE;\r
-                       if (set_stun(0)) ident = TRUE;\r
-                       if (set_cut(0)) ident = TRUE;\r
-                       if (set_shero(0,TRUE)) ident = TRUE;\r
+                       ident = cure_critical_wounds(1200);\r
                        break;\r
 \r
                case SV_POTION_LIFE:\r
@@ -377,36 +359,7 @@ void do_cmd_quaff_potion_aux(int item)
                        break;\r
 \r
                case SV_POTION_RESTORE_MANA:\r
-                       if (p_ptr->pclass == CLASS_MAGIC_EATER)\r
-                       {\r
-                               int i;\r
-                               for (i = 0; i < EATER_EXT*2; i++)\r
-                               {\r
-                                       p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i]*EATER_CHARGE/3;\r
-                                       if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i]*EATER_CHARGE) p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*EATER_CHARGE;\r
-                               }\r
-                               for (; i < EATER_EXT*3; i++)\r
-                               {\r
-                                       KIND_OBJECT_IDX k_idx = lookup_kind(TV_ROD, i-EATER_EXT*2);\r
-                                       p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? EATER_ROD_CHARGE*3 : p_ptr->magic_num2[i]*EATER_ROD_CHARGE/3)*k_info[k_idx].pval;\r
-                                       if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;\r
-                               }\r
-                               msg_print(_("頭がハッキリとした。", "You feel your head clear."));\r
-                               p_ptr->window |= (PW_PLAYER);\r
-                               ident = TRUE;\r
-                       }\r
-                       else if (p_ptr->csp < p_ptr->msp)\r
-                       {\r
-                               p_ptr->csp = p_ptr->msp;\r
-                               p_ptr->csp_frac = 0;\r
-                               msg_print(_("頭がハッキリとした。", "You feel your head clear."));\r
-\r
-                               p_ptr->redraw |= (PR_MANA);\r
-                               p_ptr->window |= (PW_PLAYER);\r
-                               p_ptr->window |= (PW_SPELL);\r
-                               ident = TRUE;\r
-                       }\r
-                       if (set_shero(0,TRUE)) ident = TRUE;\r
+                       ident = restore_mana(TRUE);\r
                        break;\r
 \r
                case SV_POTION_RESTORE_EXP:\r
@@ -527,13 +480,7 @@ void do_cmd_quaff_potion_aux(int item)
                        break;\r
 \r
                case SV_POTION_CURING:\r
-                       if (hp_player(50)) ident = TRUE;\r
-                       if (set_blind(0)) ident = TRUE;\r
-                       if (set_poisoned(0)) ident = TRUE;\r
-                       if (set_confused(0)) ident = TRUE;\r
-                       if (set_stun(0)) ident = TRUE;\r
-                       if (set_cut(0)) ident = TRUE;\r
-                       if (set_image(0)) ident = TRUE;\r
+                       if (true_healing(50)) ident = TRUE;\r
                        break;\r
 \r
                case SV_POTION_INVULNERABILITY:\r