OSDN Git Service

[Refactor] #40414 Moved sword_dancing() from spells2.c/h to mind-warrior.c/h
authorHourier <hourier@users.sourceforge.jp>
Fri, 5 Jun 2020 12:29:40 +0000 (21:29 +0900)
committerHourier <hourier@users.sourceforge.jp>
Fri, 5 Jun 2020 12:29:40 +0000 (21:29 +0900)
src/mind/mind-warrior.c
src/mind/mind-warrior.h
src/spell/spells2.c
src/spell/spells2.h

index 20e405a..b535986 100644 (file)
@@ -29,3 +29,30 @@ bool hit_and_away(player_type *caster_ptr)
     msg_print(NULL);
     return FALSE;
 }
+
+/*!
+ * 剣の舞い
+ * @param creature_ptr プレーヤーへの参照ポインタ
+ * @return 常にTRUE
+ */
+bool sword_dancing(player_type *creature_ptr)
+{
+    DIRECTION dir;
+    POSITION y = 0, x = 0;
+    grid_type *g_ptr;
+    for (int i = 0; i < 6; i++) {
+        dir = randint0(8);
+        y = creature_ptr->y + ddy_ddd[dir];
+        x = creature_ptr->x + ddx_ddd[dir];
+        g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
+
+        /* Hack -- attack monsters */
+        if (g_ptr->m_idx)
+            do_cmd_attack(creature_ptr, y, x, 0);
+        else {
+            msg_print(_("攻撃が空をきった。", "You attack the empty air."));
+        }
+    }
+
+    return TRUE;
+}
index 77ef899..7d12913 100644 (file)
@@ -3,3 +3,4 @@
 #include "system/angband.h"
 
 bool hit_and_away(player_type *caster_ptr);
+bool sword_dancing(player_type *creature_ptr);
index f17d287..43fb6c1 100644 (file)
@@ -333,36 +333,6 @@ bool comvert_mp_to_hp(player_type *creature_ptr)
 }
 
 
-/*!
- * 剣の舞い
- * @param creature_ptr プレーヤーへの参照ポインタ
- * @return 常にTRUE
-*/
-bool sword_dancing(player_type *creature_ptr)
-{
-       DIRECTION dir;
-       POSITION y = 0, x = 0;
-       grid_type *g_ptr;
-       for (int i = 0; i < 6; i++)
-       {
-               dir = randint0(8);
-               y = creature_ptr->y + ddy_ddd[dir];
-               x = creature_ptr->x + ddx_ddd[dir];
-               g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
-
-               /* Hack -- attack monsters */
-               if (g_ptr->m_idx)
-                       do_cmd_attack(creature_ptr, y, x, 0);
-               else
-               {
-                       msg_print(_("攻撃が空をきった。", "You attack the empty air."));
-               }
-       }
-
-       return TRUE;
-}
-
-
 bool clear_mind(player_type *creature_ptr)
 {
        if (total_friends)
index cad82a8..5b0c4d8 100644 (file)
@@ -12,6 +12,5 @@ void hayagake(player_type* creature_ptr);
 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 sword_dancing(player_type* creature_ptr);
 bool clear_mind(player_type* creature_ptr);
 bool vanish_dungeon(player_type* caster_ptr);