Merge branch 'NetHack-3.6' into bart-test
This commit is contained in:
@@ -767,6 +767,7 @@ const char *msg;
|
||||
static struct early_opt earlyopts[] = {
|
||||
{ARG_DEBUG, "debug", 5, TRUE},
|
||||
{ARG_VERSION, "version", 4, TRUE},
|
||||
{ARG_SHOWPATHS, "showpaths", 9, FALSE},
|
||||
#ifdef WIN32
|
||||
{ARG_WINDOWS, "windows", 4, TRUE},
|
||||
#endif
|
||||
@@ -845,6 +846,9 @@ enum earlyarg e_arg;
|
||||
early_version_info(insert_into_pastebuf);
|
||||
return 2;
|
||||
}
|
||||
case ARG_SHOWPATHS: {
|
||||
return 2;
|
||||
}
|
||||
#ifdef WIN32
|
||||
case ARG_WINDOWS: {
|
||||
if (extended_opt) {
|
||||
|
||||
+15
-11
@@ -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: 1573346182 2019/11/10 00:36:22 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.283 $ */
|
||||
/* 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;
|
||||
@@ -2292,17 +2293,19 @@ struct obj *obj;
|
||||
|
||||
if (Glib) {
|
||||
pline("%s from your %s.", Tobjnam(obj, "slip"),
|
||||
makeplural(body_part(FINGER)));
|
||||
fingers_or_gloves(FALSE));
|
||||
dropx(obj);
|
||||
return;
|
||||
}
|
||||
|
||||
if (obj->spe > 0) {
|
||||
int oldglib;
|
||||
|
||||
if ((obj->cursed || Fumbling) && !rn2(2)) {
|
||||
consume_obj_charge(obj, TRUE);
|
||||
|
||||
pline("%s from your %s.", Tobjnam(obj, "slip"),
|
||||
makeplural(body_part(FINGER)));
|
||||
fingers_or_gloves(FALSE));
|
||||
dropx(obj);
|
||||
return;
|
||||
}
|
||||
@@ -2313,17 +2316,18 @@ struct obj *obj;
|
||||
return;
|
||||
consume_obj_charge(obj, TRUE);
|
||||
|
||||
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(TRUE));
|
||||
}
|
||||
} 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(TRUE));
|
||||
}
|
||||
} else {
|
||||
if (obj->known)
|
||||
|
||||
+9
-3
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 botl.c $NHDT-Date: 1562114350 2019/07/03 00:39:10 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.146 $ */
|
||||
/* NetHack 3.6 botl.c $NHDT-Date: 1573178085 2019/11/08 01:54:45 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.148 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2006. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -142,9 +142,9 @@ do_statusline2()
|
||||
if (Upolyd)
|
||||
Sprintf(expr, "HD:%d", mons[u.umonnum].mlevel);
|
||||
else if (flags.showexp)
|
||||
Sprintf(expr, "Xp:%u/%-1ld", u.ulevel, u.uexp);
|
||||
Sprintf(expr, "Xp:%d/%-1ld", u.ulevel, u.uexp);
|
||||
else
|
||||
Sprintf(expr, "Exp:%u", u.ulevel);
|
||||
Sprintf(expr, "Exp:%d", u.ulevel);
|
||||
xln = strlen(expr);
|
||||
|
||||
/* time/move counter */
|
||||
@@ -850,6 +850,12 @@ boolean *valsetlist;
|
||||
if (anytype != ANY_MASK32) {
|
||||
#ifdef STATUS_HILITES
|
||||
if (chg || *curr->val) {
|
||||
/* if Xp percentage changed, we set 'chg' to 1 above;
|
||||
reset that if the Xp value hasn't actually changed
|
||||
or possibly went down rather than up (level loss) */
|
||||
if (chg == 1 && fld == BL_XP)
|
||||
chg = compare_blstats(prev, curr);
|
||||
|
||||
curr->hilite_rule = get_hilite(idx, fld,
|
||||
(genericptr_t) &curr->a,
|
||||
chg, pc, &color);
|
||||
|
||||
@@ -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: 1573346187 2019/11/10 00:36:27 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.349 $ */
|
||||
/* 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,9 @@ int final;
|
||||
}
|
||||
}
|
||||
if (Glib) {
|
||||
Sprintf(buf, "slippery %s", makeplural(body_part(FINGER)));
|
||||
Sprintf(buf, "slippery %s", fingers_or_gloves(TRUE));
|
||||
if (wizard)
|
||||
Sprintf(eos(buf), " (%ld)", (Glib & TIMEOUT));
|
||||
you_have(buf, "");
|
||||
}
|
||||
if (Fumbling) {
|
||||
@@ -5046,7 +5053,7 @@ const char *s;
|
||||
char dirsym;
|
||||
int is_mov;
|
||||
|
||||
retry:
|
||||
retry:
|
||||
if (in_doagain || *readchar_queue)
|
||||
dirsym = readchar();
|
||||
else
|
||||
|
||||
+60
-12
@@ -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: 1573346188 2019/11/10 00:36:28 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.113 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -44,6 +44,16 @@ STATIC_PTR int FDECL(accessory_or_armor_on, (struct obj *));
|
||||
STATIC_DCL void FDECL(already_wearing, (const char *));
|
||||
STATIC_DCL void FDECL(already_wearing2, (const char *, const char *));
|
||||
|
||||
/* plural "fingers" or optionally "gloves" */
|
||||
const char *
|
||||
fingers_or_gloves(check_gloves)
|
||||
boolean check_gloves;
|
||||
{
|
||||
return ((check_gloves && uarmg)
|
||||
? gloves_simple_name(uarmg) /* "gloves" or "gauntlets" */
|
||||
: makeplural(body_part(FINGER))); /* "fingers" */
|
||||
}
|
||||
|
||||
void
|
||||
off_msg(otmp)
|
||||
struct obj *otmp;
|
||||
@@ -562,6 +572,14 @@ Gloves_off(VOID_ARGS)
|
||||
context.takeoff.cancelled_don = FALSE;
|
||||
(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 */
|
||||
if (uwep && uwep->otyp == CORPSE)
|
||||
wielding_corpse(uwep, on_purpose);
|
||||
@@ -1529,7 +1547,15 @@ struct obj *otmp;
|
||||
boolean use_plural = (is_boots(otmp) || is_gloves(otmp)
|
||||
|| otmp->otyp == LENSES || otmp->quan > 1L);
|
||||
|
||||
You("can't. %s cursed.", use_plural ? "They are" : "It is");
|
||||
/* might be trying again after applying grease to hands */
|
||||
if (Glib && otmp->bknown
|
||||
/* for weapon, we'll only get here via 'A )' */
|
||||
&& (uarmg ? (otmp == uwep)
|
||||
: ((otmp->owornmask & (W_WEP | W_RING)) != 0)))
|
||||
pline("Despite your slippery %s, you can't.",
|
||||
fingers_or_gloves(TRUE));
|
||||
else
|
||||
You("can't. %s cursed.", use_plural ? "They are" : "It is");
|
||||
set_bknown(otmp, 1);
|
||||
return 1;
|
||||
}
|
||||
@@ -1586,7 +1612,7 @@ struct obj *otmp;
|
||||
else if (is_shield(otmp))
|
||||
(void) Shield_off();
|
||||
else
|
||||
setworn((struct obj *) 0, otmp->owornmask & W_ARMOR);
|
||||
(void) Armor_off();
|
||||
off_msg(otmp);
|
||||
}
|
||||
context.takeoff.mask = context.takeoff.what = 0L;
|
||||
@@ -1736,6 +1762,13 @@ boolean noisy;
|
||||
You("cannot wear gloves over your %s.",
|
||||
is_sword(uwep) ? c_sword : c_weapon);
|
||||
err++;
|
||||
} else if (Glib) {
|
||||
/* prevent slippery bare fingers from transferring to
|
||||
gloved fingers */
|
||||
if (noisy)
|
||||
Your("%s are too slippery to pull on %s.",
|
||||
fingers_or_gloves(FALSE), gloves_simple_name(otmp));
|
||||
err++;
|
||||
} else
|
||||
*mask = W_ARMG;
|
||||
} else if (is_shirt(otmp)) {
|
||||
@@ -1833,7 +1866,7 @@ struct obj *obj;
|
||||
if (uleft && uright) {
|
||||
There("are no more %s%s to fill.",
|
||||
humanoid(youmonst.data) ? "ring-" : "",
|
||||
makeplural(body_part(FINGER)));
|
||||
fingers_or_gloves(FALSE));
|
||||
return 0;
|
||||
}
|
||||
if (uleft) {
|
||||
@@ -1860,10 +1893,16 @@ struct obj *obj;
|
||||
}
|
||||
} 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) {
|
||||
res = !uarmg->bknown;
|
||||
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 */
|
||||
}
|
||||
if (uwep) {
|
||||
@@ -2018,7 +2057,7 @@ doputon()
|
||||
/* 'P' message doesn't mention armor */
|
||||
Your("%s%s are full, and you're already wearing an amulet and %s.",
|
||||
humanoid(youmonst.data) ? "ring-" : "",
|
||||
makeplural(body_part(FINGER)),
|
||||
fingers_or_gloves(FALSE),
|
||||
(ublindf->otyp == LENSES) ? "some lenses" : "a blindfold");
|
||||
return 0;
|
||||
}
|
||||
@@ -2088,7 +2127,7 @@ glibr()
|
||||
/* changed so cursed rings don't fall off, GAN 10/30/86 */
|
||||
Your("%s off your %s.",
|
||||
(leftfall && rightfall) ? "rings slip" : "ring slips",
|
||||
(leftfall && rightfall) ? makeplural(body_part(FINGER))
|
||||
(leftfall && rightfall) ? fingers_or_gloves(FALSE)
|
||||
: body_part(FINGER));
|
||||
xfl++;
|
||||
if (leftfall) {
|
||||
@@ -2210,6 +2249,10 @@ int otyp;
|
||||
return uarmg;
|
||||
if (ring->cursed)
|
||||
return ring;
|
||||
/* normally outermost layer is processed first, but slippery gloves
|
||||
wears off quickly so uncurse ring itself before handling those */
|
||||
if (uarmg && Glib)
|
||||
return uarmg;
|
||||
}
|
||||
/* either no ring or not right type or nothing prevents its removal */
|
||||
return (struct obj *) 0;
|
||||
@@ -2238,17 +2281,21 @@ register struct obj *otmp;
|
||||
|
||||
/* special ring checks */
|
||||
if (otmp == uright || otmp == uleft) {
|
||||
struct obj glibdummy;
|
||||
|
||||
if (nolimbs(youmonst.data)) {
|
||||
pline_The("ring is stuck.");
|
||||
return 0;
|
||||
}
|
||||
glibdummy = zeroobj;
|
||||
why = 0; /* the item which prevents ring removal */
|
||||
if (welded(uwep) && (otmp == uright || bimanual(uwep))) {
|
||||
Sprintf(buf, "free a weapon %s", body_part(HAND));
|
||||
why = uwep;
|
||||
} else if (uarmg && uarmg->cursed) {
|
||||
Sprintf(buf, "take off your %s", c_gloves);
|
||||
why = uarmg;
|
||||
} else if (uarmg && (uarmg->cursed || Glib)) {
|
||||
Sprintf(buf, "take off your %s%s",
|
||||
Glib ? "slippery " : "", gloves_simple_name(uarmg));
|
||||
why = !Glib ? uarmg : &glibdummy;
|
||||
}
|
||||
if (why) {
|
||||
You("cannot %s to remove the ring.", buf);
|
||||
@@ -2264,8 +2311,9 @@ register struct obj *otmp;
|
||||
set_bknown(uwep, 1);
|
||||
return 0;
|
||||
} else if (Glib) {
|
||||
You_cant("take off the slippery %s with your slippery %s.",
|
||||
c_gloves, makeplural(body_part(FINGER)));
|
||||
pline("%s %s are too slippery to take off.",
|
||||
uarmg->unpaid ? "The" : "Your", /* simplified Shk_Your() */
|
||||
gloves_simple_name(uarmg));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
+10
-3
@@ -1197,9 +1197,16 @@ dokick()
|
||||
exercise(A_DEX, TRUE);
|
||||
return 1;
|
||||
} else if (!rn2(3)) {
|
||||
pline("Flupp! %s.",
|
||||
(Blind ? "You hear a sloshing sound"
|
||||
: "Muddy waste pops up from the drain"));
|
||||
if (Blind && Deaf)
|
||||
Sprintf(buf, " %s", body_part(FACE));
|
||||
else
|
||||
buf[0] = '\0';
|
||||
pline("%s%s%s.", !Deaf ? "Flupp! " : "",
|
||||
!Blind
|
||||
? "Muddy waste pops up from the drain"
|
||||
: !Deaf
|
||||
? "You hear a sloshing sound" /* Deaf-aware */
|
||||
: "Something splashes you in the", buf);
|
||||
if (!(maploc->looted & S_LRING)) { /* once per sink */
|
||||
if (!Blind)
|
||||
You_see("a ring shining in its midst.");
|
||||
|
||||
@@ -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: 1573346189 2019/11/10 00:36:29 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.205 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1378,9 +1378,9 @@ const char *mesg;
|
||||
|
||||
if (tintxts[r].greasy) {
|
||||
/* 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.",
|
||||
tintxts[r].txt, makeplural(body_part(FINGER)));
|
||||
tintxts[r].txt, fingers_or_gloves(TRUE));
|
||||
}
|
||||
|
||||
} else { /* spinach... */
|
||||
@@ -1505,8 +1505,7 @@ struct obj *otmp;
|
||||
no_opener:
|
||||
pline("It is not so easy to open this tin.");
|
||||
if (Glib) {
|
||||
pline_The("tin slips from your %s.",
|
||||
makeplural(body_part(FINGER)));
|
||||
pline_The("tin slips from your %s.", fingers_or_gloves(FALSE));
|
||||
if (otmp->quan > 1L) {
|
||||
otmp = splitobj(otmp, 1L);
|
||||
}
|
||||
|
||||
+2
-2
@@ -755,7 +755,7 @@ doengrave()
|
||||
}
|
||||
Strcpy(post_engr_text,
|
||||
(Blind && !Deaf)
|
||||
? "You hear drilling!"
|
||||
? "You hear drilling!" /* Deaf-aware */
|
||||
: Blind
|
||||
? "You feel tremors."
|
||||
: IS_GRAVE(levl[u.ux][u.uy].typ)
|
||||
@@ -792,7 +792,7 @@ doengrave()
|
||||
doblind = TRUE;
|
||||
} else
|
||||
Strcpy(post_engr_text, !Deaf
|
||||
? "You hear crackling!"
|
||||
? "You hear crackling!" /* Deaf-aware */
|
||||
: "Your hair stands up!");
|
||||
break;
|
||||
|
||||
|
||||
+161
-10
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 files.c $NHDT-Date: 1571347976 2019/10/17 21:32:56 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.254 $ */
|
||||
/* NetHack 3.6 files.c $NHDT-Date: 1573358489 2019/11/10 04:01:29 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.263 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1644,7 +1644,7 @@ boolean uncomp;
|
||||
static int nesting = 0;
|
||||
|
||||
#if defined(NO_FILE_LINKS) || defined(USE_FCNTL) /* implies UNIX */
|
||||
static int lockfd; /* for lock_file() to pass to unlock_file() */
|
||||
static int lockfd = -1; /* for lock_file() to pass to unlock_file() */
|
||||
#endif
|
||||
#ifdef USE_FCNTL
|
||||
struct flock sflock; /* for unlocking, same as above */
|
||||
@@ -1756,7 +1756,7 @@ int retryct;
|
||||
return FALSE;
|
||||
}
|
||||
#else
|
||||
register int errnosv = errno;
|
||||
int errnosv = errno;
|
||||
|
||||
switch (errnosv) { /* George Barbanis */
|
||||
case EEXIST:
|
||||
@@ -1867,9 +1867,10 @@ const char *filename;
|
||||
if (nesting == 1) {
|
||||
#ifdef USE_FCNTL
|
||||
sflock.l_type = F_UNLCK;
|
||||
if (fcntl(lockfd, F_SETLK, &sflock) == -1) {
|
||||
HUP raw_printf("Can't remove fcntl lock on %s.", filename);
|
||||
(void) close(lockfd);
|
||||
if (lockfd >= 0) {
|
||||
if (fcntl(lockfd, F_SETLK, &sflock) == -1)
|
||||
HUP raw_printf("Can't remove fcntl lock on %s.", filename);
|
||||
(void) close(lockfd), lockfd = -1;
|
||||
}
|
||||
#else
|
||||
lockname = make_lockname(filename, locknambuf);
|
||||
@@ -1881,7 +1882,7 @@ const char *filename;
|
||||
if (unlink(lockname) < 0)
|
||||
HUP raw_printf("Can't unlink %s.", lockname);
|
||||
#ifdef NO_FILE_LINKS
|
||||
(void) nhclose(lockfd);
|
||||
(void) nhclose(lockfd), lockfd = -1;
|
||||
#endif
|
||||
|
||||
#endif /* UNIX || VMS */
|
||||
@@ -2020,7 +2021,7 @@ int src;
|
||||
/* constructed full path names don't need fqname() */
|
||||
#ifdef VMS
|
||||
/* no punctuation, so might be a logical name */
|
||||
set_configfile_name(fqname("nethackini", CONFIGPREFIX, 0));
|
||||
set_configfile_name("nethackini");
|
||||
if ((fp = fopenp(configfile, "r")) != (FILE *) 0)
|
||||
return fp;
|
||||
set_configfile_name("sys$login:nethack.ini");
|
||||
@@ -2056,7 +2057,7 @@ int src;
|
||||
set_configfile_name(tmp_config);
|
||||
if ((fp = fopenp(configfile, "r")) != (FILE *) 0)
|
||||
return fp;
|
||||
/* may be easier for user to edit if filename as '.txt' suffix */
|
||||
/* may be easier for user to edit if filename has '.txt' suffix */
|
||||
Sprintf(tmp_config, "%s/%s", envp,
|
||||
"Library/Preferences/NetHack Defaults.txt");
|
||||
set_configfile_name(tmp_config);
|
||||
@@ -3198,7 +3199,13 @@ fopen_sym_file()
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen_datafile(SYMBOLS, "r", CONFIGPREFIX);
|
||||
fp = fopen_datafile(SYMBOLS, "r",
|
||||
#ifdef WIN32
|
||||
SYSCONFPREFIX
|
||||
#else
|
||||
HACKPREFIX
|
||||
#endif
|
||||
);
|
||||
|
||||
return fp;
|
||||
}
|
||||
@@ -3970,6 +3977,150 @@ boolean wildcards;
|
||||
|
||||
#endif /*DEBUG*/
|
||||
|
||||
#ifdef UNIX
|
||||
#ifndef PATH_MAX
|
||||
#include <limits.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void
|
||||
reveal_paths(VOID_ARGS)
|
||||
{
|
||||
const char *fqn, *filep;
|
||||
char buf[BUFSZ];
|
||||
#if defined(UNIX) || defined(PREFIXES_IN_USE)
|
||||
char *strp;
|
||||
#endif
|
||||
#ifdef UNIX
|
||||
char *envp, cwdbuf[PATH_MAX];
|
||||
#endif
|
||||
#ifdef PREFIXES_IN_USE
|
||||
int i, maxlen = 0;
|
||||
|
||||
raw_print("Variable playground locations:");
|
||||
for (i = 0; i < PREFIX_COUNT; i++)
|
||||
raw_printf(" [%-10s]=\"%s\"", fqn_prefix_names[i],
|
||||
fqn_prefix[i] ? fqn_prefix[i] : "not set");
|
||||
#endif
|
||||
|
||||
/* sysconf file */
|
||||
|
||||
#ifdef SYSCF
|
||||
#ifdef PREFIXES_IN_USE
|
||||
strp = fqn_prefix_names[SYSCONFPREFIX];
|
||||
maxlen = BUFSZ - sizeof " (in )";
|
||||
if (strp && strlen(strp) < (size_t) maxlen)
|
||||
Sprintf(buf, " (in %s)", strp);
|
||||
#else
|
||||
buf[0] = '\0';
|
||||
#endif
|
||||
raw_printf("Your system configuration file%s:", buf);
|
||||
#ifdef SYSCF_FILE
|
||||
filep = SYSCF_FILE;
|
||||
#else
|
||||
filep = "sysconf";
|
||||
#endif
|
||||
fqn = fqname(filep, SYSCONFPREFIX, 0);
|
||||
if (fqn) {
|
||||
set_configfile_name(fqn);
|
||||
filep = configfile;
|
||||
}
|
||||
raw_printf(" \"%s\"", filep);
|
||||
#else /* !SYSCF */
|
||||
raw_printf("No system configuration file.");
|
||||
#endif /* ?SYSCF */
|
||||
|
||||
/* symbols file */
|
||||
|
||||
buf[0] = '\0';
|
||||
#ifndef UNIX
|
||||
#ifdef PREFIXES_IN_USE
|
||||
#ifdef WIN32
|
||||
strp = fqn_prefix_names[SYSCONFPREFIX];
|
||||
#else
|
||||
strp = fqn_prefix_names[HACKPREFIX];
|
||||
#endif /* WIN32 */
|
||||
maxlen = BUFSZ - sizeof " (in )";
|
||||
if (strp && strlen(strp) < (size_t) maxlen)
|
||||
Sprintf(buf, " (in %s)", strp);
|
||||
#endif /* PREFIXES_IN_USE */
|
||||
raw_printf("Your game's loadable symbols file%s:", buf);
|
||||
#endif /* UNIX */
|
||||
|
||||
#ifdef UNIX
|
||||
envp = getcwd(cwdbuf, PATH_MAX);
|
||||
if (envp) {
|
||||
raw_print("Your game's loadable symbols file:");
|
||||
raw_printf(" \"%s/%s\"", envp, SYMBOLS);
|
||||
}
|
||||
#else /* UNIX */
|
||||
filep = SYMBOLS;
|
||||
#ifdef PREFIXES_IN_USE
|
||||
#ifdef WIN32
|
||||
fqn = fqname(filep, SYSCONFPREFIX, 1);
|
||||
#else
|
||||
fqn = fqname(filep, HACKPREFIX, 1);
|
||||
#endif /* WIN32 */
|
||||
if (fqn)
|
||||
filep = fqn;
|
||||
#endif /* PREFIXES_IN_USE */
|
||||
raw_printf(" \"%s\"", filep);
|
||||
#endif /* UNIX */
|
||||
|
||||
/* personal configuration file */
|
||||
|
||||
buf[0] = '\0';
|
||||
#ifdef PREFIXES_IN_USE
|
||||
strp = fqn_prefix_names[CONFIGPREFIX];
|
||||
maxlen = BUFSZ - sizeof " (in )";
|
||||
if (strp && strlen(strp) < (size_t) maxlen)
|
||||
Sprintf(buf, " (in %s)", strp);
|
||||
#endif /* PREFIXES_IN_USE */
|
||||
raw_printf("Your personal configuration file%s:", buf);
|
||||
|
||||
#ifdef UNIX
|
||||
buf[0] = '\0';
|
||||
if ((envp = nh_getenv("HOME")) != 0) {
|
||||
copynchars(buf, envp, (int) sizeof buf - 1 - 1);
|
||||
Strcat(buf, "/");
|
||||
}
|
||||
strp = eos(buf);
|
||||
copynchars(strp, default_configfile,
|
||||
(int) (sizeof buf - 1 - strlen(buf)));
|
||||
#if defined(__APPLE__) /* UNIX+__APPLE__ => MacOSX aka OSX aka macOS */
|
||||
if (envp) {
|
||||
if (access(buf, 4) == -1) { /* 4: R_OK, -1: failure */
|
||||
/* read access to default failed; might be protected excessively
|
||||
but more likely it doesn't exist; try first alternate:
|
||||
"$HOME/Library/Pref..."; 'strp' points past '/' */
|
||||
copynchars(strp, "Library/Preferences/NetHack Defaults",
|
||||
(int) (sizeof buf - 1 - strlen(buf)));
|
||||
if (access(buf, 4) == -1) {
|
||||
/* first alternate failed, try second:
|
||||
".../NetHack Defaults.txt"; no 'strp', just append */
|
||||
copynchars(eos(buf), ".txt",
|
||||
(int) (sizeof buf - 1 - strlen(buf)));
|
||||
if (access(buf, 4) == -1) {
|
||||
/* second alternate failed too, so revert to the
|
||||
original default ("$HOME/.nethackrc") for message */
|
||||
copynchars(strp, default_configfile,
|
||||
(int) (sizeof buf - 1 - strlen(buf)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
raw_printf(" \"%s\"", buf);
|
||||
#else /* !UNIX */
|
||||
fqn = (const char *) 0;
|
||||
#ifdef PREFIXES_IN_USE
|
||||
fqn = fqname(default_configfile, CONFIGPREFIX, 2);
|
||||
#endif
|
||||
raw_printf(" \"%s\"", fqn ? fqn : default_configfile);
|
||||
#endif /* ?UNIX */
|
||||
raw_print("");
|
||||
}
|
||||
|
||||
/* ---------- BEGIN TRIBUTE ----------- */
|
||||
|
||||
/* 3.6 tribute code
|
||||
|
||||
+21
-3
@@ -153,17 +153,35 @@ moverock()
|
||||
if (mtmp && !noncorporeal(mtmp->data)
|
||||
&& (!mtmp->mtrapped
|
||||
|| !(ttmp && is_pit(ttmp->ttyp)))) {
|
||||
boolean deliver_part1 = FALSE;
|
||||
|
||||
if (Blind)
|
||||
feel_location(sx, sy);
|
||||
if (canspotmon(mtmp)) {
|
||||
pline("There's %s on the other side.", a_monnam(mtmp));
|
||||
deliver_part1 = TRUE;
|
||||
} else {
|
||||
You_hear("a monster behind %s.", the(xname(otmp)));
|
||||
if (!Deaf)
|
||||
deliver_part1 = TRUE;
|
||||
map_invisible(rx, ry);
|
||||
}
|
||||
if (flags.verbose)
|
||||
pline("Perhaps that's why %s cannot move it.",
|
||||
u.usteed ? y_monnam(u.usteed) : "you");
|
||||
if (flags.verbose) {
|
||||
char you_or_steed[BUFSZ];
|
||||
|
||||
Strcpy(you_or_steed,
|
||||
u.usteed ? y_monnam(u.usteed) : "you");
|
||||
pline("%s%s cannot move %s.",
|
||||
deliver_part1
|
||||
? "Perhaps that's why "
|
||||
: "",
|
||||
deliver_part1
|
||||
? you_or_steed
|
||||
: upstart(you_or_steed),
|
||||
deliver_part1
|
||||
? "it"
|
||||
: the(xname(otmp)));
|
||||
}
|
||||
goto cannot_push;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 invent.c $NHDT-Date: 1571436003 2019/10/18 22:00:03 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.265 $ */
|
||||
/* NetHack 3.6 invent.c $NHDT-Date: 1573346190 2019/11/10 00:36:30 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.266 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1719,7 +1719,7 @@ register const char *let, *word;
|
||||
if (iflags.force_invmenu)
|
||||
Sprintf(menuquery, "What do you want to %s?", word);
|
||||
if (!strcmp(word, "grease"))
|
||||
Sprintf(qbuf, "your %s", makeplural(body_part(FINGER)));
|
||||
Sprintf(qbuf, "your %s", fingers_or_gloves(FALSE));
|
||||
else if (!strcmp(word, "write with"))
|
||||
Sprintf(qbuf, "your %s", body_part(FINGERTIP));
|
||||
else if (!strcmp(word, "wield"))
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ boolean undirected;
|
||||
pline("%s points %s.", Monnam(mtmp), point_msg);
|
||||
} else if ((!(moves % 4) || !rn2(4))) {
|
||||
if (!Deaf)
|
||||
Norep("You hear a mumbled curse.");
|
||||
Norep("You hear a mumbled curse."); /* Deaf-aware */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1365,7 +1365,7 @@ fumaroles()
|
||||
}
|
||||
}
|
||||
if (snd && !Deaf)
|
||||
Norep("You hear a %swhoosh!", loud ? "loud " : "");
|
||||
Norep("You hear a %swhoosh!", loud ? "loud " : ""); /* Deaf-aware */
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -3762,7 +3762,7 @@ boolean msg; /* "The oldmon turns into a newmon!" */
|
||||
/* take on the new form... */
|
||||
set_mon_data(mtmp, mdat);
|
||||
|
||||
if (!leashable(mtmp))
|
||||
if (mtmp->mleashed && !leashable(mtmp))
|
||||
m_unleash(mtmp, TRUE);
|
||||
|
||||
if (emits_light(olddata) != emits_light(mtmp->data)) {
|
||||
|
||||
+73
-24
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 music.c $NHDT-Date: 1544442713 2018/12/10 11:51:53 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.57 $ */
|
||||
/* NetHack 3.6 music.c $NHDT-Date: 1573063606 2019/11/06 18:06:46 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.60 $ */
|
||||
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -187,8 +187,9 @@ struct monst *bugler; /* monster that played instrument */
|
||||
mtmp->mstrategy &= ~STRAT_WAITMASK;
|
||||
if (canseemon(mtmp))
|
||||
pline("%s is now ready for battle!", Monnam(mtmp));
|
||||
else
|
||||
Norep("You hear the rattle of battle gear being readied.");
|
||||
else if (!Deaf)
|
||||
Norep("%s the rattle of battle gear being readied.",
|
||||
"You hear"); /* Deaf-aware */
|
||||
} else if ((distm = ((bugler == &youmonst)
|
||||
? distu(mtmp->mx, mtmp->my)
|
||||
: dist2(bugler->mx, bugler->my, mtmp->mx,
|
||||
@@ -301,7 +302,7 @@ int force;
|
||||
/*FALLTHRU*/
|
||||
case ROOM:
|
||||
case CORR: /* Try to make a pit */
|
||||
do_pit:
|
||||
do_pit:
|
||||
chasm = maketrap(x, y, PIT);
|
||||
if (!chasm)
|
||||
break; /* no pit if portal at that location */
|
||||
@@ -483,6 +484,7 @@ struct obj *instr;
|
||||
itmp.otyp -= 1;
|
||||
mundane = TRUE;
|
||||
}
|
||||
|
||||
#ifdef MAC
|
||||
mac_speaker(&itmp, "C");
|
||||
#endif
|
||||
@@ -509,18 +511,41 @@ struct obj *instr;
|
||||
if (Hallucination)
|
||||
mode |= PLAY_HALLU;
|
||||
|
||||
if (!rn2(2)) {
|
||||
/*
|
||||
* TEMPORARY? for multiple impairments, don't always
|
||||
* give the generic "it's far from music" message.
|
||||
*/
|
||||
/* remove if STUNNED+CONFUSED ever gets its own message below */
|
||||
if (mode == (PLAY_STUNNED | PLAY_CONFUSED))
|
||||
mode = !rn2(2) ? PLAY_STUNNED : PLAY_CONFUSED;
|
||||
/* likewise for stunned and/or confused combined with hallucination */
|
||||
if (mode & PLAY_HALLU)
|
||||
mode = PLAY_HALLU;
|
||||
}
|
||||
|
||||
/* 3.6.3: most of these gave "You produce <blah>" and then many of
|
||||
the instrument-specific messages below which immediately follow
|
||||
also gave "You produce <something>." That looked strange so we
|
||||
now use a different verb here */
|
||||
switch (mode) {
|
||||
case PLAY_NORMAL:
|
||||
You("start playing %s.", yname(instr));
|
||||
break;
|
||||
case PLAY_STUNNED:
|
||||
You("produce an obnoxious droning sound.");
|
||||
if (!Deaf)
|
||||
You("radiate an obnoxious droning sound.");
|
||||
else
|
||||
You_feel("a monotonous vibration.");
|
||||
break;
|
||||
case PLAY_CONFUSED:
|
||||
You("produce a raucous noise.");
|
||||
if (!Deaf)
|
||||
You("generate a raucous noise.");
|
||||
else
|
||||
You_feel("a jarring vibration.");
|
||||
break;
|
||||
case PLAY_HALLU:
|
||||
You("produce a kaleidoscopic display of floating butterfiles.");
|
||||
You("disseminate a kaleidoscopic display of floating butterflies.");
|
||||
break;
|
||||
/* TODO? give some or all of these combinations their own feedback;
|
||||
hallucination ones should reference senses other than hearing... */
|
||||
@@ -529,7 +554,7 @@ struct obj *instr;
|
||||
case PLAY_CONFUSED | PLAY_HALLU:
|
||||
case PLAY_STUNNED | PLAY_CONFUSED | PLAY_HALLU:
|
||||
default:
|
||||
pline("What you produce is quite far from music...");
|
||||
pline("What you perform is quite far from music...");
|
||||
break;
|
||||
}
|
||||
#undef PLAY_NORMAL
|
||||
@@ -541,13 +566,17 @@ struct obj *instr;
|
||||
case MAGIC_FLUTE: /* Make monster fall asleep */
|
||||
consume_obj_charge(instr, TRUE);
|
||||
|
||||
You("produce %s music.", Hallucination ? "piped" : "soft");
|
||||
You("%sproduce %s music.", !Deaf ? "" : "seem to ",
|
||||
Hallucination ? "piped" : "soft");
|
||||
put_monsters_to_sleep(u.ulevel * 5);
|
||||
exercise(A_DEX, TRUE);
|
||||
break;
|
||||
case WOODEN_FLUTE: /* May charm snakes */
|
||||
do_spec &= (rn2(ACURR(A_DEX)) + u.ulevel > 25);
|
||||
pline("%s.", Tobjnam(instr, do_spec ? "trill" : "toot"));
|
||||
if (!Deaf)
|
||||
pline("%s.", Tobjnam(instr, do_spec ? "trill" : "toot"));
|
||||
else
|
||||
You_feel("%s %s.", yname(instr), do_spec ? "trill" : "toot");
|
||||
if (do_spec)
|
||||
charm_snakes(u.ulevel * 3);
|
||||
exercise(A_DEX, TRUE);
|
||||
@@ -573,26 +602,38 @@ struct obj *instr;
|
||||
makeknown(instr->otyp);
|
||||
break;
|
||||
case TOOLED_HORN: /* Awaken or scare monsters */
|
||||
You("produce a frightful, grave sound.");
|
||||
if (!Deaf)
|
||||
You("produce a frightful, grave sound.");
|
||||
else
|
||||
You("blow into the horn.");
|
||||
awaken_monsters(u.ulevel * 30);
|
||||
exercise(A_WIS, FALSE);
|
||||
break;
|
||||
case BUGLE: /* Awaken & attract soldiers */
|
||||
You("extract a loud noise from %s.", yname(instr));
|
||||
if (!Deaf)
|
||||
You("extract a loud noise from %s.", yname(instr));
|
||||
else
|
||||
You("blow into the bugle.");
|
||||
awaken_soldiers(&youmonst);
|
||||
exercise(A_WIS, FALSE);
|
||||
break;
|
||||
case MAGIC_HARP: /* Charm monsters */
|
||||
consume_obj_charge(instr, TRUE);
|
||||
|
||||
pline("%s very attractive music.", Tobjnam(instr, "produce"));
|
||||
if (!Deaf)
|
||||
pline("%s very attractive music.", Tobjnam(instr, "produce"));
|
||||
else
|
||||
You_feel("very soothing vibrations.");
|
||||
charm_monsters((u.ulevel - 1) / 3 + 1);
|
||||
exercise(A_DEX, TRUE);
|
||||
break;
|
||||
case WOODEN_HARP: /* May calm Nymph */
|
||||
do_spec &= (rn2(ACURR(A_DEX)) + u.ulevel > 25);
|
||||
pline("%s %s.", Yname2(instr),
|
||||
do_spec ? "produces a lilting melody" : "twangs");
|
||||
if (!Deaf)
|
||||
pline("%s %s.", Yname2(instr),
|
||||
do_spec ? "produces a lilting melody" : "twangs");
|
||||
else
|
||||
You_feel("soothing vibrations.");
|
||||
if (do_spec)
|
||||
calm_nymphs(u.ulevel * 3);
|
||||
exercise(A_DEX, TRUE);
|
||||
@@ -613,8 +654,12 @@ struct obj *instr;
|
||||
break;
|
||||
case LEATHER_DRUM: /* Awaken monsters */
|
||||
if (!mundane) {
|
||||
You("beat a deafening row!");
|
||||
incr_itimeout(&HDeaf, rn1(20, 30));
|
||||
if (!Deaf) {
|
||||
You("beat a deafening row!");
|
||||
incr_itimeout(&HDeaf, rn1(20, 30));
|
||||
} else {
|
||||
You("pound on the drum.");
|
||||
}
|
||||
exercise(A_WIS, FALSE);
|
||||
} else
|
||||
You("%s %s.",
|
||||
@@ -685,7 +730,10 @@ struct obj *instr;
|
||||
*s = 'B';
|
||||
}
|
||||
}
|
||||
You("extract a strange sound from %s!", the(xname(instr)));
|
||||
|
||||
You(!Deaf ? "extract a strange sound from %s!"
|
||||
: "can feel %s emitting vibrations.", the(xname(instr)));
|
||||
|
||||
#ifdef UNIX386MUSIC
|
||||
/* if user is at the console, play through the console speaker */
|
||||
if (atconsole())
|
||||
@@ -725,8 +773,8 @@ struct obj *instr;
|
||||
for (x = u.ux - 1; x <= u.ux + 1; x++)
|
||||
if (isok(x, y))
|
||||
if (find_drawbridge(&x, &y)) {
|
||||
u.uevent.uheard_tune =
|
||||
2; /* tune now fully known */
|
||||
/* tune now fully known */
|
||||
u.uevent.uheard_tune = 2;
|
||||
if (levl[x][y].typ == DRAWBRIDGE_DOWN)
|
||||
close_drawbridge(x, y);
|
||||
else
|
||||
@@ -759,7 +807,7 @@ struct obj *instr;
|
||||
if (buf[x] == tune[x]) {
|
||||
gears++;
|
||||
matched[x] = TRUE;
|
||||
} else
|
||||
} else {
|
||||
for (y = 0; y < 5; y++)
|
||||
if (!matched[y] && buf[x] == tune[y]
|
||||
&& buf[y] != tune[y]) {
|
||||
@@ -767,8 +815,9 @@ struct obj *instr;
|
||||
matched[y] = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (tumblers)
|
||||
if (tumblers) {
|
||||
if (gears)
|
||||
You_hear("%d tumbler%s click and %d gear%s turn.",
|
||||
tumblers, plur(tumblers), gears,
|
||||
@@ -776,7 +825,7 @@ struct obj *instr;
|
||||
else
|
||||
You_hear("%d tumbler%s click.", tumblers,
|
||||
plur(tumblers));
|
||||
else if (gears) {
|
||||
} else if (gears) {
|
||||
You_hear("%d gear%s turn.", gears, plur(gears));
|
||||
/* could only get `gears == 5' by playing five
|
||||
correct notes followed by excess; otherwise,
|
||||
@@ -791,7 +840,7 @@ struct obj *instr;
|
||||
} else
|
||||
return do_improvisation(instr);
|
||||
|
||||
nevermind:
|
||||
nevermind:
|
||||
pline1(Never_mind);
|
||||
return 0;
|
||||
}
|
||||
|
||||
+29
-2
@@ -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;
|
||||
|
||||
+9
-2
@@ -3396,7 +3396,8 @@ boolean tinitial, tfrom_file;
|
||||
/* WINCAP
|
||||
*
|
||||
* map_mode:[tiles|ascii4x6|ascii6x8|ascii8x8|ascii16x8|ascii7x12
|
||||
* |ascii8x12|ascii16x12|ascii12x16|ascii10x18|fit_to_screen]
|
||||
* |ascii8x12|ascii16x12|ascii12x16|ascii10x18|fit_to_screen
|
||||
* |ascii_fit_to_screen|tiles_fit_to_screen]
|
||||
*/
|
||||
fullname = "map_mode";
|
||||
if (match_optname(opts, fullname, sizeof "map_mode" - 1, TRUE)) {
|
||||
@@ -3404,7 +3405,7 @@ boolean tinitial, tfrom_file;
|
||||
complain_about_duplicate(opts, 1);
|
||||
op = string_for_opt(opts, negated);
|
||||
if (op && !negated) {
|
||||
if (!strncmpi(op, "tiles", sizeof "tiles" - 1))
|
||||
if (!strcmpi(op, "tiles"))
|
||||
iflags.wc_map_mode = MAP_MODE_TILES;
|
||||
else if (!strncmpi(op, "ascii4x6", sizeof "ascii4x6" - 1))
|
||||
iflags.wc_map_mode = MAP_MODE_ASCII4x6;
|
||||
@@ -3427,6 +3428,12 @@ boolean tinitial, tfrom_file;
|
||||
else if (!strncmpi(op, "fit_to_screen",
|
||||
sizeof "fit_to_screen" - 1))
|
||||
iflags.wc_map_mode = MAP_MODE_ASCII_FIT_TO_SCREEN;
|
||||
else if (!strncmpi(op, "ascii_fit_to_screen",
|
||||
sizeof "ascii_fit_to_screen" - 1))
|
||||
iflags.wc_map_mode = MAP_MODE_ASCII_FIT_TO_SCREEN;
|
||||
else if (!strncmpi(op, "tiles_fit_to_screen",
|
||||
sizeof "tiles_fit_to_screen" - 1))
|
||||
iflags.wc_map_mode = MAP_MODE_TILES_FIT_TO_SCREEN;
|
||||
else {
|
||||
config_error_add("Unknown %s parameter '%s'", fullname, op);
|
||||
return FALSE;
|
||||
|
||||
+1
-1
@@ -367,7 +367,7 @@ VA_DECL(const char *, line)
|
||||
else if (Unaware)
|
||||
YouPrefix(tmp, "You dream that you hear ", line);
|
||||
else
|
||||
YouPrefix(tmp, "You hear ", line);
|
||||
YouPrefix(tmp, "You hear ", line); /* Deaf-aware */
|
||||
vpline(strcat(tmp, line), VA_ARGS);
|
||||
VA_END();
|
||||
}
|
||||
|
||||
+3
-2
@@ -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 */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -691,7 +691,7 @@ int mntmp;
|
||||
}
|
||||
check_strangling(FALSE); /* maybe stop strangling */
|
||||
if (nohands(youmonst.data))
|
||||
Glib = 0;
|
||||
make_glib(0);
|
||||
|
||||
/*
|
||||
mlvl = adj_lev(&mons[mntmp]);
|
||||
@@ -967,6 +967,7 @@ break_armor()
|
||||
You("drop your gloves%s!", uwep ? " and weapon" : "");
|
||||
drop_weapon(0);
|
||||
(void) Gloves_off();
|
||||
/* Glib manipulation (ends immediately) handled by Gloves_off */
|
||||
dropp(otmp);
|
||||
}
|
||||
if ((otmp = uarms) != 0) {
|
||||
|
||||
+23
-3
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 potion.c $NHDT-Date: 1570235292 2019/10/05 00:28:12 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.163 $ */
|
||||
/* NetHack 3.6 potion.c $NHDT-Date: 1573346191 2019/11/10 00:36:31 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.166 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -440,6 +440,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
|
||||
self_invis_message()
|
||||
{
|
||||
@@ -1268,6 +1279,15 @@ const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */
|
||||
pline("%s %s.", objphrase, glowcolor);
|
||||
iflags.last_msg = PLNMSG_OBJ_GLOWS;
|
||||
targobj->bknown = !Hallucination;
|
||||
} else {
|
||||
/* didn't see what happened: forget the BUC state if that was
|
||||
known unless the bless/curse state of the water is known;
|
||||
without this, hero would know the new state even without
|
||||
seeing the glow; priest[ess] will immediately relearn it */
|
||||
if (!potion->bknown || !potion->dknown)
|
||||
targobj->bknown = 0;
|
||||
/* [should the bknown+dknown exception require that water
|
||||
be discovered or at least named?] */
|
||||
}
|
||||
/* potions of water are the only shop goods whose price depends
|
||||
on their curse/bless state */
|
||||
@@ -2118,8 +2138,8 @@ dodip()
|
||||
fire_damage(obj, TRUE, u.ux, u.uy);
|
||||
} else if (potion->cursed) {
|
||||
pline_The("potion spills and covers your %s with oil.",
|
||||
makeplural(body_part(FINGER)));
|
||||
incr_itimeout(&Glib, d(2, 10));
|
||||
fingers_or_gloves(TRUE));
|
||||
make_glib((int) (Glib & TIMEOUT) + d(2, 10));
|
||||
} else if (obj->oclass != WEAPON_CLASS && !is_weptool(obj)) {
|
||||
/* the following cases apply only to weapons */
|
||||
goto more_dips;
|
||||
|
||||
+7
-1
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 pray.c $NHDT-Date: 1564532667 2019/07/31 00:24:27 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.117 $ */
|
||||
/* NetHack 3.6 pray.c $NHDT-Date: 1573346192 2019/11/10 00:36:32 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.118 $ */
|
||||
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -494,6 +494,12 @@ int trouble;
|
||||
impossible("fix_worst_trouble: nothing to uncurse.");
|
||||
return;
|
||||
}
|
||||
if (otmp == uarmg && Glib) {
|
||||
make_glib(0);
|
||||
Your("%s are no longer slippery.", gloves_simple_name(uarmg));
|
||||
if (!otmp->cursed)
|
||||
break;
|
||||
}
|
||||
if (!Blind || (otmp == ublindf && Blindfolded_only)) {
|
||||
pline("%s %s.",
|
||||
what ? what : (const char *) Yobjnam2(otmp, "softly glow"),
|
||||
|
||||
@@ -2989,8 +2989,9 @@ boolean peaceful, silent;
|
||||
if (canseemon(shkp)) {
|
||||
Norep("%s booms: \"%s, you are a thief!\"",
|
||||
Shknam(shkp), plname);
|
||||
} else
|
||||
Norep("You hear a scream, \"Thief!\"");
|
||||
} else if (!Deaf) {
|
||||
Norep("You hear a scream, \"Thief!\""); /* Deaf-aware */
|
||||
}
|
||||
}
|
||||
hot_pursuit(shkp);
|
||||
(void) angry_guards(FALSE);
|
||||
|
||||
+4
-1
@@ -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) Robert Patrick Rankin, 2018. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -725,6 +725,9 @@ nh_timeout()
|
||||
case DETECT_MONSTERS:
|
||||
see_monsters();
|
||||
break;
|
||||
case GLIB:
|
||||
make_glib(0); /* might update persistent inventory */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -2637,7 +2637,8 @@ register struct monst *mtmp;
|
||||
a_your[trap->madeby_u]);
|
||||
}
|
||||
if (!in_sight && !Deaf)
|
||||
pline("Kaablamm! You hear an explosion in the distance!");
|
||||
pline("Kaablamm! %s an explosion in the distance!",
|
||||
"You hear"); /* Deaf-aware */
|
||||
blow_up_landmine(trap);
|
||||
/* explosion might have destroyed a drawbridge; don't
|
||||
dish out more damage if monster is already dead */
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 write.c $NHDT-Date: 1450261366 2015/12/16 10:22:46 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.17 $ */
|
||||
/* NetHack 3.6 write.c $NHDT-Date: 1573346194 2019/11/10 00:36:34 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.20 $ */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#include "hack.h"
|
||||
@@ -109,7 +109,7 @@ register struct obj *pen;
|
||||
return 0;
|
||||
} else if (Glib) {
|
||||
pline("%s from your %s.", Tobjnam(pen, "slip"),
|
||||
makeplural(body_part(FINGER)));
|
||||
fingers_or_gloves(FALSE));
|
||||
dropx(pen);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -4441,7 +4441,11 @@ short exploding_wand_typ;
|
||||
if (is_ice(x, y)) {
|
||||
melt_ice(x, y, (char *) 0);
|
||||
} else if (is_pool(x, y)) {
|
||||
const char *msgtxt = "You hear hissing gas.";
|
||||
const char *msgtxt = (!Deaf)
|
||||
? "You hear hissing gas." /* Deaf-aware */
|
||||
: (type >= 0)
|
||||
? "That seemed remarkably uneventful."
|
||||
: (const char *) 0;
|
||||
|
||||
if (lev->typ != POOL) { /* MOAT or DRAWBRIDGE_UP */
|
||||
if (see_it)
|
||||
@@ -4455,7 +4459,8 @@ short exploding_wand_typ;
|
||||
if (see_it)
|
||||
msgtxt = "The water evaporates.";
|
||||
}
|
||||
Norep("%s", msgtxt);
|
||||
if (msgtxt)
|
||||
Norep("%s", msgtxt);
|
||||
if (lev->typ == ROOM)
|
||||
newsym(x, y);
|
||||
} else if (IS_FOUNTAIN(lev->typ)) {
|
||||
|
||||
Reference in New Issue
Block a user