OSDN Git Service

[Fix] #38796 マーフォーク用の rgold_adj を追加。 / Add to rgold_adj for Merfolk.
[hengband/hengband.git] / src / cmd-zaprod.c
index f27997b..1b88d6e 100644 (file)
@@ -1,4 +1,7 @@
 #include "angband.h"
+#include "avatar.h"
+#include "spells-status.h"
+#include "player-status.h"
 
 /*!
  * @brief ロッドの効果を発動する
@@ -49,7 +52,7 @@ int rod_effect(OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, bool *use_charge, bool
 
        case SV_ROD_RECALL:
        {
-               if (!word_of_recall()) *use_charge = FALSE;
+               if (!recall_player(p_ptr, randint0(21) + 15)) *use_charge = FALSE;
                ident = TRUE;
                break;
        }
@@ -295,8 +298,7 @@ void do_cmd_zap_rod_aux(INVENTORY_IDX item)
        }
 
 
-       /* Take a turn */
-       p_ptr->energy_use = 100;
+       take_turn(p_ptr, 100);;
 
        /* Extract the item level */
        lev = k_info[o_ptr->k_idx].level;
@@ -313,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)
@@ -365,9 +361,7 @@ void do_cmd_zap_rod_aux(INVENTORY_IDX item)
 
        /* Increase the timeout by the rod kind's pval. -LM- */
        if (use_charge) o_ptr->timeout += k_ptr->pval;
-
-       /* Combine / Reorder the pack (later) */
-       p_ptr->notice |= (PN_COMBINE | PN_REORDER);
+       p_ptr->update |= (PU_COMBINE | PU_REORDER);
 
        if (!(object_is_aware(o_ptr)))
        {
@@ -386,7 +380,6 @@ void do_cmd_zap_rod_aux(INVENTORY_IDX item)
                gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
        }
 
-       /* Window stuff */
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 }
 
@@ -397,7 +390,14 @@ void do_cmd_zap_rod_aux(INVENTORY_IDX item)
 void do_cmd_zap_rod(void)
 {
        OBJECT_IDX item;
-       cptr q, s;
+       concptr q, s;
+
+       if (p_ptr->wild_mode)
+       {
+               return;
+       }
+
+       if (cmd_limit_arena(p_ptr)) return;
 
        if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
        {
@@ -407,11 +407,10 @@ void do_cmd_zap_rod(void)
        /* Restrict choices to rods */
        item_tester_tval = TV_ROD;
 
-       /* Get an item */
        q = _("どのロッドを振りますか? ", "Zap which rod? ");
        s = _("使えるロッドがない。", "You have no rod to zap.");
 
-       if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
+       if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
 
        /* Zap the rod */
        do_cmd_zap_rod_aux(item);