OSDN Git Service

幻覚に関するバグ修正.
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 19 Jul 2004 03:09:54 +0000 (03:09 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 19 Jul 2004 03:09:54 +0000 (03:09 +0000)
* 幻覚時にモンスターを攻撃すると, 攻撃したモンスターが思い出ウィンド
  ウに表示されるバグを修正.
* 幻覚になった/幻覚が切れた時にモンスターのヘルスバーが更新されないバ
  グを修正.
* 幻覚時には非ユニークモンスターの見た目の殺害数を増やさず, 実際の殺
  害数のみ増やすように修正.
* 幻覚時でもモンスターフラグなどが記憶されていたバグを修正.

src/cmd1.c
src/cmd2.c
src/defines.h
src/effects.c
src/melee2.c
src/mind.c
src/monster2.c
src/spells1.c
src/xtra2.c

index f16b037..6e4e287 100644 (file)
@@ -3079,7 +3079,7 @@ bool py_attack(int y, int x, int mode)
        if (m_ptr->ml)
        {
                /* Auto-Recall if possible and visible */
-               monster_race_track(m_ptr->ap_r_idx);
+               if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
 
                /* Track a new monster */
                health_track(c_ptr->m_idx);
@@ -3893,7 +3893,7 @@ void move_player(int dir, bool do_pickup, bool break_trap)
                        if (m_ptr->ml)
                        {
                                /* Auto-Recall if possible and visible */
-                               monster_race_track(m_ptr->ap_r_idx);
+                               if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
 
                                /* Track a new monster */
                                health_track(c_ptr->m_idx);
index 22b027c..c04707d 100644 (file)
@@ -3625,12 +3625,14 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
                                        msg_format("The %s hits %s.", o_name, m_name);
 #endif
 
+                                       if (m_ptr->ml)
+                                       {
+                                               /* Hack -- Track this monster race */
+                                               if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
 
-                                       /* Hack -- Track this monster race */
-                                       if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
-
-                                       /* Hack -- Track this monster */
-                                       if (m_ptr->ml) health_track(c_ptr->m_idx);
+                                               /* Hack -- Track this monster */
+                                               health_track(c_ptr->m_idx);
+                                       }
                                }
 
                                /* Apply special damage XXX XXX XXX */
@@ -4180,12 +4182,14 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken)
                                        msg_format("The %s hits %s.", o_name, m_name);
 #endif
 
+                                       if (m_ptr->ml)
+                                       {
+                                               /* Hack -- Track this monster race */
+                                               if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
 
-                                       /* Hack -- Track this monster race */
-                                       if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
-
-                                       /* Hack -- Track this monster */
-                                       if (m_ptr->ml) health_track(c_ptr->m_idx);
+                                               /* Hack -- Track this monster */
+                                               health_track(c_ptr->m_idx);
+                                       }
                                }
 
                                /* Hack -- Base damage from thrown object */
index f6f2b88..53bb2ff 100644 (file)
         (bool)(((A)->ap_r_idx == (A)->r_idx) ? TRUE : FALSE)
 
 #define is_original_ap_and_seen(A) \
-        (bool)((A)->ml && ((A)->ap_r_idx == (A)->r_idx))
+        (bool)((A)->ml && !p_ptr->image && ((A)->ap_r_idx == (A)->r_idx))
 
 /*
  * Is the monster seen by the player?
index 599091a..42800f4 100644 (file)
@@ -858,6 +858,9 @@ msg_print("
        /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
+       /* Update the health bar */
+       p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH);
+
        /* Update monsters */
        p_ptr->update |= (PU_MONSTERS);
 
index 222f416..79e6ba5 100644 (file)
@@ -2460,13 +2460,10 @@ static void process_monster(int m_idx)
 #endif
                }
 
-               if (m_ptr->ml)
+               /* Hack -- Count the wakings */
+               if (is_original_ap_and_seen(m_ptr) && (r_ptr->r_wake < MAX_UCHAR))
                {
-                       /* Hack -- Count the wakings */
-                       if ((r_ptr->r_wake < MAX_UCHAR) && is_original_ap(m_ptr))
-                       {
-                               r_ptr->r_wake++;
-                       }
+                       r_ptr->r_wake++;
                }
        }
 
index 9783e00..062fb58 100644 (file)
@@ -1719,7 +1719,7 @@ msg_print("
                if (m_ptr->ml)
                {
                        /* Auto-Recall if possible and visible */
-                       monster_race_track(m_ptr->ap_r_idx);
+                       if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
 
                        /* Track a new monster */
                        health_track(m_idx);
index f33e84d..25f8543 100644 (file)
@@ -2371,7 +2371,7 @@ void update_mon(int m_idx, bool full)
                                /* Detectable */
                                flag = TRUE;
 
-                               if (is_original_ap(m_ptr))
+                               if (is_original_ap(m_ptr) && !p_ptr->image)
                                {
                                        /* Hack -- Memorize mental flags */
                                        if (r_ptr->flags2 & (RF2_SMART)) r_ptr->r_flags2 |= (RF2_SMART);
@@ -2386,7 +2386,7 @@ void update_mon(int m_idx, bool full)
                                if (r_ptr->flags2 & (RF2_EMPTY_MIND))
                                {
                                        /* Memorize flags */
-                                       if (is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
+                                       if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
                                }
 
                                /* Weird mind, occasional telepathy */
@@ -2398,7 +2398,7 @@ void update_mon(int m_idx, bool full)
                                                /* Detectable */
                                                flag = TRUE;
 
-                                               if (is_original_ap(m_ptr))
+                                               if (is_original_ap(m_ptr) && !p_ptr->image)
                                                {
                                                        /* Memorize flags */
                                                        r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
@@ -2416,7 +2416,7 @@ void update_mon(int m_idx, bool full)
                                        /* Detectable */
                                        flag = TRUE;
 
-                                       if (is_original_ap(m_ptr))
+                                       if (is_original_ap(m_ptr) && !p_ptr->image)
                                        {
                                                /* Hack -- Memorize mental flags */
                                                if (r_ptr->flags2 & (RF2_SMART)) r_ptr->r_flags2 |= (RF2_SMART);
@@ -2429,70 +2429,70 @@ void update_mon(int m_idx, bool full)
                        if ((p_ptr->esp_animal) && (r_ptr->flags3 & (RF3_ANIMAL)))
                        {
                                flag = TRUE;
-                               if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_ANIMAL);
+                               if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_ANIMAL);
                        }
 
                        /* Magical sensing */
                        if ((p_ptr->esp_undead) && (r_ptr->flags3 & (RF3_UNDEAD)))
                        {
                                flag = TRUE;
-                               if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
+                               if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_UNDEAD);
                        }
 
                        /* Magical sensing */
                        if ((p_ptr->esp_demon) && (r_ptr->flags3 & (RF3_DEMON)))
                        {
                                flag = TRUE;
-                               if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
+                               if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_DEMON);
                        }
 
                        /* Magical sensing */
                        if ((p_ptr->esp_orc) && (r_ptr->flags3 & (RF3_ORC)))
                        {
                                flag = TRUE;
-                               if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_ORC);
+                               if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_ORC);
                        }
 
                        /* Magical sensing */
                        if ((p_ptr->esp_troll) && (r_ptr->flags3 & (RF3_TROLL)))
                        {
                                flag = TRUE;
-                               if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_TROLL);
+                               if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_TROLL);
                        }
 
                        /* Magical sensing */
                        if ((p_ptr->esp_giant) && (r_ptr->flags3 & (RF3_GIANT)))
                        {
                                flag = TRUE;
-                               if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GIANT);
+                               if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_GIANT);
                        }
 
                        /* Magical sensing */
                        if ((p_ptr->esp_dragon) && (r_ptr->flags3 & (RF3_DRAGON)))
                        {
                                flag = TRUE;
-                               if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_DRAGON);
+                               if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_DRAGON);
                        }
 
                        /* Magical sensing */
                        if ((p_ptr->esp_human) && (r_ptr->flags2 & (RF2_HUMAN)))
                        {
                                flag = TRUE;
-                               if (is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_HUMAN);
+                               if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags2 |= (RF2_HUMAN);
                        }
 
                        /* Magical sensing */
                        if ((p_ptr->esp_evil) && (r_ptr->flags3 & (RF3_EVIL)))
                        {
                                flag = TRUE;
-                               if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
+                               if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_EVIL);
                        }
 
                        /* Magical sensing */
                        if ((p_ptr->esp_good) && (r_ptr->flags3 & (RF3_GOOD)))
                        {
                                flag = TRUE;
-                               if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
+                               if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_GOOD);
                        }
 
                        /* Magical sensing */
@@ -2500,14 +2500,14 @@ void update_mon(int m_idx, bool full)
                            ((r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) == RF3_NONLIVING))
                        {
                                flag = TRUE;
-                               if (is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NONLIVING);
+                               if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags3 |= (RF3_NONLIVING);
                        }
 
                        /* Magical sensing */
                        if ((p_ptr->esp_unique) && (r_ptr->flags1 & (RF1_UNIQUE)))
                        {
                                flag = TRUE;
-                               if (is_original_ap(m_ptr)) r_ptr->r_flags1 |= (RF1_UNIQUE);
+                               if (is_original_ap(m_ptr) && !p_ptr->image) r_ptr->r_flags1 |= (RF1_UNIQUE);
                        }
                }
 
@@ -2563,7 +2563,7 @@ void update_mon(int m_idx, bool full)
                        /* Visible */
                        if (flag)
                        {
-                               if (is_original_ap(m_ptr))
+                               if (is_original_ap(m_ptr) && !p_ptr->image)
                                {
                                        /* Memorize flags */
                                        if (do_invisible) r_ptr->r_flags2 |= (RF2_INVISIBLE);
@@ -2591,10 +2591,13 @@ void update_mon(int m_idx, bool full)
                        if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
 
                        /* Hack -- Count "fresh" sightings */
-                       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 (!p_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++;
+                       }
 
                        /* Eldritch Horror */
                        if (r_info[m_ptr->ap_r_idx].flags2 & RF2_ELDRITCH_HORROR)
index be167d0..4c716a9 100644 (file)
@@ -8461,11 +8461,14 @@ bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int mons
                                          if(cave[project_m_y][project_m_x].m_idx >0 ){
                                            monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
 
-                                           /* Hack -- auto-recall */
-                                           if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
-
-                                           /* Hack - auto-track */
-                                           if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
+                                           if (m_ptr->ml)
+                                           {
+                                             /* Hack -- auto-recall */
+                                             if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
+
+                                             /* Hack - auto-track */
+                                             health_track(cave[project_m_y][project_m_x].m_idx);
+                                           }
                                          }
                                        }
                                        (void)project_f(0,0,y,x,dam,GF_SEEKER);
@@ -8483,12 +8486,15 @@ bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int mons
                        if(!who && (project_m_n==1) && !jump ){
                          if(cave[project_m_y][project_m_x].m_idx >0 ){
                            monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
-                           
-                           /* Hack -- auto-recall */
-                           if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
-                           
-                           /* Hack - auto-track */
-                           if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
+
+                           if (m_ptr->ml)
+                           {
+                             /* Hack -- auto-recall */
+                             if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
+
+                             /* Hack - auto-track */
+                             health_track(cave[project_m_y][project_m_x].m_idx);
+                           }
                          }
                        }
                        (void)project_f(0,0,y,x,dam,GF_SEEKER);
@@ -8612,12 +8618,15 @@ bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int mons
                        if(!who && (project_m_n==1) && !jump ){
                          if(cave[project_m_y][project_m_x].m_idx >0 ){
                            monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
-                           
-                           /* Hack -- auto-recall */
-                           if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
-                           
-                           /* Hack - auto-track */
-                           if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
+
+                           if (m_ptr->ml)
+                           {
+                             /* Hack -- auto-recall */
+                             if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
+
+                             /* Hack - auto-track */
+                             health_track(cave[project_m_y][project_m_x].m_idx);
+                           }
                          }
                        }
                        (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
@@ -9143,11 +9152,14 @@ bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int mons
                        {
                                monster_type *m_ptr = &m_list[cave[y][x].m_idx];
 
-                               /* Hack -- auto-recall */
-                               if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
+                               if (m_ptr->ml)
+                               {
+                                       /* Hack -- auto-recall */
+                                       if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
 
-                               /* Hack - auto-track */
-                               if (m_ptr->ml) health_track(cave[y][x].m_idx);
+                                       /* Hack - auto-track */
+                                       if (m_ptr->ml) health_track(cave[y][x].m_idx);
+                               }
                        }
                }
        }
index b94386e..c613019 100644 (file)
@@ -698,7 +698,7 @@ void monster_death(int m_idx, bool drop_item)
 
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
-       bool visible = (m_ptr->ml || (r_ptr->flags1 & RF1_UNIQUE));
+       bool visible = ((m_ptr->ml && !p_ptr->image) || (r_ptr->flags1 & RF1_UNIQUE));
 
        u32b mo_mode = 0L;
 
@@ -1803,7 +1803,7 @@ bool mon_take_hit(int m_idx, int dam, bool *fear, cptr note)
                if (r_ptr->r_akills < MAX_SHORT) r_ptr->r_akills++;
 
                /* Recall even invisible uniques or winners */
-               if (m_ptr->ml || (r_ptr->flags1 & RF1_UNIQUE))
+               if ((m_ptr->ml && !p_ptr->image) || (r_ptr->flags1 & RF1_UNIQUE))
                {
                        /* Count kills this life */
                        if ((m_ptr->mflag2 & MFLAG2_KAGE) && (r_info[MON_KAGE].r_pkills < MAX_SHORT)) r_info[MON_KAGE].r_pkills++;