OSDN Git Service

[Refactor] #37353 超能力と青魔法の時間停止を time_walk() に分離。 / Separate time stop of mind craft...
authorDeskull <deskull@users.sourceforge.jp>
Tue, 29 Jan 2019 14:06:21 +0000 (23:06 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Tue, 29 Jan 2019 14:06:21 +0000 (23:06 +0900)
Hengband_vcs2017/Hengband/Hengband.vcxproj
src/mind.c
src/mspells3.c
src/spells-status.c
src/spells-status.h

index bf093a4..bfcad53 100644 (file)
     <ClInclude Include="..\..\src\rooms.h" />\r
     <ClInclude Include="..\..\src\rumor.h" />\r
     <ClInclude Include="..\..\src\selfinfo.h" />\r
+    <ClInclude Include="..\..\src\shoot.h" />\r
     <ClInclude Include="..\..\src\sort.h" />\r
     <ClInclude Include="..\..\src\spells-object.h" />\r
     <ClInclude Include="..\..\src\spells-status.h" />\r
index 760afe1..d582acf 100644 (file)
@@ -1165,24 +1165,7 @@ static bool cast_mindcrafter_spell(int spell)
                break;
        case 13:
        {
-               if (world_player)
-               {
-                       msg_print(_("既に時は止まっている。", "Time is already stopped."));
-                       return (FALSE);
-               }
-               world_player = TRUE;
-               msg_print(_("「時よ!」", "You yell 'Time!'"));
-               msg_print(NULL);
-
-               /* Hack */
-               p_ptr->energy_need -= 1000 + (100 + p_ptr->csp - 50)*TURNS_PER_TICK/10;
-
-               p_ptr->redraw |= (PR_MAP);
-               p_ptr->update |= (PU_MONSTERS);
-
-               p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
-
-               handle_stuff();
+               time_walk(p_ptr);
                break;
        }
        default:
index 492caa5..fb7f2cc 100644 (file)
@@ -1050,19 +1050,7 @@ static bool cast_learned_spell(int spell, bool success)
                teleport_player(plev * 5, 0L);
                break;
        case MS_WORLD:
-        world_player = TRUE;
-        msg_print(_("「時よ!」", "'Time!'"));
-               msg_print(NULL);
-
-               /* Hack */
-               p_ptr->energy_need -= 1000 + (100 + randint1(200)+200)*TURNS_PER_TICK/10;
-
-               p_ptr->redraw |= (PR_MAP);
-               p_ptr->update |= (PU_MONSTERS);
-
-               p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
-
-               handle_stuff();
+               (void)time_walk(p_ptr);
                break;
        case MS_SPECIAL:
                break;
index 050291f..e2b5f6e 100644 (file)
@@ -165,3 +165,23 @@ void stop_singing(void)
        p_ptr->update |= (PU_BONUS);
        p_ptr->redraw |= (PR_STATUS);
 }
+
+bool time_walk(player_type *creature_ptr)
+{
+       if (world_player)
+       {
+               msg_print(_("\8aù\82É\8e\9e\82Í\8e~\82Ü\82Á\82Ä\82¢\82é\81B", "Time is already stopped."));
+               return (FALSE);
+       }
+       world_player = TRUE;
+       msg_print(_("\81u\8e\9e\82æ\81I\81v", "You yell 'Time!'"));
+       msg_print(NULL);
+
+       /* Hack */
+       p_ptr->energy_need -= 1000 + (100 + p_ptr->csp - 50)*TURNS_PER_TICK / 10;
+       p_ptr->redraw |= (PR_MAP);
+       p_ptr->update |= (PU_MONSTERS);
+       p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+       handle_stuff();
+       return TRUE;
+}
index be1ecff..cbe126a 100644 (file)
@@ -11,4 +11,5 @@ extern bool fear_monster(DIRECTION dir, PLAYER_LEVEL plev);
 extern bool poly_monster(DIRECTION dir, int power);
 extern bool clone_monster(DIRECTION dir);
 extern void stop_singing(void);
+extern bool time_walk(player_type *creature_ptr);