}
/* 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;
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;
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)
}
}
- /* 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)