OSDN Git Service

[Refactor] #37353 剣術家の「気合溜め」を concentration() に分離。 / Separate Samurai's racial skill...
authorDeskull <deskull@users.sourceforge.jp>
Thu, 24 Jan 2019 14:29:21 +0000 (23:29 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Thu, 24 Jan 2019 14:29:21 +0000 (23:29 +0900)
src/externs.h
src/racial.c
src/spells2.c

index 735bf15..b9089f9 100644 (file)
@@ -1002,6 +1002,7 @@ extern bool sword_dancing(player_type *creature_ptr);
 extern bool confusing_light(player_type *creature_ptr);
 extern bool rodeo(player_type *creature_ptr);
 extern bool clear_mind(player_type *creature_ptr);
+extern bool concentration(player_type *creature_ptr);
 
 /* spells3.c */
 extern bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode);
index 67b9727..805a0ff 100644 (file)
@@ -581,27 +581,6 @@ static bool cmd_racial_power_aux(s32b command)
                {
                        if (command == -3)
                        {
-                               int max_csp = MAX(p_ptr->msp*4, p_ptr->lev*5+5);
-
-                               if (total_friends)
-                               {
-                                       msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
-                                       return FALSE;
-                               }
-                               if (p_ptr->special_defense & KATA_MASK)
-                               {
-                                       msg_print(_("今は構えに集中している。", "You need concentration on your form."));
-                                       return FALSE;
-                               }
-                               msg_print(_("精神を集中して気合いを溜めた。", "You concentrate to charge your power."));
-
-                               p_ptr->csp += p_ptr->msp / 2;
-                               if (p_ptr->csp >= max_csp)
-                               {
-                                       p_ptr->csp = max_csp;
-                                       p_ptr->csp_frac = 0;
-                               }
-                               p_ptr->redraw |= (PR_MANA);
                        }
                        else if (command == -4)
                        {
index c36a99b..172b86e 100644 (file)
@@ -5398,4 +5398,30 @@ bool clear_mind(player_type *creature_ptr)
        }
        creature_ptr->redraw |= (PR_MANA);
        return TRUE;
-}
\ No newline at end of file
+}
+
+bool concentration(player_type *creature_ptr)
+{
+       int max_csp = MAX(creature_ptr->msp * 4, creature_ptr->lev * 5 + 5);
+
+       if (total_friends)
+       {
+               msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
+               return FALSE;
+       }
+       if (creature_ptr->special_defense & KATA_MASK)
+       {
+               msg_print(_("今は構えに集中している。", "You need concentration on your form."));
+               return FALSE;
+       }
+       msg_print(_("精神を集中して気合いを溜めた。", "You concentrate to charge your power."));
+
+       creature_ptr->csp += creature_ptr->msp / 2;
+       if (creature_ptr->csp >= max_csp)
+       {
+               creature_ptr->csp = max_csp;
+               creature_ptr->csp_frac = 0;
+       }
+       creature_ptr->redraw |= (PR_MANA);
+       return TRUE;
+}