From 604f33d6afb88d8db2342539ddcbe9c829f56654 Mon Sep 17 00:00:00 2001 From: dis- Date: Sun, 17 Jan 2021 21:25:22 +0900 Subject: [PATCH] =?utf8?q?[Fix]=20Weird=5FMind=E3=82=92=E3=83=86=E3=83=AC?= =?utf8?q?=E3=83=91=E3=82=B7=E3=83=BC=E3=81=A7=E8=A6=B3=E6=B8=AC=E3=81=97?= =?utf8?q?=E3=81=9F=E3=81=A8=E3=81=8D=E3=81=AElook=E3=82=B3=E3=83=9E?= =?utf8?q?=E3=83=B3=E3=83=89=E3=81=AE=E6=8C=99=E5=8B=95=E4=BF=AE=E6=AD=A3?= =?utf8?q?=20=E8=A6=B3=E6=B8=AC=E6=AF=8E=E3=81=AB=E4=B9=B1=E6=95=B0?= =?utf8?q?=E3=82=92=E6=8C=AF=E3=81=A3=E3=81=A6=E8=A1=A8=E7=A4=BA/=E9=9D=9E?= =?utf8?q?=E8=A1=A8=E7=A4=BA=E3=82=92=E6=B1=BA=E3=82=81=E3=81=A6=E3=81=84?= =?utf8?q?=E3=81=9F=E6=8C=99=E5=8B=95=E3=82=92=E5=A4=89=E6=9B=B4=E3=80=82?= =?utf8?q?=20=E3=82=B2=E3=83=BC=E3=83=A0=E3=82=BF=E3=83=BC=E3=83=B3?= =?utf8?q?=E3=81=A8m=5Fidx=E3=81=AE=E4=B8=8B=E4=BD=8D=E4=B8=80=E6=A1=81?= =?utf8?q?=E3=81=8C=E4=B8=80=E8=87=B4=E3=81=99=E3=82=8B=E3=81=A8=E3=81=8D?= =?utf8?q?=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?utf8?q?=E3=81=97=E3=81=9F=E3=80=82=20=E3=82=BF=E3=83=BC=E3=83=B3?= =?utf8?q?=E6=B6=88=E8=B2=BB=E3=81=AE=E3=81=AA=E3=81=84=E8=A1=8C=E5=8B=95?= =?utf8?q?=E3=81=A7=E8=A1=A8=E7=A4=BA/=E9=9D=9E=E8=A1=A8=E7=A4=BA=E3=82=92?= =?utf8?q?=E5=A4=89=E6=9B=B4=E3=81=97=E3=81=AA=E3=81=84=E3=81=9F=E3=82=81?= =?utf8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/core/player-processor.c | 1 + src/monster/monster-update.c | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/core/player-processor.c b/src/core/player-processor.c index 49926700e..c1be1d5f4 100644 --- a/src/core/player-processor.c +++ b/src/core/player-processor.c @@ -236,6 +236,7 @@ void process_player(player_type *creature_ptr) creature_ptr->counter = FALSE; creature_ptr->now_damaged = FALSE; + update_monsters(creature_ptr, FALSE); handle_stuff(creature_ptr); move_cursor_relative(creature_ptr->y, creature_ptr->x); if (fresh_before) diff --git a/src/monster/monster-update.c b/src/monster/monster-update.c index cceba9228..aa2474e9e 100644 --- a/src/monster/monster-update.c +++ b/src/monster/monster-update.c @@ -33,6 +33,7 @@ #include "status/element-resistance.h" #include "system/floor-type-definition.h" #include "target/projection-path-calculator.h" +#include "world/world.h" // Update Monster. typedef struct um_type { @@ -202,15 +203,16 @@ static void update_smart_stupid_flags(monster_race *r_ptr) * @brief WEIRD_MINDフラグ持ちのモンスターを1/10の確率でテレパシーに引っかける * @param subject_ptr プレーヤーへの参照ポインタ * @param um_ptr モンスター情報アップデート構造体への参照ポインタ + * @param m_idx モンスターID * @return WEIRD_MINDフラグがあるならTRUE */ -static bool update_weird_telepathy(player_type *subject_ptr, um_type *um_ptr) +static bool update_weird_telepathy(player_type *subject_ptr, um_type *um_ptr, MONSTER_IDX m_idx) { monster_race *r_ptr = &r_info[um_ptr->m_ptr->r_idx]; if ((r_ptr->flags2 & RF2_WEIRD_MIND) == 0) return FALSE; - if (!one_in_(10)) + if ((m_idx % 10) != (current_world_ptr->game_turn % 10)) return TRUE; um_ptr->flag = TRUE; @@ -222,7 +224,7 @@ static bool update_weird_telepathy(player_type *subject_ptr, um_type *um_ptr) return TRUE; } -static void update_telepathy_sight(player_type *subject_ptr, um_type *um_ptr) +static void update_telepathy_sight(player_type *subject_ptr, um_type *um_ptr, MONSTER_IDX m_idx) { monster_race *r_ptr = &r_info[um_ptr->m_ptr->r_idx]; if (subject_ptr->special_defense & KATA_MUSOU) { @@ -243,7 +245,7 @@ static void update_telepathy_sight(player_type *subject_ptr, um_type *um_ptr) return; } - if (update_weird_telepathy(subject_ptr, um_ptr)) + if (update_weird_telepathy(subject_ptr, um_ptr, m_idx)) return; um_ptr->flag = TRUE; @@ -366,7 +368,7 @@ static bool check_invisible(player_type *subject_ptr, um_type *um_ptr) * @param um_ptr モンスター情報アップデート構造体への参照ポインタ * @return なし */ -static void decide_sight_invisible_monster(player_type *subject_ptr, um_type *um_ptr) +static void decide_sight_invisible_monster(player_type *subject_ptr, um_type *um_ptr, MONSTER_IDX m_idx) { POSITION distance = decide_updated_distance(subject_ptr, um_ptr); monster_race *r_ptr = &r_info[um_ptr->m_ptr->r_idx]; @@ -374,7 +376,7 @@ static void decide_sight_invisible_monster(player_type *subject_ptr, um_type *um return; if (!um_ptr->in_darkness || (distance <= MAX_SIGHT / 4)) { - update_telepathy_sight(subject_ptr, um_ptr); + update_telepathy_sight(subject_ptr, um_ptr, m_idx); update_specific_race_telepathy(subject_ptr, um_ptr); } @@ -491,7 +493,7 @@ void update_monster(player_type *subject_ptr, MONSTER_IDX m_idx, bool full) if (um_ptr->m_ptr->mflag2 & MFLAG2_MARK) um_ptr->flag = TRUE; - decide_sight_invisible_monster(subject_ptr, um_ptr); + decide_sight_invisible_monster(subject_ptr, um_ptr, m_idx); if (um_ptr->flag) update_invisible_monster(subject_ptr, um_ptr, m_idx); else -- 2.11.0