OSDN Git Service

[Refactor] #37353 鏡使いのレイシャル「静水」を mirror_concentration() に分離。 / Separate Mirror master...
authorDeskull <deskull@users.sourceforge.jp>
Wed, 23 Jan 2019 14:19:29 +0000 (23:19 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Wed, 23 Jan 2019 14:21:38 +0000 (23:21 +0900)
src/externs.h
src/racial.c
src/spells2.c

index 37fc330..99691b4 100644 (file)
@@ -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);
index b8be14b..c080ca1 100644 (file)
@@ -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;
                }
index 0ad2b11..a10c445 100644 (file)
@@ -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