From: nothere Date: Sun, 21 Dec 2003 10:04:30 +0000 (+0000) Subject: モンスター情報の記憶に関する修正と変更. X-Git-Tag: v2.1.2~705 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=3e4a9c61fb6e12d59f5012927c9c5ff8b0587af3;p=hengband%2Fhengband.git モンスター情報の記憶に関する修正と変更. * モンスターの外見が違う場合でも打撃や起きた回数などが記憶されていた バグを修正. * モンスターがテレポートで消えた場合にテレポートが思い出に残らなかっ たことがあるバグを修正. is_original_ap_and_seen()を使った時のエンバ グだった. --- diff --git a/src/dungeon.c b/src/dungeon.c index ffe49d53f..cce3787bb 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -1261,13 +1261,10 @@ static void process_monsters_counters(void) m_ptr->csleep -= d; /* Notice the "not waking up" */ - if (m_ptr->ml) + if (is_original_ap_and_seen(m_ptr)) { /* Hack -- Count the ignores */ - if (r_ptr->r_ignore < MAX_UCHAR) - { - r_ptr->r_ignore++; - } + if (r_ptr->r_ignore < MAX_UCHAR) r_ptr->r_ignore++; } } @@ -1302,7 +1299,7 @@ static void process_monsters_counters(void) if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH); /* Hack -- Count the wakings */ - if (r_ptr->r_wake < MAX_UCHAR) + if ((r_ptr->r_wake < MAX_UCHAR) && is_original_ap(m_ptr)) { r_ptr->r_wake++; } diff --git a/src/melee1.c b/src/melee1.c index 79adac8ff..03d8aca4d 100644 --- a/src/melee1.c +++ b/src/melee1.c @@ -210,7 +210,6 @@ bool make_attack_normal(int m_idx) /* Scan through all four blows */ for (ap_cnt = 0; ap_cnt < 4; ap_cnt++) { - bool visible = FALSE; bool obvious = FALSE; int power = 0; @@ -245,9 +244,6 @@ bool make_attack_normal(int m_idx) if (method == RBM_SHOOT) continue; - /* Extract visibility (before blink) */ - if (m_ptr->ml) visible = TRUE; - /* Extract the attack "power" */ power = mbe_info[effect].power; @@ -2092,7 +2088,7 @@ msg_format("%s /* Analyze "visible" monsters only */ - if (visible && !do_silly_attack) + if (is_original_ap_and_seen(m_ptr) && !do_silly_attack) { /* Count "obvious" attacks (and ones that cause damage) */ if (obvious || damage || (r_ptr->r_blows[ap_cnt] > 10)) diff --git a/src/melee2.c b/src/melee2.c index 4cfc14c05..5fc71c299 100644 --- a/src/melee2.c +++ b/src/melee2.c @@ -2156,7 +2156,7 @@ msg_format("%s /* Analyze "visible" monsters only */ - if (m_ptr->ml && !do_silly_attack) + if (is_original_ap_and_seen(m_ptr) && !do_silly_attack) { /* Count "obvious" attacks (and ones that cause damage) */ if (obvious || damage || (r_ptr->r_blows[ap_cnt] > 10)) @@ -2491,13 +2491,16 @@ static void process_monster(int m_idx) #else msg_format("%^s wakes up.", m_name); #endif + } + if (m_ptr->ml) + { /* Redraw the health bar */ if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH); if (is_riding_mon) p_ptr->redraw |= (PR_UHEALTH); /* Hack -- Count the wakings */ - if (r_ptr->r_wake < MAX_UCHAR) + if ((r_ptr->r_wake < MAX_UCHAR) && is_original_ap(m_ptr)) { r_ptr->r_wake++; } diff --git a/src/mspells1.c b/src/mspells1.c index c153988c3..8709e35b9 100644 --- a/src/mspells1.c +++ b/src/mspells1.c @@ -1291,6 +1291,8 @@ bool make_attack_spell(int m_idx) bool in_no_magic_dungeon = (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && dun_level && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)); + bool can_remember; + /* Cannot cast spells when confused */ if (m_ptr->confused) { @@ -1628,6 +1630,8 @@ bool make_attack_spell(int m_idx) /* Projectable? */ direct = player_bold(y, x); + can_remember = is_original_ap_and_seen(m_ptr); + /* Cast the spell. */ switch (thrown_spell) { @@ -4555,7 +4559,7 @@ msg_print("¿ } /* Remember what the monster did to us */ - if (is_original_ap_and_seen(m_ptr)) + if (can_remember) { /* Inate spell */ if (thrown_spell < 32 * 4) diff --git a/src/mspells2.c b/src/mspells2.c index 9a7e066ad..875bf577f 100644 --- a/src/mspells2.c +++ b/src/mspells2.c @@ -300,6 +300,8 @@ bool monst_spell_monst(int m_idx) bool in_no_magic_dungeon = (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && dun_level && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)); + bool can_remember; + bool resists_tele = FALSE; /* Prepare flags for summoning */ @@ -694,6 +696,8 @@ bool monst_spell_monst(int m_idx) return (TRUE); } + can_remember = is_original_ap_and_seen(m_ptr); + switch (thrown_spell) { /* RF4_SHRIEK */ @@ -4204,7 +4208,7 @@ bool monst_spell_monst(int m_idx) } /* Remember what the monster did, if we saw it */ - if (is_original_ap_and_seen(m_ptr)) + if (can_remember) { /* Inate spell */ if (thrown_spell < 32*4)