OSDN Git Service

[Refactor] #37353 cure_critical_wounds() と greater_healing() を統合。
authorDeskull <deskull@users.sourceforge.jp>
Wed, 26 Sep 2018 11:41:58 +0000 (20:41 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Wed, 26 Sep 2018 11:41:58 +0000 (20:41 +0900)
Integrate cure_critical_wounds() and greater_healing().

src/cmd-activate.c
src/cmd-quaff.c
src/externs.h
src/realm-hex.c
src/realm-life.c
src/realm-nature.c
src/spells2.c

index 3197f1f..eeb9399 100644 (file)
@@ -1085,7 +1085,7 @@ bool activate_artifact(object_type *o_ptr)
        case ACT_CHOIR_SINGS:
        {
                msg_print(_("天国の歌が聞こえる...", "A heavenly choir sings..."));
-               (void)greater_healing(777);
+               (void)cure_critical_wounds(777);
                (void)set_hero(randint1(25) + 25, FALSE);
                break;
        }
@@ -1136,7 +1136,7 @@ bool activate_artifact(object_type *o_ptr)
        {
                msg_print(_("深青色に輝いている...", "It glows deep blue..."));
                msg_print(_("体内に暖かい鼓動が感じられる...", "You feel a warm tingling inside..."));
-               (void)greater_healing(700);
+               (void)cure_critical_wounds(700);
                break;
        }
 
@@ -1144,7 +1144,7 @@ bool activate_artifact(object_type *o_ptr)
        {
                msg_print(_("白く明るく輝いている...", "It glows a bright white..."));
                msg_print(_("ひじょうに気分がよい...", "You feel much better..."));
-               (void)greater_healing(1000);
+               (void)cure_critical_wounds(1000);
                break;
        }
 
index 8aa25cb..65c9f1a 100644 (file)
@@ -343,15 +343,15 @@ void do_cmd_quaff_potion_aux(int item)
                        break;\r
 \r
                case SV_POTION_CURE_CRITICAL:\r
-                       ident = cure_serious_wounds(6, 8);\r
+                       ident = cure_critical_wounds(damroll(6, 8));\r
                        break;\r
 \r
                case SV_POTION_HEALING:\r
-                       ident = greater_healing(300);\r
+                       ident = cure_critical_wounds(300);\r
                        break;\r
 \r
                case SV_POTION_STAR_HEALING:\r
-                       ident = greater_healing(1200);\r
+                       ident = cure_critical_wounds(1200);\r
                        break;\r
 \r
                case SV_POTION_LIFE:\r
index 6c47df1..60952f5 100644 (file)
@@ -1175,8 +1175,7 @@ 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);
+extern bool_hack cure_critical_wounds(HIT_POINT pow);
 
 /* spells3.c */
 extern bool teleport_away(MONSTER_IDX m_idx, int dis, BIT_FLAGS mode);
index 4344ba5..c7f3f98 100644 (file)
@@ -698,7 +698,7 @@ cptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        msg_print(_("気分が良くなってくる。", "You feel better and better."));
                }
-               if (cast || cont) (void)cure_serious_wounds(4, 10);
+               if (cast || cont) (void)cure_critical_wounds(damroll(4, 10));
                break;
 
        case 18:
index 35cf623..c7e123b 100644 (file)
@@ -169,7 +169,7 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        int sides = 10;\r
 \r
                        if (info) return info_heal(dice, sides, 0);\r
-                       if (cast) (void)cure_serious_wounds(dice, sides);\r
+                       if (cast) (void)cure_critical_wounds(damroll(dice, sides));\r
                }\r
                break;\r
 \r
@@ -225,15 +225,8 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 \r
                {\r
                        int heal = 300;\r
-\r
                        if (info) return info_heal(0, 0, heal);\r
-\r
-                       if (cast)\r
-                       {\r
-                               hp_player(heal);\r
-                               set_stun(0);\r
-                               set_cut(0);\r
-                       }\r
+                       if (cast) (void)cure_critical_wounds(heal);\r
                }\r
                break;\r
 \r
@@ -460,15 +453,8 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
 \r
                {\r
                        int heal = 2000;\r
-\r
                        if (info) return info_heal(0, 0, heal);\r
-\r
-                       if (cast)\r
-                       {\r
-                               hp_player(heal);\r
-                               set_stun(0);\r
-                               set_cut(0);\r
-                       }\r
+                       if (cast) (void)cure_critical_wounds(heal);\r
                }\r
                break;\r
 \r
index 31eb3fb..1360ff2 100644 (file)
@@ -310,19 +310,10 @@ cptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
        case 15:\r
                if (name) return _("\96ò\91\90\8e¡\97Ã", "Herbal Healing");\r
                if (desc) return _("\91Ì\97Í\82ð\91å\95\9d\82É\89ñ\95\9c\82³\82¹\81A\95\89\8f\9d\81A\9eN\9eO\8fó\91Ô\81A\93Å\82©\82ç\91S\89õ\82·\82é\81B", "Heals HP greatly. And heals cut, stun and poison completely.");\r
-\r
                {\r
                        int heal = 500;\r
-\r
                        if (info) return info_heal(0, 0, heal);\r
-\r
-                       if (cast)\r
-                       {\r
-                               hp_player(heal);\r
-                               set_stun(0);\r
-                               set_cut(0);\r
-                               set_poisoned(0);\r
-                       }\r
+                       if (cast) (void)cure_critical_wounds(heal);\r
                }\r
                break;\r
 \r
index c2dffdf..7b6f9b9 100644 (file)
@@ -5036,20 +5036,7 @@ bool_hack cure_serious_wounds(int dice, int sides)
        return ident;
 }
 
-bool_hack cure_critical_wounds(int dice, int sides)
-{
-       bool_hack ident = FALSE;
-       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 cure_critical_wounds(HIT_POINT pow)
 {
        bool_hack ident = FALSE;
        if (hp_player(pow)) ident = TRUE;