OSDN Git Service

[Refactor] #37353 spells2.c から spells-status.c に分離。 / Separate spells-status.c from...
authorDeskull <deskull@users.sourceforge.jp>
Tue, 22 Jan 2019 04:17:24 +0000 (13:17 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Tue, 22 Jan 2019 04:18:19 +0000 (13:18 +0900)
19 files changed:
Hengband_vcs2017/Hengband/Hengband.vcxproj
src/Makefile.am
src/cmd-activate.c
src/cmd-zaprod.c
src/cmd-zapwand.c
src/externs.h
src/mane.c
src/mind.c
src/mspells3.c
src/racial.c
src/realm-chaos.c
src/realm-crusade.c
src/realm-daemon.c
src/realm-death.c
src/realm-sorcery.c
src/realm-trump.c
src/spells-status.c [new file with mode: 0644]
src/spells-status.h [new file with mode: 0644]
src/spells2.c

index 096c3cc..8eda884 100644 (file)
     <ClCompile Include="..\..\src\shoot.c" />\r
     <ClCompile Include="..\..\src\snipe.c" />\r
     <ClCompile Include="..\..\src\sort.c" />\r
+    <ClCompile Include="..\..\src\spells-status.c" />\r
     <ClCompile Include="..\..\src\spells-summon.c" />\r
     <ClCompile Include="..\..\src\spells1.c" />\r
     <ClCompile Include="..\..\src\spells2.c" />\r
     <ClInclude Include="..\..\src\rooms.h" />\r
     <ClInclude Include="..\..\src\selfinfo.h" />\r
     <ClInclude Include="..\..\src\sort.h" />\r
+    <ClInclude Include="..\..\src\spells-status.h" />\r
     <ClInclude Include="..\..\src\spells-summon.h" />\r
     <ClInclude Include="..\..\src\floor-streams.h" />\r
     <ClInclude Include="..\..\src\projection.h" />\r
index 085c285..c46d1dc 100644 (file)
@@ -59,7 +59,9 @@ hengband_SOURCES = \
        rooms-special.c rooms-special.h rooms-trap.c rooms-trap.h rooms-vault.c \
        rooms-vault.h save.c scores.c selfinfo.c selfinfo.h shoot.c snipe.c \
        \
-       spells1.c spells2.c spells3.c spells-summon.c spells-summon.h \
+       spells1.c spells2.c spells3.c \
+       spells-status.c spells-status.h \
+       spells-summon.c spells-summon.h \
        \
        sort.c sort.h \
        store.h store.c tables.c trap.c trap.h types.h util.c \
index 1b49ab8..5af79e2 100644 (file)
@@ -14,6 +14,7 @@
 #include "projection.h"
 #include "artifact.h"
 #include "avatar.h"
+#include "spells-status.h"
 
 /*!
 * @brief ペット入りモンスターボールをソートするための比較関数
index c4f2039..2972d55 100644 (file)
@@ -1,5 +1,6 @@
 #include "angband.h"
 #include "avatar.h"
+#include "spells-status.h"
 
 /*!
  * @brief ロッドの効果を発動する
index db53678..df07b3b 100644 (file)
@@ -1,5 +1,6 @@
 #include "angband.h"
 #include "avatar.h"
+#include "spells-status.h"
 
 
 /*!
index 47f3c4b..0404180 100644 (file)
@@ -934,17 +934,6 @@ extern bool wall_to_mud(DIRECTION dir, HIT_POINT dam);
 extern bool destroy_door(DIRECTION dir);
 extern bool disarm_trap(DIRECTION dir);
 extern bool wizard_lock(DIRECTION dir);
-extern bool heal_monster(DIRECTION dir, HIT_POINT dam);
-extern bool speed_monster(DIRECTION dir, int power);
-extern bool slow_monster(DIRECTION dir, int power);
-extern bool sleep_monster(DIRECTION dir, int power);
-extern bool stasis_monster(DIRECTION dir);    /* Like sleep, affects undead as well */
-extern bool stasis_evil(DIRECTION dir);    /* Like sleep, affects undead as well */
-extern bool confuse_monster(DIRECTION dir, PLAYER_LEVEL plev);
-extern bool stun_monster(DIRECTION dir, PLAYER_LEVEL plev);
-extern bool fear_monster(DIRECTION dir, PLAYER_LEVEL plev);
-extern bool poly_monster(DIRECTION dir, int power);
-extern bool clone_monster(DIRECTION dir);
 extern bool teleport_monster(DIRECTION dir, int distance);
 extern bool door_creation(void);
 extern bool trap_creation(POSITION y, POSITION x);
index 96fcc3e..907aaad 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "angband.h"
 #include "spells-summon.h"
+#include "spells-status.h"
 
 static int damage;
 
index 6d6ef26..2a4b27c 100644 (file)
@@ -20,6 +20,7 @@
 #include "spells-summon.h"
 #include "avatar.h"
 #include "player-status.h"
+#include "spells-status.h"
 
 /*! 特殊技能の一覧テーブル */
 mind_power const mind_powers[5] =
index 07c0b71..492caa5 100644 (file)
@@ -14,6 +14,7 @@
 #include "spells-summon.h"
 #include "projection.h"
 #include "avatar.h"
+#include "spells-status.h"
 
 #define pseudo_plev() (((p_ptr->lev + 40) * (p_ptr->lev + 40) - 1550) / 130) /*!< モンスター魔法をプレイヤーが使用する場合の換算レベル */
 
index af5a357..f49fff8 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "mutation.h"
 #include "player-status.h"
+#include "spells-status.h"
 
 /*!
  * @brief レイシャル「弾/矢の製造」処理 / do_cmd_cast calls this function if the player's class is 'archer'.
index 5c07933..64db7ad 100644 (file)
@@ -1,6 +1,7 @@
 #include "angband.h"
 #include "cmd-spell.h"
 #include "spells-summon.h"
+#include "spells-status.h"
 #include "projection.h"
 
 /*!
index 10d545e..aadefe5 100644 (file)
@@ -2,6 +2,7 @@
 #include "cmd-spell.h"
 #include "spells-summon.h"
 #include "projection.h"
+#include "spells-status.h"
 
 
 
index 713b5fb..f4821b7 100644 (file)
@@ -2,6 +2,7 @@
 #include "angband.h"
 #include "cmd-spell.h"
 #include "spells-summon.h"
+#include "spells-status.h"
 #include "projection.h"
 
 /*!
index 078b6d6..0d4f92a 100644 (file)
@@ -2,6 +2,7 @@
 #include "cmd-spell.h"
 #include "projection.h"
 #include "spells-summon.h"
+#include "spells-status.h"
 #include "avatar.h"
 
 
index 411ec06..2b0875e 100644 (file)
@@ -3,6 +3,7 @@
 #include "selfinfo.h"
 #include "projection.h"
 #include "avatar.h"
+#include "spells-status.h"
 
 /*!
 * @brief 仙術領域魔法の各処理を行う
index beae828..6a153d0 100644 (file)
@@ -3,6 +3,7 @@
 #include "projection.h"
 #include "spells-summon.h"
 #include "mutation.h"
+#include "spells-status.h"
 
 
 /*!
diff --git a/src/spells-status.c b/src/spells-status.c
new file mode 100644 (file)
index 0000000..289c479
--- /dev/null
@@ -0,0 +1,136 @@
+#include "angband.h"
+#include "avatar.h"
+#include "spells-status.h"
+#include "projection.h"
+
+/*!
+ * @brief \83\82\83\93\83X\83^\81[\89ñ\95\9c\8f\88\97\9d
+ * @param dir \95û\8cü(5\82È\82ç\82Î\83O\83\8d\81[\83o\83\8b\95Ï\90\94 target_col/target_row \82Ì\8dÀ\95W\82ð\96Ú\95W\82É\82·\82é)
+ * @param dam \88Ð\97Í
+ * @return \8dì\97p\82ª\8eÀ\8dÛ\82É\82 \82Á\82½\8fê\8d\87TRUE\82ð\95Ô\82·
+ */
+bool heal_monster(DIRECTION dir, HIT_POINT dam)
+{
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       return (project_hook(GF_OLD_HEAL, dir, dam, flg));
+}
+
+/*!
+ * @brief \83\82\83\93\83X\83^\81[\89Á\91¬\8f\88\97\9d
+ * @param dir \95û\8cü(5\82È\82ç\82Î\83O\83\8d\81[\83o\83\8b\95Ï\90\94 target_col/target_row \82Ì\8dÀ\95W\82ð\96Ú\95W\82É\82·\82é)
+ * @param power \8cø\97Í
+ * @return \8dì\97p\82ª\8eÀ\8dÛ\82É\82 \82Á\82½\8fê\8d\87TRUE\82ð\95Ô\82·
+ */
+bool speed_monster(DIRECTION dir, int power)
+{
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       return (project_hook(GF_OLD_SPEED, dir, power, flg));
+}
+
+/*!
+ * @brief \83\82\83\93\83X\83^\81[\8c¸\91¬\8f\88\97\9d
+ * @param dir \95û\8cü(5\82È\82ç\82Î\83O\83\8d\81[\83o\83\8b\95Ï\90\94 target_col/target_row \82Ì\8dÀ\95W\82ð\96Ú\95W\82É\82·\82é)
+ * @param power \8cø\97Í
+ * @return \8dì\97p\82ª\8eÀ\8dÛ\82É\82 \82Á\82½\8fê\8d\87TRUE\82ð\95Ô\82·
+ */
+bool slow_monster(DIRECTION dir, int power)
+{
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       return (project_hook(GF_OLD_SLOW, dir, power, flg));
+}
+
+/*!
+ * @brief \83\82\83\93\83X\83^\81[\8dÃ\96°\8f\88\97\9d
+ * @param dir \95û\8cü(5\82È\82ç\82Î\83O\83\8d\81[\83o\83\8b\95Ï\90\94 target_col/target_row \82Ì\8dÀ\95W\82ð\96Ú\95W\82É\82·\82é)
+ * @param power \8cø\97Í
+ * @return \8dì\97p\82ª\8eÀ\8dÛ\82É\82 \82Á\82½\8fê\8d\87TRUE\82ð\95Ô\82·
+ */
+bool sleep_monster(DIRECTION dir, int power)
+{
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       return (project_hook(GF_OLD_SLEEP, dir, power, flg));
+}
+
+/*!
+ * @brief \83\82\83\93\83X\83^\81[\8dS\91©(STASIS)\8f\88\97\9d
+ * @param dir \95û\8cü(5\82È\82ç\82Î\83O\83\8d\81[\83o\83\8b\95Ï\90\94 target_col/target_row \82Ì\8dÀ\95W\82ð\96Ú\95W\82É\82·\82é)
+ * @return \8dì\97p\82ª\8eÀ\8dÛ\82É\82 \82Á\82½\8fê\8d\87TRUE\82ð\95Ô\82·
+ * @details \88Ð\97Í\82Í\83v\83\8c\83C\83\84\81[\83\8c\83x\83\8b*2\82É\8cÅ\92è
+ */
+bool stasis_monster(DIRECTION dir)
+{
+       return (fire_ball_hide(GF_STASIS, dir, p_ptr->lev * 2, 0));
+}
+
+/*!
+ * @brief \8e×\88«\82È\83\82\83\93\83X\83^\81[\8dS\91©(STASIS)\8f\88\97\9d
+ * @param dir \95û\8cü(5\82È\82ç\82Î\83O\83\8d\81[\83o\83\8b\95Ï\90\94 target_col/target_row \82Ì\8dÀ\95W\82ð\96Ú\95W\82É\82·\82é)
+ * @return \8dì\97p\82ª\8eÀ\8dÛ\82É\82 \82Á\82½\8fê\8d\87TRUE\82ð\95Ô\82·
+ * @details \88Ð\97Í\82Í\83v\83\8c\83C\83\84\81[\83\8c\83x\83\8b*2\82É\8cÅ\92è
+ */
+bool stasis_evil(DIRECTION dir)
+{
+       return (fire_ball_hide(GF_STASIS_EVIL, dir, p_ptr->lev * 2, 0));
+}
+
+/*!
+ * @brief \83\82\83\93\83X\83^\81[\8d¬\97\90\8f\88\97\9d
+ * @param dir \95û\8cü(5\82È\82ç\82Î\83O\83\8d\81[\83o\83\8b\95Ï\90\94 target_col/target_row \82Ì\8dÀ\95W\82ð\96Ú\95W\82É\82·\82é)
+ * @param plev \83v\83\8c\83C\83\84\81[\83\8c\83x\83\8b(=\8cø\97Í)
+ * @return \8dì\97p\82ª\8eÀ\8dÛ\82É\82 \82Á\82½\8fê\8d\87TRUE\82ð\95Ô\82·
+ */
+bool confuse_monster(DIRECTION dir, PLAYER_LEVEL plev)
+{
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       return (project_hook(GF_OLD_CONF, dir, plev, flg));
+}
+
+/*!
+ * @brief \83\82\83\93\83X\83^\81[\9eN\9eO\8f\88\97\9d
+ * @param dir \95û\8cü(5\82È\82ç\82Î\83O\83\8d\81[\83o\83\8b\95Ï\90\94 target_col/target_row \82Ì\8dÀ\95W\82ð\96Ú\95W\82É\82·\82é)
+ * @param plev \83v\83\8c\83C\83\84\81[\83\8c\83x\83\8b(=\8cø\97Í)
+ * @return \8dì\97p\82ª\8eÀ\8dÛ\82É\82 \82Á\82½\8fê\8d\87TRUE\82ð\95Ô\82·
+ */
+bool stun_monster(DIRECTION dir, PLAYER_LEVEL plev)
+{
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       return (project_hook(GF_STUN, dir, plev, flg));
+}
+
+/*!
+ * @brief \83`\83F\83\93\83W\83\82\83\93\83X\83^\81[\8f\88\97\9d
+ * @param dir \95û\8cü(5\82È\82ç\82Î\83O\83\8d\81[\83o\83\8b\95Ï\90\94 target_col/target_row \82Ì\8dÀ\95W\82ð\96Ú\95W\82É\82·\82é)
+ * @param power \8cø\97Í
+ * @return \8dì\97p\82ª\8eÀ\8dÛ\82É\82 \82Á\82½\8fê\8d\87TRUE\82ð\95Ô\82·
+ */
+bool poly_monster(DIRECTION dir, int power)
+{
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       bool tester = (project_hook(GF_OLD_POLY, dir, power, flg));
+       if (tester)
+               chg_virtue(V_CHANCE, 1);
+       return(tester);
+}
+
+/*!
+ * @brief \83N\83\8d\81[\83\93\83\82\83\93\83X\83^\81[\8f\88\97\9d
+ * @param dir \95û\8cü(5\82È\82ç\82Î\83O\83\8d\81[\83o\83\8b\95Ï\90\94 target_col/target_row \82Ì\8dÀ\95W\82ð\96Ú\95W\82É\82·\82é)
+ * @return \8dì\97p\82ª\8eÀ\8dÛ\82É\82 \82Á\82½\8fê\8d\87TRUE\82ð\95Ô\82·
+ */
+bool clone_monster(DIRECTION dir)
+{
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       return (project_hook(GF_OLD_CLONE, dir, 0, flg));
+}
+
+/*!
+ * @brief \83\82\83\93\83X\83^\81[\8b°\8dQ\8f\88\97\9d
+ * @param dir \95û\8cü(5\82È\82ç\82Î\83O\83\8d\81[\83o\83\8b\95Ï\90\94 target_col/target_row \82Ì\8dÀ\95W\82ð\96Ú\95W\82É\82·\82é)
+ * @param plev \83v\83\8c\83C\83\84\81[\83\8c\83x\83\8b(=\8cø\97Í)
+ * @return \8dì\97p\82ª\8eÀ\8dÛ\82É\82 \82Á\82½\8fê\8d\87TRUE\82ð\95Ô\82·
+ */
+bool fear_monster(DIRECTION dir, PLAYER_LEVEL plev)
+{
+       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
+       return (project_hook(GF_TURN_ALL, dir, plev, flg));
+}
diff --git a/src/spells-status.h b/src/spells-status.h
new file mode 100644 (file)
index 0000000..2179e05
--- /dev/null
@@ -0,0 +1,12 @@
+
+extern bool heal_monster(DIRECTION dir, HIT_POINT dam);
+extern bool speed_monster(DIRECTION dir, int power);
+extern bool slow_monster(DIRECTION dir, int power);
+extern bool sleep_monster(DIRECTION dir, int power);
+extern bool stasis_monster(DIRECTION dir);    /* Like sleep, affects undead as well */
+extern bool stasis_evil(DIRECTION dir);    /* Like sleep, affects undead as well */
+extern bool confuse_monster(DIRECTION dir, PLAYER_LEVEL plev);
+extern bool stun_monster(DIRECTION dir, PLAYER_LEVEL plev);
+extern bool fear_monster(DIRECTION dir, PLAYER_LEVEL plev);
+extern bool poly_monster(DIRECTION dir, int power);
+extern bool clone_monster(DIRECTION dir);
index 2e4de78..a9fbeac 100644 (file)
@@ -23,6 +23,7 @@
 #include "quest.h"
 #include "avatar.h"
 
+#include "spells-status.h"
 
 /*!
  * @brief プレイヤー周辺の地形を感知する
@@ -3125,137 +3126,6 @@ bool disarm_trap(DIRECTION dir)
        return (project_hook(GF_KILL_TRAP, dir, 0, flg));
 }
 
-/*!
- * @brief モンスター回復処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @param dam 威力
- * @return 作用が実際にあった場合TRUEを返す
- */
-bool heal_monster(DIRECTION dir, HIT_POINT dam)
-{
-       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
-       return (project_hook(GF_OLD_HEAL, dir, dam, flg));
-}
-
-/*!
- * @brief モンスター加速処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @param power 効力
- * @return 作用が実際にあった場合TRUEを返す
- */
-bool speed_monster(DIRECTION dir, int power)
-{
-       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
-       return (project_hook(GF_OLD_SPEED, dir, power, flg));
-}
-
-/*!
- * @brief モンスター減速処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @param power 効力
- * @return 作用が実際にあった場合TRUEを返す
- */
-bool slow_monster(DIRECTION dir, int power)
-{
-       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
-       return (project_hook(GF_OLD_SLOW, dir, power, flg));
-}
-
-/*!
- * @brief モンスター催眠処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @param power 効力
- * @return 作用が実際にあった場合TRUEを返す
- */
-bool sleep_monster(DIRECTION dir, int power)
-{
-       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
-       return (project_hook(GF_OLD_SLEEP, dir, power, flg));
-}
-
-/*!
- * @brief モンスター拘束(STASIS)処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @return 作用が実際にあった場合TRUEを返す
- * @details 威力はプレイヤーレベル*2に固定
- */
-bool stasis_monster(DIRECTION dir)
-{
-       return (fire_ball_hide(GF_STASIS, dir, p_ptr->lev*2, 0));
-}
-
-/*!
- * @brief 邪悪なモンスター拘束(STASIS)処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @return 作用が実際にあった場合TRUEを返す
- * @details 威力はプレイヤーレベル*2に固定
- */
-bool stasis_evil(DIRECTION dir)
-{
-       return (fire_ball_hide(GF_STASIS_EVIL, dir, p_ptr->lev*2, 0));
-}
-
-/*!
- * @brief モンスター混乱処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @param plev プレイヤーレベル(=効力)
- * @return 作用が実際にあった場合TRUEを返す
- */
-bool confuse_monster(DIRECTION dir, PLAYER_LEVEL plev)
-{
-       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
-       return (project_hook(GF_OLD_CONF, dir, plev, flg));
-}
-
-/*!
- * @brief モンスター朦朧処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @param plev プレイヤーレベル(=効力)
- * @return 作用が実際にあった場合TRUEを返す
- */
-bool stun_monster(DIRECTION dir, PLAYER_LEVEL plev)
-{
-       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
-       return (project_hook(GF_STUN, dir, plev, flg));
-}
-
-/*!
- * @brief チェンジモンスター処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @param power 効力
- * @return 作用が実際にあった場合TRUEを返す
- */
-bool poly_monster(DIRECTION dir, int power)
-{
-       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
-       bool tester = (project_hook(GF_OLD_POLY, dir, power, flg));
-       if (tester)
-               chg_virtue(V_CHANCE, 1);
-       return(tester);
-}
-
-/*!
- * @brief クローンモンスター処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @return 作用が実際にあった場合TRUEを返す
- */
-bool clone_monster(DIRECTION dir)
-{
-       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
-       return (project_hook(GF_OLD_CLONE, dir, 0, flg));
-}
-
-/*!
- * @brief モンスター恐慌処理
- * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
- * @param plev プレイヤーレベル(=効力)
- * @return 作用が実際にあった場合TRUEを返す
- */
-bool fear_monster(DIRECTION dir, PLAYER_LEVEL plev)
-{
-       BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
-       return (project_hook(GF_TURN_ALL, dir, plev, flg));
-}
 
 /*!
  * @brief 死の光線処理