OSDN Git Service

[Refactor] #38997 probing() に player_type * 引数を追加. / Add player_type * argument to...
authordeskull <deskull@users.sourceforge.jp>
Sat, 4 Jan 2020 07:49:34 +0000 (16:49 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 4 Jan 2020 07:49:34 +0000 (16:49 +0900)
src/cmd/cmd-activate.c
src/cmd/cmd-usestaff.c
src/cmd/cmd-zaprod.c
src/racial.c
src/realm-sorcery.c
src/spells.h
src/spells2.c
src/wizard2.c

index 0b7f1c2..3b95b25 100644 (file)
@@ -1458,7 +1458,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        {
                msg_print(_("明るく輝いている...", "It glows brightly..."));
                detect_all(DETECT_RAD_DEFAULT);
-               probing();
+               probing(user_ptr);
                identify_fully(FALSE);
                break;
        }
@@ -1627,7 +1627,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        {
                msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name);
                (void)remove_all_curse(user_ptr);
-               (void)probing();
+               (void)probing(user_ptr);
                break;
        }
 
index e9fa6f2..dcd06f6 100644 (file)
@@ -204,7 +204,7 @@ int staff_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, bool *use
 
                case SV_STAFF_PROBING:
                {
-                       ident = probing();
+                       ident = probing(creature_ptr);
                        break;
                }
 
index 9be52a5..f8bf942 100644 (file)
@@ -92,7 +92,7 @@ int rod_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION d
 
        case SV_ROD_PROBING:
        {
-               probing();
+               probing(creature_ptr);
                ident = TRUE;
                break;
        }
index 277c348..9de05e6 100644 (file)
@@ -434,7 +434,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                case CLASS_SNIPER:
                {
                        msg_print(_("敵を調査した...", "You examine your foes..."));
-                       probing();
+                       probing(creature_ptr);
                        break;
                }
                case CLASS_PALADIN:
@@ -706,7 +706,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
 
                case RACE_HALF_TITAN:
                        msg_print(_("敵を調査した...", "You examine your foes..."));
-                       probing();
+                       probing(creature_ptr);
                        break;
 
                case RACE_CYCLOPS:
index 63a7f5d..d05c820 100644 (file)
@@ -425,7 +425,7 @@ concptr do_sorcery_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
                {
                        if (cast)
                        {
-                               probing();
+                               probing(caster_ptr);
                        }
                }
                break;
index 6e2864c..cfc4294 100644 (file)
@@ -180,7 +180,7 @@ extern bool genocide_aux(player_type *caster_ptr, MONSTER_IDX m_idx, int power,
 extern bool symbol_genocide(player_type *caster_ptr, int power, bool player_cast);
 extern bool mass_genocide(player_type *caster_ptr, int power, bool player_cast);
 extern bool mass_genocide_undead(player_type *caster_ptr, int power, bool player_cast);
-extern bool probing(void);
+extern bool probing(player_type *caster_ptr);
 extern bool banish_evil(int dist);
 extern bool dispel_evil(HIT_POINT dam);
 extern bool dispel_good(HIT_POINT dam);
index ecbffa8..1945859 100644 (file)
@@ -1232,7 +1232,7 @@ bool mass_genocide_undead(player_type *caster_ptr, int power, bool player_cast)
  * @brief 周辺モンスターを調査する / Probe nearby monsters
  * @return 効力があった場合TRUEを返す
  */
-bool probing(void)
+bool probing(player_type *caster_ptr)
 {
        int i;
        int speed; /* TODO */
@@ -1247,14 +1247,14 @@ bool probing(void)
        Term->scr->cv = 1;
 
        /* Probe all (nearby) monsters */
-       for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
+       for (i = 1; i < caster_ptr->current_floor_ptr->m_max; i++)
        {
-               monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
+               monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i];
                monster_race *r_ptr = &r_info[m_ptr->r_idx];
                if (!monster_is_valid(m_ptr)) continue;
 
                /* Require line of sight */
-               if (!player_has_los_bold(p_ptr, m_ptr->fy, m_ptr->fx)) continue;
+               if (!player_has_los_bold(caster_ptr, m_ptr->fy, m_ptr->fx)) continue;
 
                /* Probe visible monsters */
                if (m_ptr->ml)
@@ -1317,7 +1317,7 @@ bool probing(void)
                        /* HACK : Add the line to message buffer */
                        message_add(buf);
 
-                       p_ptr->window |= (PW_MESSAGE);
+                       caster_ptr->window |= (PW_MESSAGE);
                        handle_stuff();
 
                        if (m_ptr->ml) move_cursor_relative(m_ptr->fy, m_ptr->fx);
@@ -1356,7 +1356,7 @@ bool probing(void)
 
        if (probe)
        {
-               chg_virtue(p_ptr, V_KNOWLEDGE, 1);
+               chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
                msg_print(_("これで全部です。", "That's all."));
        }
        return (probe);
index 5bddec9..273b676 100644 (file)
@@ -2028,7 +2028,7 @@ void do_cmd_debug(player_type *creature_ptr)
 
        /* Hack -- whatever I desire */
        case '_':
-               probing();
+               probing(creature_ptr);
                break;
 
        /* For temporary test. */