OSDN Git Service

[Refactor] #40653 Separated spells-nature.c/h from spells-object.c/h
authorHourier <hourier@users.sourceforge.jp>
Fri, 21 Aug 2020 05:02:52 +0000 (14:02 +0900)
committerHourier <hourier@users.sourceforge.jp>
Fri, 21 Aug 2020 05:02:52 +0000 (14:02 +0900)
Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/realm/realm-nature.c
src/spell-realm/spells-nature.c [new file with mode: 0644]
src/spell-realm/spells-nature.h [new file with mode: 0644]
src/spell/spells-object.c
src/spell/spells-object.h

index 91352a7..1578973 100644 (file)
     <ClCompile Include="..\..\src\spell-kind\spells-world.c" />\r
     <ClCompile Include="..\..\src\spell-realm\spells-craft.c" />\r
     <ClCompile Include="..\..\src\spell-realm\spells-demon.c" />\r
+    <ClCompile Include="..\..\src\spell-realm\spells-nature.c" />\r
     <ClCompile Include="..\..\src\spell-realm\spells-sorcery.c" />\r
     <ClCompile Include="..\..\src\status\bad-status-setter.c" />\r
     <ClCompile Include="..\..\src\status\base-status.c" />\r
     <ClInclude Include="..\..\src\spell-kind\spells-world.h" />\r
     <ClInclude Include="..\..\src\spell-realm\spells-craft.h" />\r
     <ClInclude Include="..\..\src\spell-realm\spells-demon.h" />\r
+    <ClInclude Include="..\..\src\spell-realm\spells-nature.h" />\r
     <ClInclude Include="..\..\src\spell-realm\spells-sorcery.h" />\r
     <ClInclude Include="..\..\src\status\bad-status-setter.h" />\r
     <ClInclude Include="..\..\src\status\base-status.h" />\r
index a053e5d..24edde6 100644 (file)
     <ClCompile Include="..\..\src\mind\mind-chaos-warrior.c">
       <Filter>mind</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\spell-realm\spells-nature.c">
+      <Filter>spell-realm</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\combat\shoot.h">
     <ClInclude Include="..\..\src\mind\mind-chaos-warrior.h">
       <Filter>mind</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\spell-realm\spells-nature.h">
+      <Filter>spell-realm</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index 7e4d515..75f09ff 100644 (file)
@@ -755,6 +755,7 @@ hengband_SOURCES = \
        spell-realm/spells-crusade.c spell-realm/spells-crusade.h \
        spell-realm/spells-demon.c spell-realm/spells-demon.h \
        spell-realm/spells-hex.c spell-realm/spells-hex.h \
+       spell-realm/spells-nature.c spell-realm/spells-nature.h \
        spell-realm/spells-song.c spell-realm/spells-song.h \
        spell-realm/spells-sorcery.c spell-realm/spells-sorcery.h \
        spell-realm/spells-trump.c spell-realm/spells-trump.h \
index 4cb0f0b..b038f17 100644 (file)
@@ -25,6 +25,7 @@
 #include "spell-kind/spells-neighbor.h"
 #include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-sight.h"
+#include "spell-realm/spells-nature.h"
 #include "spell/spell-types.h"
 #include "spell/spells-diceroll.h"
 #include "spell/spells-object.h"
diff --git a/src/spell-realm/spells-nature.c b/src/spell-realm/spells-nature.c
new file mode 100644 (file)
index 0000000..32535f9
--- /dev/null
@@ -0,0 +1,48 @@
+#include "spell-realm/spells-nature.h"
+#include "flavor/flavor-describer.h"
+#include "flavor/object-flavor-types.h"
+#include "floor/floor-object.h"
+#include "object-enchant/tr-types.h"
+#include "object-hook/hook-armor.h"
+#include "object-hook/hook-checker.h"
+#include "object/item-tester-hooker.h"
+#include "object/item-use-flags.h"
+#include "racial/racial-android.h"
+#include "util/bit-flags-calculator.h"
+#include "view/display-messages.h"
+
+/*!
+ * @brief \96h\8bï\82Ì\8eK\8e~\82ß\96h\8e~\8f\88\97\9d
+ * @param caster_ptr \8eK\8e~\82ß\8eÀ\8ds\8eÒ\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @return \83^\81[\83\93\8fÁ\94ï\82ð\97v\82·\82é\8f\88\97\9d\82ð\8ds\82Á\82½\82È\82ç\82ÎTRUE\82ð\95Ô\82·
+ */
+bool rustproof(player_type *caster_ptr)
+{
+    item_tester_hook = object_is_armour;
+    concptr q = _("\82Ç\82Ì\96h\8bï\82É\8eK\8e~\82ß\82ð\82µ\82Ü\82·\82©\81H", "Rustproof which piece of armour? ");
+    concptr s = _("\8eK\8e~\82ß\82Å\82«\82é\82à\82Ì\82ª\82 \82è\82Ü\82¹\82ñ\81B", "You have nothing to rustproof.");
+    OBJECT_IDX item;
+    object_type *o_ptr = choose_object(caster_ptr, &item, q, s, USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT, 0);
+    if (o_ptr == NULL)
+        return FALSE;
+
+    GAME_TEXT o_name[MAX_NLEN];
+    describe_flavor(caster_ptr, o_name, o_ptr, OD_OMIT_PREFIX | OD_NAME_ONLY);
+    add_flag(o_ptr->art_flags, TR_IGNORE_ACID);
+    if ((o_ptr->to_a < 0) && !object_is_cursed(o_ptr)) {
+#ifdef JP
+        msg_format("%s\82Í\90V\95i\93¯\97l\82É\82È\82Á\82½\81I", o_name);
+#else
+        msg_format("%s %s look%s as good as new!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
+#endif
+        o_ptr->to_a = 0;
+    }
+
+#ifdef JP
+    msg_format("%s\82Í\95\85\90H\82µ\82È\82­\82È\82Á\82½\81B", o_name);
+#else
+    msg_format("%s %s %s now protected against corrosion.", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "are" : "is"));
+#endif
+    calc_android_exp(caster_ptr);
+    return TRUE;
+}
diff --git a/src/spell-realm/spells-nature.h b/src/spell-realm/spells-nature.h
new file mode 100644 (file)
index 0000000..0240543
--- /dev/null
@@ -0,0 +1,5 @@
+#pragma once
+
+#include "system/angband.h"
+
+bool rustproof(player_type *caster_ptr);
index 95b5d20..03a4772 100644 (file)
@@ -340,50 +340,6 @@ bool curse_weapon_object(player_type *owner_ptr, bool force, object_type *o_ptr)
 }
 
 /*!
- * @brief 防具の錆止め防止処理
- * @param caster_ptr 錆止め実行者の参照ポインタ
- * @return ターン消費を要する処理を行ったならばTRUEを返す
- */
-bool rustproof(player_type *caster_ptr)
-{
-    /* Select a piece of armour */
-    item_tester_hook = object_is_armour;
-
-    concptr q = _("どの防具に錆止めをしますか?", "Rustproof which piece of armour? ");
-    concptr s = _("錆止めできるものがありません。", "You have nothing to rustproof.");
-
-    OBJECT_IDX item;
-    object_type *o_ptr;
-    o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
-    if (!o_ptr)
-        return FALSE;
-
-    GAME_TEXT o_name[MAX_NLEN];
-    describe_flavor(caster_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
-
-    add_flag(o_ptr->art_flags, TR_IGNORE_ACID);
-
-    if ((o_ptr->to_a < 0) && !object_is_cursed(o_ptr)) {
-#ifdef JP
-        msg_format("%sは新品同様になった!", o_name);
-#else
-        msg_format("%s %s look%s as good as new!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
-#endif
-
-        o_ptr->to_a = 0;
-    }
-
-#ifdef JP
-    msg_format("%sは腐食しなくなった。", o_name);
-#else
-    msg_format("%s %s %s now protected against corrosion.", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "are" : "is"));
-#endif
-
-    calc_android_exp(caster_ptr);
-    return TRUE;
-}
-
-/*!
  * @brief ボルトのエゴ化処理(火炎エゴのみ) /
  * Enchant some bolts
  * @param caster_ptr プレーヤーへの参照ポインタ
index 33b83d1..020f151 100644 (file)
@@ -6,7 +6,6 @@ void amusement(player_type *creature_ptr, POSITION y1, POSITION x1, int num, boo
 void acquirement(player_type *caster_ptr, POSITION y1, POSITION x1, int num, bool great, bool special, bool known);
 bool curse_armor(player_type *owner_ptr);
 bool curse_weapon_object(player_type *creature_ptr, bool force, object_type *o_ptr);
-bool rustproof(player_type *caster_ptr);
 void brand_bolts(player_type *caster_ptr);
 bool perilous_secrets(player_type *user_ptr);
 void phlogiston(player_type *caster_ptr);