From b678619982bb4485dcab951ab2434de0bf5589b1 Mon Sep 17 00:00:00 2001 From: Deskull Date: Tue, 25 Sep 2018 20:19:44 +0900 Subject: [PATCH] =?utf8?q?#37353=20=E8=BB=BD=E5=82=B7=E3=81=AE=E6=B2=BB?= =?utf8?q?=E7=99=92=E3=81=AE=E5=8A=B9=E6=9E=9C=E3=82=92cure=5Flight=5Fwoun?= =?utf8?q?ds()=E3=81=AB=E3=81=BE=E3=81=A8=E3=82=81=E3=82=8B=E3=80=82=20Int?= =?utf8?q?egrate=20some=20effects=20to=20cure=5Flight=5Fwounds().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/edit/k_info.txt | 4 ++-- src/cmd-quaff.c | 7 ++----- src/cmd-usestaff.c | 8 +------- src/externs.h | 1 + src/realm-arcane.c | 7 +------ src/realm-hex.c | 6 +----- src/realm-life.c | 8 +------- src/spells2.c | 10 ++++++++++ 8 files changed, 19 insertions(+), 32 deletions(-) diff --git a/lib/edit/k_info.txt b/lib/edit/k_info.txt index c53ad34d4..665b8308a 100644 --- a/lib/edit/k_info.txt +++ b/lib/edit/k_info.txt @@ -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:それは使うと体力が2d8回復し、盲目・狂戦士化を癒す。 N:313:透明物体感知:アカシアの E:Detect Invisible:Locust diff --git a/src/cmd-quaff.c b/src/cmd-quaff.c index 638df4c70..fa03adb35 100644 --- a/src/cmd-quaff.c +++ b/src/cmd-quaff.c @@ -335,10 +335,7 @@ void do_cmd_quaff_potion_aux(int item) break; case SV_POTION_CURE_LIGHT: - if (hp_player(damroll(2, 8))) ident = TRUE; - if (set_blind(0)) ident = TRUE; - if (set_cut(p_ptr->cut - 10)) ident = TRUE; - if (set_shero(0,TRUE)) ident = TRUE; + ident = cure_light_wound(2, 8); break; case SV_POTION_CURE_SERIOUS: @@ -346,7 +343,7 @@ void do_cmd_quaff_potion_aux(int item) if (set_blind(0)) ident = TRUE; if (set_confused(0)) ident = TRUE; if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE; - if (set_shero(0,TRUE)) ident = TRUE; + if (set_shero(0, TRUE)) ident = TRUE; break; case SV_POTION_CURE_CRITICAL: diff --git a/src/cmd-usestaff.c b/src/cmd-usestaff.c index 7b7c51b00..894941cbf 100644 --- a/src/cmd-usestaff.c +++ b/src/cmd-usestaff.c @@ -175,13 +175,7 @@ int staff_effect(OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, boo case SV_STAFF_CURE_LIGHT: { - if (hp_player(damroll((powerful ? 4 : 2), 8))) ident = TRUE; - if (powerful) { - if (set_blind(0)) ident = TRUE; - if (set_poisoned(0)) ident = TRUE; - if (set_cut(p_ptr->cut - 10)) ident = TRUE; - } - if (set_shero(0, TRUE)) ident = TRUE; + ident = cure_light_wound((powerful ? 4 : 2), 8); break; } diff --git a/src/externs.h b/src/externs.h index e171dc4bc..54874dd5f 100644 --- a/src/externs.h +++ b/src/externs.h @@ -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); diff --git a/src/realm-arcane.c b/src/realm-arcane.c index 06db63302..30ee0c109 100644 --- a/src/realm-arcane.c +++ b/src/realm-arcane.c @@ -141,12 +141,7 @@ cptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode) int sides = 8; if (info) return info_heal(dice, sides, 0); - - if (cast) - { - hp_player(damroll(dice, sides)); - set_cut(p_ptr->cut - 10); - } + if (cast) (void)cure_light_wound(dice, sides); } break; diff --git a/src/realm-hex.c b/src/realm-hex.c index 9dc947ed4..74d1891c0 100644 --- a/src/realm-hex.c +++ b/src/realm-hex.c @@ -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: diff --git a/src/realm-life.c b/src/realm-life.c index ca6358f67..2caf13571 100644 --- a/src/realm-life.c +++ b/src/realm-life.c @@ -25,14 +25,8 @@ cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode) { int dice = 2; int sides = 10; - if (info) return info_heal(dice, sides, 0); - - if (cast) - { - hp_player(damroll(dice, sides)); - set_cut(p_ptr->cut - 10); - } + if (cast) (void)cure_light_wound(dice, sides); } break; diff --git a/src/spells2.c b/src/spells2.c index 77a647b7f..766af0a2c 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -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 -- 2.11.0