OSDN Git Service

プレイヤーに装備的反感がある場合に, 友好的なモンスターが目を覚まして
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 24 Jul 2003 02:16:57 +0000 (02:16 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 24 Jul 2003 02:16:57 +0000 (02:16 +0000)
すぐには敵に回らない場合があったので, 反感によって起きる処理だけは
process_monster()に戻し, 敵に回る処理とのタイミングを合わせた.

src/dungeon.c
src/melee2.c

index a75121b..b13bcbb 100644 (file)
@@ -1206,8 +1206,7 @@ static void process_monsters_counters(void)
                                }
 
                                /* Handle "sight" and "aggravation" */
-                               else if ((m_ptr->cdis <= MAX_SIGHT) &&
-                                       (player_has_los_bold(m_ptr->fy, m_ptr->fx) || (p_ptr->cursed & TRC_AGGRAVATE)))
+                               else if ((m_ptr->cdis <= MAX_SIGHT) && (player_has_los_bold(m_ptr->fy, m_ptr->fx)))
                                {
                                        /* We may wake up */
                                        test = TRUE;
@@ -1216,10 +1215,7 @@ static void process_monsters_counters(void)
 
                        if (test)
                        {
-                               u32b notice = 0;
-
-                               /* Hack -- handle non-aggravation */
-                               if (!(p_ptr->cursed & TRC_AGGRAVATE)) notice = randint0(1024);
+                               u32b notice = randint0(1024);
 
                                /* Nightmare monsters are more alert */
                                if (ironman_nightmare) notice /= 2;
@@ -1228,22 +1224,12 @@ static void process_monsters_counters(void)
                                if ((notice * notice * notice) <= noise)
                                {
                                        /* Hack -- amount of "waking" */
-                                       int d = 1;
+                                       /* Wake up faster near the player */
+                                       int d = (m_ptr->cdis < AAF_LIMIT / 2) ? (AAF_LIMIT / m_ptr->cdis) : 1;
 
-                                       /* Hack -- handle aggravation */
-                                       if (p_ptr->cursed & TRC_AGGRAVATE)
-                                       {
-                                               d = m_ptr->csleep;
-                                       }
-                                       else
-                                       {
-                                               /* Wake up faster near the player */
-                                               if (m_ptr->cdis < AAF_LIMIT / 2) d = (AAF_LIMIT / m_ptr->cdis);
-
-                                               /* Hack -- amount of "waking" is affected by speed of player */
-                                               d = (d * SPEED_TO_ENERGY(p_ptr->pspeed)) / 10;
-                                               if (d < 0) d = 1;
-                                       }
+                                       /* Hack -- amount of "waking" is affected by speed of player */
+                                       d = (d * SPEED_TO_ENERGY(p_ptr->pspeed)) / 10;
+                                       if (d < 0) d = 1;
 
                                        /* Still asleep */
                                        if (m_ptr->csleep > d)
index afadfc4..0b04b14 100644 (file)
@@ -2457,8 +2457,45 @@ msg_print("
                }
        }
 
-       /* Handle "sleep" - Still sleeping */
-       if (m_ptr->csleep) return;
+       /* Handle "sleep" */
+       if (m_ptr->csleep)
+       {
+               /* Handle non-aggravation - Still sleeping */
+               if (!(p_ptr->cursed & TRC_AGGRAVATE)) return;
+
+               /* Handle aggravation */
+
+               /* Reset sleep counter */
+               m_ptr->csleep = 0;
+
+               if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
+
+               /* Notice the "waking up" */
+               if (m_ptr->ml)
+               {
+                       char m_name[80];
+
+                       /* Acquire the monster name */
+                       monster_desc(m_name, m_ptr, 0);
+
+                       /* Dump a message */
+#ifdef JP
+                       msg_format("%^s¤¬Ìܤò³Ð¤Þ¤·¤¿¡£", m_name);
+#else
+                       msg_format("%^s wakes up.", m_name);
+#endif
+
+                       /* Redraw the health bar */
+                       if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
+                       if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
+
+                       /* Hack -- Count the wakings */
+                       if (r_ptr->r_wake < MAX_UCHAR)
+                       {
+                               r_ptr->r_wake++;
+                       }
+               }
+       }
 
        /* Handle "stun" */
        if (m_ptr->stunned)