From: Deskull Date: Wed, 23 Jan 2019 14:19:29 +0000 (+0900) Subject: [Refactor] #37353 鏡使いのレイシャル「静水」を mirror_concentration() に分離。 / Separate Mirror master... X-Git-Url: http://git.osdn.net/view?p=hengband%2Fhengband.git;a=commitdiff_plain;h=74119d8c810b640f402afe3b3cf3394599b99e6e [Refactor] #37353 鏡使いのレイシャル「静水」を mirror_concentration() に分離。 / Separate Mirror master's racial skill "mirror concentration" to same name function. --- 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