From f210367c134b25f94c3b2b4da0412753a2911b5f Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Wed, 18 Dec 2002 18:15:55 +0000 Subject: [PATCH] fix B15003 - behavior of bribe-able demons Prevent a demon who is carrying the Amulet of Yendor from being removed from the game when player meets his demand for a bribe since that was effectively destroying the Amulet. There are various ways to accomplish this; I chose to make the bribe demand be for an amount that the player cannot possibly satisfy in that case. --- doc/fixes34.1 | 1 + src/minion.c | 26 ++++++++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 3d7ac6abf..1df14f008 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -333,6 +333,7 @@ most cases of the hero dropping things need to check for dropping on an altar zapping undiggable trees with wand or spell of dig gave feedback about rock being able to see invisible shouldn't cause you to not notice when potion or spell of invisibility wears off +can't successfully bribe a demon who happens to be carrying the Amulet Platform- and/or Interface-Specific Fixes diff --git a/src/minion.c b/src/minion.c index 5d45a1391..fa33d816f 100644 --- a/src/minion.c +++ b/src/minion.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)minion.c 3.4 2002/01/23 */ +/* SCCS Id: @(#)minion.c 3.4 2002/12/16 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -142,7 +142,7 @@ int demon_talk(mtmp) /* returns 1 if it won't attack. */ register struct monst *mtmp; { - long demand, offer; + long cash, demand, offer; if (uwep && uwep->oartifact == ART_EXCALIBUR) { pline("%s looks very angry.", Amonnam(mtmp)); @@ -164,14 +164,23 @@ register struct monst *mtmp; return(1); } #ifndef GOLDOBJ - demand = (u.ugold * (rnd(80) + 20 * Athome)) / + cash = u.ugold; #else - demand = (money_cnt(invent) * (rnd(80) + 20 * Athome)) / + cash = money_cnt(invent); #endif + demand = (cash * (rnd(80) + 20 * Athome)) / (100 * (1 + (sgn(u.ualign.type) == sgn(mtmp->data->maligntyp)))); - if (!demand) /* you have no gold */ - return mtmp->mpeaceful = 0; - else { + + if (!demand) { /* you have no gold */ + mtmp->mpeaceful = 0; + return 0; + } else { + /* make sure that the demand is unmeetable if the monster + has the Amulet, preventing it from being satisified and + removed from the game (along with said Amulet...) */ + if (mon_has_amulet(mtmp)) + demand = cash + (long)rn1(1000,40); + pline("%s demands %ld %s for safe passage.", Amonnam(mtmp), demand, currency(demand)); @@ -184,7 +193,8 @@ register struct monst *mtmp; Amonnam(mtmp)); } else { pline("%s gets angry...", Amonnam(mtmp)); - return mtmp->mpeaceful = 0; + mtmp->mpeaceful = 0; + return 0; } } } -- 2.40.0