OSDN Git Service

[Refactor] #39963 Separated spells-effect-util.c/h from spells.h/spells1.c
authorHourier <hourier@users.sourceforge.jp>
Wed, 29 Apr 2020 03:36:03 +0000 (12:36 +0900)
committerHourier <hourier@users.sourceforge.jp>
Wed, 29 Apr 2020 03:36:03 +0000 (12:36 +0900)
23 files changed:
Hengband_vcs2017/Hengband/Hengband.vcxproj
Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/cmd/cmd-activate.c
src/cmd/cmd-basic.c
src/cmd/cmd-pet.c
src/combat/shoot.c
src/effect/spells-effect-util.c [new file with mode: 0644]
src/effect/spells-effect-util.h [new file with mode: 0644]
src/floor.c
src/mind.c
src/mutation.c
src/racial.c
src/realm/realm-hissatsu.c
src/realm/realm-nature.c
src/realm/realm-trump.c
src/spells-summon.c
src/spells.h
src/spells1.c
src/spells2.c
src/spells3.c
src/targeting.c
src/view/display-main-window.c

index c827dc0..0b0dabc 100644 (file)
     <ClCompile Include="..\..\src\cmd\dump-util.c" />\r
     <ClCompile Include="..\..\src\effect\effect-feature.c" />\r
     <ClCompile Include="..\..\src\effect\effect-item.c" />\r
+    <ClCompile Include="..\..\src\effect\spells-effect-util.c" />\r
     <ClCompile Include="..\..\src\io\dump-remover.c" />\r
     <ClCompile Include="..\..\src\io\mutations-dump.c" />\r
     <ClCompile Include="..\..\src\knowledge\knowledge-autopick.c" />\r
     <ClInclude Include="..\..\src\cmd\dump-util.h" />\r
     <ClInclude Include="..\..\src\effect\effect-feature.h" />\r
     <ClInclude Include="..\..\src\effect\effect-item.h" />\r
+    <ClInclude Include="..\..\src\effect\spells-effect-util.h" />\r
     <ClInclude Include="..\..\src\io\dump-remover.h" />\r
     <ClInclude Include="..\..\src\io\mutations-dump.h" />\r
     <ClInclude Include="..\..\src\knowledge\knowledge-autopick.h" />\r
index b9c1e6a..a70af44 100644 (file)
     <ClCompile Include="..\..\src\realm\realm-trump.c">
       <Filter>realm</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\effect\spells-effect-util.c">
+      <Filter>effect</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\gamevalue.h" />
     <ClInclude Include="..\..\src\realm\realm-trump.h">
       <Filter>realm</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\effect\spells-effect-util.h">
+      <Filter>effect</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index fe91209..bd90c9f 100644 (file)
@@ -167,6 +167,7 @@ hengband_SOURCES = \
        \
        effect/effect-feature.c effect/effect-feature.h \
        effect/effect-item.c effect/effect-item.h \
+       effect/spells-effect-util.c effect/spells-effect-util.h \
        \
        spell/spells-common.c spell/spells-common.h \
        spells.h \
index 80f1c34..4ef6664 100644 (file)
@@ -30,6 +30,7 @@
 #include "object-ego.h"
 #include "targeting.h"
 #include "world.h"
+#include "effect/spells-effect-util.h"
 
 /*!
  * @brief 装備耐性に準じたブレス効果の選択テーブル /
index 0476725..03d4011 100644 (file)
@@ -50,6 +50,7 @@
 #include "view/display-main-window.h"
 #include "targeting.h"
 #include "world.h"
+#include "effect/spells-effect-util.h"
 
 /*!
  * @brief フロア脱出時に出戻りが不可能だった場合に警告を加える処理
index 513c69e..9f961fa 100644 (file)
@@ -22,6 +22,7 @@
 #include "view/display-main-window.h"
 #include "targeting.h"
 #include "world.h"
+#include "effect/spells-effect-util.h"
 
 int total_friends = 0;
 
index cccebc0..e9a30f2 100644 (file)
@@ -17,7 +17,6 @@
 #include "object-broken.h"
 #include "floor.h"
 #include "grid.h"
-#include "spells.h"
 #include "object-flavor.h"
 
 #include "shoot.h"
@@ -25,6 +24,7 @@
 #include "view/display-main-window.h"
 #include "object/object-kind.h"
 #include "targeting.h"
+#include "effect/spells-effect-util.h"
 
 /*!
  * @brief 矢弾を射撃した際のスレイ倍率をかけた結果を返す /
diff --git a/src/effect/spells-effect-util.c b/src/effect/spells-effect-util.c
new file mode 100644 (file)
index 0000000..9850868
--- /dev/null
@@ -0,0 +1,20 @@
+#include "angband.h"
+#include "effect/spells-effect-util.h"
+
+int rakubadam_m;
+int rakubadam_p;
+bool sukekaku;
+
+int project_length = 0;
+
+int cap_mon;
+int cap_mspeed;
+HIT_POINT cap_hp;
+HIT_POINT cap_maxhp;
+STR_OFFSET cap_nickname;
+
+int project_m_n;
+POSITION project_m_x;
+POSITION project_m_y;
+POSITION monster_target_x;
+POSITION monster_target_y;
diff --git a/src/effect/spells-effect-util.h b/src/effect/spells-effect-util.h
new file mode 100644 (file)
index 0000000..09bb420
--- /dev/null
@@ -0,0 +1,19 @@
+#pragma once
+
+extern int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
+extern int rakubadam_p; /*!< 落馬した際のダメージ量 */
+
+extern int cap_mon;
+extern int cap_mspeed;
+extern HIT_POINT cap_hp;
+extern HIT_POINT cap_maxhp;
+extern STR_OFFSET cap_nickname;
+
+extern bool sukekaku;
+extern int project_length; /*!< 投射の射程距離 */
+
+extern int project_m_n; /*!< 魔法効果範囲内にいるモンスターの数 */
+extern POSITION project_m_x; /*!< 処理中のモンスターX座標 */
+extern POSITION project_m_y; /*!< 処理中のモンスターY座標 */
+extern POSITION monster_target_x; /*!< モンスターの攻撃目標X座標 */
+extern POSITION monster_target_y; /*!< モンスターの攻撃目標Y座標 */
index 02bb290..83a4ec9 100644 (file)
@@ -13,6 +13,7 @@
 #include "artifact.h"
 #include "object/object-kind.h"
 #include "trap.h"
+#include "effect/spells-effect-util.h"
 
 /*
  * The array of floor [MAX_WID][MAX_HGT].
index fd97609..e73fa7b 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "floor.h"
 #include "melee.h"
-#include "spells.h"
 #include "spells-summon.h"
 #include "avatar.h"
 #include "player-move.h"
@@ -41,6 +40,7 @@
 #include "view/display-main-window.h"
 #include "targeting.h"
 #include "realm/realm-song.h"
+#include "effect/spells-effect-util.h"
 
 /*! 特殊技能の一覧テーブル */
 mind_power const mind_powers[5] =
index 41a5c4c..2eb4d7a 100644 (file)
 #include "spells-status.h"
 #include "spells-floor.h"
 #include "object-hook.h"
-#include "spells.h"
 #include "cmd-basic.h"
 #include "files.h"
 #include "floor.h"
 #include "targeting.h"
 #include "player-race.h"
+#include "effect/spells-effect-util.h"
 
 /*!
  * @brief プレイヤーに突然変異を与える
index 1449825..1264115 100644 (file)
 #include "spells-status.h"
 #include "spells-object.h"
 #include "spells-floor.h"
-#include "spells.h"
 #include "cmd-spell.h"
 #include "realm/realm-hex.h"
 #include "targeting.h"
 #include "view/display-main-window.h"
 #include "player-class.h"
+#include "effect/spells-effect-util.h"
 
 /*!
  * @brief 修行僧の構え設定処理
index a34d798..c46e592 100644 (file)
@@ -21,6 +21,7 @@
 #include "view/display-main-window.h"
 #include "spells-floor.h"
 #include "world.h"
+#include "effect/spells-effect-util.h"
 
 /*!
 * @brief 剣術の各処理を行う
index 19c8f87..d080e6a 100644 (file)
@@ -2,7 +2,6 @@
 #include "util.h"
 
 #include "cmd-spell.h"
-#include "spells.h"
 #include "spells-summon.h"
 #include "spells-status.h"
 #include "spells-object.h"
@@ -13,7 +12,7 @@
 #include "player-effects.h"
 #include "player-damage.h"
 #include "targeting.h"
-
+#include "effect/spells-effect-util.h"
 
 /*!
 * @brief 自然領域魔法の各処理を行う
index 38c5827..b283d06 100644 (file)
@@ -3,14 +3,13 @@
 
 #include "cmd-spell.h"
 #include "mutation.h"
-#include "spells.h"
 #include "spells-summon.h"
 #include "spells-status.h"
 #include "spells-object.h"
 #include "player-effects.h"
 #include "player-class.h"
 #include "targeting.h"
-
+#include "effect/spells-effect-util.h"
 
 /*!
 * @brief トランプ領域魔法の各処理を行う
index 3537ebc..393b477 100644 (file)
@@ -1,11 +1,11 @@
 #include "angband.h"
 #include "util.h"
 
-#include "spells.h"
 #include "spells-summon.h"
 #include "player-inventory.h"
 #include "monster-status.h"
 #include "floor.h"
+#include "effect/spells-effect-util.h"
 
 /*!
 * @brief トランプ魔法独自の召喚処理を行う / Handle summoning and failure of trump spells
index b8528fb..93f9be9 100644 (file)
@@ -126,13 +126,6 @@ extern concptr exe_spell(player_type *caster_ptr, REALM_IDX realm, SPELL_IDX spe
 
 #define MAX_GF         117
 
-extern int cap_mon;
-extern int cap_mspeed;
-extern HIT_POINT cap_hp;
-extern HIT_POINT cap_maxhp;
-extern STR_OFFSET cap_nickname;
-extern bool sukekaku;
-
 /* spells1.c */
 extern bool in_disintegration_range(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
 extern void breath_shape(player_type *caster_ptr, u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, EFFECT_ID typ);
@@ -142,7 +135,6 @@ extern POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, P
 #define PROJECT_WHO_GLASS_SHARDS -2 /*!< 魔法効果の自然発生要因: 破壊されたガラス地形の破片 */
 extern bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell);
 
-extern int project_length;
 extern bool binding_field(player_type *caster_ptr, HIT_POINT dam);
 extern void seal_of_mirror(player_type *caster_ptr, HIT_POINT dam);
 extern concptr spell_category_name(OBJECT_TYPE_VALUE tval);
index 47d34fd..c306c0c 100644 (file)
 
 #include "effect/effect-feature.h"
 #include "effect/effect-item.h"
-
-
-static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
-static int rakubadam_p; /*!< 落馬した際のダメージ量 */
-bool sukekaku;
-
-int project_length = 0; /*!< 投射の射程距離 */
-
-int cap_mon;
-int cap_mspeed;
-HIT_POINT cap_hp;
-HIT_POINT cap_maxhp;
-STR_OFFSET cap_nickname;
+#include "effect/spells-effect-util.h"
 
 /*!
  * @brief 魔法処理のメインルーチン
@@ -148,13 +136,6 @@ static void next_mirror(player_type *creature_ptr, POSITION* next_y, POSITION* n
 }
 
 
-static int project_m_n; /*!< 魔法効果範囲内にいるモンスターの数 */
-static POSITION project_m_x; /*!< 処理中のモンスターX座標 */
-static POSITION project_m_y; /*!< 処理中のモンスターY座標 */
-static POSITION monster_target_x; /*!< モンスターの攻撃目標X座標 */
-static POSITION monster_target_y; /*!< モンスターの攻撃目標Y座標 */
-
-
 /*!
  * @brief 汎用的なビーム/ボルト/ボール系によるモンスターへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
  * @param caster_ptr プレーヤーへの参照ポインタ
index 1040f5a..8405ba8 100644 (file)
@@ -59,6 +59,7 @@
 #include "targeting.h"
 #include "realm/realm-song.h"
 #include "english.h"
+#include "effect/spells-effect-util.h"
 
  /*!
   * @brief プレイヤー周辺の地形を感知する
index 2a5f1f9..7500534 100644 (file)
@@ -62,6 +62,7 @@
 #include "object/object-kind.h"
 #include "autopick/autopick.h"
 #include "targeting.h"
+#include "effect/spells-effect-util.h"
 
 /*! テレポート先探索の試行数 / Maximum number of tries for teleporting */
 #define MAX_TRIES 100
index a41fc99..263b5de 100644 (file)
@@ -38,8 +38,8 @@
 #include "feature.h"
 #include "quest.h"
 #include "dungeon.h"
-#include "spells.h"
 #include "world.h"
+#include "effect/spells-effect-util.h"
 
  /*!
   * @brief コンソール上におけるマップ表示の左上位置を返す /
index 25f5e12..a2bac91 100644 (file)
@@ -34,7 +34,6 @@
 #include "monster.h"
 #include "view/display-main-window.h"
 
-#include "spells.h"
 #include "realm/realm-hex.h"
 #include "realm/realm-song.h"
 
@@ -49,6 +48,7 @@
 #include "targeting.h"
 
 #include "market/arena-info-table.h"
+#include "effect/spells-effect-util.h"
 
  /*
   * Not using graphical tiles for this feature?