From e3712dbb312b2930bbc3a0b2c6442f1eaf2fd958 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 27 Jul 2021 11:58:44 -0700 Subject: [PATCH 1/4] gaze vs hider From a 7 or 8 year old bug report from a beta tester. A pyrolisk's gaze against a mimic didn't unhide that mimic. Somewhere along the line that has been fixed, but some apparently redundant code inside 'if (visible)' should be done even when not visible. --- src/mhitm.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/mhitm.c b/src/mhitm.c index cda45a8f6..3243fa130 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 mhitm.c $NHDT-Date: 1625838646 2021/07/09 13:50:46 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.198 $ */ +/* NetHack 3.7 mhitm.c $NHDT-Date: 1627412283 2021/07/27 18:58:03 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.199 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */ /* NetHack may be freely redistributed. See license for details. */ @@ -636,9 +636,13 @@ gazemm(struct monst *magr, struct monst *mdef, struct attack *mattk) && mattk->adtyp == AD_BLND), altmesg = (archon && !magr->mcansee); + /* bring target out of hiding even if hero doesn't see it happen (this + is already done in pre_mm_attack() and shouldn't be needed here) */ + if (mdef->data->mlet == S_MIMIC && M_AP_TYPE(mdef) != M_AP_NOTHING) + seemimic(mdef); + mdef->mundetected = 0; + if (g.vis) { - if (mdef->data->mlet == S_MIMIC && M_AP_TYPE(mdef) != M_AP_NOTHING) - seemimic(mdef); Sprintf(buf, "%s gazes %s", altmesg ? Adjmonnam(magr, "blinded") : Monnam(magr), altmesg ? "toward" : "at"); From 3c49cd2074922aebb1013c4cbc19c5f31e7bb5d4 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 27 Jul 2021 12:18:55 -0700 Subject: [PATCH 2/4] drowning monster's [lack of] corpse From the newsgroup 6.5 years ago, | Subject: Re: Reviving drowned pets impossible if you displaced your pet into water and it drowned, it would never leave a corpse. That seems to be moot these days because a pet or peaceful monster which would drown will refuse to swap places, but change corpse handling anyway. --- doc/fixes37.0 | 4 +++- src/mon.c | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index ed31e23d2..ffabdd7ca 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.596 $ $NHDT-Date: 1626390626 2021/07/15 23:10:26 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.608 $ $NHDT-Date: 1627413528 2021/07/27 19:18:48 $ General Fixes and Modified Features ----------------------------------- @@ -573,6 +573,8 @@ for "a" vs "an", add ukulele and uke as exceptions for "an u" add new extended command #retravel remove special doinv key, functionality was equal to BIND=0:inventory some monsters should not have been scared of bugle playing +monsters that drowned would never leave a corpse (holdover from decades ago + when it wasn't possible to recover anything from a water location) Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/mon.c b/src/mon.c index 0b5d3da91..1bebe1f53 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 mon.c $NHDT-Date: 1620923921 2021/05/13 16:38:41 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.375 $ */ +/* NetHack 3.7 mon.c $NHDT-Date: 1627413528 2021/07/27 19:18:48 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.382 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -732,7 +732,7 @@ minliquid_core(struct monst* mtmp) if (mtmp->mhpmax > dam) mtmp->mhpmax -= dam; if (DEADMONSTER(mtmp)) { - mondead(mtmp); + mondied(mtmp); if (DEADMONSTER(mtmp)) return 1; } @@ -768,7 +768,7 @@ minliquid_core(struct monst* mtmp) case is not expected to happen (and we haven't made a player-against-monster variation of the message above) */ if (g.context.mon_moving) - mondead(mtmp); + mondead(mtmp); /* no corpse */ else xkilled(mtmp, XKILL_NOMSG); } else { @@ -776,7 +776,7 @@ minliquid_core(struct monst* mtmp) if (DEADMONSTER(mtmp)) { if (cansee(mtmp->mx, mtmp->my)) pline("%s surrenders to the fire.", Monnam(mtmp)); - mondead(mtmp); + mondead(mtmp); /* no corpse */ } else if (cansee(mtmp->mx, mtmp->my)) pline("%s burns slightly.", Monnam(mtmp)); } @@ -815,7 +815,7 @@ minliquid_core(struct monst* mtmp) Monnam(mtmp), hliquid("water")); } if (g.context.mon_moving) - mondead(mtmp); + mondied(mtmp); /* ok to leave corpse despite water */ else xkilled(mtmp, XKILL_NOMSG); if (!DEADMONSTER(mtmp)) { From 068fa6c658cc85c130c24b60f7bc482323c277d6 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 27 Jul 2021 12:29:46 -0700 Subject: [PATCH 3/4] fix #H2797 - avoid "vision clears" if hero can't see From 8 years ago, sitting on a throne and getting the confers-see- invisible result gave "your vision becomes clear" message even when hero was blind (who stays blind at the time). Give an alternate message if hero is blind, with another alternate when the blindless is due to being poly'd into something without eyes. --- doc/fixes37.0 | 3 ++- src/sit.c | 27 +++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index ffabdd7ca..b535ea9c1 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.608 $ $NHDT-Date: 1627413528 2021/07/27 19:18:48 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.609 $ $NHDT-Date: 1627414178 2021/07/27 19:29:38 $ General Fixes and Modified Features ----------------------------------- @@ -575,6 +575,7 @@ remove special doinv key, functionality was equal to BIND=0:inventory some monsters should not have been scared of bugle playing monsters that drowned would never leave a corpse (holdover from decades ago when it wasn't possible to recover anything from a water location) +give alternate message if hero is blind when throne gives "your vision clears" Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/sit.c b/src/sit.c index ac22bbbe4..0ca44dcc7 100644 --- a/src/sit.c +++ b/src/sit.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 sit.c $NHDT-Date: 1596498210 2020/08/03 23:43:30 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.70 $ */ +/* NetHack 3.7 sit.c $NHDT-Date: 1627414178 2021/07/27 19:29:38 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.73 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -245,7 +245,30 @@ dosit(void) do_mapping(); } } else { - Your("vision becomes clear."); + /* avoid "vision clears" if hero can't see */ + if (!Blind) { + Your("vision becomes clear."); + } else { + int num_of_eyes = eyecount(g.youmonst.data); + const char *eye = body_part(EYE); + + /* note: 1 eye case won't actually happen--can't + sit on throne when poly'd into always-levitating + floating eye and can't polymorph into Cyclops */ + switch (num_of_eyes) { /* 2, 1, or 0 */ + default: + case 2: /* more than 1 eye */ + eye = makeplural(eye); + /*FALLTHRU*/ + case 1: /* one eye (Cyclops, floating eye) */ + Your("%s %s...", eye, vtense(eye, "tingle")); + break; + case 0: /* no eyes */ + You("have a very strange feeling in your %s.", + body_part(HEAD)); + break; + } + } HSee_invisible |= FROMOUTSIDE; newsym(u.ux, u.uy); } From 81b3b56296d94caf7a70bfdab1ad91aeec07a595 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 27 Jul 2021 12:31:32 -0700 Subject: [PATCH 4/4] unfixed bug #H2668 - hitting disenchanter w/ rings From 8 or so years ago, hitting a disenchanter without wielding a weapon and without wearing gloves while wearing a possitively 'charged' ring should reduce the ring's enchantment. This doesn't fix that, it just adds a brief comment about it. --- src/uhitm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/uhitm.c b/src/uhitm.c index 36f0c2109..f510686f9 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -4967,6 +4967,15 @@ passive(struct monst *mon, } else if (aatyp == AT_BITE || aatyp == AT_BUTT || (aatyp >= AT_STNG && aatyp < AT_WEAP)) { break; /* no object involved */ + } else { + /* + * TODO: #H2668 - if hitting with a ring that has a + * positive enchantment, it ought to be subject to + * having that enchantment reduced. But we don't have + * sufficient information here to know which hand/ring + * has delived a weaponless blow. + */ + ; } passive_obj(mon, weapon, &(ptr->mattk[i])); }