From e6ed52da9d5258f10567bac1d95d58ce565f3142 Mon Sep 17 00:00:00 2001 From: Hourier <66951241+Hourier@users.noreply.github.com> Date: Sun, 30 Oct 2022 23:42:01 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#2680=20MAX=5FSIGHT=E3=81=A8AAF=5FL?= =?utf8?q?IMIT=E3=81=8C=E5=88=86=E3=81=8B=E3=82=8A=E3=81=AB=E3=81=8F?= =?utf8?q?=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E5=88=86=E3=81=8B?= =?utf8?q?=E3=82=8A=E3=82=84=E3=81=99=E3=81=84=E5=AE=9A=E6=95=B0=E5=90=8D?= =?utf8?q?=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cmd-item/cmd-zaprod.cpp | 2 +- src/cmd-item/cmd-zapwand.cpp | 2 +- src/effect/effect-monster-util.cpp | 2 +- src/floor/wild.cpp | 2 +- src/melee/melee-postprocess.cpp | 2 +- src/melee/melee-util.cpp | 2 +- src/melee/monster-attack-monster.cpp | 2 +- src/monster-floor/monster-lite.cpp | 2 +- src/monster-floor/monster-move.cpp | 2 +- src/monster-floor/monster-sweep-grid.cpp | 4 ++-- src/monster/monster-processor.cpp | 6 +++--- src/monster/monster-status.cpp | 8 ++++---- src/monster/monster-update.cpp | 4 ++-- src/mspell/mspell-floor.cpp | 4 ++-- src/mspell/mspell-util.cpp | 2 +- src/player/player-view.cpp | 8 ++++---- src/realm/realm-crusade.cpp | 2 +- src/realm/realm-hex.cpp | 2 +- src/realm/realm-hissatsu.cpp | 2 +- src/spell-kind/spells-genocide.cpp | 4 ++-- src/spell-kind/spells-sight.cpp | 2 +- src/spell-kind/spells-teleport.cpp | 4 ++-- src/spell-realm/spells-hex.cpp | 2 +- src/system/gamevalue.h | 10 +++------- src/wizard/wizard-special-process.cpp | 2 +- src/world/world-turn-processor.cpp | 2 +- 26 files changed, 41 insertions(+), 45 deletions(-) diff --git a/src/cmd-item/cmd-zaprod.cpp b/src/cmd-item/cmd-zaprod.cpp index 09c0e55b1..5adcf48e5 100644 --- a/src/cmd-item/cmd-zaprod.cpp +++ b/src/cmd-item/cmd-zaprod.cpp @@ -157,7 +157,7 @@ int rod_effect(PlayerType *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION dir, } case SV_ROD_TELEPORT_AWAY: { - int distance = MAX_SIGHT * (powerful ? 8 : 5); + int distance = MAX_PLAYER_SIGHT * (powerful ? 8 : 5); if (teleport_monster(player_ptr, dir, distance)) { ident = true; } diff --git a/src/cmd-item/cmd-zapwand.cpp b/src/cmd-item/cmd-zapwand.cpp index e0d3c7061..8d5ddd24f 100644 --- a/src/cmd-item/cmd-zapwand.cpp +++ b/src/cmd-item/cmd-zapwand.cpp @@ -109,7 +109,7 @@ bool wand_effect(PlayerType *player_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION di } case SV_WAND_TELEPORT_AWAY: { - int distance = MAX_SIGHT * (powerful ? 8 : 5); + int distance = MAX_PLAYER_SIGHT * (powerful ? 8 : 5); if (teleport_monster(player_ptr, dir, distance)) { ident = true; } diff --git a/src/effect/effect-monster-util.cpp b/src/effect/effect-monster-util.cpp index 6f39b44fa..cc8245ea8 100644 --- a/src/effect/effect-monster-util.cpp +++ b/src/effect/effect-monster-util.cpp @@ -66,7 +66,7 @@ effect_monster_type *initialize_effect_monster(PlayerType *player_ptr, effect_mo em_ptr->seen_msg = is_seen(player_ptr, em_ptr->m_ptr); em_ptr->slept = em_ptr->m_ptr->is_asleep(); em_ptr->obvious = false; - em_ptr->known = ((em_ptr->m_ptr->cdis <= MAX_SIGHT) || player_ptr->phase_out); + em_ptr->known = ((em_ptr->m_ptr->cdis <= MAX_PLAYER_SIGHT) || player_ptr->phase_out); em_ptr->skipped = false; em_ptr->get_angry = false; em_ptr->do_polymorph = false; diff --git a/src/floor/wild.cpp b/src/floor/wild.cpp index 1d2a5ee06..1cf6d6b15 100644 --- a/src/floor/wild.cpp +++ b/src/floor/wild.cpp @@ -929,7 +929,7 @@ bool change_wild_mode(PlayerType *player_ptr, bool encount) has_pet = true; } - if (m_ptr->is_asleep() || (m_ptr->cdis > MAX_SIGHT) || !m_ptr->is_hostile()) { + if (m_ptr->is_asleep() || (m_ptr->cdis > MAX_PLAYER_SIGHT) || !m_ptr->is_hostile()) { continue; } diff --git a/src/melee/melee-postprocess.cpp b/src/melee/melee-postprocess.cpp index a48b0e750..ec19298e1 100644 --- a/src/melee/melee-postprocess.cpp +++ b/src/melee/melee-postprocess.cpp @@ -66,7 +66,7 @@ mam_pp_type *initialize_mam_pp_type( mam_pp_ptr->m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; mam_pp_ptr->seen = is_seen(player_ptr, mam_pp_ptr->m_ptr); mam_pp_ptr->dam = dam; - mam_pp_ptr->known = mam_pp_ptr->m_ptr->cdis <= MAX_SIGHT; + mam_pp_ptr->known = mam_pp_ptr->m_ptr->cdis <= MAX_PLAYER_SIGHT; mam_pp_ptr->dead = dead; mam_pp_ptr->fear = fear; mam_pp_ptr->note = note; diff --git a/src/melee/melee-util.cpp b/src/melee/melee-util.cpp index dfddd5d04..38d9cc35e 100644 --- a/src/melee/melee-util.cpp +++ b/src/melee/melee-util.cpp @@ -34,7 +34,7 @@ mam_type *initialize_mam_type(PlayerType *player_ptr, mam_type *mam_ptr, MONSTER mam_ptr->do_silly_attack = (one_in_(2) && player_ptr->effects()->hallucination()->is_hallucinated()); mam_ptr->power = 0; mam_ptr->obvious = false; - mam_ptr->known = (mam_ptr->m_ptr->cdis <= MAX_SIGHT) || (mam_ptr->t_ptr->cdis <= MAX_SIGHT); + mam_ptr->known = (mam_ptr->m_ptr->cdis <= MAX_PLAYER_SIGHT) || (mam_ptr->t_ptr->cdis <= MAX_PLAYER_SIGHT); mam_ptr->fear = false; mam_ptr->dead = false; return mam_ptr; diff --git a/src/melee/monster-attack-monster.cpp b/src/melee/monster-attack-monster.cpp index bff37a2df..80bb26c9d 100644 --- a/src/melee/monster-attack-monster.cpp +++ b/src/melee/monster-attack-monster.cpp @@ -272,7 +272,7 @@ static void thief_runaway_by_melee(PlayerType *player_ptr, mam_type *mam_ptr) player_ptr->current_floor_ptr->monster_noise = true; } - teleport_away(player_ptr, mam_ptr->m_idx, MAX_SIGHT * 2 + 5, TELEPORT_SPONTANEOUS); + teleport_away(player_ptr, mam_ptr->m_idx, MAX_PLAYER_SIGHT * 2 + 5, TELEPORT_SPONTANEOUS); } } diff --git a/src/monster-floor/monster-lite.cpp b/src/monster-floor/monster-lite.cpp index 090e80995..333455293 100644 --- a/src/monster-floor/monster-lite.cpp +++ b/src/monster-floor/monster-lite.cpp @@ -151,7 +151,7 @@ void update_mon_lite(PlayerType *player_ptr) std::vector points; void (*add_mon_lite)(PlayerType *, std::vector &, const POSITION, const POSITION, const monster_lite_type *); - int dis_lim = (dungeons_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS) && !player_ptr->see_nocto) ? (MAX_SIGHT / 2 + 1) : (MAX_SIGHT + 3); + int dis_lim = (dungeons_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS) && !player_ptr->see_nocto) ? (MAX_PLAYER_SIGHT / 2 + 1) : (MAX_PLAYER_SIGHT + 3); auto *floor_ptr = player_ptr->current_floor_ptr; for (int i = 0; i < floor_ptr->mon_lite_n; i++) { grid_type *g_ptr; diff --git a/src/monster-floor/monster-move.cpp b/src/monster-floor/monster-move.cpp index bee70c932..274567a3b 100644 --- a/src/monster-floor/monster-move.cpp +++ b/src/monster-floor/monster-move.cpp @@ -518,7 +518,7 @@ void process_speak_sound(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION oy, } auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx]; - if (m_ptr->ap_r_idx == MonsterRaceId::CYBER && one_in_(CYBERNOISE) && !m_ptr->ml && (m_ptr->cdis <= MAX_SIGHT)) { + if (m_ptr->ap_r_idx == MonsterRaceId::CYBER && one_in_(CYBERNOISE) && !m_ptr->ml && (m_ptr->cdis <= MAX_PLAYER_SIGHT)) { if (disturb_minor) { disturb(player_ptr, false, false); } diff --git a/src/monster-floor/monster-sweep-grid.cpp b/src/monster-floor/monster-sweep-grid.cpp index fb73a1e4e..80f038004 100644 --- a/src/monster-floor/monster-sweep-grid.cpp +++ b/src/monster-floor/monster-sweep-grid.cpp @@ -103,7 +103,7 @@ bool MonsterSweepGrid::mon_will_run() return (this->player_ptr->pet_follow_distance < 0) && (m_ptr->cdis <= (0 - this->player_ptr->pet_follow_distance)); } - if (m_ptr->cdis > MAX_SIGHT + 5) { + if (m_ptr->cdis > MAX_PLAYER_SIGHT + 5) { return false; } @@ -144,7 +144,7 @@ void MonsterSweepGrid::check_hiding_grid(POSITION *y, POSITION *x, POSITION *y2, } if ((!los(this->player_ptr, m_ptr->fy, m_ptr->fx, this->player_ptr->y, this->player_ptr->x) || !projectable(this->player_ptr, m_ptr->fy, m_ptr->fx, this->player_ptr->y, this->player_ptr->x))) { - if (floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].get_distance(r_ptr) >= MAX_SIGHT / 2) { + if (floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].get_distance(r_ptr) >= MAX_PLAYER_SIGHT / 2) { return; } } diff --git a/src/monster/monster-processor.cpp b/src/monster/monster-processor.cpp index 724ca2633..fb4f6042a 100644 --- a/src/monster/monster-processor.cpp +++ b/src/monster/monster-processor.cpp @@ -597,7 +597,7 @@ void sweep_monster_process(PlayerType *player_ptr) continue; } - if ((m_ptr->cdis >= AAF_LIMIT) || !decide_process_continue(player_ptr, m_ptr)) { + if ((m_ptr->cdis >= MAX_MONSTER_SENSING) || !decide_process_continue(player_ptr, m_ptr)) { continue; } @@ -635,11 +635,11 @@ bool decide_process_continue(PlayerType *player_ptr, monster_type *m_ptr) m_ptr->mflag2.reset(MonsterConstantFlagType::NOFLOW); } - if (m_ptr->cdis <= (m_ptr->is_pet() ? (r_ptr->aaf > MAX_SIGHT ? MAX_SIGHT : r_ptr->aaf) : r_ptr->aaf)) { + if (m_ptr->cdis <= (m_ptr->is_pet() ? (r_ptr->aaf > MAX_PLAYER_SIGHT ? MAX_PLAYER_SIGHT : r_ptr->aaf) : r_ptr->aaf)) { return true; } - if ((m_ptr->cdis <= MAX_SIGHT || player_ptr->phase_out) && (player_has_los_bold(player_ptr, m_ptr->fy, m_ptr->fx) || has_aggravate(player_ptr))) { + if ((m_ptr->cdis <= MAX_PLAYER_SIGHT || player_ptr->phase_out) && (player_has_los_bold(player_ptr, m_ptr->fy, m_ptr->fx) || has_aggravate(player_ptr))) { return true; } diff --git a/src/monster/monster-status.cpp b/src/monster/monster-status.cpp index 0335882fb..4411a9751 100644 --- a/src/monster/monster-status.cpp +++ b/src/monster/monster-status.cpp @@ -169,14 +169,14 @@ static void process_monsters_mtimed_aux(PlayerType *player_ptr, MONSTER_IDX m_id case MTIMED_CSLEEP: { auto *r_ptr = &monraces_info[m_ptr->r_idx]; auto is_wakeup = false; - if (m_ptr->cdis < AAF_LIMIT) { + if (m_ptr->cdis < MAX_MONSTER_SENSING) { /* Handle "sensing radius" */ - if (m_ptr->cdis <= (m_ptr->is_pet() ? ((r_ptr->aaf > MAX_SIGHT) ? MAX_SIGHT : r_ptr->aaf) : r_ptr->aaf)) { + if (m_ptr->cdis <= (m_ptr->is_pet() ? ((r_ptr->aaf > MAX_PLAYER_SIGHT) ? MAX_PLAYER_SIGHT : r_ptr->aaf) : r_ptr->aaf)) { is_wakeup = true; } /* Handle "sight" and "aggravation" */ - else if ((m_ptr->cdis <= MAX_SIGHT) && (player_has_los_bold(player_ptr, m_ptr->fy, m_ptr->fx))) { + else if ((m_ptr->cdis <= MAX_PLAYER_SIGHT) && (player_has_los_bold(player_ptr, m_ptr->fy, m_ptr->fx))) { is_wakeup = true; } } @@ -199,7 +199,7 @@ static void process_monsters_mtimed_aux(PlayerType *player_ptr, MONSTER_IDX m_id /* Hack -- amount of "waking" */ /* Wake up faster near the player */ - auto d = (m_ptr->cdis < AAF_LIMIT / 2) ? (AAF_LIMIT / m_ptr->cdis) : 1; + auto d = (m_ptr->cdis < MAX_MONSTER_SENSING / 2) ? (MAX_MONSTER_SENSING / m_ptr->cdis) : 1; /* Hack -- amount of "waking" is affected by speed of player */ d = (d * speed_to_energy(player_ptr->pspeed)) / 10; diff --git a/src/monster/monster-update.cpp b/src/monster/monster-update.cpp index 9037c0ce6..06ae62692 100644 --- a/src/monster/monster-update.cpp +++ b/src/monster/monster-update.cpp @@ -439,11 +439,11 @@ static void decide_sight_invisible_monster(PlayerType *player_ptr, um_type *um_p m_ptr->mflag.reset(MonsterTemporaryFlagType::ESP); - if (distance > (um_ptr->in_darkness ? MAX_SIGHT / 2 : MAX_SIGHT)) { + if (distance > (um_ptr->in_darkness ? MAX_PLAYER_SIGHT / 2 : MAX_PLAYER_SIGHT)) { return; } - if (!um_ptr->in_darkness || (distance <= MAX_SIGHT / 4)) { + if (!um_ptr->in_darkness || (distance <= MAX_PLAYER_SIGHT / 4)) { update_telepathy_sight(player_ptr, um_ptr, m_idx); update_specific_race_telepathy(player_ptr, um_ptr); } diff --git a/src/mspell/mspell-floor.cpp b/src/mspell/mspell-floor.cpp index 86e44e31f..02ba0d873 100644 --- a/src/mspell/mspell-floor.cpp +++ b/src/mspell/mspell-floor.cpp @@ -314,9 +314,9 @@ MonsterSpellResult spell_RF6_TELE_AWAY(PlayerType *player_ptr, MONSTER_IDX m_idx } if (t_idx == player_ptr->riding) { - teleport_player_away(m_idx, player_ptr, MAX_SIGHT * 2 + 5, false); + teleport_player_away(m_idx, player_ptr, MAX_PLAYER_SIGHT * 2 + 5, false); } else { - teleport_away(player_ptr, t_idx, MAX_SIGHT * 2 + 5, TELEPORT_PASSIVE); + teleport_away(player_ptr, t_idx, MAX_PLAYER_SIGHT * 2 + 5, TELEPORT_PASSIVE); } set_monster_csleep(player_ptr, t_idx, 0); diff --git a/src/mspell/mspell-util.cpp b/src/mspell/mspell-util.cpp index 550ddec1d..7eecf5455 100644 --- a/src/mspell/mspell-util.cpp +++ b/src/mspell/mspell-util.cpp @@ -54,7 +54,7 @@ bool monster_near_player(FloorType *floor_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_ { monster_type *m_ptr = &floor_ptr->m_list[m_idx]; monster_type *t_ptr = &floor_ptr->m_list[t_idx]; - return (m_ptr->cdis <= MAX_SIGHT) || (t_ptr->cdis <= MAX_SIGHT); + return (m_ptr->cdis <= MAX_PLAYER_SIGHT) || (t_ptr->cdis <= MAX_PLAYER_SIGHT); } /*! diff --git a/src/player/player-view.cpp b/src/player/player-view.cpp index 6cd5794e1..24d81f921 100644 --- a/src/player/player-view.cpp +++ b/src/player/player-view.cpp @@ -116,11 +116,11 @@ void update_view(PlayerType *player_ptr) grid_type *g_ptr; if (view_reduce_view && !floor_ptr->dun_level) { - full = MAX_SIGHT / 2; - over = MAX_SIGHT * 3 / 4; + full = MAX_PLAYER_SIGHT / 2; + over = MAX_PLAYER_SIGHT * 3 / 4; } else { - full = MAX_SIGHT; - over = MAX_SIGHT * 3 / 2; + full = MAX_PLAYER_SIGHT; + over = MAX_PLAYER_SIGHT * 3 / 2; } for (n = 0; n < floor_ptr->view_n; n++) { diff --git a/src/realm/realm-crusade.cpp b/src/realm/realm-crusade.cpp index 08d07b1f9..4f8c2c4f9 100644 --- a/src/realm/realm-crusade.cpp +++ b/src/realm/realm-crusade.cpp @@ -213,7 +213,7 @@ concptr do_crusade_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessTy } { - int power = MAX_SIGHT * 5; + int power = MAX_PLAYER_SIGHT * 5; if (info) { return info_power(power); } diff --git a/src/realm/realm-hex.cpp b/src/realm/realm-hex.cpp index a4a872905..a8539e6f4 100644 --- a/src/realm/realm-hex.cpp +++ b/src/realm/realm-hex.cpp @@ -265,7 +265,7 @@ concptr do_hex_spell(PlayerType *player_ptr, spell_hex_type spell, SpellProcessT return _("周囲の邪悪なモンスターを感知する。", "Detects evil monsters."); } if (info) { - return info_range(MAX_SIGHT); + return info_range(MAX_PLAYER_SIGHT); } if (cast) { msg_print(_("邪悪な生物の存在を感じ取ろうとした。", "You sense the presence of evil creatures.")); diff --git a/src/realm/realm-hissatsu.cpp b/src/realm/realm-hissatsu.cpp index e5f45cc3f..351badda7 100644 --- a/src/realm/realm-hissatsu.cpp +++ b/src/realm/realm-hissatsu.cpp @@ -982,7 +982,7 @@ concptr do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessT return nullptr; } - if (!cave_player_teleportable_bold(player_ptr, y, x, TELEPORT_SPONTANEOUS) || (distance(y, x, player_ptr->y, player_ptr->x) > MAX_SIGHT / 2) || !projectable(player_ptr, player_ptr->y, player_ptr->x, y, x)) { + if (!cave_player_teleportable_bold(player_ptr, y, x, TELEPORT_SPONTANEOUS) || (distance(y, x, player_ptr->y, player_ptr->x) > MAX_PLAYER_SIGHT / 2) || !projectable(player_ptr, player_ptr->y, player_ptr->x, y, x)) { msg_print(_("失敗!", "You cannot move to that place!")); break; } diff --git a/src/spell-kind/spells-genocide.cpp b/src/spell-kind/spells-genocide.cpp index 54e94888a..98cb8cfe0 100644 --- a/src/spell-kind/spells-genocide.cpp +++ b/src/spell-kind/spells-genocide.cpp @@ -179,7 +179,7 @@ bool mass_genocide(PlayerType *player_ptr, int power, bool player_cast) if (!m_ptr->is_valid()) { continue; } - if (m_ptr->cdis > MAX_SIGHT) { + if (m_ptr->cdis > MAX_PLAYER_SIGHT) { continue; } @@ -220,7 +220,7 @@ bool mass_genocide_undead(PlayerType *player_ptr, int power, bool player_cast) if (r_ptr->kind_flags.has_not(MonsterKindType::UNDEAD)) { continue; } - if (m_ptr->cdis > MAX_SIGHT) { + if (m_ptr->cdis > MAX_PLAYER_SIGHT) { continue; } diff --git a/src/spell-kind/spells-sight.cpp b/src/spell-kind/spells-sight.cpp index 5902e7796..06b716759 100644 --- a/src/spell-kind/spells-sight.cpp +++ b/src/spell-kind/spells-sight.cpp @@ -227,7 +227,7 @@ void aggravate_monsters(PlayerType *player_ptr, MONSTER_IDX who) continue; } - if (m_ptr->cdis < MAX_SIGHT * 2) { + if (m_ptr->cdis < MAX_PLAYER_SIGHT * 2) { if (m_ptr->is_asleep()) { (void)set_monster_csleep(player_ptr, i, 0); sleep = true; diff --git a/src/spell-kind/spells-teleport.cpp b/src/spell-kind/spells-teleport.cpp index 1bb77e0b3..e84c15201 100644 --- a/src/spell-kind/spells-teleport.cpp +++ b/src/spell-kind/spells-teleport.cpp @@ -538,10 +538,10 @@ void teleport_away_followable(PlayerType *player_ptr, MONSTER_IDX m_idx) bool old_ml = m_ptr->ml; POSITION old_cdis = m_ptr->cdis; - teleport_away(player_ptr, m_idx, MAX_SIGHT * 2 + 5, TELEPORT_SPONTANEOUS); + teleport_away(player_ptr, m_idx, MAX_PLAYER_SIGHT * 2 + 5, TELEPORT_SPONTANEOUS); bool is_followable = old_ml; - is_followable &= old_cdis <= MAX_SIGHT; + is_followable &= old_cdis <= MAX_PLAYER_SIGHT; is_followable &= w_ptr->timewalk_m_idx == 0; is_followable &= !player_ptr->phase_out; is_followable &= los(player_ptr, player_ptr->y, player_ptr->x, oldfy, oldfx); diff --git a/src/spell-realm/spells-hex.cpp b/src/spell-realm/spells-hex.cpp index 7115823d6..30ee636a5 100644 --- a/src/spell-realm/spells-hex.cpp +++ b/src/spell-realm/spells-hex.cpp @@ -382,7 +382,7 @@ void SpellHex::thief_teleport() msg_print(_("泥棒は笑って逃げ...ようとしたがバリアに防がれた。", "The thief flees laughing...? But a magic barrier obstructs it.")); } else { msg_print(_("泥棒は笑って逃げた!", "The thief flees laughing!")); - teleport_away(this->player_ptr, this->monap_ptr->m_idx, MAX_SIGHT * 2 + 5, TELEPORT_SPONTANEOUS); + teleport_away(this->player_ptr, this->monap_ptr->m_idx, MAX_PLAYER_SIGHT * 2 + 5, TELEPORT_SPONTANEOUS); } } diff --git a/src/system/gamevalue.h b/src/system/gamevalue.h index 82fb8f7b6..b523d23fe 100644 --- a/src/system/gamevalue.h +++ b/src/system/gamevalue.h @@ -30,13 +30,6 @@ #define FUEL_TORCH 5000 /*!< 松明の基本寿命値 / Maximum amount of fuel in a torch */ #define FUEL_LAMP 15000 /*!< ランタンの基本寿命値 / Maximum amount of fuel in a lantern */ -/* - * More maximum values - */ -#define MAX_SIGHT 20 /*!< プレイヤーの最大視界範囲(マス) / Maximum view distance */ - -#define AAF_LIMIT 100 /*!< モンスターの限界感知範囲(マス) Limit of sensing radius */ - #define MAX_SKILLS 10 #define TY_CURSE_CHANCE 200 /*!<太古の怨念の1ターン毎の発動確率(1/n)*/ @@ -61,6 +54,9 @@ #define MON_DRAIN_LIFE 2 /*!< モンスターの打撃によるプレイヤーの経験値吸収基本倍率(%) / Percent of player exp drained per hit */ #define USE_DEVICE 3 /*!< 魔道具の最低失敗基準値 x> Harder devices x< Easier devices */ +constexpr auto MAX_PLAYER_SIGHT = 20; /*!< プレイヤーの最大視界グリッド数 */ +constexpr auto MAX_MONSTER_SENSING = 100; /*!< モンスターの最大感知グリッド数 */ + /*! * @brief 1フロアに存在可能な、増殖フラグ付きモンスター実体の最大数 * @details 呪術や突然変異で増殖阻止状態にすると、 diff --git a/src/wizard/wizard-special-process.cpp b/src/wizard/wizard-special-process.cpp index ab67210a4..487605ac6 100644 --- a/src/wizard/wizard-special-process.cpp +++ b/src/wizard/wizard-special-process.cpp @@ -820,7 +820,7 @@ void wiz_zap_surrounding_monsters(PlayerType *player_ptr) { for (MONSTER_IDX i = 1; i < player_ptr->current_floor_ptr->m_max; i++) { auto *m_ptr = &player_ptr->current_floor_ptr->m_list[i]; - if (!m_ptr->is_valid() || (i == player_ptr->riding) || (m_ptr->cdis > MAX_SIGHT)) { + if (!m_ptr->is_valid() || (i == player_ptr->riding) || (m_ptr->cdis > MAX_PLAYER_SIGHT)) { continue; } diff --git a/src/world/world-turn-processor.cpp b/src/world/world-turn-processor.cpp index 8b79b8a98..854912f02 100644 --- a/src/world/world-turn-processor.cpp +++ b/src/world/world-turn-processor.cpp @@ -307,7 +307,7 @@ void WorldTurnProcessor::decide_alloc_monster() should_alloc &= !inside_quest(floor_ptr->quest_number); should_alloc &= !this->player_ptr->phase_out; if (should_alloc) { - (void)alloc_monster(this->player_ptr, MAX_SIGHT + 5, 0, summon_specific); + (void)alloc_monster(this->player_ptr, MAX_PLAYER_SIGHT + 5, 0, summon_specific); } } -- 2.11.0