From 74119d8c810b640f402afe3b3cf3394599b99e6e Mon Sep 17 00:00:00 2001 From: Deskull Date: Wed, 23 Jan 2019 23:19:29 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20=E9=8F=A1=E4=BD=BF?= =?utf8?q?=E3=81=84=E3=81=AE=E3=83=AC=E3=82=A4=E3=82=B7=E3=83=A3=E3=83=AB?= =?utf8?q?=E3=80=8C=E9=9D=99=E6=B0=B4=E3=80=8D=E3=82=92=20mirror=5Fconcent?= =?utf8?q?ration()=20=E3=81=AB=E5=88=86=E9=9B=A2=E3=80=82=20/=20Separate?= =?utf8?q?=20Mirror=20master's=20racial=20skill=20"mirror=20concentration"?= =?utf8?q?=20to=20same=20name=20function.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/externs.h | 1 + src/racial.c | 22 +--------------------- src/spells2.c | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/externs.h b/src/externs.h index 37fc330a3..99691b42b 100644 --- a/src/externs.h +++ b/src/externs.h @@ -997,6 +997,7 @@ extern bool double_attack(player_type *creature_ptr); extern bool comvert_hp_to_mp(player_type *creature_ptr); extern bool comvert_mp_to_hp(player_type *creature_ptr); extern bool demonic_breath(player_type *creature_ptr); +extern bool mirror_concentration(player_type *creature_ptr); /* spells3.c */ extern bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode); diff --git a/src/racial.c b/src/racial.c index b8be14b7c..c080ca1f9 100644 --- a/src/racial.c +++ b/src/racial.c @@ -731,27 +731,7 @@ static bool cmd_racial_power_aux(s32b command) } else if (command == -4) { - if (total_friends) - { - msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now.")); - return FALSE; - } - if (is_mirror_grid(&cave[p_ptr->y][p_ptr->x])) - { - msg_print(_("少し頭がハッキリした。", "You feel your head clear a little.")); - - p_ptr->csp += (5 + p_ptr->lev * p_ptr->lev / 100); - if (p_ptr->csp >= p_ptr->msp) - { - p_ptr->csp = p_ptr->msp; - p_ptr->csp_frac = 0; - } - p_ptr->redraw |= (PR_MANA); - } - else - { - msg_print(_("鏡の上でないと集中できない!", "Here are not any mirrors!")); - } + return mirror_concentration(p_ptr); } break; } diff --git a/src/spells2.c b/src/spells2.c index 0ad2b11a4..a10c445dc 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -5273,3 +5273,28 @@ bool demonic_breath(player_type *creature_ptr) return TRUE; } +bool mirror_concentration(player_type *creature_ptr) +{ + if (total_friends) + { + msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now.")); + return FALSE; + } + if (is_mirror_grid(&cave[creature_ptr->y][creature_ptr->x])) + { + msg_print(_("少し頭がハッキリした。", "You feel your head clear a little.")); + + creature_ptr->csp += (5 + creature_ptr->lev * creature_ptr->lev / 100); + if (creature_ptr->csp >= creature_ptr->msp) + { + creature_ptr->csp = creature_ptr->msp; + creature_ptr->csp_frac = 0; + } + creature_ptr->redraw |= (PR_MANA); + } + else + { + msg_print(_("鏡の上でないと集中できない!", "Here are not any mirrors!")); + } + return TRUE; +} \ No newline at end of file -- 2.11.0