From 3f1512126f862cc076645b801ee072b863c3a725 Mon Sep 17 00:00:00 2001 From: Hourier Date: Wed, 3 Jun 2020 23:38:13 +0900 Subject: [PATCH] [Refactor] #40414 Moved mirror_concentration() from spells2.c/h to racial-mirror-master.c/h --- src/mind/racial-mirror-master.c | 30 ++++++++++++++++++++++++++++++ src/mind/racial-mirror-master.h | 1 + src/mind/racial.c | 1 + src/spell/spells2.c | 33 --------------------------------- src/spell/spells2.h | 1 - 5 files changed, 32 insertions(+), 34 deletions(-) diff --git a/src/mind/racial-mirror-master.c b/src/mind/racial-mirror-master.c index 33f81972c..dbbc0ff98 100644 --- a/src/mind/racial-mirror-master.c +++ b/src/mind/racial-mirror-master.c @@ -1,4 +1,5 @@ #include "system/angband.h" +#include "cmd-action/cmd-pet.h" #include "mind/racial-mirror-master.h" #include "world/world.h" @@ -9,3 +10,32 @@ bool check_multishadow(player_type *creature_ptr) { return (creature_ptr->multishadow != 0) && ((current_world_ptr->game_turn & 1) != 0); } + +/*! + * 静水 + * @param creature_ptr プレーヤーへの参照ポインタ + * @return ペットを操っている場合を除きTRUE + */ +bool mirror_concentration(player_type *creature_ptr) +{ + if (total_friends) { + msg_print(_("今はペットを操ることに集中していないと。", "Your pets demand all of your attention.")); + return FALSE; + } + + if (!is_mirror_grid(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])) { + msg_print(_("鏡の上でないと集中できない!", "There's no mirror here!")); + return TRUE; + } + + 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; + return TRUE; +} diff --git a/src/mind/racial-mirror-master.h b/src/mind/racial-mirror-master.h index f21d3d205..58004e38f 100644 --- a/src/mind/racial-mirror-master.h +++ b/src/mind/racial-mirror-master.h @@ -1,3 +1,4 @@ #pragma once bool check_multishadow(player_type *creature_ptr); +bool mirror_concentration(player_type *creature_ptr); diff --git a/src/mind/racial.c b/src/mind/racial.c index 94b2ba35f..da760e460 100644 --- a/src/mind/racial.c +++ b/src/mind/racial.c @@ -21,6 +21,7 @@ #include "effect/spells-effect-util.h" #include "io/targeting.h" #include "mind/racial-cavalry.h" +#include "mind/racial-mirror-master.h" #include "mind/racial-samurai.h" #include "mutation/mutation.h" #include "object/object-hook.h" diff --git a/src/spell/spells2.c b/src/spell/spells2.c index 9cff1312b..a46f9c495 100644 --- a/src/spell/spells2.c +++ b/src/spell/spells2.c @@ -3672,39 +3672,6 @@ bool demonic_breath(player_type *creature_ptr) /*! - * 静水 - * @param creature_ptr プレーヤーへの参照ポインタ - * @return ペットを操っている場合を除きTRUE -*/ -bool mirror_concentration(player_type *creature_ptr) -{ - if (total_friends) - { - msg_print(_("今はペットを操ることに集中していないと。", "Your pets demand all of your attention.")); - return FALSE; - } - - if (!is_mirror_grid(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])) - { - msg_print(_("鏡の上でないと集中できない!", "There's no mirror here!")); - return TRUE; - } - - 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; - return TRUE; -} - - -/*! * 剣の舞い * @param creature_ptr プレーヤーへの参照ポインタ * @return 常にTRUE diff --git a/src/spell/spells2.h b/src/spell/spells2.h index 9a085a231..66f1230f1 100644 --- a/src/spell/spells2.h +++ b/src/spell/spells2.h @@ -97,7 +97,6 @@ bool double_attack(player_type* creature_ptr); bool comvert_hp_to_mp(player_type* creature_ptr); bool comvert_mp_to_hp(player_type* creature_ptr); bool demonic_breath(player_type* creature_ptr); -bool mirror_concentration(player_type* creature_ptr); bool sword_dancing(player_type* creature_ptr); bool confusing_light(player_type* creature_ptr); bool clear_mind(player_type* creature_ptr); -- 2.11.0