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:
25
src/apply.c
25
src/apply.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 apply.c $NHDT-Date: 1571531886 2019/10/20 00:38:06 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.279 $ */
|
||||
/* NetHack 3.6 apply.c $NHDT-Date: 1573290415 2019/11/09 09:06:55 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.282 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -105,8 +105,8 @@ struct obj *obj;
|
||||
|
||||
switch (rn2(3)) {
|
||||
case 2:
|
||||
old = Glib;
|
||||
incr_itimeout(&Glib, rn1(10, 3));
|
||||
old = (Glib & TIMEOUT);
|
||||
make_glib((int) old + rn1(10, 3)); /* + 3..12 */
|
||||
Your("%s %s!", makeplural(body_part(HAND)),
|
||||
(old ? "are filthier than ever" : "get slimy"));
|
||||
if (is_wet_towel(obj))
|
||||
@@ -145,8 +145,9 @@ struct obj *obj;
|
||||
}
|
||||
|
||||
if (Glib) {
|
||||
Glib = 0;
|
||||
You("wipe off your %s.", makeplural(body_part(HAND)));
|
||||
make_glib(0);
|
||||
You("wipe off your %s.",
|
||||
!uarmg ? makeplural(body_part(HAND)) : gloves_simple_name(uarmg));
|
||||
if (is_wet_towel(obj))
|
||||
dry_a_towel(obj, -1, drying_feedback);
|
||||
return 1;
|
||||
@@ -2298,6 +2299,9 @@ struct obj *obj;
|
||||
}
|
||||
|
||||
if (obj->spe > 0) {
|
||||
const char *fingers_or_gloves;
|
||||
int oldglib;
|
||||
|
||||
if ((obj->cursed || Fumbling) && !rn2(2)) {
|
||||
consume_obj_charge(obj, TRUE);
|
||||
|
||||
@@ -2313,17 +2317,20 @@ struct obj *obj;
|
||||
return;
|
||||
consume_obj_charge(obj, TRUE);
|
||||
|
||||
fingers_or_gloves = !uarmg ? makeplural(body_part(FINGER))
|
||||
: gloves_simple_name(uarmg);
|
||||
oldglib = (int) (Glib & TIMEOUT);
|
||||
if (otmp != &zeroobj) {
|
||||
You("cover %s with a thick layer of grease.", yname(otmp));
|
||||
otmp->greased = 1;
|
||||
if (obj->cursed && !nohands(youmonst.data)) {
|
||||
incr_itimeout(&Glib, rnd(15));
|
||||
make_glib(oldglib + rn1(6, 10)); /* + 10..15 */
|
||||
pline("Some of the grease gets all over your %s.",
|
||||
makeplural(body_part(HAND)));
|
||||
fingers_or_gloves);
|
||||
}
|
||||
} else {
|
||||
incr_itimeout(&Glib, rnd(15));
|
||||
You("coat your %s with grease.", makeplural(body_part(FINGER)));
|
||||
make_glib(oldglib + rn1(11, 5)); /* + 5..15 */
|
||||
You("coat your %s with grease.", fingers_or_gloves);
|
||||
}
|
||||
} else {
|
||||
if (obj->known)
|
||||
|
||||
Reference in New Issue
Block a user