OSDN Git Service

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

index 1578973..8de55f2 100644 (file)
     <ClCompile Include="..\..\src\spell-kind\spells-fetcher.c" />\r
     <ClCompile Include="..\..\src\spell-kind\spells-polymorph.c" />\r
     <ClCompile Include="..\..\src\spell-kind\spells-world.c" />\r
+    <ClCompile Include="..\..\src\spell-realm\spells-arcane.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
     <ClInclude Include="..\..\src\spell-kind\spells-fetcher.h" />\r
     <ClInclude Include="..\..\src\spell-kind\spells-polymorph.h" />\r
     <ClInclude Include="..\..\src\spell-kind\spells-world.h" />\r
+    <ClInclude Include="..\..\src\spell-realm\spells-arcane.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
index 24edde6..e20fd30 100644 (file)
     <ClCompile Include="..\..\src\spell-realm\spells-nature.c">
       <Filter>spell-realm</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\spell-realm\spells-arcane.c">
+      <Filter>spell-realm</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\combat\shoot.h">
     <ClInclude Include="..\..\src\spell-realm\spells-nature.h">
       <Filter>spell-realm</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\spell-realm\spells-arcane.h">
+      <Filter>spell-realm</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index 75f09ff..79c2b85 100644 (file)
@@ -750,6 +750,7 @@ hengband_SOURCES = \
        spell-kind/spells-teleport.c spell-kind/spells-teleport.h \
        spell-kind/spells-world.c spell-kind/spells-world.h \
        \
+       spell-realm/spells-arcane.c spell-realm/spells-arcane.h \
        spell-realm/spells-chaos.c spell-realm/spells-chaos.h \
        spell-realm/spells-craft.c spell-realm/spells-craft.h \
        spell-realm/spells-crusade.c spell-realm/spells-crusade.h \
index 345b195..7fbc126 100644 (file)
@@ -13,9 +13,9 @@
 #include "spell-kind/spells-perception.h"
 #include "spell-kind/spells-teleport.h"
 #include "spell-kind/spells-world.h"
+#include "spell-realm/spells-arcane.h"
 #include "spell/spell-types.h"
 #include "spell/spells-diceroll.h"
-#include "spell/spells-object.h"
 #include "spell/spells-status.h"
 #include "spell/spells-summon.h"
 #include "status/bad-status-setter.h"
diff --git a/src/spell-realm/spells-arcane.c b/src/spell-realm/spells-arcane.c
new file mode 100644 (file)
index 0000000..2262922
--- /dev/null
@@ -0,0 +1,39 @@
+#include "spell-realm/spells-arcane.h"
+#include "core/player-update-types.h"
+#include "inventory/inventory-slot-types.h"
+#include "sv-definition/sv-lite-types.h"
+#include "system/object-type-definition.h"
+#include "view/display-messages.h"
+
+/*!
+ * @brief \8eõ\96½\82Â\82«\8cõ\8c¹\82Ì\94R\91f\92Ç\89Á\8f\88\97\9d /
+ * Charge a lite (torch or latern)
+ * @return \82È\82µ
+ */
+void phlogiston(player_type *caster_ptr)
+{
+    GAME_TURN max_flog = 0;
+    object_type *o_ptr = &caster_ptr->inventory_list[INVEN_LITE];
+    if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_LANTERN))
+        max_flog = FUEL_LAMP;
+    else if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_TORCH))
+        max_flog = FUEL_TORCH;
+    else {
+        msg_print(_("\94R\91f\82ð\8fÁ\94ï\82·\82é\83A\83C\83e\83\80\82ð\91\95\94õ\82µ\82Ä\82¢\82Ü\82¹\82ñ\81B", "You are not wielding anything which uses phlogiston."));
+        return;
+    }
+
+    if (o_ptr->xtra4 >= max_flog) {
+        msg_print(_("\82±\82Ì\83A\83C\83e\83\80\82É\82Í\82±\82ê\88È\8fã\94R\91f\82ð\95â\8f[\82Å\82«\82Ü\82¹\82ñ\81B", "No more phlogiston can be put in this item."));
+        return;
+    }
+
+    o_ptr->xtra4 += (XTRA16)(max_flog / 2);
+    msg_print(_("\8fÆ\96¾\97p\83A\83C\83e\83\80\82É\94R\91f\82ð\95â\8f[\82µ\82½\81B", "You add phlogiston to your light item."));
+    if (o_ptr->xtra4 >= max_flog) {
+        o_ptr->xtra4 = (XTRA16)max_flog;
+        msg_print(_("\8fÆ\96¾\97p\83A\83C\83e\83\80\82Í\96\9e\83^\83\93\82É\82È\82Á\82½\81B", "Your light item is full."));
+    }
+
+    caster_ptr->update |= PU_TORCH;
+}
diff --git a/src/spell-realm/spells-arcane.h b/src/spell-realm/spells-arcane.h
new file mode 100644 (file)
index 0000000..1873a49
--- /dev/null
@@ -0,0 +1,5 @@
+#pragma once
+
+#include "system/angband.h"
+
+void phlogiston(player_type *caster_ptr);
index 03a4772..8d500ac 100644 (file)
@@ -423,49 +423,6 @@ bool perilous_secrets(player_type *user_ptr)
 }
 
 /*!
- * @brief 寿命つき光源の燃素追加処理 /
- * Charge a lite (torch or latern)
- * @return なし
- */
-void phlogiston(player_type *caster_ptr)
-{
-    GAME_TURN max_flog = 0;
-    object_type *o_ptr = &caster_ptr->inventory_list[INVEN_LITE];
-
-    /* It's a lamp */
-    if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_LANTERN)) {
-        max_flog = FUEL_LAMP;
-    }
-
-    /* It's a torch */
-    else if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_TORCH)) {
-        max_flog = FUEL_TORCH;
-    }
-
-    /* No torch to refill */
-    else {
-        msg_print(_("燃素を消費するアイテムを装備していません。", "You are not wielding anything which uses phlogiston."));
-        return;
-    }
-
-    if (o_ptr->xtra4 >= max_flog) {
-        msg_print(_("このアイテムにはこれ以上燃素を補充できません。", "No more phlogiston can be put in this item."));
-        return;
-    }
-
-    /* Refuel */
-    o_ptr->xtra4 += (XTRA16)(max_flog / 2);
-    msg_print(_("照明用アイテムに燃素を補充した。", "You add phlogiston to your light item."));
-
-    if (o_ptr->xtra4 >= max_flog) {
-        o_ptr->xtra4 = (XTRA16)max_flog;
-        msg_print(_("照明用アイテムは満タンになった。", "Your light item is full."));
-    }
-
-    caster_ptr->update |= (PU_TORCH);
-}
-
-/*!
  * @brief 武器の祝福処理 /
  * Bless a weapon
  * @return ターン消費を要する処理を行ったならばTRUEを返す
index 020f151..89d0407 100644 (file)
@@ -8,7 +8,6 @@ bool curse_armor(player_type *owner_ptr);
 bool curse_weapon_object(player_type *creature_ptr, bool force, object_type *o_ptr);
 void brand_bolts(player_type *caster_ptr);
 bool perilous_secrets(player_type *user_ptr);
-void phlogiston(player_type *caster_ptr);
 bool bless_weapon(player_type *caster_ptr);
 bool pulish_shield(player_type *caster_ptr);
 bool create_ration(player_type *crature_ptr);