OSDN Git Service

[Refactor] #37353 MP回復系の効果をrestore_mana()にまとめる。
[hengband/hengband.git] / src / cmd-usestaff.c
index 7b7c51b..69a39bb 100644 (file)
@@ -175,13 +175,7 @@ int staff_effect(OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, boo
 \r
        case SV_STAFF_CURE_LIGHT:\r
        {\r
-               if (hp_player(damroll((powerful ? 4 : 2), 8))) ident = TRUE;\r
-               if (powerful) {\r
-                       if (set_blind(0)) ident = TRUE;\r
-                       if (set_poisoned(0)) ident = TRUE;\r
-                       if (set_cut(p_ptr->cut - 10)) ident = TRUE;\r
-               }\r
-               if (set_shero(0, TRUE)) ident = TRUE;\r
+               ident = cure_light_wounds((powerful ? 4 : 2), 8);\r
                break;\r
        }\r
 \r
@@ -209,17 +203,7 @@ int staff_effect(OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, boo
        case SV_STAFF_THE_MAGI:\r
        {\r
                if (do_res_stat(A_INT)) ident = TRUE;\r
-               if (p_ptr->csp < p_ptr->msp)\r
-               {\r
-                       p_ptr->csp = p_ptr->msp;\r
-                       p_ptr->csp_frac = 0;\r
-                       ident = TRUE;\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
-               }\r
+               ident |= restore_mana(FALSE);\r
                if (set_shero(0, TRUE)) ident = TRUE;\r
                break;\r
        }\r