OSDN Git Service

[Refactor] #40414 Separated racial-warrior.c/h from spells2.c/h
authorHourier <hourier@users.sourceforge.jp>
Fri, 5 Jun 2020 11:46:05 +0000 (20:46 +0900)
committerHourier <hourier@users.sourceforge.jp>
Fri, 5 Jun 2020 11:46:05 +0000 (20:46 +0900)
Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/mind/mind.c
src/mind/racial-warrior.c [new file with mode: 0644]
src/mind/racial-warrior.h [new file with mode: 0644]
src/mind/racial.c
src/mutation/mutation.c
src/realm/realm-daemon.c
src/spell/spells2.c
src/spell/spells2.h

index 9d680ea..197c328 100644 (file)
     <ClCompile Include="..\..\src\mind\monk-attack.c" />\r
     <ClCompile Include="..\..\src\mind\racial-ninja.c" />\r
     <ClCompile Include="..\..\src\mind\racial-samurai.c" />\r
+    <ClCompile Include="..\..\src\mind\racial-warrior.c" />\r
     <ClCompile Include="..\..\src\mind\samurai-slaying.c" />\r
     <ClCompile Include="..\..\src\mind\surprise-attack.c" />\r
     <ClCompile Include="..\..\src\object-enchant\apply-magic-accessory.c" />\r
     <ClInclude Include="..\..\src\mind\monk-attack.h" />\r
     <ClInclude Include="..\..\src\mind\racial-ninja.h" />\r
     <ClInclude Include="..\..\src\mind\racial-samurai.h" />\r
+    <ClInclude Include="..\..\src\mind\racial-warrior.h" />\r
     <ClInclude Include="..\..\src\mind\samurai-slaying.h" />\r
     <ClInclude Include="..\..\src\mind\surprise-attack.h" />\r
     <ClInclude Include="..\..\src\object-enchant\apply-magic-accessory.h" />\r
index 2cfda83..79c7b33 100644 (file)
     <ClCompile Include="..\..\src\spell-kind\spells-charm.c">
       <Filter>spell-kind</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\mind\racial-warrior.c">
+      <Filter>mind</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\cmd\cmd-basic.h">
     <ClInclude Include="..\..\src\spell-kind\spells-charm.h">
       <Filter>spell-kind</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\mind\racial-warrior.h">
+      <Filter>mind</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index db86262..45e80bd 100644 (file)
@@ -254,6 +254,7 @@ hengband_SOURCES = \
        mind/racial-mirror-master.c mind/racial-mirror-master.h \
        mind/racial-ninja.c mind/racial-ninja.h \
        mind/racial-samurai.c mind/racial-samurai.h \
+       mind/racial-warrior.c mind/racial-warrior.h \
        mind/samurai-slaying.c mind/samurai-slaying.h \
        mind/surprise-attack.c mind/surprise-attack.h \
        \
index 988ffed..be95ff6 100644 (file)
@@ -29,6 +29,7 @@
 #include "mind/racial-mindcrafter.h"
 #include "mind/racial-mirror-master.h"
 #include "mind/racial-ninja.h"
+#include "mind/racial-warrior.h"
 #include "monster/monster-status.h"
 #include "player/avatar.h"
 #include "player/player-class.h"
@@ -47,7 +48,6 @@
 #include "spell/spells-summon.h"
 #include "spell-kind/spells-teleport.h"
 #include "spell/spells-type.h"
-#include "spell/spells2.h"
 #include "spell/spells3.h"
 #include "util/util.h"
 #include "view/display-main-window.h"
diff --git a/src/mind/racial-warrior.c b/src/mind/racial-warrior.c
new file mode 100644 (file)
index 0000000..9a93ff2
--- /dev/null
@@ -0,0 +1,31 @@
+#include "mind/racial-warrior.h"
+#include "cmd-action/cmd-attack.h"
+#include "floor/floor.h"
+#include "io/targeting.h"
+#include "spell-kind/spells-teleport.h"
+
+/*!
+ * 戦士と盗賊における、ヒット&アウェイのレイシャルパワー/突然変異
+ * @param caster_ptr プレーヤーへの参照ポインタ
+ * @return コマンドの入力先にモンスターがいたらTRUE
+ */
+bool hit_and_away(player_type *caster_ptr)
+{
+    DIRECTION dir;
+    if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
+        return FALSE;
+    POSITION y = caster_ptr->y + ddy[dir];
+    POSITION x = caster_ptr->x + ddx[dir];
+    if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+        do_cmd_attack(caster_ptr, y, x, 0);
+        if (randint0(caster_ptr->skill_dis) < 7)
+            msg_print(_("うまく逃げられなかった。", "You failed to run away."));
+        else
+            teleport_player(caster_ptr, 30, TELEPORT_SPONTANEOUS);
+        return TRUE;
+    }
+
+    msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
+    msg_print(NULL);
+    return FALSE;
+}
diff --git a/src/mind/racial-warrior.h b/src/mind/racial-warrior.h
new file mode 100644 (file)
index 0000000..77ef899
--- /dev/null
@@ -0,0 +1,5 @@
+#pragma once
+
+#include "system/angband.h"
+
+bool hit_and_away(player_type *caster_ptr);
index 2aacf4d..a7bc9a5 100644 (file)
@@ -25,6 +25,7 @@
 #include "mind/racial-draconian.h"
 #include "mind/racial-mirror-master.h"
 #include "mind/racial-samurai.h"
+#include "mind/racial-warrior.h"
 #include "mutation/mutation.h"
 #include "object/object-hook.h"
 #include "player/player-class.h"
index 7150c37..1aa2228 100644 (file)
@@ -21,6 +21,7 @@
 #include "io/files-util.h"
 #include "io/targeting.h"
 #include "io/write-diary.h"
+#include "mind/racial-warrior.h"
 #include "object-enchant/item-feeling.h"
 #include "object/object-hook.h"
 #include "player/avatar.h"
index 1f4f88d..108becd 100644 (file)
@@ -5,17 +5,17 @@
 #include "player/player-damage.h"
 #include "player/player-effects.h"
 #include "player/player-race.h"
+#include "spell-kind/spells-charm.h"
 #include "spell-kind/spells-detection.h"
-#include "spell/spells-diceroll.h"
 #include "spell-kind/spells-floor.h"
 #include "spell-kind/spells-launcher.h"
-#include "spell/spells-object.h"
 #include "spell-kind/spells-pet.h"
 #include "spell-kind/spells-sight.h"
+#include "spell/spells-diceroll.h"
+#include "spell/spells-object.h"
 #include "spell/spells-status.h"
 #include "spell/spells-summon.h"
 #include "spell/spells-type.h"
-#include "spell/spells2.h"
 #include "util/util.h"
 
 /*!
index 4bfa399..73bb3a0 100644 (file)
@@ -465,33 +465,6 @@ bool vampirism(player_type *caster_ptr)
 }
 
 
-/*!
- * ヒット&アウェイのレイシャルパワー/突然変異
- * @param caster_ptr プレーヤーへの参照ポインタ
- * @return コマンドの入力先にモンスターがいたらTRUE
- */
-bool hit_and_away(player_type *caster_ptr)
-{
-       DIRECTION dir;
-       if (!get_direction(caster_ptr, &dir, FALSE, FALSE)) return FALSE;
-       POSITION y = caster_ptr->y + ddy[dir];
-       POSITION x = caster_ptr->x + ddx[dir];
-       if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
-       {
-               do_cmd_attack(caster_ptr, y, x, 0);
-               if (randint0(caster_ptr->skill_dis) < 7)
-                       msg_print(_("うまく逃げられなかった。", "You failed to run away."));
-               else
-                       teleport_player(caster_ptr, 30, TELEPORT_SPONTANEOUS);
-               return TRUE;
-       }
-
-       msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
-       msg_print(NULL);
-       return FALSE;
-}
-
-
 bool android_inside_weapon(player_type *creature_ptr)
 {
        DIRECTION dir;
index 6392dd9..1509750 100644 (file)
@@ -9,7 +9,6 @@ bool cast_wrath_of_the_god(player_type* caster_ptr, HIT_POINT dam, POSITION rad)
 void cast_wonder(player_type* caster_ptr, DIRECTION dir);
 void cast_shuffle(player_type* caster_ptr);
 bool vampirism(player_type* caster_ptr);
-bool hit_and_away(player_type* caster_ptr);
 bool android_inside_weapon(player_type* creature_ptr);
 bool create_ration(player_type* crature_ptr);
 void hayagake(player_type* creature_ptr);