• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisionf2f30fa709412594b662c28db73b0b4488ac9e3a (tree)
Time2019-02-14 13:16:30
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

[Refactor] #37353 set_gametime() を spells-world.c/h に移動。 / Move set_gametime() to spells-world.c/h.

Change Summary

Incremental Difference

--- a/Hengband_vcs2017/Hengband/Hengband.vcxproj
+++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj
@@ -242,6 +242,7 @@
242242 <ClCompile Include="..\..\src\spells-object.c" />
243243 <ClCompile Include="..\..\src\spells-status.c" />
244244 <ClCompile Include="..\..\src\spells-summon.c" />
245+ <ClCompile Include="..\..\src\spells-world.c" />
245246 <ClCompile Include="..\..\src\spells1.c" />
246247 <ClCompile Include="..\..\src\spells2.c" />
247248 <ClCompile Include="..\..\src\spells3.c" />
@@ -331,6 +332,7 @@
331332 <ClInclude Include="..\..\src\spells-summon.h" />
332333 <ClInclude Include="..\..\src\floor-streams.h" />
333334 <ClInclude Include="..\..\src\projection.h" />
335+ <ClInclude Include="..\..\src\spells-world.h" />
334336 <ClInclude Include="..\..\src\spells.h" />
335337 <ClInclude Include="..\..\src\store.h" />
336338 <ClInclude Include="..\..\src\trap.h" />
--- /dev/null
+++ b/src/spells-world.c
@@ -0,0 +1,24 @@
1+#include "angband.h"
2+
3+/*!
4+ * @brief プレイ日数を変更する / Set gametime.
5+ * @return 実際に変更を行ったらTRUEを返す
6+ */
7+bool set_gametime(void)
8+{
9+ int tmp_int = 0;
10+ char ppp[80], tmp_val[40];
11+
12+ sprintf(ppp, "Dungeon Turn (0-%ld): ", (long)dungeon_turn_limit);
13+ sprintf(tmp_val, "%ld", (long)dungeon_turn);
14+ if (!get_string(ppp, tmp_val, 10)) return (FALSE);
15+ tmp_int = atoi(tmp_val);
16+
17+ /* Verify */
18+ if (tmp_int >= dungeon_turn_limit) tmp_int = dungeon_turn_limit - 1;
19+ else if (tmp_int < 0) tmp_int = 0;
20+ dungeon_turn = turn = tmp_int;
21+ return (TRUE);
22+
23+}
24+
--- /dev/null
+++ b/src/spells-world.h
@@ -0,0 +1 @@
1+extern bool set_gametime(void);
--- a/src/wizard2.c
+++ b/src/wizard2.c
@@ -23,6 +23,7 @@
2323 #include "spells-object.h"
2424 #include "spells-summon.h"
2525 #include "spells-status.h"
26+#include "spells-world.h"
2627 #include "object-hook.h"
2728
2829 #ifdef ALLOW_WIZARD
@@ -39,30 +40,6 @@ static bool wiz_dimension_door(void)
3940 return (TRUE);
4041 }
4142
42-
43-/*!
44- * @brief プレイ日数を変更する / Set gametime.
45- * @return 実際に変更を行ったらTRUEを返す
46- */
47-static bool set_gametime(void)
48-{
49- int tmp_int = 0;
50- char ppp[80], tmp_val[40];
51-
52- sprintf(ppp, "Dungeon Turn (0-%ld): ", (long)dungeon_turn_limit);
53- sprintf(tmp_val, "%ld", (long)dungeon_turn);
54- if (!get_string(ppp, tmp_val, 10)) return (FALSE);
55- tmp_int = atoi(tmp_val);
56-
57- /* Verify */
58- if (tmp_int >= dungeon_turn_limit) tmp_int = dungeon_turn_limit - 1;
59- else if (tmp_int < 0) tmp_int = 0;
60- dungeon_turn = turn = tmp_int;
61- return (TRUE);
62-
63-}
64-
65-
6643 /*!
6744 * @brief 指定されたIDの固定アーティファクトを生成する / Create the artifact of the specified number
6845 * @return なし
Show on old repository browser