OSDN Git Service

#37353 軽傷の治癒の効果をcure_light_wounds()にまとめる。
authorDeskull <deskull@users.sourceforge.jp>
Tue, 25 Sep 2018 11:19:44 +0000 (20:19 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Tue, 25 Sep 2018 11:19:44 +0000 (20:19 +0900)
Integrate some effects to cure_light_wounds().

lib/edit/k_info.txt
src/cmd-quaff.c
src/cmd-usestaff.c
src/externs.h
src/realm-arcane.c
src/realm-hex.c
src/realm-life.c
src/spells2.c

index c53ad34..665b830 100644 (file)
@@ -3350,8 +3350,8 @@ I:55:16:12
 W:5:0:50:350
 A:5/1
 P:0:1d2:0:0:0
-D:$It heals you 2d8 and cures berserk when you use it.
-D:それは使うと体力が2d8回復し、狂戦士化を癒す。
+D:$It heals you 2d8 and cures blindness and berserk when you use it.
+D:ã\81\9dã\82\8cã\81¯ä½¿ã\81\86ã\81¨ä½\93å\8a\9bã\81\8c2d8å\9b\9e復ã\81\97ã\80\81ç\9b²ç\9b®ã\83»ç\8b\82æ\88¦å£«å\8c\96ã\82\92ç\99\92ã\81\99ã\80\82
 
 N:313:透明物体感知:アカシアの
 E:Detect Invisible:Locust
index 638df4c..fa03adb 100644 (file)
@@ -335,10 +335,7 @@ void do_cmd_quaff_potion_aux(int item)
                        break;\r
 \r
                case SV_POTION_CURE_LIGHT:\r
-                       if (hp_player(damroll(2, 8))) ident = TRUE;\r
-                       if (set_blind(0)) ident = TRUE;\r
-                       if (set_cut(p_ptr->cut - 10)) ident = TRUE;\r
-                       if (set_shero(0,TRUE)) ident = TRUE;\r
+                       ident = cure_light_wound(2, 8);\r
                        break;\r
 \r
                case SV_POTION_CURE_SERIOUS:\r
@@ -346,7 +343,7 @@ void do_cmd_quaff_potion_aux(int item)
                        if (set_blind(0)) ident = TRUE;\r
                        if (set_confused(0)) ident = TRUE;\r
                        if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;\r
-                       if (set_shero(0,TRUE)) ident = TRUE;\r
+                       if (set_shero(0, TRUE)) ident = TRUE;\r
                        break;\r
 \r
                case SV_POTION_CURE_CRITICAL:\r
index 7b7c51b..894941c 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_wound((powerful ? 4 : 2), 8);\r
                break;\r
        }\r
 \r
index e171dc4..54874dd 100644 (file)
@@ -1173,6 +1173,7 @@ extern void cast_invoke_spirits(int dir);
 extern void cast_shuffle(void);
 extern bool_hack life_stream(bool_hack message, bool_hack virtue);
 extern bool_hack heroism(int base);
+extern bool_hack cure_light_wound(int dice, int sides);
 
 /* spells3.c */
 extern bool teleport_away(MONSTER_IDX m_idx, int dis, BIT_FLAGS mode);
index 06db633..30ee0c1 100644 (file)
@@ -141,12 +141,7 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        int sides = 8;\r
 \r
                        if (info) return info_heal(dice, sides, 0);\r
-\r
-                       if (cast)\r
-                       {\r
-                               hp_player(damroll(dice, sides));\r
-                               set_cut(p_ptr->cut - 10);\r
-                       }\r
+                       if (cast) (void)cure_light_wound(dice, sides);\r
                }\r
                break;\r
 \r
index 9dc947e..74d1891 100644 (file)
@@ -394,11 +394,7 @@ cptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {
                        msg_print(_("気分が良くなってくる。", "You feel better and better."));
                }
-               if (cast || cont)
-               {
-                       hp_player(damroll(1, 10));
-                       set_cut(p_ptr->cut - 10);
-               }
+               if (cast || cont) (void)cure_light_wound(1, 10);
                break;
 
        case 2:
index ca6358f..2caf135 100644 (file)
@@ -25,14 +25,8 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
                {\r
                        int dice = 2;\r
                        int sides = 10;\r
-\r
                        if (info) return info_heal(dice, sides, 0);\r
-\r
-                       if (cast)\r
-                       {\r
-                               hp_player(damroll(dice, sides));\r
-                               set_cut(p_ptr->cut - 10);\r
-                       }\r
+                       if (cast) (void)cure_light_wound(dice, sides);                  \r
                }\r
                break;\r
 \r
index 77a647b..766af0a 100644 (file)
@@ -5013,4 +5013,14 @@ bool_hack heroism(int base)
        if(set_hero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
        if(hp_player(10)) ident = TRUE;
        return ident;
+}
+
+bool_hack cure_light_wound(int dice, int sides)
+{
+       bool_hack ident = FALSE;
+       if (hp_player(damroll(dice, sides))) ident = TRUE;
+       if (set_blind(0)) ident = TRUE;
+       if (set_cut(p_ptr->cut - 10)) ident = TRUE;
+       if (set_shero(0, TRUE)) ident = TRUE;
+       return ident;
 }
\ No newline at end of file