From 72afb0d4f68bbf6800d2001ec76fc6ea746fac09 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 20 Jun 2019 10:54:59 -0700 Subject: [PATCH 1/4] muse wand/horn feedback for monst zapping at self Recent commit 5d59b288c9a8e6f15f683007bdf5c4e4549642f4 changed monster zapping a fire horn at self to cure sliming to not use the wand-zap feedback routine, but inadvertently did for zaps of wands of fire too. Use the zap routine for wand and play-instrument routine for horn. --- doc/fixes36.3 | 4 +++- src/muse.c | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 8ae1adaa5..2bd410c87 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.59 $ $NHDT-Date: 1561022792 2019/06/20 09:26:32 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.60 $ $NHDT-Date: 1561053256 2019/06/20 17:54:16 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -89,6 +89,8 @@ using ^G to create "hidden mimic" shouldn't have marked it as undetected since also for eels and other fish if/when created at water location for wizard mode 'wizweight' option, glob weight wasn't shown unless glob had shop price information attached +fix for feedback when a monster plays a fire horn at self to cure green slime + ended up being used for zapping a wand of fire at self too curses: sometimes the message window would show a blank line after a prompt tty: revert the attempt to fix "message line anomaly: if autodecribe feedback wrapped to second line, the wrapped portion wasn't erased when a diff --git a/src/muse.c b/src/muse.c index 499febc65..4324311f5 100644 --- a/src/muse.c +++ b/src/muse.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 muse.c $NHDT-Date: 1560161807 2019/06/10 10:16:47 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.96 $ */ +/* NetHack 3.6 muse.c $NHDT-Date: 1561053256 2019/06/20 17:54:16 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.97 $ */ /* Copyright (C) 1990 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ @@ -2506,7 +2506,10 @@ boolean by_you; /* true: if mon kills itself, hero gets credit/blame */ dmg = 0; /* damage has been applied by explode() */ } } else { /* wand/horn of fire w/ positive charge count */ - mplayhorn(mon, obj, TRUE); + if (obj->otyp == FIRE_HORN) + mplayhorn(mon, obj, TRUE); + else + mzapwand(mon, obj, TRUE); /* -1 => monster's wand of fire; 2 => # of damage dice */ dmg = zhitm(mon, by_you ? 1 : -1, 2, &odummyp); } From 05958e9b3a68eb6587da74ffd62b627330193c65 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 20 Jun 2019 10:59:48 -0700 Subject: [PATCH 2/4] comment typo for "transient" --- include/monst.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/monst.h b/include/monst.h index 717b4eb6e..3a2c40ccc 100644 --- a/include/monst.h +++ b/include/monst.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 monst.h $NHDT-Date: 1559994623 2019/06/08 11:50:23 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.32 $ */ +/* NetHack 3.6 monst.h $NHDT-Date: 1561053561 2019/06/20 17:59:21 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.33 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2016. */ /* NetHack may be freely redistributed. See license for details. */ @@ -98,8 +98,8 @@ struct monst { Bitfield(mcan, 1); /* has been cancelled */ Bitfield(mburied, 1); /* has been buried */ #define mtemplit mburied /* since buried isn't implemented, use bit for - * monsters shown by transcient light source; - * only valid during bhit() execution */ + * monsters shown by transient light source; + * only valid during bhit() execution */ Bitfield(mundetected, 1); /* not seen in present hiding place; * implies one of M1_CONCEAL or M1_HIDE, * but not mimic (that is, snake, spider, From 2da552e22fb0a2029cb09c031d47ac996d659e04 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 20 Jun 2019 13:08:47 -0700 Subject: [PATCH 3/4] fix #8924 - demonic bribery while hero is deaf Even though it isn't using verbalize() to make a specific statement, don't let a demon ask the hero for a bribe when the hero is deaf. Also, give alternate setup messages in a couple of places where a divine voice is overriding deafness. --- doc/fixes36.3 | 3 ++- src/minion.c | 51 ++++++++++++++++++++++++++++++++++++--------------- src/pray.c | 13 +++++++------ 3 files changed, 45 insertions(+), 22 deletions(-) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 2bd410c87..2cda62e95 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.60 $ $NHDT-Date: 1561053256 2019/06/20 17:54:16 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.61 $ $NHDT-Date: 1561061319 2019/06/20 20:08:39 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -77,6 +77,7 @@ for wizard mode 'monpolycontrol', allow usually disallowed type 'chameleon', 'doppelganger', or 'sandestin' as answer to "change @ into what?" prompt when is really that type of creature add Space, Return, and Escape to '? k' (help for menu control keys) +hero can no longer negotiate a bribe with a demon lord when deaf Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository diff --git a/src/minion.c b/src/minion.c index 7d4c6b9c8..85acbe51c 100644 --- a/src/minion.c +++ b/src/minion.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 minion.c $NHDT-Date: 1544998886 2018/12/16 22:21:26 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.40 $ */ +/* NetHack 3.6 minion.c $NHDT-Date: 1561061319 2019/06/20 20:08:39 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.42 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2008. */ /* NetHack may be freely redistributed. See license for details. */ @@ -204,9 +204,13 @@ boolean talk; } if (mon) { if (talk) { - pline_The("voice of %s booms:", align_gname(alignment)); + if (!Deaf) + pline_The("voice of %s booms:", align_gname(alignment)); + else + You_feel("%s booming voice:", + s_suffix(align_gname(alignment))); verbalize("Thou shalt pay for thine indiscretion!"); - if (!Blind) + if (canspotmon(mon)) pline("%s appears before you.", Amonnam(mon)); mon->mstrategy &= ~STRAT_APPEARMSG; } @@ -254,16 +258,18 @@ register struct monst *mtmp; newsym(mtmp->mx, mtmp->my); } if (youmonst.data->mlet == S_DEMON) { /* Won't blackmail their own. */ - pline("%s says, \"Good hunting, %s.\"", Amonnam(mtmp), - flags.female ? "Sister" : "Brother"); + if (!Deaf) + pline("%s says, \"Good hunting, %s.\"", Amonnam(mtmp), + flags.female ? "Sister" : "Brother"); + else if (canseemon(mtmp)) + pline("%s says something.", Amonnam(mtmp)); if (!tele_restrict(mtmp)) (void) rloc(mtmp, TRUE); return 1; } cash = money_cnt(invent); - demand = - (cash * (rnd(80) + 20 * Athome)) - / (100 * (1 + (sgn(u.ualign.type) == sgn(mtmp->data->maligntyp)))); + demand = (cash * (rnd(80) + 20 * Athome)) + / (100 * (1 + (sgn(u.ualign.type) == sgn(mtmp->data->maligntyp)))); if (!demand || multi < 0) { /* you have no gold or can't move */ mtmp->mpeaceful = 0; @@ -273,13 +279,22 @@ register struct monst *mtmp; /* make sure that the demand is unmeetable if the monster has the Amulet, preventing monster from being satisfied and removed from the game (along with said Amulet...) */ - if (mon_has_amulet(mtmp)) - demand = cash + (long) rn1(1000, 40); + /* [actually the Amulet is safe; it would be dropped when + mongone() gets rid of the monster; force combat anyway; + also make it unmeetable if the player is Deaf, to simplify + handling that case as player-won't-pay] */ + if (mon_has_amulet(mtmp) || Deaf) + /* 125: 5*25 in case hero has maximum possible charisma */ + demand = cash + (long) rn1(1000, 125); - pline("%s demands %ld %s for safe passage.", Amonnam(mtmp), demand, - currency(demand)); + if (!Deaf) + pline("%s demands %ld %s for safe passage.", + Amonnam(mtmp), demand, currency(demand)); + else if (canseemon(mtmp)) + pline("%s seems to be demanding something.", Amonnam(mtmp)); - if ((offer = bribe(mtmp)) >= demand) { + offer = 0L; + if (!Deaf && ((offer = bribe(mtmp)) >= demand)) { pline("%s vanishes, laughing about cowardly mortals.", Amonnam(mtmp)); } else if (offer > 0L @@ -447,12 +462,18 @@ gain_guardian_angel() Hear_again(); /* attempt to cure any deafness now (divine message will be heard even if that fails) */ if (Conflict) { - pline("A voice booms:"); + if (!Deaf) + pline("A voice booms:"); + else + You_feel("a booming voice:"); verbalize("Thy desire for conflict shall be fulfilled!"); /* send in some hostile angels instead */ lose_guardian_angel((struct monst *) 0); } else if (u.ualign.record > 8) { /* fervent */ - pline("A voice whispers:"); + if (!Deaf) + pline("A voice whispers:"); + else + You_feel("a soft voice:"); verbalize("Thou hast been worthy of me!"); mm.x = u.ux; mm.y = u.uy; diff --git a/src/pray.c b/src/pray.c index 7626b7487..d5958ac52 100644 --- a/src/pray.c +++ b/src/pray.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 pray.c $NHDT-Date: 1559853037 2019/06/06 20:30:37 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.114 $ */ +/* NetHack 3.6 pray.c $NHDT-Date: 1561061321 2019/06/20 20:08:41 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.115 $ */ /* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */ /* NetHack may be freely redistributed. See license for details. */ @@ -489,7 +489,7 @@ int trouble; what = rightglow; else if (otmp == uleft) what = leftglow; - decurse: + decurse: if (!otmp) { impossible("fix_worst_trouble: nothing to uncurse."); return; @@ -721,8 +721,9 @@ aligntyp resp_god; (on_altar() && (a_align(u.ux, u.uy) != resp_god)) ? "scorn" : "call upon"); + /* [why isn't this using verbalize()?] */ pline("\"Then die, %s!\"", - youmonst.data->mlet == S_HUMAN ? "mortal" : "creature"); + (youmonst.data->mlet == S_HUMAN) ? "mortal" : "creature"); summon_minion(resp_god, FALSE); break; @@ -802,7 +803,7 @@ gcrownu() && uwep->oartifact != ART_STORMBRINGER)) && !carrying(SPE_FINGER_OF_DEATH)) { class_gift = SPE_FINGER_OF_DEATH; - make_splbk: + make_splbk: obj = mksobj(class_gift, TRUE, FALSE); bless(obj); obj->bknown = 1; /* ok to skip set_bknown() */ @@ -1488,7 +1489,7 @@ dosacrifice() if (otmp->otyp == AMULET_OF_YENDOR) { if (!highaltar) { - too_soon: + too_soon: if (altaralign == A_NONE && Inhell) /* hero has left Moloch's Sanctum so is in the process of getting away with the Amulet (outside of Gehennom, @@ -1584,7 +1585,7 @@ dosacrifice() } if (altaralign != u.ualign.type && highaltar) { - desecrate_high_altar: + desecrate_high_altar: /* * REAL BAD NEWS!!! High altars cannot be converted. Even an attempt * gets the god who owns it truly pissed off. From 2fe57af3f34de78ed15d590927ada6b3f6a54268 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 20 Jun 2019 18:42:35 -0700 Subject: [PATCH 4/4] fix #H8833 - wishing for " amulet" and receiving a random amulet instead of an "amulet of ". Although the failure to produce the 'right' amulet wasn't a regression compared to earlier versions as the report indicated, supporting that wish is straightforward. --- doc/fixes36.3 | 3 ++- src/objnam.c | 28 ++++++++++++++++++++++------ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/doc/fixes36.3 b/doc/fixes36.3 index 2cda62e95..f4e36ac3a 100644 --- a/doc/fixes36.3 +++ b/doc/fixes36.3 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.61 $ $NHDT-Date: 1561061319 2019/06/20 20:08:39 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.62 $ $NHDT-Date: 1561081353 2019/06/21 01:42:33 $ This fixes36.3 file is here to capture information about updates in the 3.6.x lineage following the release of 3.6.2 in May 2019. Please note, however, @@ -78,6 +78,7 @@ for wizard mode 'monpolycontrol', allow usually disallowed type 'chameleon', into what?" prompt when is really that type of creature add Space, Return, and Escape to '? k' (help for menu control keys) hero can no longer negotiate a bribe with a demon lord when deaf +wishing for "foo amulet" now yields an "amulet of foo" rather than random one Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository diff --git a/src/objnam.c b/src/objnam.c index 20b89625b..0992fb518 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 objnam.c $NHDT-Date: 1560185545 2019/06/10 16:52:25 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.243 $ */ +/* NetHack 3.6 objnam.c $NHDT-Date: 1561081353 2019/06/21 01:42:33 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.244 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2818,7 +2818,7 @@ int xtra_prob; /* to force 0% random generation items to also be considered */ * probabilities are not very useful because they don't take * the class generation probability into account. [If 10% * of spellbooks were blank and 1% of scrolls were blank, - * "blank" would have 10/11 chance to yield a blook even though + * "blank" would have 10/11 chance to yield a book even though * scrolls are supposed to be much more common than books.] */ for (i = oclass ? bases[(int) oclass] : STRANGE_OBJECT + 1; @@ -3353,6 +3353,7 @@ struct obj *no_wish; for (i = 0; i < (int) (sizeof wrpsym); i++) { register int j = strlen(wrp[i]); + /* check for " [ of ] something" */ if (!strncmpi(bp, wrp[i], j)) { oclass = wrpsym[i]; if (oclass != AMULET_CLASS) { @@ -3364,12 +3365,27 @@ struct obj *no_wish; actualn = bp; goto srch; } + /* check for "something " */ if (!BSTRCMPI(bp, p - j, wrp[i])) { oclass = wrpsym[i]; - p -= j; - *p = 0; - if (p > bp && p[-1] == ' ') - p[-1] = 0; + /* for "foo amulet", leave the class name so that + wishymatch() can do "of inversion" to try matching + "amulet of foo"; other classes don't include their + class name in their full object names (where + "potion of healing" is just "healing", for instance) */ + if (oclass != AMULET_CLASS) { + p -= j; + *p = '\0'; + if (p > bp && p[-1] == ' ') + p[-1] = '\0'; + } else { + /* amulet without "of"; convoluted wording but better a + special case that's handled than one that's missing */ + if (!strncmpi(bp, "versus poison ", 14)) { + typ = AMULET_VERSUS_POISON; + goto typfnd; + } + } actualn = dn = bp; goto srch; }