OSDN Git Service

[Refactor] #37353 型の置換。 / Type replacement.
[hengband/hengband.git] / src / cmd-zaprod.c
index f6d2cfa..1b88d6e 100644 (file)
@@ -1,6 +1,7 @@
 #include "angband.h"
 #include "avatar.h"
 #include "spells-status.h"
+#include "player-status.h"
 
 /*!
  * @brief ロッドの効果を発動する
@@ -297,7 +298,7 @@ void do_cmd_zap_rod_aux(INVENTORY_IDX item)
        }
 
 
-       p_ptr->energy_use = 100;
+       take_turn(p_ptr, 100);;
 
        /* Extract the item level */
        lev = k_info[o_ptr->k_idx].level;
@@ -314,13 +315,7 @@ void do_cmd_zap_rod_aux(INVENTORY_IDX item)
        if (fail < USE_DEVICE) fail = USE_DEVICE;
        if (chance < USE_DEVICE) chance = USE_DEVICE;
 
-       if (world_player)
-       {
-               if (flush_failure) flush();
-               msg_print(_("止まった時の中ではうまく働かないようだ。", "Nothing happen. Maybe this rod is freezing too."));
-               sound(SOUND_FAIL);
-               return;
-       }
+       if (cmd_limit_time_walk(p_ptr)) return;
 
        if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
        else if (chance > fail)