OSDN Git Service

[Refactor] #37353 戦士のレイシャル「剣の舞い」を sword_dancing() に分離。 / Separate Warrior's racial...
authorDeskull <deskull@users.sourceforge.jp>
Wed, 23 Jan 2019 14:58:35 +0000 (23:58 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Wed, 23 Jan 2019 14:58:35 +0000 (23:58 +0900)
src/externs.h
src/racial.c
src/spells2.c

index 99691b4..f61bf44 100644 (file)
@@ -998,6 +998,7 @@ 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);
+extern bool sword_dancing(player_type *creature_ptr);
 
 /* spells3.c */
 extern bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode);
index c080ca1..2f4e79e 100644 (file)
@@ -414,25 +414,7 @@ static bool cmd_racial_power_aux(s32b command)
                {
                case CLASS_WARRIOR:
                {
-                       POSITION y = 0, x = 0;
-                       int i;
-                       cave_type *c_ptr;
-
-                       for (i = 0; i < A_MAX; i++)
-                       {
-                               dir = randint0(8);
-                               y = p_ptr->y + ddy_ddd[dir];
-                               x = p_ptr->x + ddx_ddd[dir];
-                               c_ptr = &cave[y][x];
-
-                               /* Hack -- attack monsters */
-                               if (c_ptr->m_idx)
-                                       py_attack(y, x, 0);
-                               else
-                               {
-                                       msg_print(_("攻撃が空をきった。", "You attack the empty air."));
-                               }
-                       }
+                       return sword_dancing(p_ptr);
                        break;
                }
                case CLASS_HIGH_MAGE:
index a10c445..be7a9c0 100644 (file)
@@ -5297,4 +5297,29 @@ bool mirror_concentration(player_type *creature_ptr)
                msg_print(_("鏡の上でないと集中できない!", "Here are not any mirrors!"));
        }
        return TRUE;
-}
\ No newline at end of file
+}
+
+bool sword_dancing(player_type *creature_ptr)
+{
+       DIRECTION dir;
+       POSITION y = 0, x = 0;
+       int i;
+       cave_type *c_ptr;
+
+       for (i = 0; i < 6; i++)
+       {
+               dir = randint0(8);
+               y = creature_ptr->y + ddy_ddd[dir];
+               x = creature_ptr->x + ddx_ddd[dir];
+               c_ptr = &cave[y][x];
+
+               /* Hack -- attack monsters */
+               if (c_ptr->m_idx)
+                       py_attack(y, x, 0);
+               else
+               {
+                       msg_print(_("攻撃が空をきった。", "You attack the empty air."));
+               }
+       }
+       return TRUE;
+}