From fd889b2538dae859cf54768a550dc389c23a10f6 Mon Sep 17 00:00:00 2001 From: Erik Lunna Date: Tue, 26 Sep 2023 07:03:54 +0200 Subject: [PATCH] Tweaks to monster behavior when wielding/wearing a bane artifact. From EvilHack commit f9a7db8a185463d8323455ae7bcb873845bf19a7. This builds on previous commit 30785e44d. In that commit I neglected to give credit to K2 for idea for shopkeepers banning the player. Credit also to hothraxxa for reporting the behavior of banes alerting all monsters on the level regardless of sight to me in the first place. --- src/allmain.c | 7 ++++++- src/priest.c | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/allmain.c b/src/allmain.c index 26e8ffade..dd2a584a7 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -666,8 +666,14 @@ boolean resuming; monsters that they are against hostile should they be tame or peaceful */ for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { + boolean is_shkp = has_eshk(mtmp) && inhishop(mtmp); + boolean is_prst = has_epri(mtmp) && inhistemple(mtmp); + if (!(mtmp->mcansee && m_canseeu(mtmp))) continue; + /* coaligned temple priests will stay civil */ + if (is_prst && p_coaligned(mtmp)) + continue; if ((wielding_artifact(ART_DRAGONBANE) && is_dragon(mtmp->data)) @@ -703,7 +709,6 @@ boolean resuming; || (wielding_artifact(ART_VORPAL_BLADE) && is_jabberwock(mtmp->data))) { - boolean is_shkp = has_eshk(mtmp) && inhishop(mtmp); /* Shopkeepers will get angry but just ban you, to * avoid cheap early Sting deaths */ if (is_shkp) diff --git a/src/priest.c b/src/priest.c index e78dc0547..7e6a07d65 100644 --- a/src/priest.c +++ b/src/priest.c @@ -615,10 +615,10 @@ register struct monst *priest; boolean strayed = (u.ualign.record < 0); /* KMH, conduct */ - if(!u.uconduct.gnostic++) + if (!u.uconduct.gnostic++) livelog_printf(LL_CONDUCT, - "rejected atheism by consulting with %s", - mon_nam(priest)); + "rejected atheism by consulting with %s", + mon_nam(priest)); if (priest->mflee || (!priest->ispriest && coaligned && strayed)) { pline("%s doesn't want anything to do with you!", Monnam(priest));