From 939e507345edcb5c614e977314c8a87356d2621e Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 11 Jun 2016 20:27:55 +0300 Subject: [PATCH] When attacking a peaceful monster, make other peaceful monsters react. --- src/mon.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/mon.c b/src/mon.c index 059903a7b..3094425eb 100644 --- a/src/mon.c +++ b/src/mon.c @@ -2611,6 +2611,52 @@ struct monst *mtmp; : makeplural(q_guardian->mname), got_mad == 1 ? "s" : ""); } + + /* make other peaceful monsters react */ + if (!context.mon_moving) { + struct monst *mon; + int got_mad = 0; + + for (mon = fmon; mon; mon = mon->nmon) + if (!DEADMONSTER(mon) && !mindless(mon->data) && mon->mpeaceful + && couldsee(mon->mx, mon->my) && !mon->msleeping + && mon->mcansee && m_canseeu(mon)) { + boolean exclaimed = FALSE; + + if (humanoid(mon->data) || mon->isshk || mon->ispriest) { + if (is_watch(mon->data)) { + verbalize("Halt! You're under arrest!"); + (void) angry_guards(!!Deaf); + } else { + const char *exclam[] = { + "Gasp!", "Uh-oh.", "Oh my!", "What?", "Why?" + }; + if (!rn2(5)) { + verbalize("%s", exclam[mon->m_id % SIZE(exclam)]); + exclaimed = TRUE; + } + if (!mon->isshk && !mon->ispriest && (mon->data->mlevel < rn2(10))) { + monflee(mon, rn2(50)+25, TRUE, !exclaimed); + exclaimed = TRUE; + } + if (!mon->isshk && !mon->ispriest) { + mon->mpeaceful = 0; + adjalign(-1); + if (!exclaimed) + pline("%s gets angry!", Monnam(mon)); + } + } + } else if ((mtmp->data == mon->data) && !rn2(3)) { + if (!rn2(4)) { + growl(mon); + exclaimed = TRUE; + } + if (rn2(6)) + monflee(mon, rn2(25)+15, TRUE, !exclaimed); + } + } + } + } /* wake up a monster, usually making it angry in the process */ -- 2.40.0