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:
21
src/cmd.c
21
src/cmd.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 cmd.c $NHDT-Date: 1572141702 2019/10/27 02:01:42 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.347 $ */
|
||||
/* NetHack 3.6 cmd.c $NHDT-Date: 1573290415 2019/11/09 09:06:55 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.348 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -155,7 +155,6 @@ STATIC_PTR int NDECL(wiz_level_change);
|
||||
STATIC_PTR int NDECL(wiz_show_seenv);
|
||||
STATIC_PTR int NDECL(wiz_show_vision);
|
||||
STATIC_PTR int NDECL(wiz_smell);
|
||||
STATIC_PTR int NDECL(wiz_intrinsic);
|
||||
STATIC_PTR int NDECL(wiz_show_wmodes);
|
||||
STATIC_DCL void NDECL(wiz_map_levltyp);
|
||||
STATIC_DCL void NDECL(wiz_levltyp_legend);
|
||||
@@ -1485,15 +1484,21 @@ wiz_intrinsic(VOID_ARGS)
|
||||
= &mons[context.warntype.speciesidx];
|
||||
}
|
||||
goto def_feedback;
|
||||
case GLIB:
|
||||
/* slippery fingers applies to gloves if worn at the time
|
||||
so persistent inventory might need updating */
|
||||
make_glib((int) newtimeout);
|
||||
goto def_feedback;
|
||||
case LEVITATION:
|
||||
case FLYING:
|
||||
float_vs_flight();
|
||||
/*FALLTHRU*/
|
||||
default:
|
||||
def_feedback:
|
||||
def_feedback:
|
||||
pline("Timeout for %s %s %d.", propertynames[i].prop_name,
|
||||
oldtimeout ? "increased by" : "set to", amt);
|
||||
incr_itimeout(&u.uprops[p].intrinsic, amt);
|
||||
if (p != GLIB)
|
||||
incr_itimeout(&u.uprops[p].intrinsic, amt);
|
||||
break;
|
||||
}
|
||||
context.botl = 1; /* probably not necessary... */
|
||||
@@ -2472,7 +2477,11 @@ int final;
|
||||
}
|
||||
}
|
||||
if (Glib) {
|
||||
Sprintf(buf, "slippery %s", makeplural(body_part(FINGER)));
|
||||
Sprintf(buf, "slippery %s",
|
||||
!uarmg ? makeplural(body_part(FINGER))
|
||||
: gloves_simple_name(uarmg));
|
||||
if (wizard)
|
||||
Sprintf(eos(buf), " (%ld)", (Glib & TIMEOUT));
|
||||
you_have(buf, "");
|
||||
}
|
||||
if (Fumbling) {
|
||||
@@ -5046,7 +5055,7 @@ const char *s;
|
||||
char dirsym;
|
||||
int is_mov;
|
||||
|
||||
retry:
|
||||
retry:
|
||||
if (in_doagain || *readchar_queue)
|
||||
dirsym = readchar();
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user