OSDN Git Service

[Refactor] #40457 Separated snipe-types.h
authorHourier <hourier@users.sourceforge.jp>
Sun, 7 Jun 2020 11:28:02 +0000 (20:28 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 7 Jun 2020 11:28:02 +0000 (20:28 +0900)
12 files changed:
Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/cmd-item/cmd-item.c
src/cmd/cmd-basic.c
src/combat/shoot.c
src/io/input-key-processor.c
src/io/input-key-processor.h
src/mind/mind-sniper.c
src/mind/mind-sniper.h
src/mind/snipe-types.h [new file with mode: 0644]
src/object/object-broken.c

index ef6b249..9de7486 100644 (file)
     <ClInclude Include="..\..\src\info-reader\skill-reader.h" />\r
     <ClInclude Include="..\..\src\info-reader\vault-reader.h" />\r
     <ClInclude Include="..\..\src\mind\drs-types.h" />\r
+    <ClInclude Include="..\..\src\mind\snipe-types.h" />\r
     <ClInclude Include="..\..\src\monster-race\race-indice-types.h" />\r
     <ClInclude Include="..\..\src\monster\monster-flag-types.h" />\r
     <ClInclude Include="..\..\src\object-enchant\activation-info-table.h" />\r
index 52f767a..2c940a7 100644 (file)
     <ClInclude Include="..\..\src\mind\mind-sniper.h">
       <Filter>mind</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\mind\snipe-types.h">
+      <Filter>mind</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index f98204f..9a121ab 100644 (file)
@@ -269,6 +269,7 @@ hengband_SOURCES = \
        mind/mind-warrior.c mind/mind-warrior.h \
        mind/mind-warrior-mage.c mind/mind-warrior-mage.h \
        mind/monk-attack.c mind/monk-attack.h \
+       mind/snipe-types.h \
        mind/racial.c mind/racial.h \
        mind/racial-android.c mind/racial-android.h \
        mind/racial-balrog.c mind/racial-balrog.h \
index 9f4303e..a85ddef 100644 (file)
@@ -22,7 +22,6 @@
 #include "cmd-item/cmd-zaprod.h"
 #include "cmd-item/cmd-zapwand.h"
 #include "cmd/cmd-basic.h"
-#include "mind/mind-sniper.h"
 #include "core/sort.h"
 #include "core/stuff-handler.h"
 #include "dungeon/quest.h"
@@ -31,6 +30,7 @@
 #include "inventory/player-inventory.h"
 #include "io/targeting.h"
 #include "main/sound-definitions-table.h"
+#include "mind/snipe-types.h"
 #include "monster/monster.h"
 #include "object-enchant/item-feeling.h"
 #include "object-enchant/object-ego.h"
index f1402e4..fc55c35 100644 (file)
@@ -18,7 +18,6 @@
 #include "combat/attack-power-table.h"
 #include "combat/shoot.h"
 #include "combat/slaying.h"
-#include "mind/mind-sniper.h"
 #include "core/output-updater.h"
 #include "core/stuff-handler.h"
 #include "dungeon/dungeon.h"
@@ -37,6 +36,7 @@
 #include "io/write-diary.h"
 #include "main/music-definitions-table.h"
 #include "main/sound-definitions-table.h"
+#include "mind/snipe-types.h"
 #include "monster/monster-status.h"
 #include "object-enchant/special-object-flags.h"
 #include "object-enchant/tr-types.h"
index aa07196..0e15f4b 100644 (file)
@@ -9,6 +9,7 @@
 #include "inventory/inventory-object.h"
 #include "io/targeting.h"
 #include "main/sound-definitions-table.h"
+#include "mind/snipe-types.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-status.h"
 #include "monster/monster.h"
index c27e546..049e2f4 100644 (file)
@@ -5,60 +5,59 @@
  * @author Hourier
  */
 
-#include "system/angband.h"
 #include "io/input-key-processor.h"
-#include "world/world.h"
-#include "core/special-internal-keys.h"
-#include "dungeon/dungeon.h"
-#include "mind/mind-sniper.h"
 #include "autopick/autopick-pref-processor.h"
-#include "store/store-util.h"
-#include "main/sound-definitions-table.h"
-#include "io/write-diary.h"
-#include "inventory/player-inventory.h"
-#include "player/player-effects.h"
-#include "store/store.h" // do_cmd_store() がある。後で移設する.
-#include "dungeon/quest.h" // do_cmd_quest() がある。後で移設する.
-#include "floor/wild.h"
-#include "spell/spells-object.h"
-#include "mind/mind.h" // do_cmd_mind_browse() がある。後で移設する.
-#include "mspell/monster-spell.h" // do_cmd_cast_learned() がある。後で移設する.
-#include "mind/racial.h" // do_cmd_racial_power() がある。ファイル名変更?.
-#include "view/display-main-window.h"
-#include "knowledge/knowledge-autopick.h"
-#include "knowledge/knowledge-quests.h"
-#include "io/chuukei.h"
-#include "player/player-move.h" // do_cmd_travel() がある。後で移設する.
-#include "io/files-util.h"
-
-#include "cmd-item/cmd-activate.h"
-#include "cmd-io/cmd-autopick.h"
+#include "cmd-action/cmd-hissatsu.h"
+#include "cmd-action/cmd-mane.h"
+#include "cmd-action/cmd-pet.h"
+#include "cmd-action/cmd-spell.h"
 #include "cmd-building/cmd-building.h"
+#include "cmd-io/cmd-autopick.h"
 #include "cmd-io/cmd-diary.h"
-#include "cmd/cmd-draw.h"
 #include "cmd-io/cmd-dump.h"
+#include "cmd-io/cmd-help.h"
+#include "cmd-io/cmd-knowledge.h"
+#include "cmd-io/cmd-macro.h"
 #include "cmd-io/cmd-process-screen.h"
+#include "cmd-io/cmd-save.h"
+#include "cmd-item/cmd-activate.h"
 #include "cmd-item/cmd-eat.h"
-#include "cmd-io/cmd-help.h"
-#include "cmd-action/cmd-hissatsu.h"
 #include "cmd-item/cmd-item.h"
-#include "cmd-io/cmd-knowledge.h"
 #include "cmd-item/cmd-magiceat.h"
-#include "cmd-action/cmd-mane.h"
-#include "cmd-io/cmd-macro.h"
 #include "cmd-item/cmd-quaff.h"
 #include "cmd-item/cmd-read.h"
-#include "cmd-io/cmd-save.h"
 #include "cmd-item/cmd-smith.h"
-#include "cmd-action/cmd-spell.h"
 #include "cmd-item/cmd-usestaff.h"
 #include "cmd-item/cmd-zaprod.h"
 #include "cmd-item/cmd-zapwand.h"
-#include "cmd-action/cmd-pet.h"
 #include "cmd/cmd-basic.h"
+#include "cmd/cmd-draw.h"
 #include "cmd/cmd-visuals.h"
-#include "wizard/wizard-spoiler.h"
+#include "core/special-internal-keys.h"
+#include "dungeon/dungeon.h"
+#include "dungeon/quest.h" // do_cmd_quest() がある。後で移設する.
+#include "floor/wild.h"
+#include "inventory/player-inventory.h"
+#include "io/chuukei.h"
+#include "io/files-util.h"
+#include "io/write-diary.h"
+#include "knowledge/knowledge-autopick.h"
+#include "knowledge/knowledge-quests.h"
+#include "main/sound-definitions-table.h"
+#include "mind/mind-sniper.h"
+#include "mind/mind.h" // do_cmd_mind_browse() がある。後で移設する.
+#include "mind/racial.h" // do_cmd_racial_power() がある。ファイル名変更?.
+#include "mind/snipe-types.h"
+#include "mspell/monster-spell.h" // do_cmd_cast_learned() がある。後で移設する.
+#include "player/player-effects.h"
+#include "player/player-move.h" // do_cmd_travel() がある。後で移設する.
+#include "spell/spells-object.h"
+#include "store/store-util.h"
+#include "store/store.h" // do_cmd_store() がある。後で移設する.
+#include "view/display-main-window.h"
 #include "wizard/wizard-special-process.h"
+#include "wizard/wizard-spoiler.h"
+#include "world/world.h"
 
 // todo command-processor.h と util.h が相互依存している。後で別な場所に移す.
 COMMAND_CODE now_message;
@@ -69,7 +68,7 @@ COMMAND_CODE now_message;
  * @param player_ptr プレーヤーへの参照ポインタ
  * @return 実際にウィザードモードへ移行したらTRUEを返す。
  */
-bool enter_wizard_mode(player_typeplayer_ptr)
+bool enter_wizard_mode(player_type *player_ptr)
 {
     if (!current_world_ptr->noscore) {
         if (!allow_debug_opts || arg_wizard) {
@@ -84,7 +83,8 @@ bool enter_wizard_mode(player_type* player_ptr)
             return FALSE;
         }
 
-        exe_write_diary(player_ptr, DIARY_DESCRIPTION, 0, _("ウィザードモードに突入してスコアを残せなくなった。", "gave up recording score to enter wizard mode."));
+        exe_write_diary(
+            player_ptr, DIARY_DESCRIPTION, 0, _("ウィザードモードに突入してスコアを残せなくなった。", "gave up recording score to enter wizard mode."));
         current_world_ptr->noscore |= 0x0002;
     }
 
@@ -97,7 +97,7 @@ bool enter_wizard_mode(player_type* player_ptr)
  * @param player_ptr プレーヤーへの参照ポインタ
  * @return 実際にデバッグコマンドへ移行したらTRUEを返す。
  */
-static bool enter_debug_mode(player_typeplayer_ptr)
+static bool enter_debug_mode(player_type *player_ptr)
 {
     if (!current_world_ptr->noscore) {
         if (!allow_debug_opts) {
@@ -112,7 +112,8 @@ static bool enter_debug_mode(player_type* player_ptr)
             return FALSE;
         }
 
-        exe_write_diary(player_ptr, DIARY_DESCRIPTION, 0, _("デバッグモードに突入してスコアを残せなくなった。", "gave up sending score to use debug commands."));
+        exe_write_diary(
+            player_ptr, DIARY_DESCRIPTION, 0, _("デバッグモードに突入してスコアを残せなくなった。", "gave up sending score to use debug commands."));
         current_world_ptr->noscore |= 0x0008;
     }
 
@@ -125,7 +126,7 @@ static bool enter_debug_mode(player_type* player_ptr)
  * @todo Make some "blocks"
  * @return なし
  */
-void process_command(player_typecreature_ptr)
+void process_command(player_type *creature_ptr)
 {
     COMMAND_CODE old_now_message = now_message;
     repeat_check();
@@ -133,7 +134,7 @@ void process_command(player_type* creature_ptr)
     if ((creature_ptr->pclass == CLASS_SNIPER) && (creature_ptr->concent))
         creature_ptr->reset_concent = TRUE;
 
-    floor_typefloor_ptr = creature_ptr->current_floor_ptr;
+    floor_type *floor_ptr = creature_ptr->current_floor_ptr;
     switch (command_cmd) {
     case ESCAPE:
     case ' ':
@@ -325,7 +326,8 @@ void process_command(player_type* creature_ptr)
         break;
     }
     case 'b': {
-        if ((creature_ptr->pclass == CLASS_MINDCRAFTER) || (creature_ptr->pclass == CLASS_BERSERKER) || (creature_ptr->pclass == CLASS_NINJA) || (creature_ptr->pclass == CLASS_MIRROR_MASTER))
+        if ((creature_ptr->pclass == CLASS_MINDCRAFTER) || (creature_ptr->pclass == CLASS_BERSERKER) || (creature_ptr->pclass == CLASS_NINJA)
+            || (creature_ptr->pclass == CLASS_MIRROR_MASTER))
             do_cmd_mind_browse(creature_ptr);
         else if (creature_ptr->pclass == CLASS_SMITH)
             do_cmd_kaji(creature_ptr, TRUE);
@@ -342,7 +344,8 @@ void process_command(player_type* creature_ptr)
         if (!creature_ptr->wild_mode) {
             if ((creature_ptr->pclass == CLASS_WARRIOR) || (creature_ptr->pclass == CLASS_ARCHER) || (creature_ptr->pclass == CLASS_CAVALRY)) {
                 msg_print(_("呪文を唱えられない!", "You cannot cast spells!"));
-            } else if (floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH)) {
+            } else if (floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && (creature_ptr->pclass != CLASS_BERSERKER)
+                && (creature_ptr->pclass != CLASS_SMITH)) {
                 msg_print(_("ダンジョンが魔法を吸収した!", "The dungeon absorbs all attempted magic!"));
                 msg_print(NULL);
             } else if (creature_ptr->anti_magic && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH)) {
@@ -366,7 +369,8 @@ void process_command(player_type* creature_ptr)
                 msg_format(_("狂戦士化していて頭が回らない!", "You cannot think directly!"));
                 free_turn(creature_ptr);
             } else {
-                if ((creature_ptr->pclass == CLASS_MINDCRAFTER) || (creature_ptr->pclass == CLASS_BERSERKER) || (creature_ptr->pclass == CLASS_NINJA) || (creature_ptr->pclass == CLASS_MIRROR_MASTER))
+                if ((creature_ptr->pclass == CLASS_MINDCRAFTER) || (creature_ptr->pclass == CLASS_BERSERKER) || (creature_ptr->pclass == CLASS_NINJA)
+                    || (creature_ptr->pclass == CLASS_MIRROR_MASTER))
                     do_cmd_mind(creature_ptr);
                 else if (creature_ptr->pclass == CLASS_IMITATOR)
                     do_cmd_mane(creature_ptr, FALSE);
index bcb783d..37f7896 100644 (file)
@@ -1,5 +1,7 @@
 #pragma once
 
+#include "system/angband.h"
+
 extern COMMAND_CODE now_message;
 
 bool enter_wizard_mode(player_type* player_ptr);
index eb56e8f..edb6332 100644 (file)
@@ -11,6 +11,7 @@
 #include "core/stuff-handler.h"
 #include "floor/floor.h"
 #include "main/sound-definitions-table.h"
+#include "mind/snipe-types.h"
 #include "monster-race/monster-race.h"
 #include "player/player-status.h"
 #include "term/term-color-types.h"
index d194f42..0f36acb 100644 (file)
@@ -2,24 +2,6 @@
 
 #include "system/angband.h"
 
-/* Sniper */
-#define SP_NONE          0
-#define SP_LITE          1
-#define SP_AWAY          2
-#define SP_FIRE          3
-#define SP_KILL_WALL     4
-#define SP_COLD          5
-#define SP_KILL_TRAP     6
-#define SP_ELEC          7
-#define SP_PIERCE        8
-#define SP_RUSH          9
-#define SP_DOUBLE        10
-#define SP_EXPLODE       11
-#define SP_EVILNESS      12
-#define SP_HOLYNESS      13
-#define SP_FINAL         14
-#define SP_NEEDLE        15
-
 void reset_concentration(player_type *creature_ptr, bool msg);
 void display_snipe_list(player_type *sniper_ptr);
 MULTIPLY calc_snipe_damage_with_slay(player_type *sniper_ptr, MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_type);
diff --git a/src/mind/snipe-types.h b/src/mind/snipe-types.h
new file mode 100644 (file)
index 0000000..4037e81
--- /dev/null
@@ -0,0 +1,20 @@
+#pragma once
+
+typedef enum snipe_type {
+       SP_NONE = 0,
+    SP_LITE = 1,
+    SP_AWAY = 2,
+    SP_FIRE = 3,
+    SP_KILL_WALL = 4,
+    SP_COLD = 5,
+    SP_KILL_TRAP = 6,
+    SP_ELEC = 7,
+    SP_PIERCE = 8,
+    SP_RUSH = 9,
+    SP_DOUBLE = 10,
+    SP_EXPLODE = 11,
+    SP_EVILNESS = 12,
+    SP_HOLYNESS = 13,
+    SP_FINAL = 14,
+    SP_NEEDLE = 15,
+} snipe_type;
\ No newline at end of file
index 108f070..5644004 100644 (file)
@@ -4,14 +4,14 @@
  * @author deskull
  */
 #include "object/object-broken.h"
-#include "mind/mind-sniper.h"
 #include "effect/effect-characteristics.h"
+#include "mind/snipe-types.h"
+#include "object-enchant/tr-types.h"
 #include "object/object-flags.h"
 #include "object/object-kind.h"
-#include "sv-definition/sv-potion-types.h"
-#include "object-enchant/tr-types.h"
 #include "spell/process-effect.h"
 #include "spell/spells-type.h"
+#include "sv-definition/sv-potion-types.h"
 
 /*!
 * @brief アイテムが酸で破損するかどうかを判定する