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/player-update-types.h"
19 #include "core/speed-table.h"
20 #include "floor/cave.h"
21 #include "floor/geometry.h"
22 #include "game-option/play-record-options.h"
23 #include "grid/feature.h"
24 #include "io/write-diary.h"
25 #include "melee/melee-postprocess.h"
26 #include "melee/melee-spell.h"
27 #include "monster-floor/monster-direction.h"
28 #include "monster-floor/monster-generator.h"
29 #include "monster-floor/monster-move.h"
30 #include "monster-floor/monster-remover.h"
31 #include "monster-floor/monster-runaway.h"
32 #include "monster-floor/monster-summon.h"
33 #include "monster-floor/place-monster-types.h"
34 #include "monster-floor/quantum-effect.h"
35 #include "monster-race/monster-race.h"
36 #include "monster-race/race-flags-resistance.h"
37 #include "monster-race/race-flags1.h"
38 #include "monster-race/race-flags2.h"
39 #include "monster-race/race-flags7.h"
40 #include "monster-race/race-indice-types.h"
41 #include "monster/monster-describer.h"
42 #include "monster/monster-description-types.h"
43 #include "monster/monster-flag-types.h"
44 #include "monster/monster-info.h"
45 #include "monster/monster-list.h"
46 #include "monster/monster-processor-util.h"
47 #include "monster/monster-status-setter.h"
48 #include "monster/monster-status.h"
49 #include "monster/monster-update.h"
50 #include "monster/monster-util.h"
51 #include "mspell/mspell-attack.h"
52 #include "mspell/mspell-judgement.h"
53 #include "object-enchant/trc-types.h"
54 #include "pet/pet-fall-off.h"
55 #include "player-base/player-class.h"
56 #include "player-info/ninja-data-type.h"
57 #include "player/player-move.h"
58 #include "player/player-skill.h"
59 #include "player/player-status-flags.h"
60 #include "player/special-defense-types.h"
61 #include "spell-realm/spells-hex.h"
62 #include "spell/summon-types.h"
63 #include "system/floor-type-definition.h"
64 #include "system/grid-type-definition.h"
65 #include "system/monster-entity.h"
66 #include "system/monster-race-info.h"
67 #include "system/player-type-definition.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) || process_quantum_effect(player_ptr, m_idx, turn_flags_ptr->see_m) || explode_grenade(player_ptr, m_idx) || runaway_monster(player_ptr, turn_flags_ptr, m_idx) || !awake_monster(player_ptr, m_idx)) {
134 if (m_ptr->is_stunned() && one_in_(2)) {
138 if (turn_flags_ptr->is_riding_mon) {
139 player_ptr->update |= PU_BONUS;
142 process_angar(player_ptr, m_idx, turn_flags_ptr->see_m);
144 POSITION oy = m_ptr->fy;
145 POSITION ox = m_ptr->fx;
146 if (decide_monster_multiplication(player_ptr, m_idx, oy, ox)) {
150 process_special(player_ptr, m_idx);
151 process_speak_sound(player_ptr, m_idx, oy, ox, turn_flags_ptr->aware);
152 if (cast_spell(player_ptr, m_idx, turn_flags_ptr->aware)) {
157 mm[0] = mm[1] = mm[2] = mm[3] = 0;
158 mm[4] = mm[5] = mm[6] = mm[7] = 0;
160 if (!decide_monster_movement_direction(player_ptr, mm, m_idx, turn_flags_ptr->aware)) {
165 if (!process_monster_movement(player_ptr, turn_flags_ptr, m_idx, mm, oy, ox, &count)) {
170 * Forward movements failed, but now received LOS attack!
171 * Try to flow by smell.
173 if (player_ptr->no_flowed && count > 2 && m_ptr->target_y) {
174 m_ptr->mflag2.reset(MonsterConstantFlagType::NOFLOW);
177 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) {
178 if (r_ptr->freq_spell && randint1(100) <= r_ptr->freq_spell) {
179 if (make_attack_spell(player_ptr, m_idx)) {
185 update_player_type(player_ptr, turn_flags_ptr, r_ptr);
186 update_monster_race_flags(player_ptr, turn_flags_ptr, m_ptr);
188 if (!process_monster_fear(player_ptr, turn_flags_ptr, m_idx)) {
193 chg_virtue(player_ptr, Virtue::COMPASSION, -1);
199 * @param player_ptr プレイヤーへの参照ポインタ
200 * @param m_idx モンスターID
201 * @return モンスターがプレイヤーに気付いているならばTRUE、超隠密状態ならばFALSE
203 bool process_stealth(PlayerType *player_ptr, MONSTER_IDX m_idx)
205 auto ninja_data = PlayerClass(player_ptr).get_specific_data<ninja_data_type>();
206 if (!ninja_data || !ninja_data->s_stealth) {
210 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
211 auto *r_ptr = &monraces_info[m_ptr->r_idx];
212 int tmp = player_ptr->lev * 6 + (player_ptr->skill_stl + 10) * 4;
213 if (player_ptr->monlite) {
217 if (has_aggravate(player_ptr)) {
221 if (r_ptr->level > (player_ptr->lev * player_ptr->lev / 20 + 10)) {
225 return randint0(tmp) <= (r_ptr->level + 20);
229 * @brief 死亡したモンスターが乗馬中のモンスターだった場合に落馬処理を行う
230 * @param player_ptr プレイヤーへの参照ポインタ
231 * @param m_idx モンスターID
232 * @param is_riding_mon 騎乗中であればTRUE
234 void decide_drop_from_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool is_riding_mon)
236 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
237 auto *r_ptr = &monraces_info[m_ptr->r_idx];
238 if (!is_riding_mon || ((r_ptr->flags7 & RF7_RIDING) != 0)) {
242 if (process_fall_off_horse(player_ptr, 0, true)) {
244 msg_print("地面に落とされた。");
246 const auto m_name = monster_desc(player_ptr, &player_ptr->current_floor_ptr->m_list[player_ptr->riding], 0);
247 msg_format("You have fallen from %s.", m_name.data());
253 * @brief 召喚の親元が消滅した時、子供も消滅させる
254 * @param player_ptr プレイヤーへの参照ポインタ
255 * @param m_idx モンスターID
256 * @param see_m モンスターが視界内にいたらTRUE
257 * @return 召喚モンスターが消滅したらTRUE
259 bool vanish_summoned_children(PlayerType *player_ptr, MONSTER_IDX m_idx, bool see_m)
261 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
263 if (m_ptr->parent_m_idx == 0) {
267 // parent_m_idxが自分自身を指している場合は召喚主は消滅している
268 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()) {
273 const auto m_name = monster_desc(player_ptr, m_ptr, 0);
274 msg_format(_("%sは消え去った!", "%s^ disappears!"), m_name.data());
277 if (record_named_pet && m_ptr->is_named_pet()) {
278 const auto m_name = monster_desc(player_ptr, m_ptr, MD_INDEF_VISIBLE);
279 exe_write_diary(player_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_LOSE_PARENT, m_name.data());
282 delete_monster_idx(player_ptr, m_idx);
287 * @brief 寝ているモンスターの起床を判定する
288 * @param player_ptr プレイヤーへの参照ポインタ
289 * @param m_idx モンスターID
290 * @return 寝たままならFALSE、起きているor起きたらTRUE
292 bool awake_monster(PlayerType *player_ptr, MONSTER_IDX m_idx)
294 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
295 auto *r_ptr = &monraces_info[m_ptr->r_idx];
296 if (!m_ptr->is_asleep()) {
300 if (!has_aggravate(player_ptr)) {
304 (void)set_monster_csleep(player_ptr, m_idx, 0);
306 const auto m_name = monster_desc(player_ptr, m_ptr, 0);
307 msg_format(_("%s^が目を覚ました。", "%s^ wakes up."), m_name.data());
310 if (is_original_ap_and_seen(player_ptr, m_ptr) && (r_ptr->r_wake < MAX_UCHAR)) {
318 * @brief モンスターの怒り状態を判定する (怒っていたら敵に回す)
319 * @param player_ptr プレイヤーへの参照ポインタ
320 * @param m_idx モンスターID
321 * @param see_m モンスターが視界内にいたらTRUE
323 void process_angar(PlayerType *player_ptr, MONSTER_IDX m_idx, bool see_m)
325 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
326 auto *r_ptr = &monraces_info[m_ptr->r_idx];
327 bool gets_angry = false;
328 if (m_ptr->is_friendly() && has_aggravate(player_ptr)) {
332 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))) {
336 if (player_ptr->phase_out || !gets_angry) {
340 const auto m_name = monster_desc(player_ptr, m_ptr, m_ptr->is_pet() ? MD_ASSUME_VISIBLE : 0);
342 /* When riding a hostile alignment pet */
343 if (player_ptr->riding == m_idx) {
344 if (abs(player_ptr->alignment / 10) < randint0(player_ptr->skill_exp[PlayerSkillKindType::RIDING])) {
348 msg_format(_("%s^が突然暴れだした!", "%s^ suddenly begins unruly!"), m_name.data());
349 if (!process_fall_off_horse(player_ptr, 1, true)) {
353 msg_format(_("あなたは振り落とされた。", "You have fallen."));
356 if (m_ptr->is_pet() || see_m) {
357 msg_format(_("%s^は突然敵にまわった!", "%s^ suddenly becomes hostile!"), m_name.data());
360 set_hostile(player_ptr, m_ptr);
365 * @param player_ptr プレイヤーへの参照ポインタ
366 * @param m_idx モンスターID
369 bool explode_grenade(PlayerType *player_ptr, MONSTER_IDX m_idx)
371 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
372 if (m_ptr->r_idx != MonsterRaceId::GRENADE) {
377 mon_take_hit_mon(player_ptr, m_idx, 1, &dead, &fear, _("は爆発して粉々になった。", " explodes into tiny shreds."), m_idx);
382 * @brief モンスター依存の特別な行動を取らせる
383 * @param player_ptr プレイヤーへの参照ポインタ
384 * @param m_idx モンスターID
386 void process_special(PlayerType *player_ptr, MONSTER_IDX m_idx)
388 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
389 auto *r_ptr = &monraces_info[m_ptr->r_idx];
390 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)) {
395 DEPTH rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
396 BIT_FLAGS p_mode = m_ptr->is_pet() ? PM_FORCE_PET : PM_NONE;
398 for (int k = 0; k < A_MAX; k++) {
399 if (summon_specific(player_ptr, m_idx, m_ptr->fy, m_ptr->fx, rlev, SUMMON_MOLD, (PM_ALLOW_GROUP | p_mode))) {
400 if (player_ptr->current_floor_ptr->m_list[hack_m_idx_ii].ml) {
406 if (count && is_original_ap_and_seen(player_ptr, m_ptr)) {
407 r_ptr->r_ability_flags.set(MonsterAbilityType::SPECIAL);
412 * @brief モンスターを分裂させるかどうかを決定する (分裂もさせる)
413 * @param player_ptr プレイヤーへの参照ポインタ
414 * @param m_idx モンスターID
415 * @param oy 分裂元モンスターのY座標
416 * @param ox 分裂元モンスターのX座標
417 * @return 実際に分裂したらTRUEを返す
419 bool decide_monster_multiplication(PlayerType *player_ptr, MONSTER_IDX m_idx, POSITION oy, POSITION ox)
421 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
422 auto *r_ptr = &monraces_info[m_ptr->r_idx];
423 if (((r_ptr->flags2 & RF2_MULTIPLY) == 0) || (player_ptr->current_floor_ptr->num_repro >= MAX_REPRODUCTION)) {
428 for (POSITION y = oy - 1; y <= oy + 1; y++) {
429 for (POSITION x = ox - 1; x <= ox + 1; x++) {
430 if (!in_bounds2(player_ptr->current_floor_ptr, y, x)) {
434 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
440 if (SpellHex(player_ptr).check_hex_barrier(m_idx, HEX_ANTI_MULTI)) {
444 constexpr auto chance_reproduction = 8;
445 if ((k < 4) && (!k || !randint0(k * chance_reproduction))) {
446 if (multiply_monster(player_ptr, m_idx, false, (m_ptr->is_pet() ? PM_FORCE_PET : 0))) {
447 if (player_ptr->current_floor_ptr->m_list[hack_m_idx_ii].ml && is_original_ap_and_seen(player_ptr, m_ptr)) {
448 r_ptr->r_flags2 |= RF2_MULTIPLY;
459 * @brief モンスターに魔法を試行させる
460 * @param player_ptr プレイヤーへの参照ポインタ
461 * @param m_idx モンスターID
462 * @param aware モンスターがプレイヤーに気付いているならばTRUE、超隠密状態ならばFALSE
463 * @return 魔法を唱えられなければ強制的にFALSE、その後モンスターが実際に魔法を唱えればTRUE
465 bool cast_spell(PlayerType *player_ptr, MONSTER_IDX m_idx, bool aware)
467 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
468 auto *r_ptr = &monraces_info[m_ptr->r_idx];
469 if ((r_ptr->freq_spell == 0) || (randint1(100) > r_ptr->freq_spell)) {
473 bool counterattack = false;
474 if (m_ptr->target_y) {
475 MONSTER_IDX t_m_idx = player_ptr->current_floor_ptr->grid_array[m_ptr->target_y][m_ptr->target_x].m_idx;
476 const auto &target_ref = player_ptr->current_floor_ptr->m_list[t_m_idx];
477 const auto is_projectable = projectable(player_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x);
478 if (t_m_idx && are_enemies(player_ptr, *m_ptr, target_ref) && is_projectable) {
479 counterattack = true;
484 if (monst_spell_monst(player_ptr, m_idx) || (aware && make_attack_spell(player_ptr, m_idx))) {
488 if ((aware && make_attack_spell(player_ptr, m_idx)) || monst_spell_monst(player_ptr, m_idx)) {
497 * @brief モンスターの恐怖状態を処理する
498 * @param player_ptr プレイヤーへの参照ポインタ
499 * @param turn_flags_ptr ターン経過処理フラグへの参照ポインタ
500 * @param m_idx モンスターID
501 * @param aware モンスターがプレイヤーに気付いているならばTRUE、超隠密状態ならばFALSE
502 * @return モンスターが戦いを決意したらTRUE
504 bool process_monster_fear(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx)
506 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
507 bool is_battle_determined = !turn_flags_ptr->do_turn && !turn_flags_ptr->do_move && m_ptr->is_fearful() && turn_flags_ptr->aware;
508 if (!is_battle_determined) {
512 (void)set_monster_monfear(player_ptr, m_idx, 0);
513 if (!turn_flags_ptr->see_m) {
517 const auto m_name = monster_desc(player_ptr, m_ptr, 0);
518 msg_format(_("%s^は戦いを決意した!", "%s^ turns to fight!"), m_name.data());
523 * @brief 全モンスターのターン管理メインルーチン /
524 * Process all the "live" monsters, once per game turn.
526 * During each game current game turn, we scan through the list of all the "live" monsters,\n
527 * (backwards, so we can excise any "freshly dead" monsters), energizing each\n
528 * monster, and allowing fully energized monsters to move, attack, pass, etc.\n
530 * Note that monsters can never move in the monster array (except when the\n
531 * "compact_monsters()" function is called by "dungeon()" or "save_player()").\n
533 * This function is responsible for at least half of the processor time\n
534 * on a normal system with a "normal" amount of monsters and a player doing\n
537 * When the player is resting, virtually 90% of the processor time is spent\n
538 * in this function, and its children, "process_monster()" and "make_move()".\n
540 * Most of the rest of the time is spent in "update_view()" and "lite_spot()",\n
541 * especially when the player is running.\n
543 * Note the special "MFLAG_BORN" flag, which allows us to ignore "fresh"\n
544 * monsters while they are still being "born". A monster is "fresh" only\n
545 * during the game turn in which it is created, and we use the "hack_m_idx" to\n
546 * determine if the monster is yet to be processed during the game turn.\n
548 * Note the special "MFLAG_PREVENT_MAGIC" flag, which allows the player to get one\n
549 * move before any "nasty" monsters get to use their spell attacks.\n
551 * Note that when the "knowledge" about the currently tracked monster\n
552 * changes (flags, attacks, spells), we induce a redraw of the monster\n
555 void process_monsters(PlayerType *player_ptr)
557 old_race_flags tmp_flags;
558 old_race_flags *old_race_flags_ptr = init_old_race_flags(&tmp_flags);
559 player_ptr->current_floor_ptr->monster_noise = false;
560 MonsterRaceId old_monster_race_idx = player_ptr->monster_race_idx;
561 save_old_race_flags(player_ptr->monster_race_idx, old_race_flags_ptr);
562 sweep_monster_process(player_ptr);
564 if (!MonsterRace(player_ptr->monster_race_idx).is_valid() || (player_ptr->monster_race_idx != old_monster_race_idx)) {
568 update_player_window(player_ptr, old_race_flags_ptr);
572 * @brief フロア内のモンスターについてターン終了時の処理を繰り返す
573 * @param player_ptr プレイヤーへの参照ポインタ
575 void sweep_monster_process(PlayerType *player_ptr)
577 auto *floor_ptr = player_ptr->current_floor_ptr;
578 for (MONSTER_IDX i = floor_ptr->m_max - 1; i >= 1; i--) {
579 MonsterEntity *m_ptr;
580 m_ptr = &floor_ptr->m_list[i];
582 if (player_ptr->leaving) {
586 if (!m_ptr->is_valid() || player_ptr->wild_mode) {
590 if (m_ptr->mflag.has(MonsterTemporaryFlagType::BORN)) {
591 m_ptr->mflag.reset(MonsterTemporaryFlagType::BORN);
595 if ((m_ptr->cdis >= MAX_MONSTER_SENSING) || !decide_process_continue(player_ptr, m_ptr)) {
599 byte speed = (player_ptr->riding == i) ? player_ptr->pspeed : m_ptr->get_temporary_speed();
600 m_ptr->energy_need -= speed_to_energy(speed);
601 if (m_ptr->energy_need > 0) {
605 m_ptr->energy_need += ENERGY_NEED();
607 process_monster(player_ptr, i);
609 if (player_ptr->no_flowed && one_in_(3)) {
610 m_ptr->mflag2.set(MonsterConstantFlagType::NOFLOW);
613 if (!player_ptr->playing || player_ptr->is_dead || player_ptr->leaving) {
620 * @brief 後続のモンスター処理が必要かどうか判定する (要調査)
621 * @param player_ptr プレイヤーへの参照ポインタ
622 * @param m_ptr モンスターへの参照ポインタ
623 * @return 後続処理が必要ならTRUE
625 bool decide_process_continue(PlayerType *player_ptr, MonsterEntity *m_ptr)
627 MonsterRaceInfo *r_ptr;
628 r_ptr = &monraces_info[m_ptr->r_idx];
629 if (!player_ptr->no_flowed) {
630 m_ptr->mflag2.reset(MonsterConstantFlagType::NOFLOW);
633 if (m_ptr->cdis <= (m_ptr->is_pet() ? (r_ptr->aaf > MAX_PLAYER_SIGHT ? MAX_PLAYER_SIGHT : r_ptr->aaf) : r_ptr->aaf)) {
637 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))) {
641 if (m_ptr->target_y) {