OSDN Git Service

[Refactor] #37353 体力回復系の効果をgreater_healing()にまとめる。
authorDeskull <deskull@users.sourceforge.jp>
Wed, 26 Sep 2018 11:24:33 +0000 (20:24 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Wed, 26 Sep 2018 11:24:33 +0000 (20:24 +0900)
Integrate some effects to greater_healing().

src/cmd-activate.c
src/cmd-quaff.c
src/externs.h
src/realm-daemon.c
src/spells2.c

index 74faefa..3197f1f 100644 (file)
@@ -1085,14 +1085,8 @@ bool activate_artifact(object_type *o_ptr)
        case ACT_CHOIR_SINGS:
        {
                msg_print(_("天国の歌が聞こえる...", "A heavenly choir sings..."));
-               (void)set_poisoned(0);
-               (void)set_cut(0);
-               (void)set_stun(0);
-               (void)set_confused(0);
-               (void)set_blind(0);
-               (void)set_afraid(0);
+               (void)greater_healing(777);
                (void)set_hero(randint1(25) + 25, FALSE);
-               (void)hp_player(777);
                break;
        }
 
@@ -1142,8 +1136,7 @@ bool activate_artifact(object_type *o_ptr)
        {
                msg_print(_("深青色に輝いている...", "It glows deep blue..."));
                msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
-               (void)hp_player(700);
-               (void)set_cut(0);
+               (void)greater_healing(700);
                break;
        }
 
@@ -1151,8 +1144,7 @@ bool activate_artifact(object_type *o_ptr)
        {
                msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
                msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
-               (void)hp_player(1000);
-               (void)set_cut(0);
+               (void)greater_healing(1000);
                break;
        }
 
index 6c8b304..8aa25cb 100644 (file)
@@ -347,23 +347,11 @@ void do_cmd_quaff_potion_aux(int item)
                        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 = greater_healing(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 = greater_healing(1200);\r
                        break;\r
 \r
                case SV_POTION_LIFE:\r
index d0faafe..6c47df1 100644 (file)
@@ -1175,6 +1175,8 @@ extern bool_hack life_stream(bool_hack message, bool_hack virtue);
 extern bool_hack heroism(int base);
 extern bool_hack cure_light_wounds(int dice, int sides);
 extern bool_hack cure_serious_wounds(int dice, int sides);
+extern bool_hack cure_critical_wounds(int dice, int sides);
+extern bool_hack greater_healing(int pow);
 
 /* spells3.c */
 extern bool teleport_away(MONSTER_IDX m_idx, int dis, BIT_FLAGS mode);
index c261109..3103d6c 100644 (file)
@@ -484,15 +484,8 @@ cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
 \r
                {\r
                        int base = 25;\r
-\r
                        if (info) return info_duration(base, base);\r
-\r
-                       if (cast)\r
-                       {\r
-                               set_hero(randint1(base) + base, FALSE);\r
-                               hp_player(10);\r
-                               set_afraid(0);\r
-                       }\r
+                       if (cast)heroism(base);\r
                }\r
                break;\r
 \r
index 133f9c7..c2dffdf 100644 (file)
@@ -5039,11 +5039,25 @@ bool_hack cure_serious_wounds(int dice, int sides)
 bool_hack cure_critical_wounds(int dice, int sides)
 {
        bool_hack ident = FALSE;
-       if (hp_player(damroll(6, 8))) ident = TRUE;
+       if (hp_player(damroll(dice, sides))) ident = TRUE;
+       if (set_blind(0)) ident = TRUE;
+       if (set_confused(0)) ident = TRUE;
+       if (set_poisoned(0)) ident = TRUE;
+       if (set_stun(0)) ident = TRUE;
+       if (set_cut(0)) ident = TRUE;
+       if (set_shero(0, TRUE)) ident = TRUE;
+       return ident;
+}
+
+bool_hack greater_healing(int pow)
+{
+       bool_hack ident = FALSE;
+       if (hp_player(pow)) ident = TRUE;
        if (set_blind(0)) ident = TRUE;
        if (set_confused(0)) ident = TRUE;
        if (set_poisoned(0)) ident = TRUE;
        if (set_stun(0)) ident = TRUE;
        if (set_cut(0)) ident = TRUE;
        if (set_shero(0, TRUE)) ident = TRUE;
-}
\ No newline at end of file
+       return ident;
+}