OSDN Git Service

[Refactor] #37353 超能力者と錬気術師のレイシャル「明鏡止水」を clear_mind() に分離。 / Separate Mindcrafter...
authorDeskull <deskull@users.sourceforge.jp>
Thu, 24 Jan 2019 04:42:45 +0000 (13:42 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Thu, 24 Jan 2019 04:42:45 +0000 (13:42 +0900)
src/externs.h
src/racial.c
src/spells2.c

index c71299e..735bf15 100644 (file)
@@ -1001,6 +1001,7 @@ extern bool mirror_concentration(player_type *creature_ptr);
 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);
 
 /* spells3.c */
 extern bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode);
index efa4bbe..67b9727 100644 (file)
@@ -508,21 +508,7 @@ static bool cmd_racial_power_aux(s32b command)
                case CLASS_MINDCRAFTER:
                case CLASS_FORCETRAINER:
                {
-                       if (total_friends)
-                       {
-                               msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
-                               return FALSE;
-                       }
-                       msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
-
-                       p_ptr->csp += (3 + p_ptr->lev/20);
-                       if (p_ptr->csp >= p_ptr->msp)
-                       {
-                               p_ptr->csp = p_ptr->msp;
-                               p_ptr->csp_frac = 0;
-                       }
-                       p_ptr->redraw |= (PR_MANA);
-                       break;
+                       return clear_mind(p_ptr);
                }
                case CLASS_TOURIST:
                {
index fdc9c7b..c36a99b 100644 (file)
@@ -5379,4 +5379,23 @@ bool rodeo(player_type *creature_ptr)
                creature_ptr->riding = 0;
        }
        return TRUE;
+}
+
+bool clear_mind(player_type *creature_ptr)
+{
+       if (total_friends)
+       {
+               msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
+               return FALSE;
+       }
+       msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
+
+       creature_ptr->csp += (3 + creature_ptr->lev / 20);
+       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;
 }
\ No newline at end of file