From 30785e44d2f2a1fdd4beaa0a9254fa0a3aa1d915 Mon Sep 17 00:00:00 2001 From: Erik Lunna Date: Mon, 25 Sep 2023 00:22:36 +0200 Subject: [PATCH] Wielding banes will only anger monsters in view; shopkeepers will ban you. Before wielding a bane would render all the hated monsters on the level hostile no matter their location. We also use setmangry, which gives the player an indication something has happened. It will also ding their alignment for angering peacefuls. Shopkeepers will not become angry, but will ban you for life if your bane matches their race. This is similar to how convicts are banned and uses the same shopkeeper flag. An interesting note is that this fits perfectly with existing store hawker code, so instead of inviting you in, they openly show their contempt for you. --- src/allmain.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/allmain.c b/src/allmain.c index 4259915c3..26e8ffade 100644 --- a/src/allmain.c +++ b/src/allmain.c @@ -666,6 +666,9 @@ boolean resuming; monsters that they are against hostile should they be tame or peaceful */ for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { + if (!(mtmp->mcansee && m_canseeu(mtmp))) + continue; + if ((wielding_artifact(ART_DRAGONBANE) && is_dragon(mtmp->data)) || (wielding_artifact(ART_DEATHSWORD) @@ -699,8 +702,16 @@ boolean resuming; && is_angel(mtmp->data)) || (wielding_artifact(ART_VORPAL_BLADE) && is_jabberwock(mtmp->data))) { - if (mtmp->mpeaceful || mtmp->mtame) + + 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) + ESHK(mtmp)->pbanned = TRUE; + else if (mtmp->mpeaceful || mtmp->mtame) { mtmp->mpeaceful = mtmp->mtame = 0; + setmangry(mtmp, FALSE); + } } } }