OSDN Git Service

[Refactor] #38997 cmd-activate.c, cmd-basic.c, cmd-quaff.c 内の引数参照整理. / Refactoring...
authordeskull <deskull@users.sourceforge.jp>
Wed, 4 Sep 2019 01:36:02 +0000 (10:36 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 4 Sep 2019 01:36:02 +0000 (10:36 +0900)
src/cmd/cmd-activate.c
src/cmd/cmd-basic.c
src/cmd/cmd-quaff.c

index 5a01870..f29cff2 100644 (file)
@@ -638,7 +638,7 @@ void do_cmd_activate(player_type *user_ptr)
        q = _("どのアイテムを始動させますか? ", "Activate which item? ");
        s = _("始動できるアイテムを装備していない。", "You have nothing to activate.");
 
-       if (!choose_object(p_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) return;
+       if (!choose_object(user_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) return;
 
        /* Activate the item */
        exe_activate(user_ptr, item);
@@ -1297,7 +1297,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_CURE_MANA_FULL:
        {
                msg_format(_("%sが青白く光った...", "The %s glows pale..."), name);
-               restore_mana(p_ptr, TRUE);
+               restore_mana(user_ptr, TRUE);
                break;
        }
 
@@ -1550,7 +1550,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
                msg_format(_("%sは赤く明るく光った!", "The %s flashes bright red!"), name);
                chg_virtue(user_ptr, V_KNOWLEDGE, 1);
                chg_virtue(user_ptr, V_ENLIGHTEN, 1);
-               wiz_lite(p_ptr, FALSE);
+               wiz_lite(user_ptr, FALSE);
 
                msg_format(_("%sはあなたの体力を奪った...", "The %s drains your vitality..."), name);
                take_hit(user_ptr, DAMAGE_LOSELIFE, damroll(3, 8), _("審判の宝石", "the Jewel of Judgement"), -1);
index e99ad92..001cba7 100644 (file)
@@ -887,7 +887,7 @@ void do_cmd_open(player_type *creature_ptr)
                {
                        take_turn(creature_ptr, 100);
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
-                       py_attack(p_ptr, y, x, 0);
+                       py_attack(creature_ptr, y, x, 0);
                }
                else if (o_idx)
                {
@@ -1026,7 +1026,7 @@ void do_cmd_close(player_type *creature_ptr)
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
                        /* Attack */
-                       py_attack(p_ptr, y, x, 0);
+                       py_attack(creature_ptr, y, x, 0);
                }
 
                /* Close the door */
@@ -1265,7 +1265,7 @@ void do_cmd_tunnel(player_type *creature_ptr)
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
                        /* Attack */
-                       py_attack(p_ptr, y, x, 0);
+                       py_attack(creature_ptr, y, x, 0);
                }
 
                /* Try digging */
@@ -1614,7 +1614,7 @@ void do_cmd_disarm(player_type *creature_ptr)
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
                        /* Attack */
-                       py_attack(p_ptr, y, x, 0);
+                       py_attack(creature_ptr, y, x, 0);
                }
 
                /* Disarm chest */
@@ -1795,7 +1795,7 @@ void do_cmd_bash(player_type *creature_ptr)
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
                        /* Attack */
-                       py_attack(p_ptr, y, x, 0);
+                       py_attack(creature_ptr, y, x, 0);
                }
 
                /* Bash a closed door */
@@ -1868,7 +1868,7 @@ void do_cmd_alter(player_type *creature_ptr)
 
                if (g_ptr->m_idx)
                {
-                       py_attack(p_ptr, y, x, 0);
+                       py_attack(creature_ptr, y, x, 0);
                }
 
                /* Locked doors */
@@ -2002,7 +2002,7 @@ void do_cmd_spike(player_type *creature_ptr)
                        msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
 
                        /* Attack */
-                       py_attack(p_ptr, y, x, 0);
+                       py_attack(creature_ptr, y, x, 0);
                }
 
                /* Go for it */
index 314b0af..4bd806f 100644 (file)
@@ -324,7 +324,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
                        break;
 
                case SV_POTION_LIFE:
-                       ident = life_stream(p_ptr, TRUE, TRUE);
+                       ident = life_stream(creature_ptr, TRUE, TRUE);
                        break;
 
                case SV_POTION_RESTORE_MANA:
@@ -396,7 +396,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
                        msg_print(_("自分の置かれている状況が脳裏に浮かんできた...", "An image of your surroundings forms in your mind..."));
                        chg_virtue(creature_ptr, V_KNOWLEDGE, 1);
                        chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
-                       wiz_lite(p_ptr, FALSE);
+                       wiz_lite(creature_ptr, FALSE);
                        ident = TRUE;
                        break;
 
@@ -405,7 +405,7 @@ void exe_quaff_potion(player_type *creature_ptr, INVENTORY_IDX item)
                        chg_virtue(creature_ptr, V_KNOWLEDGE, 1);
                        chg_virtue(creature_ptr, V_ENLIGHTEN, 2);
                        msg_print(NULL);
-                       wiz_lite(p_ptr, FALSE);
+                       wiz_lite(creature_ptr, FALSE);
                        (void)do_inc_stat(creature_ptr, A_INT);
                        (void)do_inc_stat(creature_ptr, A_WIS);
                        (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
@@ -610,7 +610,7 @@ void do_cmd_quaff_potion(player_type *creature_ptr)
        q = _("どの薬を飲みますか? ", "Quaff which potion? ");
        s = _("飲める薬がない。", "You have no potions to quaff.");
 
-       if (!choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0)) return;
+       if (!choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0)) return;
 
        /* Quaff the potion */
        exe_quaff_potion(creature_ptr, item);