OSDN Git Service

[Refactor] #37353 グローバル変数 dungeon_type を他の慣例に従い dungeon_idx に改名。 / Rename dungeon_typ...
[hengband/hengband.git] / src / cmd-quaff.c
index 4d93aa0..5a4d695 100644 (file)
@@ -10,6 +10,9 @@
 #include "selfinfo.h"\r
 #include "object-hook.h"\r
 #include "mutation.h"\r
+#include "avatar.h"\r
+#include "spells-status.h"\r
+#include "realm-hex.h"\r
 \r
 /*!\r
  * @brief 薬を飲むコマンドのサブルーチン /\r
@@ -26,7 +29,7 @@ void do_cmd_quaff_potion_aux(INVENTORY_IDX item)
        object_type *q_ptr;\r
 \r
 \r
-       if (world_player)\r
+       if (p_ptr->timewalk)\r
        {\r
                if (flush_failure) flush();\r
                msg_print(_("瓶から水が流れ出てこない!", "The potion doesn't flow out from a bottle."));\r
@@ -449,7 +452,7 @@ void do_cmd_quaff_potion_aux(INVENTORY_IDX item)
                        break;\r
 \r
                case SV_POTION_NEW_LIFE:\r
-                       do_cmd_rerate(FALSE);\r
+                       roll_hitdice(0L);\r
                        get_max_stats();\r
                        p_ptr->update |= PU_BONUS;\r
                        lose_all_mutations();\r
@@ -499,8 +502,6 @@ void do_cmd_quaff_potion_aux(INVENTORY_IDX item)
                msg_print(_("液体の一部はあなたのアゴを素通りして落ちた!", "Some of the fluid falls through your jaws!"));\r
                (void)potion_smash_effect(0, p_ptr->y, p_ptr->x, q_ptr->k_idx);\r
        }\r
-\r
-       /* Combine / Reorder the pack (later) */\r
        p_ptr->update |= (PU_COMBINE | PU_REORDER);\r
 \r
        if (!(object_is_aware(q_ptr)))\r
@@ -590,12 +591,7 @@ void do_cmd_quaff_potion(void)
                return;\r
        }\r
 \r
-       if (p_ptr->inside_arena)\r
-       {\r
-               msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));\r
-               msg_print(NULL);\r
-               return;\r
-       }\r
+       if (cmd_limit_arena(p_ptr)) return;\r
 \r
        if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))\r
        {\r