2 * @brief モンスターの特殊技能とターン経過処理 (移動等)/ Monster spells and movement for passaging a turn
5 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
6 * This software may be copied and distributed for educational, research,\n
7 * and not for profit purposes provided that this copyright and statement\n
8 * are included in all such copies. Other copyrights may also apply.\n
9 * 2014 Deskull rearranged comment for Doxygen.\n
11 * This file has several additions to it by Keldon Jones (keldon@umr.edu)
12 * to improve the general quality of the AI (version 0.1.1).
15 #include "monster/monster-processor.h"
16 #include "avatar/avatar.h"
17 #include "cmd-io/cmd-dump.h"
18 #include "core/speed-table.h"
19 #include "floor/cave.h"
20 #include "floor/geometry.h"
21 #include "game-option/play-record-options.h"
22 #include "grid/feature.h"
23 #include "io/write-diary.h"
24 #include "melee/melee-postprocess.h"
25 #include "melee/melee-spell.h"
26 #include "monster-floor/monster-direction.h"
27 #include "monster-floor/monster-generator.h"
28 #include "monster-floor/monster-move.h"
29 #include "monster-floor/monster-remover.h"
30 #include "monster-floor/monster-runaway.h"
31 #include "monster-floor/monster-summon.h"
32 #include "monster-floor/place-monster-types.h"
33 #include "monster-floor/quantum-effect.h"
34 #include "monster-race/monster-race.h"
35 #include "monster-race/race-flags-resistance.h"
36 #include "monster-race/race-flags1.h"
37 #include "monster-race/race-flags2.h"
38 #include "monster-race/race-flags7.h"
39 #include "monster-race/race-indice-types.h"
40 #include "monster/monster-describer.h"
41 #include "monster/monster-description-types.h"
42 #include "monster/monster-flag-types.h"
43 #include "monster/monster-info.h"
44 #include "monster/monster-list.h"
45 #include "monster/monster-processor-util.h"
46 #include "monster/monster-status-setter.h"
47 #include "monster/monster-status.h"
48 #include "monster/monster-update.h"
49 #include "monster/monster-util.h"
50 #include "mspell/mspell-attack.h"
51 #include "mspell/mspell-judgement.h"
52 #include "object-enchant/trc-types.h"
53 #include "pet/pet-fall-off.h"
54 #include "player-base/player-class.h"
55 #include "player-info/ninja-data-type.h"
56 #include "player/player-move.h"
57 #include "player/player-skill.h"
58 #include "player/player-status-flags.h"
59 #include "player/special-defense-types.h"
60 #include "spell-realm/spells-hex.h"
61 #include "spell/summon-types.h"
62 #include "system/floor-type-definition.h"
63 #include "system/grid-type-definition.h"
64 #include "system/monster-entity.h"
65 #include "system/monster-race-info.h"
66 #include "system/player-type-definition.h"
67 #include "system/redrawing-flags-updater.h"
68 #include "target/projection-path-calculator.h"
69 #include "view/display-messages.h"
71 void decide_drop_from_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool is_riding_mon);
72 bool process_stealth(PlayerType *player_ptr, MONSTER_IDX m_idx);
73 bool vanish_summoned_children(PlayerType *player_ptr, MONSTER_IDX m_idx, bool see_m);
74 bool awake_monster(PlayerType *player_ptr, MONSTER_IDX m_idx);
75 void process_angar(PlayerType *player_ptr, MONSTER_IDX m_idx, bool see_m);
76 bool explode_grenade(PlayerType *player_ptr, MONSTER_IDX m_idx);
77 bool decide_monster_multiplication(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION oy, POSITION ox);
78 void process_special(PlayerType *player_ptr, MONSTER_IDX m_idx);
79 bool cast_spell(PlayerType *player_ptr, MONSTER_IDX m_idx, bool aware);
81 bool process_monster_fear(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx);
83 void sweep_monster_process(PlayerType *player_ptr);
84 bool decide_process_continue(PlayerType *player_ptr, MonsterEntity *m_ptr);
87 * @brief モンスター単体の1ターン行動処理メインルーチン /
89 * @param player_ptr プレイヤーへの参照ポインタ
90 * @param m_idx 行動モンスターの参照ID
92 * The monster is known to be within 100 grids of the player\n
94 * In several cases, we directly update the monster lore\n
96 * Note that a monster is only allowed to "reproduce" if there\n
97 * are a limited number of "reproducing" monsters on the current\n
98 * level. This should prevent the level from being "swamped" by\n
99 * reproducing monsters. It also allows a large mass of mice to\n
100 * prevent a louse from multiplying, but this is a small price to\n
101 * pay for a simple ENERGY_MULTIPLICATION method.\n
103 * XXX Monster fear is slightly odd, in particular, monsters will\n
104 * fixate on opening a door even if they cannot open it. Actually,\n
105 * the same thing happens to normal monsters when they hit a door\n
107 * In addition, monsters which *cannot* open or bash\n
108 * down a door will still stand there trying to open it...\n
110 * XXX Technically, need to check for monster in the way\n
111 * combined with that monster being in a wall (or door?)\n
113 * A "direction" of "5" means "pick a random direction".\n
115 void process_monster(PlayerType *player_ptr, MONSTER_IDX m_idx)
117 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
118 auto *r_ptr = &monraces_info[m_ptr->r_idx];
119 turn_flags tmp_flags;
120 turn_flags *turn_flags_ptr = init_turn_flags(player_ptr->riding, m_idx, &tmp_flags);
121 turn_flags_ptr->see_m = is_seen(player_ptr, m_ptr);
123 decide_drop_from_monster(player_ptr, m_idx, turn_flags_ptr->is_riding_mon);
124 if (m_ptr->mflag2.has(MonsterConstantFlagType::CHAMELEON) && one_in_(13) && !m_ptr->is_asleep()) {
125 choose_new_monster(player_ptr, m_idx, false, MonsterRace::empty_id());
126 r_ptr = &monraces_info[m_ptr->r_idx];
129 turn_flags_ptr->aware = process_stealth(player_ptr, m_idx);
130 if (vanish_summoned_children(player_ptr, m_idx, turn_flags_ptr->see_m)) {
134 if (process_quantum_effect(player_ptr, m_idx, turn_flags_ptr->see_m)) {
138 if (explode_grenade(player_ptr, m_idx)) {
142 if (runaway_monster(player_ptr, turn_flags_ptr, m_idx)) {
146 if (!awake_monster(player_ptr, m_idx)) {
150 if (m_ptr->is_stunned() && one_in_(2)) {
154 if (turn_flags_ptr->is_riding_mon) {
155 RedrawingFlagsUpdater::get_instance().set_flag(StatusRecalculatingFlag::BONUS);
158 process_angar(player_ptr, m_idx, turn_flags_ptr->see_m);
160 POSITION oy = m_ptr->fy;
161 POSITION ox = m_ptr->fx;
162 if (decide_monster_multiplication(player_ptr, m_idx, oy, ox)) {
166 process_special(player_ptr, m_idx);
167 process_speak_sound(player_ptr, m_idx, oy, ox, turn_flags_ptr->aware);
168 if (cast_spell(player_ptr, m_idx, turn_flags_ptr->aware)) {
173 mm[0] = mm[1] = mm[2] = mm[3] = 0;
174 mm[4] = mm[5] = mm[6] = mm[7] = 0;
176 if (!decide_monster_movement_direction(player_ptr, mm, m_idx, turn_flags_ptr->aware)) {
181 if (!process_monster_movement(player_ptr, turn_flags_ptr, m_idx, mm, oy, ox, &count)) {
186 * Forward movements failed, but now received LOS attack!
187 * Try to flow by smell.
189 if (player_ptr->no_flowed && count > 2 && m_ptr->target_y) {
190 m_ptr->mflag2.reset(MonsterConstantFlagType::NOFLOW);
193 if (!turn_flags_ptr->do_turn && !turn_flags_ptr->do_move && !m_ptr->is_fearful() && !turn_flags_ptr->is_riding_mon && turn_flags_ptr->aware) {
194 if (r_ptr->freq_spell && randint1(100) <= r_ptr->freq_spell) {
195 if (make_attack_spell(player_ptr, m_idx)) {
201 update_player_type(player_ptr, turn_flags_ptr, r_ptr);
202 update_monster_race_flags(player_ptr, turn_flags_ptr, m_ptr);
204 if (!process_monster_fear(player_ptr, turn_flags_ptr, m_idx)) {
209 chg_virtue(player_ptr, Virtue::COMPASSION, -1);
215 * @param player_ptr プレイヤーへの参照ポインタ
216 * @param m_idx モンスターID
217 * @return モンスターがプレイヤーに気付いているならばTRUE、超隠密状態ならばFALSE
219 bool process_stealth(PlayerType *player_ptr, MONSTER_IDX m_idx)
221 auto ninja_data = PlayerClass(player_ptr).get_specific_data<ninja_data_type>();
222 if (!ninja_data || !ninja_data->s_stealth) {
226 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
227 auto *r_ptr = &monraces_info[m_ptr->r_idx];
228 int tmp = player_ptr->lev * 6 + (player_ptr->skill_stl + 10) * 4;
229 if (player_ptr->monlite) {
233 if (has_aggravate(player_ptr)) {
237 if (r_ptr->level > (player_ptr->lev * player_ptr->lev / 20 + 10)) {
241 return randint0(tmp) <= (r_ptr->level + 20);
245 * @brief 死亡したモンスターが乗馬中のモンスターだった場合に落馬処理を行う
246 * @param player_ptr プレイヤーへの参照ポインタ
247 * @param m_idx モンスターID
248 * @param is_riding_mon 騎乗中であればTRUE
250 void decide_drop_from_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool is_riding_mon)
252 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
253 auto *r_ptr = &monraces_info[m_ptr->r_idx];
254 if (!is_riding_mon || ((r_ptr->flags7 & RF7_RIDING) != 0)) {
258 if (process_fall_off_horse(player_ptr, 0, true)) {
260 msg_print("地面に落とされた。");
262 const auto m_name = monster_desc(player_ptr, &player_ptr->current_floor_ptr->m_list[player_ptr->riding], 0);
263 msg_format("You have fallen from %s.", m_name.data());
269 * @brief 召喚の親元が消滅した時、子供も消滅させる
270 * @param player_ptr プレイヤーへの参照ポインタ
271 * @param m_idx モンスターID
272 * @param see_m モンスターが視界内にいたらTRUE
273 * @return 召喚モンスターが消滅したらTRUE
275 bool vanish_summoned_children(PlayerType *player_ptr, MONSTER_IDX m_idx, bool see_m)
277 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
279 if (m_ptr->parent_m_idx == 0) {
283 // parent_m_idxが自分自身を指している場合は召喚主は消滅している
284 if (m_ptr->parent_m_idx != m_idx && MonsterRace(player_ptr->current_floor_ptr->m_list[m_ptr->parent_m_idx].r_idx).is_valid()) {
289 const auto m_name = monster_desc(player_ptr, m_ptr, 0);
290 msg_format(_("%sは消え去った!", "%s^ disappears!"), m_name.data());
293 if (record_named_pet && m_ptr->is_named_pet()) {
294 const auto m_name = monster_desc(player_ptr, m_ptr, MD_INDEF_VISIBLE);
295 exe_write_diary(player_ptr, DiaryKind::NAMED_PET, RECORD_NAMED_PET_LOSE_PARENT, m_name);
298 delete_monster_idx(player_ptr, m_idx);
303 * @brief 寝ているモンスターの起床を判定する
304 * @param player_ptr プレイヤーへの参照ポインタ
305 * @param m_idx モンスターID
306 * @return 寝たままならFALSE、起きているor起きたらTRUE
308 bool awake_monster(PlayerType *player_ptr, MONSTER_IDX m_idx)
310 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
311 auto *r_ptr = &monraces_info[m_ptr->r_idx];
312 if (!m_ptr->is_asleep()) {
316 if (!has_aggravate(player_ptr)) {
320 (void)set_monster_csleep(player_ptr, m_idx, 0);
322 const auto m_name = monster_desc(player_ptr, m_ptr, 0);
323 msg_format(_("%s^が目を覚ました。", "%s^ wakes up."), m_name.data());
326 if (is_original_ap_and_seen(player_ptr, m_ptr) && (r_ptr->r_wake < MAX_UCHAR)) {
334 * @brief モンスターの怒り状態を判定する (怒っていたら敵に回す)
335 * @param player_ptr プレイヤーへの参照ポインタ
336 * @param m_idx モンスターID
337 * @param see_m モンスターが視界内にいたらTRUE
339 void process_angar(PlayerType *player_ptr, MONSTER_IDX m_idx, bool see_m)
341 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
342 auto *r_ptr = &monraces_info[m_ptr->r_idx];
343 bool gets_angry = false;
344 if (m_ptr->is_friendly() && has_aggravate(player_ptr)) {
348 if (m_ptr->is_pet() && (((r_ptr->kind_flags.has(MonsterKindType::UNIQUE) || (r_ptr->population_flags.has(MonsterPopulationType::NAZGUL))) && monster_has_hostile_align(player_ptr, nullptr, 10, -10, r_ptr)) || r_ptr->resistance_flags.has(MonsterResistanceType::RESIST_ALL))) {
352 if (player_ptr->phase_out || !gets_angry) {
356 const auto m_name = monster_desc(player_ptr, m_ptr, m_ptr->is_pet() ? MD_ASSUME_VISIBLE : 0);
358 /* When riding a hostile alignment pet */
359 if (player_ptr->riding == m_idx) {
360 if (abs(player_ptr->alignment / 10) < randint0(player_ptr->skill_exp[PlayerSkillKindType::RIDING])) {
364 msg_format(_("%s^が突然暴れだした!", "%s^ suddenly begins unruly!"), m_name.data());
365 if (!process_fall_off_horse(player_ptr, 1, true)) {
369 msg_format(_("あなたは振り落とされた。", "You have fallen."));
372 if (m_ptr->is_pet() || see_m) {
373 msg_format(_("%s^は突然敵にまわった!", "%s^ suddenly becomes hostile!"), m_name.data());
376 set_hostile(player_ptr, m_ptr);
381 * @param player_ptr プレイヤーへの参照ポインタ
382 * @param m_idx モンスターID
385 bool explode_grenade(PlayerType *player_ptr, MONSTER_IDX m_idx)
387 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
388 if (m_ptr->r_idx != MonsterRaceId::GRENADE) {
393 mon_take_hit_mon(player_ptr, m_idx, 1, &dead, &fear, _("は爆発して粉々になった。", " explodes into tiny shreds."), m_idx);
398 * @brief モンスター依存の特別な行動を取らせる
399 * @param player_ptr プレイヤーへの参照ポインタ
400 * @param m_idx モンスターID
402 void process_special(PlayerType *player_ptr, MONSTER_IDX m_idx)
404 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
405 auto *r_ptr = &monraces_info[m_ptr->r_idx];
406 if (r_ptr->ability_flags.has_not(MonsterAbilityType::SPECIAL) || (m_ptr->r_idx != MonsterRaceId::OHMU) || player_ptr->current_floor_ptr->inside_arena || player_ptr->phase_out || (r_ptr->freq_spell == 0) || (randint1(100) > r_ptr->freq_spell)) {
411 DEPTH rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
412 BIT_FLAGS p_mode = m_ptr->is_pet() ? PM_FORCE_PET : PM_NONE;
414 for (int k = 0; k < A_MAX; k++) {
415 if (summon_specific(player_ptr, m_idx, m_ptr->fy, m_ptr->fx, rlev, SUMMON_MOLD, (PM_ALLOW_GROUP | p_mode))) {
416 if (player_ptr->current_floor_ptr->m_list[hack_m_idx_ii].ml) {
422 if (count && is_original_ap_and_seen(player_ptr, m_ptr)) {
423 r_ptr->r_ability_flags.set(MonsterAbilityType::SPECIAL);
428 * @brief モンスターを分裂させるかどうかを決定する (分裂もさせる)
429 * @param player_ptr プレイヤーへの参照ポインタ
430 * @param m_idx モンスターID
431 * @param oy 分裂元モンスターのY座標
432 * @param ox 分裂元モンスターのX座標
433 * @return 実際に分裂したらTRUEを返す
435 bool decide_monster_multiplication(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION oy, POSITION ox)
437 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
438 auto *r_ptr = &monraces_info[m_ptr->r_idx];
439 if (((r_ptr->flags2 & RF2_MULTIPLY) == 0) || (player_ptr->current_floor_ptr->num_repro >= MAX_REPRODUCTION)) {
444 for (POSITION y = oy - 1; y <= oy + 1; y++) {
445 for (POSITION x = ox - 1; x <= ox + 1; x++) {
446 if (!in_bounds2(player_ptr->current_floor_ptr, y, x)) {
450 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
456 if (SpellHex(player_ptr).check_hex_barrier(m_idx, HEX_ANTI_MULTI)) {
460 constexpr auto chance_reproduction = 8;
461 if ((k < 4) && (!k || !randint0(k * chance_reproduction))) {
462 if (multiply_monster(player_ptr, m_idx, false, (m_ptr->is_pet() ? PM_FORCE_PET : 0))) {
463 if (player_ptr->current_floor_ptr->m_list[hack_m_idx_ii].ml && is_original_ap_and_seen(player_ptr, m_ptr)) {
464 r_ptr->r_flags2 |= RF2_MULTIPLY;
475 * @brief モンスターに魔法を試行させる
476 * @param player_ptr プレイヤーへの参照ポインタ
477 * @param m_idx モンスターID
478 * @param aware モンスターがプレイヤーに気付いているならばTRUE、超隠密状態ならばFALSE
479 * @return 魔法を唱えられなければ強制的にFALSE、その後モンスターが実際に魔法を唱えればTRUE
481 bool cast_spell(PlayerType *player_ptr, MONSTER_IDX m_idx, bool aware)
483 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
484 auto *r_ptr = &monraces_info[m_ptr->r_idx];
485 if ((r_ptr->freq_spell == 0) || (randint1(100) > r_ptr->freq_spell)) {
489 bool counterattack = false;
490 if (m_ptr->target_y) {
491 MONSTER_IDX t_m_idx = player_ptr->current_floor_ptr->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
492 const auto &target_ref = player_ptr->current_floor_ptr->m_list[t_m_idx];
493 const auto is_projectable = projectable(player_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x);
494 if (t_m_idx && are_enemies(player_ptr, *m_ptr, target_ref) && is_projectable) {
495 counterattack = true;
500 if (monst_spell_monst(player_ptr, m_idx) || (aware && make_attack_spell(player_ptr, m_idx))) {
504 if ((aware && make_attack_spell(player_ptr, m_idx)) || monst_spell_monst(player_ptr, m_idx)) {
513 * @brief モンスターの恐怖状態を処理する
514 * @param player_ptr プレイヤーへの参照ポインタ
515 * @param turn_flags_ptr ターン経過処理フラグへの参照ポインタ
516 * @param m_idx モンスターID
517 * @param aware モンスターがプレイヤーに気付いているならばTRUE、超隠密状態ならばFALSE
518 * @return モンスターが戦いを決意したらTRUE
520 bool process_monster_fear(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx)
522 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
523 bool is_battle_determined = !turn_flags_ptr->do_turn && !turn_flags_ptr->do_move && m_ptr->is_fearful() && turn_flags_ptr->aware;
524 if (!is_battle_determined) {
528 (void)set_monster_monfear(player_ptr, m_idx, 0);
529 if (!turn_flags_ptr->see_m) {
533 const auto m_name = monster_desc(player_ptr, m_ptr, 0);
534 msg_format(_("%s^は戦いを決意した!", "%s^ turns to fight!"), m_name.data());
539 * @brief 全モンスターのターン管理メインルーチン /
540 * Process all the "live" monsters, once per game turn.
542 * During each game current game turn, we scan through the list of all the "live" monsters,\n
543 * (backwards, so we can excise any "freshly dead" monsters), energizing each\n
544 * monster, and allowing fully energized monsters to move, attack, pass, etc.\n
546 * Note that monsters can never move in the monster array (except when the\n
547 * "compact_monsters()" function is called by "dungeon()" or "save_player()").\n
549 * This function is responsible for at least half of the processor time\n
550 * on a normal system with a "normal" amount of monsters and a player doing\n
553 * When the player is resting, virtually 90% of the processor time is spent\n
554 * in this function, and its children, "process_monster()" and "make_move()".\n
556 * Most of the rest of the time is spent in "update_view()" and "lite_spot()",\n
557 * especially when the player is running.\n
559 * Note the special "MFLAG_BORN" flag, which allows us to ignore "fresh"\n
560 * monsters while they are still being "born". A monster is "fresh" only\n
561 * during the game turn in which it is created, and we use the "hack_m_idx" to\n
562 * determine if the monster is yet to be processed during the game turn.\n
564 * Note the special "MFLAG_PREVENT_MAGIC" flag, which allows the player to get one\n
565 * move before any "nasty" monsters get to use their spell attacks.\n
567 * Note that when the "knowledge" about the currently tracked monster\n
568 * changes (flags, attacks, spells), we induce a redraw of the monster\n
571 void process_monsters(PlayerType *player_ptr)
573 old_race_flags tmp_flags;
574 old_race_flags *old_race_flags_ptr = &tmp_flags;
575 player_ptr->current_floor_ptr->monster_noise = false;
576 MonsterRaceId old_monster_race_idx = player_ptr->monster_race_idx;
577 save_old_race_flags(player_ptr->monster_race_idx, old_race_flags_ptr);
578 sweep_monster_process(player_ptr);
580 if (!MonsterRace(player_ptr->monster_race_idx).is_valid() || (player_ptr->monster_race_idx != old_monster_race_idx)) {
584 update_player_window(player_ptr, old_race_flags_ptr);
588 * @brief フロア内のモンスターについてターン終了時の処理を繰り返す
589 * @param player_ptr プレイヤーへの参照ポインタ
591 void sweep_monster_process(PlayerType *player_ptr)
593 auto *floor_ptr = player_ptr->current_floor_ptr;
594 for (MONSTER_IDX i = floor_ptr->m_max - 1; i >= 1; i--) {
595 MonsterEntity *m_ptr;
596 m_ptr = &floor_ptr->m_list[i];
598 if (player_ptr->leaving) {
602 if (!m_ptr->is_valid() || player_ptr->wild_mode) {
606 if (m_ptr->mflag.has(MonsterTemporaryFlagType::BORN)) {
607 m_ptr->mflag.reset(MonsterTemporaryFlagType::BORN);
611 if ((m_ptr->cdis >= MAX_MONSTER_SENSING) || !decide_process_continue(player_ptr, m_ptr)) {
615 byte speed = (player_ptr->riding == i) ? player_ptr->pspeed : m_ptr->get_temporary_speed();
616 m_ptr->energy_need -= speed_to_energy(speed);
617 if (m_ptr->energy_need > 0) {
621 m_ptr->energy_need += ENERGY_NEED();
623 process_monster(player_ptr, i);
625 if (player_ptr->no_flowed && one_in_(3)) {
626 m_ptr->mflag2.set(MonsterConstantFlagType::NOFLOW);
629 if (!player_ptr->playing || player_ptr->is_dead || player_ptr->leaving) {
636 * @brief 後続のモンスター処理が必要かどうか判定する (要調査)
637 * @param player_ptr プレイヤーへの参照ポインタ
638 * @param m_ptr モンスターへの参照ポインタ
639 * @return 後続処理が必要ならTRUE
641 bool decide_process_continue(PlayerType *player_ptr, MonsterEntity *m_ptr)
643 MonsterRaceInfo *r_ptr;
644 r_ptr = &monraces_info[m_ptr->r_idx];
645 if (!player_ptr->no_flowed) {
646 m_ptr->mflag2.reset(MonsterConstantFlagType::NOFLOW);
649 if (m_ptr->cdis <= (m_ptr->is_pet() ? (r_ptr->aaf > MAX_PLAYER_SIGHT ? MAX_PLAYER_SIGHT : r_ptr->aaf) : r_ptr->aaf)) {
653 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))) {
657 if (m_ptr->target_y) {