-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.524 $ $NHDT-Date: 1620326528 2021/05/06 18:42:08 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.525 $ $NHDT-Date: 1620329775 2021/05/06 19:36:15 $
General Fixes and Modified Features
-----------------------------------
doing a level-wide wake-up
any blessed key was behaving as if was the rogue's Master Key when unlocking
a trapped chest or box
+when an unseen non-pet picks up or uses an item, hero loses known/dknown/
+ bknown/cknown/lknown memory of that item (so becomes unidentified; in
+ particular, player won't be asked what to call unseen thrown potion)
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
-/* NetHack 3.7 extern.h $NHDT-Date: 1611445282 2021/01/23 23:41:22 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.947 $ */
+/* NetHack 3.7 extern.h $NHDT-Date: 1620329773 2021/05/06 19:36:13 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.968 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
unsigned *);
extern int askchain(struct obj **, const char *, int, int(*)(struct obj *),
int(*)(struct obj *), int, const char *);
+extern void unknow_object(struct obj *);
extern void set_cknown_lknown(struct obj *);
extern void fully_identify_obj(struct obj *);
extern int identify(struct obj *);
-/* NetHack 3.7 invent.c $NHDT-Date: 1615794750 2021/03/15 07:52:30 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.324 $ */
+/* NetHack 3.7 invent.c $NHDT-Date: 1620329776 2021/05/06 19:36:16 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.330 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
return cnt;
}
+/* hero is losing access to previously known info about an object
+ (called when an unseen monster picks up or uses the object) */
+void
+unknow_object(struct obj *obj)
+{
+ obj->dknown = 0;
+ obj->bknown = obj->rknown = 0;
+ obj->cknown = obj->lknown = 0;
+ /* awareness of charges or enchantment has gone poof... */
+ if (objects[obj->otyp].oc_uses_known)
+ obj->known = 0;
+}
+
/*
* Object identification routines:
*/
-/* NetHack 3.7 mthrowu.c $NHDT-Date: 1613258169 2021/02/13 23:16:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.112 $ */
+/* NetHack 3.7 mthrowu.c $NHDT-Date: 1620329778 2021/05/06 19:36:18 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.113 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Pasi Kallinen, 2016. */
/* NetHack may be freely redistributed. See license for details. */
g.notonhead = (g.bhitpos.x != mtmp->mx || g.bhitpos.y != mtmp->my);
ismimic = M_AP_TYPE(mtmp) && M_AP_TYPE(mtmp) != M_AP_MONSTER;
vis = cansee(g.bhitpos.x, g.bhitpos.y);
+ if (vis)
+ otmp->dknown = 1;
tmp = 5 + find_mac(mtmp) + omon_adj(mtmp, otmp, FALSE);
/* High level monsters will be more likely to hit */
if (ismimic)
seemimic(mtmp);
mtmp->msleeping = 0;
- if (vis)
- otmp->dknown = 1;
/* probably thrown by a monster rather than 'other', but the
distinction only matters when hitting the hero */
potionhit(mtmp, otmp, POTHIT_OTHER_THROW);
}
singleobj->owornmask = 0; /* threw one of multiple weapons in hand? */
+ if (!canseemon(mon))
+ singleobj->dknown = 0;
if ((singleobj->cursed || singleobj->greased) && (dx || dy) && !rn2(7)) {
if (canseemon(mon) && flags.verbose) {
while (range-- > 0) { /* Actually the loop is always exited by break */
g.bhitpos.x += dx;
g.bhitpos.y += dy;
+ if (cansee(g.bhitpos.x, g.bhitpos.y))
+ singleobj->dknown = 1;
+
mtmp = m_at(g.bhitpos.x, g.bhitpos.y);
if (mtmp && shade_miss(mon, mtmp, singleobj, TRUE, TRUE)) {
/* if mtmp is a shade and missile passes harmlessly through it,
break;
}
if (singleobj->oclass == POTION_CLASS) {
- if (!Blind)
- singleobj->dknown = 1;
potionhit(&g.youmonst, singleobj, POTHIT_MONST_THROW);
break;
}
+
oldumort = u.umortality;
switch (singleobj->otyp) {
int dam, hitv;
hitu = 0;
break;
}
- /* fall through */
+ /*FALLTHRU*/
case CREAM_PIE:
case BLINDING_VENOM:
hitu = thitu(8, 0, &singleobj, (char *) 0);
break;
}
}
+
if (!range || MT_FLIGHTCHECK(FALSE)) { /* end of path or blocked */
if (singleobj) { /* hits_bars might have destroyed it */
/* note: pline(The(missile)) rather than pline_The(missile)
-/* NetHack 3.7 muse.c $NHDT-Date: 1607734843 2020/12/12 01:00:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.136 $ */
+/* NetHack 3.7 muse.c $NHDT-Date: 1620329779 2021/05/06 19:36:19 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.143 $ */
/* Copyright (C) 1990 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */
You_hear("a %s zap.", (distu(mtmp->mx, mtmp->my) <= range * range)
? "nearby" : "distant");
- otmp->known = 0;
+ unknow_object(otmp); /* hero loses info when unseen obj is used */
} else if (self) {
pline("%s with %s!",
monverbself(mtmp, Monnam(mtmp), "zap", (char *) 0),
You_hear("a horn being played %s.",
(distu(mtmp->mx, mtmp->my) <= range * range)
? "nearby" : "in the distance");
- otmp->known = 0; /* hero doesn't know how many charges are left */
+ unknow_object(otmp); /* hero loses info when unseen obj is used */
} else if (self) {
otmp->dknown = 1;
objnamp = xname(otmp);
-/* NetHack 3.7 steal.c $NHDT-Date: 1596498213 2020/08/03 23:43:33 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.84 $ */
+/* NetHack 3.7 steal.c $NHDT-Date: 1620329782 2021/05/06 19:36:22 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.90 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
and if it's eventually dropped in a shop, shk will claim it */
if (!mtmp->mtame)
otmp->no_charge = 0;
+ /* if monster is unseen, info hero knows about this object becomes lost;
+ continual pickup and drop by pets makes this too annoying if it is
+ applied to them */
+ if (!mtmp->mtame && !canseemon(mtmp))
+ unknow_object(otmp);
/* Must do carrying effects on object prior to add_to_minv() */
carry_obj_effects(otmp);
/* add_to_minv() might free otmp [if merged with something else],