OSDN Git Service

[Refactor] #40014 Moved update_monster() and update_monsters() from monster2.c/h...
authorHourier <hourier@users.sourceforge.jp>
Wed, 10 Jun 2020 11:08:39 +0000 (20:08 +0900)
committerHourier <hourier@users.sourceforge.jp>
Wed, 10 Jun 2020 11:08:39 +0000 (20:08 +0900)
24 files changed:
src/combat/shoot.c
src/core/player-processor.c
src/effect/effect-feature.c
src/effect/effect-monster.c
src/floor/floor-generate.c
src/floor/floor-save.c
src/floor/floor.c
src/grid/grid.c
src/io/targeting.c
src/mind/mind-ninja.c
src/monster/monster-status.c
src/monster/monster-update.c
src/monster/monster-update.h
src/monster/monster2.c
src/monster/monster2.h
src/player/player-move.c
src/player/player-status.c
src/realm/realm-hissatsu.c
src/spell-kind/earthquake.c
src/spell-kind/spells-detection.c
src/spell-kind/spells-lite.c
src/spell-kind/spells-teleport.c
src/spell/spells3.c
src/view/display-main-window.c

index 0db3450..fd2300b 100644 (file)
@@ -19,6 +19,7 @@
 #include "monster/monster-death.h"
 #include "monster/monster-status.h"
 #include "monster/monster-info.h"
+#include "monster/monster-update.h"
 #include "monster/monster2.h"
 #include "mspell/monster-spell.h"
 #include "object-enchant/artifact.h"
index 3b80db4..a8cd2cf 100644 (file)
@@ -11,6 +11,7 @@
 #include "monster-race/monster-race-hook.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-status.h"
+#include "monster/monster-update.h"
 #include "monster/monster-util.h"
 #include "monster/monster2.h"
 #include "monster/place-monster-types.h"
index ef5d863..4477784 100644 (file)
@@ -5,7 +5,7 @@
 #include "grid/grid.h"
 #include "grid/trap.h"
 #include "main/sound-definitions-table.h"
-#include "monster/monster2.h"
+#include "monster/monster-update.h"
 #include "player/player-effects.h"
 #include "room/rooms.h"
 #include "spell/process-effect.h" // 暫定、後で消す.
index fa87de8..3fc7bbf 100644 (file)
@@ -18,8 +18,9 @@
 #include "monster-race/race-flags7.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-death.h"
-#include "monster/monster-status.h"
 #include "monster/monster-info.h"
+#include "monster/monster-status.h"
+#include "monster/monster-update.h"
 #include "monster/monster2.h"
 #include "object-enchant/special-object-flags.h"
 #include "object/object-generator.h"
index 1b22619..1a2f750 100644 (file)
@@ -31,6 +31,7 @@
 #include "monster-race/race-flags1.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-status.h"
+#include "monster/monster-update.h"
 #include "monster/monster-util.h"
 #include "monster/monster-info.h"
 #include "monster/monster2.h"
index 04861af..36c9c42 100644 (file)
@@ -37,6 +37,7 @@
 #include "monster/monster-description-types.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-status.h"
+#include "monster/monster-update.h"
 #include "monster/monster-info.h"
 #include "monster/monster2.h"
 #include "monster/smart-learn-types.h"
index 386e996..2a6ceaa 100644 (file)
@@ -7,6 +7,7 @@
 #include "floor/floor-object.h"
 #include "grid/grid.h"
 #include "grid/trap.h"
+#include "monster/monster-update.h"
 #include "monster/monster2.h"
 #include "monster/place-monster-types.h"
 #include "object-enchant/artifact.h"
index 1e82696..ee6cc7b 100644 (file)
@@ -24,6 +24,7 @@
 #include "grid/trap.h"
 #include "monster/monster-status.h"
 #include "monster/monster-info.h"
+#include "monster/monster-update.h"
 #include "monster/monster2.h"
 #include "object/object-flavor.h"
 #include "object/object-hook.h"
index 2c25a40..f1f425b 100644 (file)
@@ -30,6 +30,7 @@
 #include "monster/monster-description-types.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-status.h"
+#include "monster/monster-update.h"
 #include "monster/monster2.h"
 #include "monster/smart-learn-types.h"
 #include "object-enchant/object-curse.h"
index 0a855bb..c737231 100644 (file)
@@ -8,6 +8,7 @@
 #include "monster-race/race-flags-resistance.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-status.h"
+#include "monster/monster-update.h"
 #include "monster/monster2.h"
 #include "object-enchant/trc-types.h"
 #include "object/object-generator.h"
index 1744e8d..ffb2483 100644 (file)
@@ -28,6 +28,7 @@
 #include "monster/monster-description-types.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-processor.h"
+#include "monster/monster-update.h"
 #include "monster/monster-util.h"
 #include "monster/monster-info.h"
 #include "monster/monster2.h"
index 997cfad..f9158c4 100644 (file)
@@ -5,10 +5,17 @@
  */
 
 #include "monster/monster-update.h"
+#include "dungeon/dungeon.h"
+#include "monster-race/race-flags1.h"
 #include "monster-race/race-flags2.h"
+#include "monster-race/race-flags3.h"
 #include "monster-race/race-flags7.h"
+#include "monster-race/race-indice-types.h"
 #include "monster/monster-info.h"
+#include "monster/monster-flag-types.h"
+#include "monster/monster-status.h"
 #include "monster/monster2.h"
+#include "player/eldritch-horror.h"
 #include "player/player-move.h"
 
 /*!
@@ -122,3 +129,286 @@ void update_player_window(player_type *target_ptr, old_race_flags *old_race_flag
                target_ptr->window |= (PW_MONSTER);
        }
 }
+
+/*!
+ * @brief モンスターの各情報を更新する / This function updates the monster record of the given monster
+ * @param m_idx 更新するモンスター情報のID
+ * @param full プレイヤーとの距離更新を行うならばtrue
+ * @return なし
+ */
+void update_monster(player_type *subject_ptr, MONSTER_IDX m_idx, bool full)
+{
+    monster_type *m_ptr = &subject_ptr->current_floor_ptr->m_list[m_idx];
+    monster_race *r_ptr = &r_info[m_ptr->r_idx];
+
+    bool do_disturb = disturb_move;
+
+    POSITION fy = m_ptr->fy;
+    POSITION fx = m_ptr->fx;
+
+    bool flag = FALSE;
+    bool easy = FALSE;
+    bool in_darkness = (d_info[subject_ptr->dungeon_idx].flags1 & DF1_DARKNESS) && !subject_ptr->see_nocto;
+    if (disturb_high) {
+        monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx];
+        if (ap_r_ptr->r_tkills && ap_r_ptr->level >= subject_ptr->lev)
+            do_disturb = TRUE;
+    }
+
+    POSITION distance;
+    if (full) {
+        int dy = (subject_ptr->y > fy) ? (subject_ptr->y - fy) : (fy - subject_ptr->y);
+        int dx = (subject_ptr->x > fx) ? (subject_ptr->x - fx) : (fx - subject_ptr->x);
+
+        distance = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
+        if (distance > 255)
+            distance = 255;
+        if (!distance)
+            distance = 1;
+
+        m_ptr->cdis = distance;
+    } else {
+        distance = m_ptr->cdis;
+    }
+
+    if (m_ptr->mflag2 & (MFLAG2_MARK))
+        flag = TRUE;
+
+    if (distance <= (in_darkness ? MAX_SIGHT / 2 : MAX_SIGHT)) {
+        if (!in_darkness || (distance <= MAX_SIGHT / 4)) {
+            if (subject_ptr->special_defense & KATA_MUSOU) {
+                flag = TRUE;
+                if (is_original_ap(m_ptr) && !subject_ptr->image) {
+                    if (r_ptr->flags2 & (RF2_SMART))
+                        r_ptr->r_flags2 |= (RF2_SMART);
+                    if (r_ptr->flags2 & (RF2_STUPID))
+                        r_ptr->r_flags2 |= (RF2_STUPID);
+                }
+            } else if (subject_ptr->telepathy) {
+                if (r_ptr->flags2 & (RF2_EMPTY_MIND)) {
+                    if (is_original_ap(m_ptr) && !subject_ptr->image)
+                        r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
+                } else if (r_ptr->flags2 & (RF2_WEIRD_MIND)) {
+                    if ((m_idx % 10) == 5) {
+                        flag = TRUE;
+                        if (is_original_ap(m_ptr) && !subject_ptr->image) {
+                            r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
+                            if (r_ptr->flags2 & (RF2_SMART))
+                                r_ptr->r_flags2 |= (RF2_SMART);
+                            if (r_ptr->flags2 & (RF2_STUPID))
+                                r_ptr->r_flags2 |= (RF2_STUPID);
+                        }
+                    }
+                } else {
+                    flag = TRUE;
+                    if (is_original_ap(m_ptr) && !subject_ptr->image) {
+                        if (r_ptr->flags2 & (RF2_SMART))
+                            r_ptr->r_flags2 |= (RF2_SMART);
+                        if (r_ptr->flags2 & (RF2_STUPID))
+                            r_ptr->r_flags2 |= (RF2_STUPID);
+                    }
+                }
+            }
+
+            if ((subject_ptr->esp_animal) && (r_ptr->flags3 & (RF3_ANIMAL))) {
+                flag = TRUE;
+                if (is_original_ap(m_ptr) && !subject_ptr->image)
+                    r_ptr->r_flags3 |= (RF3_ANIMAL);
+            }
+
+            if ((subject_ptr->esp_undead) && (r_ptr->flags3 & (RF3_UNDEAD))) {
+                flag = TRUE;
+                if (is_original_ap(m_ptr) && !subject_ptr->image)
+                    r_ptr->r_flags3 |= (RF3_UNDEAD);
+            }
+
+            if ((subject_ptr->esp_demon) && (r_ptr->flags3 & (RF3_DEMON))) {
+                flag = TRUE;
+                if (is_original_ap(m_ptr) && !subject_ptr->image)
+                    r_ptr->r_flags3 |= (RF3_DEMON);
+            }
+
+            if ((subject_ptr->esp_orc) && (r_ptr->flags3 & (RF3_ORC))) {
+                flag = TRUE;
+                if (is_original_ap(m_ptr) && !subject_ptr->image)
+                    r_ptr->r_flags3 |= (RF3_ORC);
+            }
+
+            if ((subject_ptr->esp_troll) && (r_ptr->flags3 & (RF3_TROLL))) {
+                flag = TRUE;
+                if (is_original_ap(m_ptr) && !subject_ptr->image)
+                    r_ptr->r_flags3 |= (RF3_TROLL);
+            }
+
+            if ((subject_ptr->esp_giant) && (r_ptr->flags3 & (RF3_GIANT))) {
+                flag = TRUE;
+                if (is_original_ap(m_ptr) && !subject_ptr->image)
+                    r_ptr->r_flags3 |= (RF3_GIANT);
+            }
+
+            if ((subject_ptr->esp_dragon) && (r_ptr->flags3 & (RF3_DRAGON))) {
+                flag = TRUE;
+                if (is_original_ap(m_ptr) && !subject_ptr->image)
+                    r_ptr->r_flags3 |= (RF3_DRAGON);
+            }
+
+            if ((subject_ptr->esp_human) && (r_ptr->flags2 & (RF2_HUMAN))) {
+                flag = TRUE;
+                if (is_original_ap(m_ptr) && !subject_ptr->image)
+                    r_ptr->r_flags2 |= (RF2_HUMAN);
+            }
+
+            if ((subject_ptr->esp_evil) && (r_ptr->flags3 & (RF3_EVIL))) {
+                flag = TRUE;
+                if (is_original_ap(m_ptr) && !subject_ptr->image)
+                    r_ptr->r_flags3 |= (RF3_EVIL);
+            }
+
+            if ((subject_ptr->esp_good) && (r_ptr->flags3 & (RF3_GOOD))) {
+                flag = TRUE;
+                if (is_original_ap(m_ptr) && !subject_ptr->image)
+                    r_ptr->r_flags3 |= (RF3_GOOD);
+            }
+
+            if ((subject_ptr->esp_nonliving) && ((r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) == RF3_NONLIVING)) {
+                flag = TRUE;
+                if (is_original_ap(m_ptr) && !subject_ptr->image)
+                    r_ptr->r_flags3 |= (RF3_NONLIVING);
+            }
+
+            if ((subject_ptr->esp_unique) && (r_ptr->flags1 & (RF1_UNIQUE))) {
+                flag = TRUE;
+                if (is_original_ap(m_ptr) && !subject_ptr->image)
+                    r_ptr->r_flags1 |= (RF1_UNIQUE);
+            }
+        }
+
+        if (player_has_los_bold(subject_ptr, fy, fx) && !subject_ptr->blind) {
+            bool do_invisible = FALSE;
+            bool do_cold_blood = FALSE;
+
+            if (subject_ptr->concent >= CONCENT_RADAR_THRESHOLD) {
+                easy = flag = TRUE;
+            }
+
+            if (distance <= subject_ptr->see_infra) {
+                if ((r_ptr->flags2 & (RF2_COLD_BLOOD | RF2_AURA_FIRE)) == RF2_COLD_BLOOD) {
+                    do_cold_blood = TRUE;
+                } else {
+                    easy = flag = TRUE;
+                }
+            }
+
+            if (player_can_see_bold(subject_ptr, fy, fx)) {
+                if (r_ptr->flags2 & (RF2_INVISIBLE)) {
+                    do_invisible = TRUE;
+                    if (subject_ptr->see_inv) {
+                        easy = flag = TRUE;
+                    }
+                } else {
+                    easy = flag = TRUE;
+                }
+            }
+
+            if (flag) {
+                if (is_original_ap(m_ptr) && !subject_ptr->image) {
+                    if (do_invisible)
+                        r_ptr->r_flags2 |= (RF2_INVISIBLE);
+                    if (do_cold_blood)
+                        r_ptr->r_flags2 |= (RF2_COLD_BLOOD);
+                }
+            }
+        }
+    }
+
+    /* The monster is now visible */
+    if (flag) {
+        if (!m_ptr->ml) {
+            m_ptr->ml = TRUE;
+            lite_spot(subject_ptr, fy, fx);
+
+            if (subject_ptr->health_who == m_idx)
+                subject_ptr->redraw |= (PR_HEALTH);
+            if (subject_ptr->riding == m_idx)
+                subject_ptr->redraw |= (PR_UHEALTH);
+
+            if (!subject_ptr->image) {
+                if ((m_ptr->ap_r_idx == MON_KAGE) && (r_info[MON_KAGE].r_sights < MAX_SHORT))
+                    r_info[MON_KAGE].r_sights++;
+                else if (is_original_ap(m_ptr) && (r_ptr->r_sights < MAX_SHORT))
+                    r_ptr->r_sights++;
+            }
+
+            if (r_info[m_ptr->ap_r_idx].flags2 & RF2_ELDRITCH_HORROR) {
+                sanity_blast(subject_ptr, m_ptr, FALSE);
+            }
+
+            if (disturb_near
+                && (projectable(subject_ptr, m_ptr->fy, m_ptr->fx, subject_ptr->y, subject_ptr->x)
+                    && projectable(subject_ptr, subject_ptr->y, subject_ptr->x, m_ptr->fy, m_ptr->fx))) {
+                if (disturb_pets || is_hostile(m_ptr))
+                    disturb(subject_ptr, TRUE, TRUE);
+            }
+        }
+    }
+
+    /* The monster is not visible */
+    else {
+        if (m_ptr->ml) {
+            m_ptr->ml = FALSE;
+            lite_spot(subject_ptr, fy, fx);
+
+            if (subject_ptr->health_who == m_idx)
+                subject_ptr->redraw |= (PR_HEALTH);
+            if (subject_ptr->riding == m_idx)
+                subject_ptr->redraw |= (PR_UHEALTH);
+            if (do_disturb) {
+                if (disturb_pets || is_hostile(m_ptr))
+                    disturb(subject_ptr, TRUE, TRUE);
+            }
+        }
+    }
+
+    /* The monster is now easily visible */
+    if (easy) {
+        if (!(m_ptr->mflag & (MFLAG_VIEW))) {
+            m_ptr->mflag |= (MFLAG_VIEW);
+            if (do_disturb) {
+                if (disturb_pets || is_hostile(m_ptr))
+                    disturb(subject_ptr, TRUE, TRUE);
+            }
+        }
+
+        return;
+    }
+
+    /* The monster is not easily visible */
+    /* Change */
+    if (!(m_ptr->mflag & (MFLAG_VIEW)))
+        return;
+
+    /* Mark as not easily visible */
+    m_ptr->mflag &= ~(MFLAG_VIEW);
+
+    if (do_disturb) {
+        if (disturb_pets || is_hostile(m_ptr))
+            disturb(subject_ptr, TRUE, TRUE);
+    }
+}
+
+/*!
+ * @param player_ptr プレーヤーへの参照ポインタ
+ * @brief 単純に生存している全モンスターの更新処理を行う / This function simply updates all the (non-dead) monsters (see above).
+ * @param full 距離更新を行うならtrue
+ * @return なし
+ */
+void update_monsters(player_type *player_ptr, bool full)
+{
+    floor_type *floor_ptr = player_ptr->current_floor_ptr;
+    for (MONSTER_IDX i = 1; i < floor_ptr->m_max; i++) {
+        monster_type *m_ptr = &floor_ptr->m_list[i];
+        if (!monster_is_valid(m_ptr))
+            continue;
+        update_monster(player_ptr, i, full);
+    }
+}
index ca5878b..07482e8 100644 (file)
@@ -8,3 +8,5 @@ bool update_riding_monster(player_type *target_ptr, turn_flags *turn_flags_ptr,
 void update_player_type(player_type *target_ptr, turn_flags *turn_flags_ptr, monster_race *r_ptr);
 void update_monster_race_flags(player_type *target_ptr, turn_flags *turn_flags_ptr, monster_type *m_ptr);
 void update_player_window(player_type *target_ptr, old_race_flags *old_race_flags_ptr);
+void update_monster(player_type *subject_ptr, MONSTER_IDX m_idx, bool full);
+void update_monsters(player_type *player_ptr, bool full);
index 1da2eb7..736f9bd 100644 (file)
@@ -33,6 +33,7 @@
 #include "monster/monster-flag-types.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status.h"
+#include "monster/monster-update.h"
 #include "monster/monster-util.h"
 #include "monster/place-monster-types.h"
 #include "monster/smart-learn-types.h"
@@ -920,289 +921,6 @@ void monster_name(player_type *player_ptr, MONSTER_IDX m_idx, char *m_name)
 }
 
 /*!
- * @brief モンスターの各情報を更新する / This function updates the monster record of the given monster
- * @param m_idx 更新するモンスター情報のID
- * @param full プレイヤーとの距離更新を行うならばtrue
- * @return なし
- */
-void update_monster(player_type *subject_ptr, MONSTER_IDX m_idx, bool full)
-{
-    monster_type *m_ptr = &subject_ptr->current_floor_ptr->m_list[m_idx];
-    monster_race *r_ptr = &r_info[m_ptr->r_idx];
-
-    bool do_disturb = disturb_move;
-
-    POSITION fy = m_ptr->fy;
-    POSITION fx = m_ptr->fx;
-
-    bool flag = FALSE;
-    bool easy = FALSE;
-    bool in_darkness = (d_info[subject_ptr->dungeon_idx].flags1 & DF1_DARKNESS) && !subject_ptr->see_nocto;
-    if (disturb_high) {
-        monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx];
-        if (ap_r_ptr->r_tkills && ap_r_ptr->level >= subject_ptr->lev)
-            do_disturb = TRUE;
-    }
-
-    POSITION distance;
-    if (full) {
-        int dy = (subject_ptr->y > fy) ? (subject_ptr->y - fy) : (fy - subject_ptr->y);
-        int dx = (subject_ptr->x > fx) ? (subject_ptr->x - fx) : (fx - subject_ptr->x);
-
-        distance = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
-        if (distance > 255)
-            distance = 255;
-        if (!distance)
-            distance = 1;
-
-        m_ptr->cdis = distance;
-    } else {
-        distance = m_ptr->cdis;
-    }
-
-    if (m_ptr->mflag2 & (MFLAG2_MARK))
-        flag = TRUE;
-
-    if (distance <= (in_darkness ? MAX_SIGHT / 2 : MAX_SIGHT)) {
-        if (!in_darkness || (distance <= MAX_SIGHT / 4)) {
-            if (subject_ptr->special_defense & KATA_MUSOU) {
-                flag = TRUE;
-                if (is_original_ap(m_ptr) && !subject_ptr->image) {
-                    if (r_ptr->flags2 & (RF2_SMART))
-                        r_ptr->r_flags2 |= (RF2_SMART);
-                    if (r_ptr->flags2 & (RF2_STUPID))
-                        r_ptr->r_flags2 |= (RF2_STUPID);
-                }
-            } else if (subject_ptr->telepathy) {
-                if (r_ptr->flags2 & (RF2_EMPTY_MIND)) {
-                    if (is_original_ap(m_ptr) && !subject_ptr->image)
-                        r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
-                } else if (r_ptr->flags2 & (RF2_WEIRD_MIND)) {
-                    if ((m_idx % 10) == 5) {
-                        flag = TRUE;
-                        if (is_original_ap(m_ptr) && !subject_ptr->image) {
-                            r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
-                            if (r_ptr->flags2 & (RF2_SMART))
-                                r_ptr->r_flags2 |= (RF2_SMART);
-                            if (r_ptr->flags2 & (RF2_STUPID))
-                                r_ptr->r_flags2 |= (RF2_STUPID);
-                        }
-                    }
-                } else {
-                    flag = TRUE;
-                    if (is_original_ap(m_ptr) && !subject_ptr->image) {
-                        if (r_ptr->flags2 & (RF2_SMART))
-                            r_ptr->r_flags2 |= (RF2_SMART);
-                        if (r_ptr->flags2 & (RF2_STUPID))
-                            r_ptr->r_flags2 |= (RF2_STUPID);
-                    }
-                }
-            }
-
-            if ((subject_ptr->esp_animal) && (r_ptr->flags3 & (RF3_ANIMAL))) {
-                flag = TRUE;
-                if (is_original_ap(m_ptr) && !subject_ptr->image)
-                    r_ptr->r_flags3 |= (RF3_ANIMAL);
-            }
-
-            if ((subject_ptr->esp_undead) && (r_ptr->flags3 & (RF3_UNDEAD))) {
-                flag = TRUE;
-                if (is_original_ap(m_ptr) && !subject_ptr->image)
-                    r_ptr->r_flags3 |= (RF3_UNDEAD);
-            }
-
-            if ((subject_ptr->esp_demon) && (r_ptr->flags3 & (RF3_DEMON))) {
-                flag = TRUE;
-                if (is_original_ap(m_ptr) && !subject_ptr->image)
-                    r_ptr->r_flags3 |= (RF3_DEMON);
-            }
-
-            if ((subject_ptr->esp_orc) && (r_ptr->flags3 & (RF3_ORC))) {
-                flag = TRUE;
-                if (is_original_ap(m_ptr) && !subject_ptr->image)
-                    r_ptr->r_flags3 |= (RF3_ORC);
-            }
-
-            if ((subject_ptr->esp_troll) && (r_ptr->flags3 & (RF3_TROLL))) {
-                flag = TRUE;
-                if (is_original_ap(m_ptr) && !subject_ptr->image)
-                    r_ptr->r_flags3 |= (RF3_TROLL);
-            }
-
-            if ((subject_ptr->esp_giant) && (r_ptr->flags3 & (RF3_GIANT))) {
-                flag = TRUE;
-                if (is_original_ap(m_ptr) && !subject_ptr->image)
-                    r_ptr->r_flags3 |= (RF3_GIANT);
-            }
-
-            if ((subject_ptr->esp_dragon) && (r_ptr->flags3 & (RF3_DRAGON))) {
-                flag = TRUE;
-                if (is_original_ap(m_ptr) && !subject_ptr->image)
-                    r_ptr->r_flags3 |= (RF3_DRAGON);
-            }
-
-            if ((subject_ptr->esp_human) && (r_ptr->flags2 & (RF2_HUMAN))) {
-                flag = TRUE;
-                if (is_original_ap(m_ptr) && !subject_ptr->image)
-                    r_ptr->r_flags2 |= (RF2_HUMAN);
-            }
-
-            if ((subject_ptr->esp_evil) && (r_ptr->flags3 & (RF3_EVIL))) {
-                flag = TRUE;
-                if (is_original_ap(m_ptr) && !subject_ptr->image)
-                    r_ptr->r_flags3 |= (RF3_EVIL);
-            }
-
-            if ((subject_ptr->esp_good) && (r_ptr->flags3 & (RF3_GOOD))) {
-                flag = TRUE;
-                if (is_original_ap(m_ptr) && !subject_ptr->image)
-                    r_ptr->r_flags3 |= (RF3_GOOD);
-            }
-
-            if ((subject_ptr->esp_nonliving) && ((r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) == RF3_NONLIVING)) {
-                flag = TRUE;
-                if (is_original_ap(m_ptr) && !subject_ptr->image)
-                    r_ptr->r_flags3 |= (RF3_NONLIVING);
-            }
-
-            if ((subject_ptr->esp_unique) && (r_ptr->flags1 & (RF1_UNIQUE))) {
-                flag = TRUE;
-                if (is_original_ap(m_ptr) && !subject_ptr->image)
-                    r_ptr->r_flags1 |= (RF1_UNIQUE);
-            }
-        }
-
-        if (player_has_los_bold(subject_ptr, fy, fx) && !subject_ptr->blind) {
-            bool do_invisible = FALSE;
-            bool do_cold_blood = FALSE;
-
-            if (subject_ptr->concent >= CONCENT_RADAR_THRESHOLD) {
-                easy = flag = TRUE;
-            }
-
-            if (distance <= subject_ptr->see_infra) {
-                if ((r_ptr->flags2 & (RF2_COLD_BLOOD | RF2_AURA_FIRE)) == RF2_COLD_BLOOD) {
-                    do_cold_blood = TRUE;
-                } else {
-                    easy = flag = TRUE;
-                }
-            }
-
-            if (player_can_see_bold(subject_ptr, fy, fx)) {
-                if (r_ptr->flags2 & (RF2_INVISIBLE)) {
-                    do_invisible = TRUE;
-                    if (subject_ptr->see_inv) {
-                        easy = flag = TRUE;
-                    }
-                } else {
-                    easy = flag = TRUE;
-                }
-            }
-
-            if (flag) {
-                if (is_original_ap(m_ptr) && !subject_ptr->image) {
-                    if (do_invisible)
-                        r_ptr->r_flags2 |= (RF2_INVISIBLE);
-                    if (do_cold_blood)
-                        r_ptr->r_flags2 |= (RF2_COLD_BLOOD);
-                }
-            }
-        }
-    }
-
-    /* The monster is now visible */
-    if (flag) {
-        if (!m_ptr->ml) {
-            m_ptr->ml = TRUE;
-            lite_spot(subject_ptr, fy, fx);
-
-            if (subject_ptr->health_who == m_idx)
-                subject_ptr->redraw |= (PR_HEALTH);
-            if (subject_ptr->riding == m_idx)
-                subject_ptr->redraw |= (PR_UHEALTH);
-
-            if (!subject_ptr->image) {
-                if ((m_ptr->ap_r_idx == MON_KAGE) && (r_info[MON_KAGE].r_sights < MAX_SHORT))
-                    r_info[MON_KAGE].r_sights++;
-                else if (is_original_ap(m_ptr) && (r_ptr->r_sights < MAX_SHORT))
-                    r_ptr->r_sights++;
-            }
-
-            if (r_info[m_ptr->ap_r_idx].flags2 & RF2_ELDRITCH_HORROR) {
-                sanity_blast(subject_ptr, m_ptr, FALSE);
-            }
-
-            if (disturb_near
-                && (projectable(subject_ptr, m_ptr->fy, m_ptr->fx, subject_ptr->y, subject_ptr->x)
-                    && projectable(subject_ptr, subject_ptr->y, subject_ptr->x, m_ptr->fy, m_ptr->fx))) {
-                if (disturb_pets || is_hostile(m_ptr))
-                    disturb(subject_ptr, TRUE, TRUE);
-            }
-        }
-    }
-
-    /* The monster is not visible */
-    else {
-        if (m_ptr->ml) {
-            m_ptr->ml = FALSE;
-            lite_spot(subject_ptr, fy, fx);
-
-            if (subject_ptr->health_who == m_idx)
-                subject_ptr->redraw |= (PR_HEALTH);
-            if (subject_ptr->riding == m_idx)
-                subject_ptr->redraw |= (PR_UHEALTH);
-            if (do_disturb) {
-                if (disturb_pets || is_hostile(m_ptr))
-                    disturb(subject_ptr, TRUE, TRUE);
-            }
-        }
-    }
-
-    /* The monster is now easily visible */
-    if (easy) {
-        if (!(m_ptr->mflag & (MFLAG_VIEW))) {
-            m_ptr->mflag |= (MFLAG_VIEW);
-            if (do_disturb) {
-                if (disturb_pets || is_hostile(m_ptr))
-                    disturb(subject_ptr, TRUE, TRUE);
-            }
-        }
-
-        return;
-    }
-
-    /* The monster is not easily visible */
-    /* Change */
-    if (!(m_ptr->mflag & (MFLAG_VIEW)))
-        return;
-
-    /* Mark as not easily visible */
-    m_ptr->mflag &= ~(MFLAG_VIEW);
-
-    if (do_disturb) {
-        if (disturb_pets || is_hostile(m_ptr))
-            disturb(subject_ptr, TRUE, TRUE);
-    }
-}
-
-/*!
- * @param player_ptr プレーヤーへの参照ポインタ
- * @brief 単純に生存している全モンスターの更新処理を行う / This function simply updates all the (non-dead) monsters (see above).
- * @param full 距離更新を行うならtrue
- * @return なし
- */
-void update_monsters(player_type *player_ptr, bool full)
-{
-    floor_type *floor_ptr = player_ptr->current_floor_ptr;
-    for (MONSTER_IDX i = 1; i < floor_ptr->m_max; i++) {
-        monster_type *m_ptr = &floor_ptr->m_list[i];
-        if (!monster_is_valid(m_ptr))
-            continue;
-        update_monster(player_ptr, i, full);
-    }
-}
-
-/*!
  * todo ここにplayer_typeを追加すると関数ポインタ周りの収拾がつかなくなるので保留
  * @param player_ptr プレーヤーへの参照ポインタ
  * @brief カメレオンの王の変身対象となるモンスターかどうか判定する / Hack -- the index of the summoning monster
index 5090fd2..92b0f1d 100644 (file)
@@ -14,8 +14,6 @@ MONSTER_IDX m_pop(player_type *player_ptr);
 
 #define GMN_ARENA 0x00000001 //!< 賭け闘技場向け生成
 MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH level, BIT_FLAGS option);
-void update_monster(player_type *subject_ptr, MONSTER_IDX m_idx, bool full);
-void update_monsters(player_type *player_ptr, bool full);
 bool multiply_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode);
 bool summon_specific(player_type *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int type, BIT_FLAGS mode);
 bool summon_named_creature(player_type *player_ptr, MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode);
index b003aee..9dde572 100644 (file)
 #include "monster-race/race-flags2.h"
 #include "monster-race/race-flags7.h"
 #include "monster-race/race-flags8.h"
-#include "monster/monster-status.h"
 #include "monster/monster-info.h"
+#include "monster/monster-status.h"
+#include "monster/monster-update.h"
 #include "monster/monster2.h"
 #include "mspell/monster-spell.h"
 #include "object-enchant/special-object-flags.h"
index 7b946d3..5df0f24 100644 (file)
@@ -29,6 +29,7 @@
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
 #include "monster/monster-status.h"
+#include "monster/monster-update.h"
 #include "monster/monster2.h"
 #include "monster/smart-learn-types.h"
 #include "mutation/mutation.h"
index b8b5e14..ed775c5 100644 (file)
@@ -15,6 +15,7 @@
 #include "monster-race/race-flags7.h"
 #include "monster-race/monster-race-hook.h"
 #include "monster/monster-info.h"
+#include "monster/monster-update.h"
 #include "monster/monster2.h"
 #include "object-enchant/tr-types.h"
 #include "object/object-flags.h"
index df37c27..52b5cb6 100644 (file)
@@ -9,6 +9,7 @@
 #include "monster-race/race-flags2.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-status.h"
+#include "monster/monster-update.h"
 #include "monster/monster2.h"
 #include "monster/smart-learn-types.h"
 #include "player/player-damage.h"
index 8181e33..670c87d 100644 (file)
@@ -9,6 +9,7 @@
 #include "monster-race/monster-race-hook.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-status.h"
+#include "monster/monster-update.h"
 #include "monster/monster2.h"
 #include "object/object-hook.h"
 #include "object/object-mark-types.h"
index b2a1b37..b4b156b 100644 (file)
@@ -5,6 +5,7 @@
 #include "grid/grid.h"
 #include "monster-race/race-flags2.h"
 #include "monster/monster-status.h"
+#include "monster/monster-update.h"
 #include "monster/monster2.h"
 #include "player/player-effects.h"
 #include "spell/process-effect.h"
index a359f39..a7e40aa 100644 (file)
@@ -21,6 +21,7 @@
 #include "monster-race/race-flags7.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-status.h"
+#include "monster/monster-update.h"
 #include "monster/monster-info.h"
 #include "monster/monster2.h"
 #include "monster/smart-learn-types.h"
index e61301d..cb8b0d6 100644 (file)
@@ -41,6 +41,7 @@
 #include "monster/monster-flag-types.h"
 #include "monster/monster-processor.h"
 #include "monster/monster-status.h"
+#include "monster/monster-update.h"
 #include "monster/monster-util.h"
 #include "monster/monster2.h"
 #include "monster/place-monster-types.h"
index a4c1378..65f488f 100644 (file)
@@ -33,6 +33,7 @@
 #include "monster-race/race-flags2.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-status.h"
+#include "monster/monster-update.h"
 #include "monster/monster2.h"
 #include "monster/smart-learn-types.h"
 #include "object/object-flavor.h"