From 8e20dd2c1d5569b1893e4357e2fd362464cf3a16 Mon Sep 17 00:00:00 2001 From: nothere Date: Thu, 24 Jul 2003 02:16:57 +0000 Subject: [PATCH] =?utf8?q?=E3=83=97=E3=83=AC=E3=82=A4=E3=83=A4=E3=83=BC?= =?utf8?q?=E3=81=AB=E8=A3=85=E5=82=99=E7=9A=84=E5=8F=8D=E6=84=9F=E3=81=8C?= =?utf8?q?=E3=81=82=E3=82=8B=E5=A0=B4=E5=90=88=E3=81=AB,=20=E5=8F=8B?= =?utf8?q?=E5=A5=BD=E7=9A=84=E3=81=AA=E3=83=A2=E3=83=B3=E3=82=B9=E3=82=BF?= =?utf8?q?=E3=83=BC=E3=81=8C=E7=9B=AE=E3=82=92=E8=A6=9A=E3=81=BE=E3=81=97?= =?utf8?q?=E3=81=A6=20=E3=81=99=E3=81=90=E3=81=AB=E3=81=AF=E6=95=B5?= =?utf8?q?=E3=81=AB=E5=9B=9E=E3=82=89=E3=81=AA=E3=81=84=E5=A0=B4=E5=90=88?= =?utf8?q?=E3=81=8C=E3=81=82=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7,=20?= =?utf8?q?=E5=8F=8D=E6=84=9F=E3=81=AB=E3=82=88=E3=81=A3=E3=81=A6=E8=B5=B7?= =?utf8?q?=E3=81=8D=E3=82=8B=E5=87=A6=E7=90=86=E3=81=A0=E3=81=91=E3=81=AF?= =?utf8?q?=20process=5Fmonster()=E3=81=AB=E6=88=BB=E3=81=97,=20=E6=95=B5?= =?utf8?q?=E3=81=AB=E5=9B=9E=E3=82=8B=E5=87=A6=E7=90=86=E3=81=A8=E3=81=AE?= =?utf8?q?=E3=82=BF=E3=82=A4=E3=83=9F=E3=83=B3=E3=82=B0=E3=82=92=E5=90=88?= =?utf8?q?=E3=82=8F=E3=81=9B=E3=81=9F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/dungeon.c | 28 +++++++--------------------- src/melee2.c | 41 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 23 deletions(-) diff --git a/src/dungeon.c b/src/dungeon.c index a75121b5c..b13bcbbe3 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -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) diff --git a/src/melee2.c b/src/melee2.c index afadfc49b..0b04b14d7 100644 --- a/src/melee2.c +++ b/src/melee2.c @@ -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) -- 2.11.0