OSDN Git Service

[Refactor] #38997 get_rep_dir() にplayer_type * 引数を追加 / Added player_type * argument...
authorHourier <hourier@users.sourceforge.jp>
Mon, 13 Jan 2020 12:08:48 +0000 (21:08 +0900)
committerHourier <hourier@users.sourceforge.jp>
Mon, 13 Jan 2020 12:08:48 +0000 (21:08 +0900)
src/cmd/cmd-basic.c
src/realm-hissatsu.c
src/spells-object.c
src/spells2.c
src/targeting.c
src/targeting.h

index 2bd1d15..2729b93 100644 (file)
@@ -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;
@@ -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];
@@ -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;
@@ -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,7 +2081,7 @@ 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);
index 858726a..7d1a082 100644 (file)
@@ -825,7 +825,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                {
                        POSITION x, y;
 
-                       if (!get_rep_dir(&dir, FALSE)) return NULL;
+                       if (!get_rep_dir(caster_ptr, &dir, FALSE)) return NULL;
 
                        y = caster_ptr->y + ddy[dir];
                        x = caster_ptr->x + ddx[dir];
index e318961..db71d60 100644 (file)
@@ -135,7 +135,7 @@ bool create_ammo(player_type *creature_ptr)
                DIRECTION dir;
                grid_type *g_ptr;
 
-               if (!get_rep_dir(&dir, FALSE)) return FALSE;
+               if (!get_rep_dir(creature_ptr, &dir, FALSE)) return FALSE;
                y = creature_ptr->y + ddy[dir];
                x = creature_ptr->x + ddx[dir];
                g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
index dc9cdb8..84a1a05 100644 (file)
@@ -4460,7 +4460,7 @@ void hayagake(player_type *creature_ptr)
 bool double_attack(player_type *creature_ptr)
 {
        DIRECTION dir;
-       if (!get_rep_dir(&dir, FALSE)) return FALSE;
+       if (!get_rep_dir(creature_ptr, &dir, FALSE)) return FALSE;
        POSITION y = creature_ptr->y + ddy[dir];
        POSITION x = creature_ptr->x + ddx[dir];
        if (!creature_ptr->current_floor_ptr->grid_array[y][x].m_idx)
index fdd0b22..38903de 100644 (file)
@@ -1803,7 +1803,7 @@ bool get_direction(player_type *creature_ptr, DIRECTION *dp, bool allow_under, b
  * This function tracks and uses the "global direction", and uses
  * that as the "desired direction", to which "confusion" is applied.
  */
-bool get_rep_dir(DIRECTION *dp, bool under)
+bool get_rep_dir(player_type *creature_ptr, DIRECTION *dp, bool under)
 {
        DIRECTION dir;
        concptr prompt;
@@ -1862,7 +1862,7 @@ bool get_rep_dir(DIRECTION *dp, bool under)
        command_dir = dir;
 
        /* Apply "confusion" */
-       if (p_ptr->confused)
+       if (creature_ptr->confused)
        {
                /* Standard confusion */
                if (randint0(100) < 75)
@@ -1871,9 +1871,9 @@ bool get_rep_dir(DIRECTION *dp, bool under)
                        dir = ddd[randint0(8)];
                }
        }
-       else if (p_ptr->riding)
+       else if (creature_ptr->riding)
        {
-               monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->riding];
+               monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->riding];
                monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
                if (MON_CONFUSED(m_ptr))
@@ -1900,7 +1900,7 @@ bool get_rep_dir(DIRECTION *dp, bool under)
        /* Notice confusion */
        if (command_dir != dir)
        {
-               if (p_ptr->confused)
+               if (creature_ptr->confused)
                {
                        /* Warn the user */
                        msg_print(_("あなたは混乱している。", "You are confused."));
@@ -1908,7 +1908,7 @@ bool get_rep_dir(DIRECTION *dp, bool under)
                else
                {
                        GAME_TEXT m_name[MAX_NLEN];
-                       monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->riding];
+                       monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->riding];
 
                        monster_desc(m_name, m_ptr, 0);
                        if (MON_CONFUSED(m_ptr))
index 1bd08d5..322cf9b 100644 (file)
@@ -22,5 +22,5 @@ extern void target_set_prepare_look(player_type *creature_ptr);
 extern bool get_aim_dir(player_type *creature_ptr, DIRECTION *dp);
 extern bool get_hack_dir(player_type *creature_ptr, DIRECTION *dp);
 extern bool get_direction(player_type *creature_ptr, DIRECTION *dp, bool allow_under, bool with_steed);
-extern bool get_rep_dir(DIRECTION *dp, bool under);
+extern bool get_rep_dir(player_type *creature_ptr, DIRECTION *dp, bool under);
 extern bool tgt_pt(player_type *creature_ptr, POSITION *x, POSITION *y);