From b9f3e52969b98cb4c0aad043cb78e635a8c043ae Mon Sep 17 00:00:00 2001 From: deskull Date: Sat, 4 Jan 2020 16:49:34 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20probing()=20=E3=81=AB=20pl?= =?utf8?q?ayer=5Ftype=20*=20=E5=BC=95=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0?= =?utf8?q?=EF=BC=8E=20/=20Add=20player=5Ftype=20*=20argument=20to=20probin?= =?utf8?q?g().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cmd/cmd-activate.c | 4 ++-- src/cmd/cmd-usestaff.c | 2 +- src/cmd/cmd-zaprod.c | 2 +- src/racial.c | 4 ++-- src/realm-sorcery.c | 2 +- src/spells.h | 2 +- src/spells2.c | 12 ++++++------ src/wizard2.c | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/cmd/cmd-activate.c b/src/cmd/cmd-activate.c index 0b7f1c23c..3b95b25a1 100644 --- a/src/cmd/cmd-activate.c +++ b/src/cmd/cmd-activate.c @@ -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; } diff --git a/src/cmd/cmd-usestaff.c b/src/cmd/cmd-usestaff.c index e9fa6f25e..dcd06f600 100644 --- a/src/cmd/cmd-usestaff.c +++ b/src/cmd/cmd-usestaff.c @@ -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; } diff --git a/src/cmd/cmd-zaprod.c b/src/cmd/cmd-zaprod.c index 9be52a532..f8bf94247 100644 --- a/src/cmd/cmd-zaprod.c +++ b/src/cmd/cmd-zaprod.c @@ -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; } diff --git a/src/racial.c b/src/racial.c index 277c34851..9de05e675 100644 --- a/src/racial.c +++ b/src/racial.c @@ -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: diff --git a/src/realm-sorcery.c b/src/realm-sorcery.c index 63a7f5dd2..d05c82006 100644 --- a/src/realm-sorcery.c +++ b/src/realm-sorcery.c @@ -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; diff --git a/src/spells.h b/src/spells.h index 6e2864c31..cfc42946f 100644 --- a/src/spells.h +++ b/src/spells.h @@ -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); diff --git a/src/spells2.c b/src/spells2.c index ecbffa821..1945859fc 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -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); diff --git a/src/wizard2.c b/src/wizard2.c index 5bddec964..273b67617 100644 --- a/src/wizard2.c +++ b/src/wizard2.c @@ -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. */ -- 2.11.0