OSDN Git Service

[Refactor] #38862 Moved angband.h, h-*.h and system-variables.c/h
[hengband/hengband.git] / src / cmd / cmd-quaff.c
index 2d15f45..0b2e22c 100644 (file)
@@ -6,34 +6,36 @@
  * cmd6.cより分離。
  */
 
-#include "angband.h"
+#include "system/angband.h"
 #include "util.h"
+#include "main/sound-definitions-table.h"
 
-#include "birth.h"
+#include "birth/birth.h"
 #include "selfinfo.h"
-#include "object-hook.h"
-#include "mutation.h"
+#include "object/object-hook.h"
+#include "mutation/mutation.h"
 #include "avatar.h"
-#include "spells.h"
+#include "spell/spells2.h"
+#include "spell/spells3.h"
 #include "spells-status.h"
-#include "player-effects.h"
-#include "player-status.h"
-#include "player-damage.h"
-#include "player-race.h"
+#include "player/player-effects.h"
+#include "player/player-status.h"
+#include "player/player-damage.h"
+#include "player/mimic-info-table.h"
 #include "player-inventory.h"
-#include "realm-hex.h"
-#include "realm-song.h"
+#include "realm/realm-hex.h"
 #include "spells-floor.h"
-#include "object-broken.h"
+#include "object/object-broken.h"
 #include "cmd-basic.h"
-#include "floor.h"
-#include "objectkind.h"
-#include "view-mainwindow.h"
-#include "player-class.h"
+#include "floor/floor.h"
+#include "object/object-kind.h"
+#include "view/display-main-window.h"
+#include "player/player-class.h"
 
 /*!
  * @brief 薬を飲むコマンドのサブルーチン /
  * Quaff a potion (from the pack or the floor)
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @param item 飲む薬オブジェクトの所持品ID
  * @return なし
  */
@@ -50,7 +52,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
        if (creature_ptr->timewalk)
        {
                if (flush_failure) flush();
-               msg_print(_("瓶から水が流れ出てこない!", "The potion doesn't flow out from a bottle."));
+               msg_print(_("瓶から水が流れ出てこない!", "The potion doesn't flow out from the bottle."));
 
                sound(SOUND_FAIL);
                return;
@@ -59,7 +61,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
        if (music_singing_any(creature_ptr)) stop_singing(creature_ptr);
        if (hex_spelling_any(creature_ptr))
        {
-               if (!hex_spelling(HEX_INHAIL)) stop_hex_spell_all(creature_ptr);
+               if (!hex_spelling(creature_ptr, HEX_INHAIL)) stop_hex_spell_all(creature_ptr);
        }
 
        o_ptr = REF_ITEM(creature_ptr, creature_ptr->current_floor_ptr, item);
@@ -69,7 +71,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
        /* Single object */
        q_ptr->number = 1;
 
-       vary_item(item, -1);
+       vary_item(creature_ptr, item, -1);
        sound(SOUND_QUAFF);
 
 
@@ -127,7 +129,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
                        break;
 
                case SV_POTION_POISON:
-                       if (!(creature_ptr->resist_pois || IS_OPPOSE_POIS()))
+                       if (!(creature_ptr->resist_pois || is_oppose_pois(creature_ptr)))
                        {
                                if (set_poisoned(creature_ptr, creature_ptr->poisoned + randint0(15) + 10))
                                {
@@ -394,11 +396,11 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
                        (void)do_inc_stat(creature_ptr, A_INT);
                        (void)do_inc_stat(creature_ptr, A_WIS);
                        (void)detect_traps(creature_ptr, DETECT_RAD_DEFAULT, TRUE);
-                       (void)detect_doors(DETECT_RAD_DEFAULT);
-                       (void)detect_stairs(DETECT_RAD_DEFAULT);
-                       (void)detect_treasure(DETECT_RAD_DEFAULT);
+                       (void)detect_doors(creature_ptr, DETECT_RAD_DEFAULT);
+                       (void)detect_stairs(creature_ptr, DETECT_RAD_DEFAULT);
+                       (void)detect_treasure(creature_ptr, DETECT_RAD_DEFAULT);
                        (void)detect_objects_gold(creature_ptr, DETECT_RAD_DEFAULT);
-                       (void)detect_objects_normal(DETECT_RAD_DEFAULT);
+                       (void)detect_objects_normal(creature_ptr, DETECT_RAD_DEFAULT);
                        identify_pack(creature_ptr);
                        self_knowledge(creature_ptr);
                        ident = TRUE;
@@ -491,7 +493,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
        if (PRACE_IS_(creature_ptr, RACE_SKELETON))
        {
                msg_print(_("液体の一部はあなたのアゴを素通りして落ちた!", "Some of the fluid falls through your jaws!"));
-               (void)potion_smash_effect(0, creature_ptr->y, creature_ptr->x, q_ptr->k_idx);
+               (void)potion_smash_effect(creature_ptr, 0, creature_ptr->y, creature_ptr->x, q_ptr->k_idx);
        }
        creature_ptr->update |= (PU_COMBINE | PU_REORDER);
 
@@ -508,7 +510,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
        /* An identification was made */
        if (ident && !object_is_aware(q_ptr))
        {
-               object_aware(q_ptr);
+               object_aware(creature_ptr, q_ptr);
                gain_exp(creature_ptr, (lev + (creature_ptr->lev >> 1)) / creature_ptr->lev);
        }