OSDN Git Service

[Refactor] #38997 get_rep_dir() にplayer_type * 引数を追加 / Added player_type * argument...
[hengband/hengband.git] / src / cmd / cmd-basic.c
index 5b4e175..2729b93 100644 (file)
@@ -365,7 +365,7 @@ void do_cmd_go_down(player_type *creature_ptr)
                        msg_print(_("下の階に降りた。", "You enter the down staircase."));
 
                leave_quest_check(creature_ptr);
-               leave_tower_check();
+               leave_tower_check(creature_ptr);
 
                creature_ptr->current_floor_ptr->inside_quest = g_ptr->special;
 
@@ -830,7 +830,7 @@ void do_cmd_open(player_type *creature_ptr)
        }
 
        /* Get a "repeated" direction */
-       if (get_rep_dir(&dir, TRUE))
+       if (get_rep_dir(creature_ptr, &dir, TRUE))
        {
                FEAT_IDX feat;
                grid_type *g_ptr;
@@ -973,7 +973,7 @@ void do_cmd_close(player_type *creature_ptr)
        }
 
        /* Get a "repeated" direction */
-       if (get_rep_dir(&dir, FALSE))
+       if (get_rep_dir(creature_ptr, &dir, FALSE))
        {
                grid_type *g_ptr;
                FEAT_IDX feat;
@@ -1031,7 +1031,7 @@ static bool do_cmd_tunnel_test(floor_type *floor_ptr, POSITION y, POSITION x)
        {
                msg_print(_("そこには何も見当たらない。", "You see nothing there."));
 
-               return (FALSE);
+               return FALSE;
        }
 
        /* Must be a wall/door/etc */
@@ -1039,10 +1039,10 @@ static bool do_cmd_tunnel_test(floor_type *floor_ptr, POSITION y, POSITION x)
        {
                msg_print(_("そこには掘るものが見当たらない。", "You see nothing there to tunnel."));
 
-               return (FALSE);
+               return FALSE;
        }
 
-       return (TRUE);
+       return TRUE;
 }
 
 
@@ -1066,7 +1066,7 @@ static bool exe_tunnel(player_type *creature_ptr, POSITION y, POSITION x)
        bool more = FALSE;
 
        /* Verify legality */
-       if (!do_cmd_tunnel_test(creature_ptr->current_floor_ptr, y, x)) return (FALSE);
+       if (!do_cmd_tunnel_test(creature_ptr->current_floor_ptr, y, x)) return FALSE;
 
        take_turn(creature_ptr, 100);
 
@@ -1209,7 +1209,7 @@ void do_cmd_tunnel(player_type *creature_ptr)
        }
 
        /* Get a direction to tunnel, or Abort */
-       if (get_rep_dir(&dir,FALSE))
+       if (get_rep_dir(creature_ptr, &dir,FALSE))
        {
                /* Get location */
                y = creature_ptr->y + ddy[dir];
@@ -1278,7 +1278,7 @@ bool easy_open_door(player_type *creature_ptr, POSITION y, POSITION x)
        /* Must be a closed door */
        if (!is_closed_door(g_ptr->feat))
        {
-               return (FALSE);
+               return FALSE;
        }
 
        /* Jammed door */
@@ -1342,7 +1342,7 @@ bool easy_open_door(player_type *creature_ptr, POSITION y, POSITION x)
                sound(SOUND_OPENDOOR);
        }
 
-       return (TRUE);
+       return TRUE;
 }
 
 /*!
@@ -1563,7 +1563,7 @@ void do_cmd_disarm(player_type *creature_ptr)
        }
 
        /* Get a direction (or abort) */
-       if (get_rep_dir(&dir,TRUE))
+       if (get_rep_dir(creature_ptr, &dir,TRUE))
        {
                grid_type *g_ptr;
                FEAT_IDX feat;
@@ -1745,7 +1745,7 @@ void do_cmd_bash(player_type *creature_ptr)
        }
 
        /* Get a "repeated" direction */
-       if (get_rep_dir(&dir,FALSE))
+       if (get_rep_dir(creature_ptr, &dir,FALSE))
        {
                FEAT_IDX feat;
 
@@ -1827,7 +1827,7 @@ void do_cmd_alter(player_type *creature_ptr)
        }
 
        /* Get a direction */
-       if (get_rep_dir(&dir,TRUE))
+       if (get_rep_dir(creature_ptr, &dir,TRUE))
        {
                FEAT_IDX feat;
                feature_type *f_ptr;
@@ -1917,11 +1917,11 @@ static bool get_spike(player_type *creature_ptr, INVENTORY_IDX *ip)
                        (*ip) = i;
 
                        /* Success */
-                       return (TRUE);
+                       return TRUE;
                }
        }
 
-       return (FALSE);
+       return FALSE;
 }
 
 
@@ -1946,7 +1946,7 @@ void do_cmd_spike(player_type *creature_ptr)
        }
 
        /* Get a "repeated" direction */
-       if (!get_rep_dir(&dir, FALSE)) return;
+       if (!get_rep_dir(creature_ptr, &dir, FALSE)) return;
 
        POSITION y = creature_ptr->y + ddy[dir];
        POSITION x = creature_ptr->x + ddx[dir];
@@ -2017,7 +2017,7 @@ void do_cmd_walk(player_type *creature_ptr, bool pickup)
        /* Get a "repeated" direction */
        bool more = FALSE;
        DIRECTION dir;
-       if (get_rep_dir(&dir, FALSE))
+       if (get_rep_dir(creature_ptr, &dir, FALSE))
        {
                take_turn(creature_ptr, 100);
 
@@ -2081,13 +2081,13 @@ void do_cmd_run(player_type *creature_ptr)
        }
 
        /* Get a "repeated" direction */
-       if (get_rep_dir(&dir,FALSE))
+       if (get_rep_dir(creature_ptr, &dir,FALSE))
        {
                /* Hack -- Set the run counter */
                creature_ptr->running = (command_arg ? command_arg : 1000);
 
                /* First step */
-               run_step(dir);
+               run_step(creature_ptr, dir);
        }
 }
 
@@ -2201,7 +2201,7 @@ char out_val[80];
        update_creature(creature_ptr);
 
        creature_ptr->redraw |= (PR_STATE);
-       update_output();
+       update_output(creature_ptr);
 
        Term_fresh();
 }
@@ -2441,14 +2441,14 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
                project_length = tdis + 1;
 
                /* Get a direction (or cancel) */
-               if (!get_aim_dir(&dir)) return FALSE;
+               if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
 
                /* Predict the "target" location */
                tx = creature_ptr->x + 99 * ddx[dir];
                ty = creature_ptr->y + 99 * ddy[dir];
 
                /* Check for "target request" */
-               if ((dir == 5) && target_okay())
+               if ((dir == 5) && target_okay(creature_ptr))
                {
                        tx = target_col;
                        ty = target_row;
@@ -2463,15 +2463,15 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
 
        if (item >= 0)
        {
-               inven_item_increase(item, -1);
+               inven_item_increase(creature_ptr, item, -1);
                if (!return_when_thrown)
                        inven_item_describe(creature_ptr, item);
-               inven_item_optimize(item);
+               inven_item_optimize(creature_ptr, item);
        }
        else
        {
-               floor_item_increase(0 - item, -1);
-               floor_item_optimize(0 - item);
+               floor_item_increase(creature_ptr->current_floor_ptr, 0 - item, -1);
+               floor_item_optimize(creature_ptr->current_floor_ptr, 0 - item);
        }
 
        if (item >= INVEN_RARM)
@@ -2490,7 +2490,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
        y = creature_ptr->y;
        x = creature_ptr->x;
 
-       handle_stuff();
+       handle_stuff(creature_ptr);
 
        if ((creature_ptr->pclass == CLASS_NINJA) && ((q_ptr->tval == TV_SPIKE) || ((have_flag(flgs, TR_THROW)) && (q_ptr->tval == TV_SWORD)))) shuriken = TRUE;
        else shuriken = FALSE;
@@ -2588,8 +2588,8 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
 
                                        if (m_ptr->ml)
                                        {
-                                               if (!creature_ptr->image) monster_race_track(m_ptr->ap_r_idx);
-                                               health_track(g_ptr->m_idx);
+                                               if (!creature_ptr->image) monster_race_track(creature_ptr, m_ptr->ap_r_idx);
+                                               health_track(creature_ptr, g_ptr->m_idx);
                                        }
                                }
 
@@ -2629,13 +2629,13 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
                                if (tdam < 0) tdam = 0;
 
                                /* Modify the damage */
-                               tdam = mon_damage_mod(m_ptr, tdam, FALSE);
+                               tdam = mon_damage_mod(creature_ptr, m_ptr, tdam, FALSE);
 
                                msg_format_wizard(CHEAT_MONSTER, _("%dのダメージを与えた。(残りHP %d/%d(%d))", "You do %d damage. (left HP %d/%d(%d))"),
                                        tdam, m_ptr->hp - tdam, m_ptr->maxhp, m_ptr->max_maxhp);
 
                                /* Hit the monster, check for death */
-                               if (mon_take_hit(g_ptr->m_idx, tdam, &fear, extract_note_dies(real_r_idx(m_ptr))))
+                               if (mon_take_hit(creature_ptr, g_ptr->m_idx, tdam, &fear, extract_note_dies(real_r_idx(m_ptr))))
                                {
                                        /* Dead monster */
                                }
@@ -2749,7 +2749,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
                        {
                                if (item >= 0)
                                {
-                                       msg_format(_("%sを受け損ねた!", "%s backs, but you can't catch!"), o2_name);
+                                       msg_format(_("%sを受け損ねた!", "%s comes backs, but you can't catch!"), o2_name);
                                }
                                else
                                {
@@ -2761,7 +2761,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
                }
                else
                {
-                       msg_format(_("%sが返ってこなかった!", "%s doesn't back!"), o2_name);
+                       msg_format(_("%sが返ってこなかった!", "%s doesn't come back!"), o2_name);
                }
        }