OSDN Git Service

[Refactor] #37353 朦朧によるコマンド制約を cmd_limit_stun() に分離。 / Separate cmd_limit_stun().
authordeskull <deskull@users.sourceforge.jp>
Thu, 7 Mar 2019 12:15:46 +0000 (21:15 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Thu, 7 Mar 2019 12:15:46 +0000 (21:15 +0900)
src/cmd2.c
src/externs.h
src/snipe.c

index fd5cd5a..13a0138 100644 (file)
@@ -105,6 +105,16 @@ bool cmd_limit_image(player_type *creature_ptr)
        return FALSE;
 }
 
+bool cmd_limit_stun(player_type *creature_ptr)
+{
+       if (creature_ptr->stun)
+       {
+               msg_print(_("頭が朦朧としていて集中できない!", "You are too stuned!"));
+               return TRUE;
+       }
+       return FALSE;
+}
+
 bool cmd_limit_arena(player_type *creature_ptr)
 {
        if (creature_ptr->inside_arena)
index b07bfcd..7121da1 100644 (file)
@@ -493,6 +493,7 @@ extern bool cmd_limit_time_walk(player_type *creature_ptr);
 extern bool cmd_limit_blind(player_type *creature_ptr);
 extern bool cmd_limit_confused(player_type *creature_ptr);
 extern bool cmd_limit_image(player_type *creature_ptr);
+extern bool cmd_limit_stun(player_type *creature_ptr);
 extern void forget_travel_flow(void);
 extern void do_cmd_go_up(void);
 extern void do_cmd_go_down(void);
index e82f7ca..644de8d 100644 (file)
@@ -538,13 +538,7 @@ void do_cmd_snipe(void)
 
        if(cmd_limit_confused(p_ptr)) return;
        if(cmd_limit_image(p_ptr)) return;
-
-       /* not if stuned */
-       if (p_ptr->stun)
-       {
-               msg_print(_("頭が朦朧としていて集中できない!", "You are too stuned!"));
-               return;
-       }
+       if(cmd_limit_stun(p_ptr)) return;
 
        if (!get_snipe_power(&n, FALSE)) return;