OSDN Git Service

モンスター情報の記憶に関する修正と変更.
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 21 Dec 2003 10:04:30 +0000 (10:04 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 21 Dec 2003 10:04:30 +0000 (10:04 +0000)
* モンスターの外見が違う場合でも打撃や起きた回数などが記憶されていた
  バグを修正.
* モンスターがテレポートで消えた場合にテレポートが思い出に残らなかっ
  たことがあるバグを修正. is_original_ap_and_seen()を使った時のエンバ
  グだった.

src/dungeon.c
src/melee1.c
src/melee2.c
src/mspells1.c
src/mspells2.c

index ffe49d5..cce3787 100644 (file)
@@ -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++;
                                                        }
index 79adac8..03d8aca 100644 (file)
@@ -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))
index 4cfc14c..5fc71c2 100644 (file)
@@ -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++;
                        }
index c153988..8709e35 100644 (file)
@@ -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)
index 9a7e066..875bf57 100644 (file)
@@ -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)