OSDN Git Service

[Refactor] #40466 Separated stances-table.c/h from player-effects.c/h
authorHourier <hourier@users.sourceforge.jp>
Sat, 27 Jun 2020 07:16:37 +0000 (16:16 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 27 Jun 2020 07:16:37 +0000 (16:16 +0900)
Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/mind/mind-samurai.c
src/mind/racial.c
src/mind/stances-table.c [new file with mode: 0644]
src/mind/stances-table.h [new file with mode: 0644]
src/player/player-effects.c
src/player/player-effects.h
src/view/display-player-middle.c
src/view/main-window-stat-poster.c

index 0ba7610..7643dac 100644 (file)
     <ClCompile Include="..\..\src\io\input-key-acceptor.c" />\r
     <ClCompile Include="..\..\src\io\input-key-requester.c" />\r
     <ClCompile Include="..\..\src\locale\vowel-checker.c" />\r
+    <ClCompile Include="..\..\src\mind\stances-table.c" />\r
     <ClCompile Include="..\..\src\view\display-map.c" />\r
     <ClCompile Include="..\..\src\view\display-sub-windows.c" />\r
     <ClCompile Include="..\..\src\view\main-window-left-frame.c" />\r
     <ClInclude Include="..\..\src\locale\language-switcher.h" />\r
     <ClInclude Include="..\..\src\locale\vowel-checker.h" />\r
     <ClInclude Include="..\..\src\mind\mind-blue-mage.h" />\r
+    <ClInclude Include="..\..\src\mind\stances-table.h" />\r
     <ClInclude Include="..\..\src\mspell\monster-power-table.h" />\r
     <ClInclude Include="..\..\src\mspell\mspell-mask-definitions.h" />\r
     <ClInclude Include="..\..\src\mspell\mspells1.h" />\r
index 58ef5da..45a43c0 100644 (file)
     <ClCompile Include="..\..\src\io\screen-util.c">
       <Filter>io</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\mind\stances-table.c">
+      <Filter>mind</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\cmd\cmd-basic.h">
     <ClInclude Include="..\..\src\io\screen-util.h">
       <Filter>io</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\mind\stances-table.h">
+      <Filter>mind</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index 0a2bdd8..a14b5c7 100644 (file)
@@ -317,6 +317,7 @@ hengband_SOURCES = \
        mind/racial-balrog.c mind/racial-balrog.h \
        mind/racial-draconian.c mind/racial-draconian.h \
        mind/racial-vampire.c mind/racial-vampire.h \
+       mind/stances-table.c mind/stances-table.h \
        \
        monster/horror-descriptions.c monster/horror-descriptions.h \
        monster/monster-compaction.c monster/monster-compaction.h \
index 93bd8f8..2989e79 100644 (file)
@@ -9,6 +9,7 @@
 #include "cmd-action/cmd-pet.h"
 #include "cmd/cmd-basic.h"
 #include "io/input-key-acceptor.h"
+#include "mind/stances-table.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
 #include "monster-race/race-flags3.h"
@@ -346,8 +347,8 @@ bool choose_kata(player_type *creature_ptr)
     screen_save();
     prt(_(" a) 型を崩す", " a) No Form"), 2, 20);
     for (i = 0; i < MAX_KATA; i++) {
-        if (creature_ptr->lev >= kata_shurui[i].min_level) {
-            sprintf(buf, _(" %c) %sの型    %s", " %c) Stance of %-12s  %s"), I2A(i + 1), kata_shurui[i].desc, kata_shurui[i].info);
+        if (creature_ptr->lev >= samurai_stances[i].min_level) {
+            sprintf(buf, _(" %c) %sの型    %s", " %c) Stance of %-12s  %s"), I2A(i + 1), samurai_stances[i].desc, samurai_stances[i].info);
             prt(buf, 3 + i, 20);
         }
     }
@@ -389,7 +390,7 @@ bool choose_kata(player_type *creature_ptr)
     } else {
         creature_ptr->special_defense &= ~(KATA_MASK);
         creature_ptr->update |= (PU_BONUS | PU_MONSTERS);
-        msg_format(_("%sの型で構えた。", "You assume the %s stance."), kata_shurui[new_kata].desc);
+        msg_format(_("%sの型で構えた。", "You assume the %s stance."), samurai_stances[new_kata].desc);
         creature_ptr->special_defense |= (KATA_IAI << new_kata);
     }
 
index e633dc1..26342ae 100644 (file)
@@ -38,6 +38,7 @@
 #include "mind/racial-balrog.h"
 #include "mind/racial-draconian.h"
 #include "mind/racial-vampire.h"
+#include "mind/stances-table.h"
 #include "mutation/mutation.h"
 #include "object/object-hook.h"
 #include "player/player-class.h"
@@ -80,9 +81,9 @@ static bool choose_kamae(player_type *creature_ptr)
 
        for (i = 0; i < MAX_KAMAE; i++)
        {
-               if (creature_ptr->lev >= kamae_shurui[i].min_level)
+               if (creature_ptr->lev >= monk_stances[i].min_level)
                {
-                       sprintf(buf," %c) %-12s  %s",I2A(i+1), kamae_shurui[i].desc, kamae_shurui[i].info);
+                       sprintf(buf," %c) %-12s  %s",I2A(i+1), monk_stances[i].desc, monk_stances[i].info);
                        prt(buf, 3+i, 20);
                }
        }
@@ -142,7 +143,7 @@ static bool choose_kamae(player_type *creature_ptr)
                creature_ptr->special_defense &= ~(KAMAE_MASK);
                creature_ptr->update |= (PU_BONUS);
                creature_ptr->redraw |= (PR_STATE);
-               msg_format(_("%sの構えをとった。", "You assume the %s stance."), kamae_shurui[new_kamae].desc);
+               msg_format(_("%sの構えをとった。", "You assume the %s stance."), monk_stances[new_kamae].desc);
                creature_ptr->special_defense |= (KAMAE_GENBU << new_kamae);
        }
        creature_ptr->redraw |= PR_STATE;
diff --git a/src/mind/stances-table.c b/src/mind/stances-table.c
new file mode 100644 (file)
index 0000000..b7da1e1
--- /dev/null
@@ -0,0 +1,21 @@
+#include "mind/stances-table.h"
+
+/*!
+ * @brief 修行僧の構え能力テーブル
+ */
+const blow_stance monk_stances[MAX_KAMAE] = {
+    { _("玄武", "Genbu"), 25, _("", "(Black Tortoise) ") },
+    { _("白虎", "Byakko"), 30, _("", "(White Tiger) ") },
+    { _("青竜", "Seiryuu"), 35, _("", "(Blue Dragon) ") },
+    { _("朱雀", "Suzaku"), 40, _("", "(Red Phoenix) ") },
+};
+
+/*!
+ * @brief 剣術家の構え能力テーブル
+ */
+const blow_stance samurai_stances[MAX_KATA] = {
+    { _("居合", "Iai"), 25, "" },
+    { _("風塵", "Huujin"), 30, "" },
+    { _("降鬼", "Kouki"), 35, "" },
+    { _("無想", "Musou"), 40, "" },
+};
diff --git a/src/mind/stances-table.h b/src/mind/stances-table.h
new file mode 100644 (file)
index 0000000..dc707c7
--- /dev/null
@@ -0,0 +1,12 @@
+#pragma once
+
+#include "system/angband.h"
+
+typedef struct blow_stance {
+    concptr desc; /* A verbose stance description */
+    PLAYER_LEVEL min_level; /* Minimum level to use */
+    concptr info;
+} blow_stance;
+
+extern const blow_stance monk_stances[MAX_KAMAE];
+extern const blow_stance samurai_stances[MAX_KATA];
index f7dee05..0c54d58 100644 (file)
@@ -31,6 +31,7 @@
 #include "io/report.h"
 #include "io/save.h"
 #include "locale/vowel-checker.h"
+#include "mind/stances-table.h"
 #include "mind/mind-sniper.h"
 #include "monster/monster-status.h"
 #include "mutation/mutation.h"
 #include "world/world.h"
 
 /*!
- * @brief 修行僧の構え能力テーブル
- */
-const kamae kamae_shurui[MAX_KAMAE] = {
-    { _("玄武", "Genbu"), 25, _("", "(Black Tortoise) ") },
-    { _("白虎", "Byakko"), 30, _("", "(White Tiger) ") },
-    { _("青竜", "Seiryuu"), 35, _("", "(Blue Dragon) ") },
-    { _("朱雀", "Suzaku"), 40, _("", "(Red Phoenix) ") },
-};
-
-/*!
- * @brief 剣術家の構え能力テーブル
- */
-const kamae kata_shurui[MAX_KATA] = {
-    { _("居合", "Iai"), 25, "" },
-    { _("風塵", "Huujin"), 30, "" },
-    { _("降鬼", "Kouki"), 35, "" },
-    { _("無想", "Musou"), 40, "" },
-};
-
-/*!
  * @brief プレイヤーの継続行動を設定する。
  * @param typ 継続行動のID\n
  * #ACTION_NONE / #ACTION_SEARCH / #ACTION_REST / #ACTION_LEARN / #ACTION_FISH / #ACTION_KAMAE / #ACTION_KATA / #ACTION_SING / #ACTION_HAYAGAKE / #ACTION_SPELL
index 6633424..a1ed0a2 100644 (file)
@@ -2,15 +2,6 @@
 
 #include "system/angband.h"
 
-typedef struct kamae {
-       concptr desc;       /* A verbose kamae description */
-       PLAYER_LEVEL min_level;  /* Minimum level to use */
-       concptr info;
-} kamae;
-
-extern const kamae kamae_shurui[MAX_KAMAE];
-extern const kamae kata_shurui[MAX_KATA];
-
 void set_action(player_type *creature_ptr, ACTION_IDX typ);
 void reset_tim_flags(player_type *creature_ptr);
 void dispel_player(player_type *creature_ptr);
index 042a25f..c85be52 100644 (file)
@@ -3,10 +3,10 @@
 #include "floor/floor.h"
 #include "game-option/birth-options.h"
 #include "game-option/special-options.h"
+#include "mind/stances-table.h"
 #include "monster/monster-status.h"
 #include "object-enchant/special-object-flags.h"
 #include "perception/object-perception.h"
-#include "player/player-effects.h"
 #include "player/player-race-types.h"
 #include "player/player-skill.h"
 #include "sv-definition/sv-bow-types.h"
@@ -76,7 +76,7 @@ static void display_left_hand(player_type *creature_ptr)
 
        if (kamae_num < MAX_KAMAE)
        {
-               display_player_one_line(ENTRY_POSTURE, format(_("%sの構え", "%s form"), kamae_shurui[kamae_num].desc), TERM_YELLOW);
+               display_player_one_line(ENTRY_POSTURE, format(_("%sの構え", "%s form"), monk_stances[kamae_num].desc), TERM_YELLOW);
        }
 }
 
index fbb0153..3da00bd 100644 (file)
@@ -1,9 +1,9 @@
 #include "view/main-window-stat-poster.h"
 #include "floor/floor.h"
-#include "realm/realm-hex-numbers.h"
 #include "io/input-key-requester.h"
+#include "mind/stances-table.h"
 #include "monster/monster-status.h"
-#include "player/player-effects.h"
+#include "realm/realm-hex-numbers.h"
 #include "realm/realm-types.h"
 #include "spell-realm/spells-hex.h"
 #include "term/screen-processor.h"
@@ -234,7 +234,7 @@ void print_state(player_type *player_ptr)
             break;
         }
 
-        strcpy(text, kamae_shurui[i].desc);
+        strcpy(text, monk_stances[i].desc);
         break;
     }
     case ACTION_KATA: {
@@ -243,7 +243,7 @@ void print_state(player_type *player_ptr)
             if (player_ptr->special_defense & (KATA_IAI << i))
                 break;
 
-        strcpy(text, kata_shurui[i].desc);
+        strcpy(text, samurai_stances[i].desc);
         break;
     }
     case ACTION_SING: {