fix #H9391 - slippery gloves
Slippery fingers would transfer from bare hands to gloved hands if you put gloves on. The reverse, transfering from gloves to bare hands when taking gloves off, was already being prevented for directly taking them off, but still allowed the slipperiness to transfer when gloves were lost. This prevents putting on gloves when fingers are slippery and attempts to handle cases where gloves get unworn by ways other than 'T' (or 'R') or 'A'. There's no slippery attribute for objects (way too much work for too little value); slippery gloves is just the combination of wearing gloves and having slippery fingers (which now has to have happened while already wearing those gloves). This changes inventory to use "(being worn; slippery)" when applicable and much of the patch deals with funnelling Glib changes through new make_glib() to try to make sure that persistent inventory adds or removes "; slippery" right away when changes happen. If gloves are taken off involuntarily (shapechange to a form that can't wear them, destruction via scroll of destroy armor or monster spell of same or via overenchantment, theft), slippery fingers ends right away instead of the usual few turns later.
This commit is contained in:
31
src/objnam.c
31
src/objnam.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 objnam.c $NHDT-Date: 1571436005 2019/10/18 22:00:05 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.247 $ */
|
||||
/* NetHack 3.6 objnam.c $NHDT-Date: 1573290418 2019/11/09 09:06:58 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.248 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1059,7 +1059,7 @@ unsigned doname_flags;
|
||||
Strcat(bp, " (being worn)");
|
||||
break;
|
||||
case ARMOR_CLASS:
|
||||
if (obj->owornmask & W_ARMOR)
|
||||
if (obj->owornmask & W_ARMOR) {
|
||||
Strcat(bp, (obj == uskin) ? " (embedded in your skin)"
|
||||
/* in case of perm_invent update while Wear/Takeoff
|
||||
is in progress; check doffing() before donning()
|
||||
@@ -1067,6 +1067,13 @@ unsigned doname_flags;
|
||||
: doffing(obj) ? " (being doffed)"
|
||||
: donning(obj) ? " (being donned)"
|
||||
: " (being worn)");
|
||||
/* slippery fingers is an intrinsic condition of the hero
|
||||
rather than extrinsic condition of objects, but gloves
|
||||
are described as slippery when hero has slippery fingers */
|
||||
if (obj == uarmg && Glib) /* just appended "(something)",
|
||||
* change to "(something; slippery)" */
|
||||
Strcpy(rindex(bp, ')'), "; slippery)");
|
||||
}
|
||||
/*FALLTHRU*/
|
||||
case WEAPON_CLASS:
|
||||
if (ispoisoned)
|
||||
@@ -4182,6 +4189,26 @@ struct obj *helmet;
|
||||
return (helmet && !is_metallic(helmet)) ? "hat" : "helm";
|
||||
}
|
||||
|
||||
/* gloves vs gauntlets; depends upon discovery state */
|
||||
const char *
|
||||
gloves_simple_name(gloves)
|
||||
struct obj *gloves;
|
||||
{
|
||||
static const char gauntlets[] = "gauntlets";
|
||||
|
||||
if (gloves && gloves->dknown) {
|
||||
int otyp = gloves->otyp;
|
||||
struct objclass *ocl = &objects[otyp];
|
||||
const char *actualn = OBJ_NAME(*ocl),
|
||||
*descrpn = OBJ_DESCR(*ocl);
|
||||
|
||||
if (strstri(objects[otyp].oc_name_known ? actualn : descrpn,
|
||||
gauntlets))
|
||||
return gauntlets;
|
||||
}
|
||||
return "gloves";
|
||||
}
|
||||
|
||||
const char *
|
||||
mimic_obj_name(mtmp)
|
||||
struct monst *mtmp;
|
||||
|
||||
Reference in New Issue
Block a user