Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-11-09 12:24:10 -05:00
16 changed files with 243 additions and 35 deletions
+4 -1
View File
@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.167 $ $NHDT-Date: 1573178084 2019/11/08 01:54:44 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.168 $ $NHDT-Date: 1573290414 2019/11/09 09:06:54 $
This fixes36.3 file is here to capture information about updates in the 3.6.x This fixes36.3 file is here to capture information about updates in the 3.6.x
lineage following the release of 3.6.2 in May 2019. Please note, however, lineage following the release of 3.6.2 in May 2019. Please note, however,
@@ -218,6 +218,9 @@ when dipping into holy/unholy water while blind (where the glow message is
suppressed), clear dipped item's bknown flag unless water potion's suppressed), clear dipped item's bknown flag unless water potion's
bless/curse state is known bless/curse state is known
playing music while hallucinating: message misspelled "butterflies" playing music while hallucinating: message misspelled "butterflies"
putting on gloves while having slippery fingers transfered slipperiness to
those gloves; taking off slippery gloves directly was disallowed but
losing them in other ways transfered slipperiness to bare fingers
Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository
+7
View File
@@ -47,6 +47,9 @@ nethack \- Exploring The Mazes of Menace
.B \-ibm .B \-ibm
] ]
[ [
.BR \-\-showpaths
]
[
.BR \-\-version [ :paste ] .BR \-\-version [ :paste ]
] ]
.PP .PP
@@ -223,6 +226,10 @@ the list of top scorers, and a subdirectory
.I save .I save
where games are saved. where games are saved.
.PP .PP
.B \-\-showpaths
can be used to cause NetHack to show where it is expecting
to find various configuration files.
.PP
.B \-\-version .B \-\-version
can be used to cause NetHack to show the version information it can be used to cause NetHack to show the version information it
was compiled with, then exit. That will include the was compiled with, then exit. That will include the
+1 -1
View File
@@ -461,7 +461,7 @@ struct breadcrumbs {
E const char *ARGV0; E const char *ARGV0;
#endif #endif
enum earlyarg {ARG_DEBUG, ARG_VERSION enum earlyarg {ARG_DEBUG, ARG_VERSION, ARG_SHOWPATHS
#ifdef WIN32 #ifdef WIN32
,ARG_WINDOWS ,ARG_WINDOWS
#endif #endif
+4 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 extern.h $NHDT-Date: 1571436000 2019/10/18 22:00:00 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.730 $ */ /* NetHack 3.6 extern.h $NHDT-Date: 1573290414 2019/11/09 09:06:54 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.736 $ */
/* Copyright (c) Steve Creps, 1988. */ /* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -847,6 +847,7 @@ E int FDECL(nhclose, (int));
#ifdef DEBUG #ifdef DEBUG
E boolean FDECL(debugcore, (const char *, BOOLEAN_P)); E boolean FDECL(debugcore, (const char *, BOOLEAN_P));
#endif #endif
E void NDECL(reveal_paths);
E boolean FDECL(read_tribute, (const char *, const char *, int, E boolean FDECL(read_tribute, (const char *, const char *, int,
char *, int, unsigned)); char *, int, unsigned));
E boolean FDECL(Death_quote, (char *, int)); E boolean FDECL(Death_quote, (char *, int));
@@ -1749,6 +1750,7 @@ E int FDECL(rnd_class, (int, int));
E const char *FDECL(suit_simple_name, (struct obj *)); E const char *FDECL(suit_simple_name, (struct obj *));
E const char *FDECL(cloak_simple_name, (struct obj *)); E const char *FDECL(cloak_simple_name, (struct obj *));
E const char *FDECL(helm_simple_name, (struct obj *)); E const char *FDECL(helm_simple_name, (struct obj *));
E const char *FDECL(gloves_simple_name, (struct obj *));
E const char *FDECL(mimic_obj_name, (struct monst *)); E const char *FDECL(mimic_obj_name, (struct monst *));
E char *FDECL(safe_qbuf, (char *, const char *, const char *, struct obj *, E char *FDECL(safe_qbuf, (char *, const char *, const char *, struct obj *,
char *(*)(OBJ_P), char *(*)(OBJ_P), const char *)); char *(*)(OBJ_P), char *(*)(OBJ_P), const char *));
@@ -1966,6 +1968,7 @@ E void FDECL(make_blinded, (long, BOOLEAN_P));
E void NDECL(toggle_blindness); E void NDECL(toggle_blindness);
E boolean FDECL(make_hallucinated, (long, BOOLEAN_P, long)); E boolean FDECL(make_hallucinated, (long, BOOLEAN_P, long));
E void FDECL(make_deaf, (long, BOOLEAN_P)); E void FDECL(make_deaf, (long, BOOLEAN_P));
E void FDECL(make_glib, (int));
E void NDECL(self_invis_message); E void NDECL(self_invis_message);
E int NDECL(dodrink); E int NDECL(dodrink);
E int FDECL(dopotion, (struct obj *)); E int FDECL(dopotion, (struct obj *));
+4
View File
@@ -772,6 +772,7 @@ const char *msg;
static const struct early_opt earlyopts[] = { static const struct early_opt earlyopts[] = {
{ARG_DEBUG, "debug", 5, TRUE}, {ARG_DEBUG, "debug", 5, TRUE},
{ARG_VERSION, "version", 4, TRUE}, {ARG_VERSION, "version", 4, TRUE},
{ARG_SHOWPATHS, "showpaths", 9, FALSE},
#ifdef WIN32 #ifdef WIN32
{ARG_WINDOWS, "windows", 4, TRUE}, {ARG_WINDOWS, "windows", 4, TRUE},
#endif #endif
@@ -850,6 +851,9 @@ enum earlyarg e_arg;
early_version_info(insert_into_pastebuf); early_version_info(insert_into_pastebuf);
return 2; return 2;
} }
case ARG_SHOWPATHS: {
return 2;
}
#ifdef WIN32 #ifdef WIN32
case ARG_WINDOWS: { case ARG_WINDOWS: {
if (extended_opt) { if (extended_opt) {
+16 -9
View File
@@ -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) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -99,8 +99,8 @@ struct obj *obj;
switch (rn2(3)) { switch (rn2(3)) {
case 2: case 2:
old = Glib; old = (Glib & TIMEOUT);
incr_itimeout(&Glib, rn1(10, 3)); make_glib((int) old + rn1(10, 3)); /* + 3..12 */
Your("%s %s!", makeplural(body_part(HAND)), Your("%s %s!", makeplural(body_part(HAND)),
(old ? "are filthier than ever" : "get slimy")); (old ? "are filthier than ever" : "get slimy"));
if (is_wet_towel(obj)) if (is_wet_towel(obj))
@@ -139,8 +139,9 @@ struct obj *obj;
} }
if (Glib) { if (Glib) {
Glib = 0; make_glib(0);
You("wipe off your %s.", makeplural(body_part(HAND))); You("wipe off your %s.",
!uarmg ? makeplural(body_part(HAND)) : gloves_simple_name(uarmg));
if (is_wet_towel(obj)) if (is_wet_towel(obj))
dry_a_towel(obj, -1, drying_feedback); dry_a_towel(obj, -1, drying_feedback);
return 1; return 1;
@@ -2282,6 +2283,9 @@ struct obj *obj;
} }
if (obj->spe > 0) { if (obj->spe > 0) {
const char *fingers_or_gloves;
int oldglib;
if ((obj->cursed || Fumbling) && !rn2(2)) { if ((obj->cursed || Fumbling) && !rn2(2)) {
consume_obj_charge(obj, TRUE); consume_obj_charge(obj, TRUE);
@@ -2297,17 +2301,20 @@ struct obj *obj;
return; return;
consume_obj_charge(obj, TRUE); consume_obj_charge(obj, TRUE);
fingers_or_gloves = !uarmg ? makeplural(body_part(FINGER))
: gloves_simple_name(uarmg);
oldglib = (int) (Glib & TIMEOUT);
if (otmp != &cg.zeroobj) { if (otmp != &cg.zeroobj) {
You("cover %s with a thick layer of grease.", yname(otmp)); You("cover %s with a thick layer of grease.", yname(otmp));
otmp->greased = 1; otmp->greased = 1;
if (obj->cursed && !nohands(g.youmonst.data)) { if (obj->cursed && !nohands(g.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.", pline("Some of the grease gets all over your %s.",
makeplural(body_part(HAND))); fingers_or_gloves);
} }
} else { } else {
incr_itimeout(&Glib, rnd(15)); make_glib(oldglib + rn1(11, 5)); /* + 5..15 */
You("coat your %s with grease.", makeplural(body_part(FINGER))); You("coat your %s with grease.", fingers_or_gloves);
} }
} else { } else {
if (obj->known) if (obj->known)
+15 -5
View File
@@ -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) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1477,15 +1477,21 @@ wiz_intrinsic(VOID_ARGS)
= &mons[g.context.warntype.speciesidx]; = &mons[g.context.warntype.speciesidx];
} }
goto def_feedback; 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 LEVITATION:
case FLYING: case FLYING:
float_vs_flight(); float_vs_flight();
/*FALLTHRU*/ /*FALLTHRU*/
default: default:
def_feedback: def_feedback:
pline("Timeout for %s %s %d.", propertynames[i].prop_name, pline("Timeout for %s %s %d.", propertynames[i].prop_name,
oldtimeout ? "increased by" : "set to", amt); oldtimeout ? "increased by" : "set to", amt);
incr_itimeout(&u.uprops[p].intrinsic, amt); if (p != GLIB)
incr_itimeout(&u.uprops[p].intrinsic, amt);
break; break;
} }
g.context.botl = 1; /* probably not necessary... */ g.context.botl = 1; /* probably not necessary... */
@@ -2467,7 +2473,11 @@ int final;
} }
} }
if (Glib) { 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, ""); you_have(buf, "");
} }
if (Fumbling) { if (Fumbling) {
@@ -5044,7 +5054,7 @@ const char *s;
char dirsym; char dirsym;
int is_mov; int is_mov;
retry: retry:
if (g.in_doagain || *readchar_queue) if (g.in_doagain || *readchar_queue)
dirsym = readchar(); dirsym = readchar();
else else
+27 -5
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 do_wear.c $NHDT-Date: 1570566377 2019/10/08 20:26:17 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.111 $ */ /* NetHack 3.6 do_wear.c $NHDT-Date: 1573290416 2019/11/09 09:06:56 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.112 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -558,6 +558,14 @@ Gloves_off(VOID_ARGS)
g.context.takeoff.cancelled_don = FALSE; g.context.takeoff.cancelled_don = FALSE;
(void) encumber_msg(); /* immediate feedback for GoP */ (void) encumber_msg(); /* immediate feedback for GoP */
/* usually can't remove gloves when they're slippery but it can
be done by having them fall off (polymorph), stolen, or
destroyed (scroll, overenchantment, monster spell); if that
happens, 'cure' slippery fingers so that it doesn't transfer
from gloves to bare hands */
if (Glib)
make_glib(0); /* for update_inventory() */
/* prevent wielding cockatrice when not wearing gloves */ /* prevent wielding cockatrice when not wearing gloves */
if (uwep && uwep->otyp == CORPSE) if (uwep && uwep->otyp == CORPSE)
wielding_corpse(uwep, on_purpose); wielding_corpse(uwep, on_purpose);
@@ -1582,7 +1590,7 @@ struct obj *otmp;
else if (is_shield(otmp)) else if (is_shield(otmp))
(void) Shield_off(); (void) Shield_off();
else else
setworn((struct obj *) 0, otmp->owornmask & W_ARMOR); (void) Armor_off();
off_msg(otmp); off_msg(otmp);
} }
g.context.takeoff.mask = g.context.takeoff.what = 0L; g.context.takeoff.mask = g.context.takeoff.what = 0L;
@@ -1732,6 +1740,13 @@ boolean noisy;
You("cannot wear gloves over your %s.", You("cannot wear gloves over your %s.",
is_sword(uwep) ? c_sword : c_weapon); is_sword(uwep) ? c_sword : c_weapon);
err++; err++;
} else if (Glib) {
/* prevent slippery bare fingers from transferring to
gloved fingers */
if (noisy)
Your("%s are too slippery to pull on %s.",
makeplural(body_part(FINGER)), gloves_simple_name(otmp));
err++;
} else } else
*mask = W_ARMG; *mask = W_ARMG;
} else if (is_shirt(otmp)) { } else if (is_shirt(otmp)) {
@@ -1856,10 +1871,16 @@ struct obj *obj;
} }
} while (!mask); } while (!mask);
} }
if (uarmg && Glib) {
Your(
"%s are too slippery to remove, so you cannot put on the ring.",
gloves_simple_name(uarmg));
return 1; /* always uses move */
}
if (uarmg && uarmg->cursed) { if (uarmg && uarmg->cursed) {
res = !uarmg->bknown; res = !uarmg->bknown;
set_bknown(uarmg, 1); set_bknown(uarmg, 1);
You("cannot remove your gloves to put on the ring."); You("cannot remove your %s to put on the ring.", c_gloves);
return res; /* uses move iff we learned gloves are cursed */ return res; /* uses move iff we learned gloves are cursed */
} }
if (uwep) { if (uwep) {
@@ -2260,8 +2281,9 @@ register struct obj *otmp;
set_bknown(uwep, 1); set_bknown(uwep, 1);
return 0; return 0;
} else if (Glib) { } else if (Glib) {
You_cant("take off the slippery %s with your slippery %s.", pline("%s %s are too slippery to take off.",
c_gloves, makeplural(body_part(FINGER))); uarmg->unpaid ? "The" : "Your", /* simplified Shk_Your() */
gloves_simple_name(uarmg));
return 0; return 0;
} }
} }
+5 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 eat.c $NHDT-Date: 1561233801 2019/06/22 20:03:21 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.203 $ */ /* NetHack 3.6 eat.c $NHDT-Date: 1573290417 2019/11/09 09:06:57 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.204 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1372,9 +1372,11 @@ const char *mesg;
if (tintxts[r].greasy) { if (tintxts[r].greasy) {
/* Assume !Glib, because you can't open tins when Glib. */ /* Assume !Glib, because you can't open tins when Glib. */
incr_itimeout(&Glib, rnd(15)); make_glib(rn1(11, 5)); /* 5..15 */
pline("Eating %s food made your %s very slippery.", pline("Eating %s food made your %s very slippery.",
tintxts[r].txt, makeplural(body_part(FINGER))); tintxts[r].txt,
!uarmg ? makeplural(body_part(FINGER))
: gloves_simple_name(uarmg));
} }
} else { /* spinach... */ } else { /* spinach... */
+99 -1
View File
@@ -3428,7 +3428,13 @@ fopen_sym_file()
{ {
FILE *fp; FILE *fp;
fp = fopen_datafile(SYMBOLS, "r", HACKPREFIX); fp = fopen_datafile(SYMBOLS, "r",
#ifdef WIN32
SYSCONFPREFIX
#else
HACKPREFIX
#endif
);
return fp; return fp;
} }
@@ -4227,6 +4233,98 @@ boolean wildcards;
#endif /*DEBUG*/ #endif /*DEBUG*/
void
reveal_paths(VOID_ARGS)
{
int i;
#define PATHBUFSZ 1024
char buf[PATHBUFSZ];
#ifdef UNIX
char *envp, *slash, nhpath[PATHBUFSZ];
#endif
/* write out path details */
#ifdef PREFIXES_IN_USE
raw_print("Variable playground locations:");
for (i = 0; i < PREFIX_COUNT; i++)
raw_printf(" [%-10s]=\"%s\"", fqn_prefix_names[i],
g.fqn_prefix[i]
? g.fqn_prefix[i]
: "not set");
#endif
/* sysconf file */
#ifdef PREFIXES_IN_USE
Sprintf(buf, " (in %s)",
fqn_prefix_names[SYSCONFPREFIX]);
#else
buf[0] = '\0';
#endif
raw_printf("Your system configuration file%s:", buf);
set_configfile_name(fqname(SYSCF_FILE, SYSCONFPREFIX, 0));
raw_printf(" \"%s\"", configfile);
#ifdef UNIX
Strcpy(nhpath, configfile);
slash = rindex(nhpath, '/');
if (slash)
*slash = '\0';
#endif
/* symbols file */
#ifdef PREFIXES_IN_USE
Sprintf(buf, " (in %s)",
#ifdef WIN32
fqn_prefix_names[SYSCONFPREFIX]);
#else
fqn_prefix_names[HACKPREFIX]);
#endif /* WIN32 */
#else /* PREFIXES_IN_USE */
buf[0] = '\0';
#endif
raw_printf("Your system symbols file%s:", buf);
#ifdef UNIX
Sprintf(buf, "%s/%s", nhpath, SYMBOLS);
#else
#ifdef PREFIXES_IN_USE
Sprintf(buf, "%s",
fqname(SYMBOLS,
#ifdef WIN32
SYSCONFPREFIX, 2));
#else
HACKPREFIX, 2));
#endif
#endif /* PREFIXES_IN_USE */
#endif /* UNIX */
raw_printf(" \"%s\"", buf);
/* configuration file */
#ifdef PREFIXES_IN_USE
Sprintf(buf, " (in %s)",
fqn_prefix_names[CONFIGPREFIX]);
#else /* PREFIXES_IN_USE */
buf[0] = '\0';
#endif
raw_printf("Your personal configuration file%s:", buf);
#ifdef UNIX
envp = nh_getenv("HOME");
if (!envp)
Strcpy(nhpath, ".nethackrc");
else
Sprintf(nhpath, "%s/%s", envp, default_configfile);
#endif
raw_printf(" \"%s\"",
#ifdef UNIX
nhpath);
#else
#ifdef PREFIXES_IN_USE
fqname(default_configfile, CONFIGPREFIX, 3));
#else
default_configfile);
#endif /* PREFIXES_IN_USE */
#endif /* UNIX */
raw_print("");
}
/* ---------- BEGIN TRIBUTE ----------- */ /* ---------- BEGIN TRIBUTE ----------- */
/* 3.6 tribute code /* 3.6 tribute code
+29 -2
View File
@@ -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) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -1053,7 +1053,7 @@ unsigned doname_flags;
Strcat(bp, " (being worn)"); Strcat(bp, " (being worn)");
break; break;
case ARMOR_CLASS: case ARMOR_CLASS:
if (obj->owornmask & W_ARMOR) if (obj->owornmask & W_ARMOR) {
Strcat(bp, (obj == uskin) ? " (embedded in your skin)" Strcat(bp, (obj == uskin) ? " (embedded in your skin)"
/* in case of perm_invent update while Wear/Takeoff /* in case of perm_invent update while Wear/Takeoff
is in progress; check doffing() before donning() is in progress; check doffing() before donning()
@@ -1061,6 +1061,13 @@ unsigned doname_flags;
: doffing(obj) ? " (being doffed)" : doffing(obj) ? " (being doffed)"
: donning(obj) ? " (being donned)" : donning(obj) ? " (being donned)"
: " (being worn)"); : " (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*/ /*FALLTHRU*/
case WEAPON_CLASS: case WEAPON_CLASS:
if (ispoisoned) if (ispoisoned)
@@ -4160,6 +4167,26 @@ struct obj *helmet;
return (helmet && !is_metallic(helmet)) ? "hat" : "helm"; 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 * const char *
mimic_obj_name(mtmp) mimic_obj_name(mtmp)
struct monst *mtmp; struct monst *mtmp;
+3 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 polyself.c $NHDT-Date: 1570230710 2019/10/04 23:11:50 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.134 $ */ /* NetHack 3.6 polyself.c $NHDT-Date: 1573290419 2019/11/09 09:06:59 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.135 $ */
/* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */ /* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -709,7 +709,7 @@ int mntmp;
} }
check_strangling(FALSE); /* maybe stop strangling */ check_strangling(FALSE); /* maybe stop strangling */
if (nohands(g.youmonst.data)) if (nohands(g.youmonst.data))
Glib = 0; make_glib(0);
/* /*
mlvl = adj_lev(&mons[mntmp]); mlvl = adj_lev(&mons[mntmp]);
@@ -985,6 +985,7 @@ break_armor()
You("drop your gloves%s!", uwep ? " and weapon" : ""); You("drop your gloves%s!", uwep ? " and weapon" : "");
drop_weapon(0); drop_weapon(0);
(void) Gloves_off(); (void) Gloves_off();
/* Glib manipulation (ends immediately) handled by Gloves_off */
dropp(otmp); dropp(otmp);
} }
if ((otmp = uarms) != 0) { if ((otmp = uarms) != 0) {
+15 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 potion.c $NHDT-Date: 1572887644 2019/11/04 17:14:04 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.164 $ */ /* NetHack 3.6 potion.c $NHDT-Date: 1573290421 2019/11/09 09:07:01 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.165 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -437,6 +437,17 @@ boolean talk;
} }
} }
/* set or clear "slippery fingers" */
void
make_glib(xtime)
int xtime;
{
set_itimeout(&Glib, xtime);
/* may change "(being worn)" to "(being worn; slippery)" or vice versa */
if (uarmg)
update_inventory();
}
void void
self_invis_message() self_invis_message()
{ {
@@ -2124,8 +2135,9 @@ dodip()
fire_damage(obj, TRUE, u.ux, u.uy); fire_damage(obj, TRUE, u.ux, u.uy);
} else if (potion->cursed) { } else if (potion->cursed) {
pline_The("potion spills and covers your %s with oil.", pline_The("potion spills and covers your %s with oil.",
makeplural(body_part(FINGER))); !uarmg ? makeplural(body_part(FINGER))
incr_itimeout(&Glib, d(2, 10)); : gloves_simple_name(uarmg));
make_glib((int) (Glib & TIMEOUT) + d(2, 10));
} else if (obj->oclass != WEAPON_CLASS && !is_weptool(obj)) { } else if (obj->oclass != WEAPON_CLASS && !is_weptool(obj)) {
/* the following cases apply only to weapons */ /* the following cases apply only to weapons */
goto more_dips; goto more_dips;
+4 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 timeout.c $NHDT-Date: 1565574996 2019/08/12 01:56:36 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.92 $ */ /* NetHack 3.6 timeout.c $NHDT-Date: 1573290422 2019/11/09 09:07:02 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.93 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */ /*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -727,6 +727,9 @@ nh_timeout()
case DETECT_MONSTERS: case DETECT_MONSTERS:
see_monsters(); see_monsters();
break; break;
case GLIB:
make_glib(0); /* might update persistent inventory */
break;
} }
} }
+5 -1
View File
@@ -114,11 +114,15 @@ char *argv[];
if (argcheck(argc, argv, ARG_VERSION) == 2) if (argcheck(argc, argv, ARG_VERSION) == 2)
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
if (argcheck(argc, argv, ARG_SHOWPATHS) == 2) {
initoptions();
reveal_paths();
exit(EXIT_SUCCESS);
}
if (argcheck(argc, argv, ARG_DEBUG) == 1) { if (argcheck(argc, argv, ARG_DEBUG) == 1) {
argc--; argc--;
argv++; argv++;
} }
if (argc > 1 && !strncmp(argv[1], "-d", 2) && argv[1][2] != 'e') { if (argc > 1 && !strncmp(argv[1], "-d", 2) && argv[1][2] != 'e') {
/* avoid matching "-dec" for DECgraphics; since the man page /* avoid matching "-dec" for DECgraphics; since the man page
* says -d directory, hope nobody's using -desomething_else * says -d directory, hope nobody's using -desomething_else
+5
View File
@@ -579,6 +579,11 @@ char *argv[];
if (argcheck(argc, argv, ARG_VERSION) == 2) if (argcheck(argc, argv, ARG_VERSION) == 2)
nethack_exit(EXIT_SUCCESS); nethack_exit(EXIT_SUCCESS);
if (argcheck(argc, argv, ARG_SHOWPATHS) == 2) {
initoptions();
reveal_paths();
nethack_exit(EXIT_SUCCESS);
}
if (argcheck(argc, argv, ARG_DEBUG) == 1) { if (argcheck(argc, argv, ARG_DEBUG) == 1) {
argc--; argc--;
argv++; argv++;