Merge branch 'NetHack-3.6'
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.177 $ $NHDT-Date: 1573778559 2019/11/15 00:42:39 $
|
$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.178 $ $NHDT-Date: 1573848574 2019/11/15 20:09:34 $
|
||||||
|
|
||||||
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,
|
||||||
@@ -225,6 +225,13 @@ putting on gloves while having slippery fingers transfered slipperiness to
|
|||||||
when a monster reads a scroll of fire to cure sliming, don't access that
|
when a monster reads a scroll of fire to cure sliming, don't access that
|
||||||
scroll's memory after it has been used up (bcsign)
|
scroll's memory after it has been used up (bcsign)
|
||||||
monster vs monster attacks didn't handle shades or silver weapon feedback
|
monster vs monster attacks didn't handle shades or silver weapon feedback
|
||||||
|
successful alchemy would show new potion's description (color) even when blind
|
||||||
|
dipping some types of objects into oil would yield "<object> gleams with an
|
||||||
|
oily sheen" even when blind
|
||||||
|
dipping into an undiscovered potion would offer chance to give a name to the
|
||||||
|
potion even when its description wasn't known (picked up while blind)
|
||||||
|
dipping lichen corpse into acid when not blind and acid was undicovered would
|
||||||
|
not offer a chance to give a name to the potion after lichen feedback
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 decl.h $NHDT-Date: 1559601011 2019/06/03 22:30:11 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.150 $ */
|
/* NetHack 3.6 decl.h $NHDT-Date: 1573869061 2019/11/16 01:51: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) Michael Allison, 2007. */
|
/*-Copyright (c) Michael Allison, 2007. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 extern.h $NHDT-Date: 1573688684 2019/11/13 23:44:44 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.739 $ */
|
/* NetHack 3.6 extern.h $NHDT-Date: 1573869062 2019/11/16 01:51:02 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.740 $ */
|
||||||
/* 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. */
|
||||||
|
|
||||||
@@ -2931,10 +2931,13 @@ E void NDECL(nhwindows_hangup);
|
|||||||
#endif
|
#endif
|
||||||
E void NDECL(genl_status_init);
|
E void NDECL(genl_status_init);
|
||||||
E void NDECL(genl_status_finish);
|
E void NDECL(genl_status_finish);
|
||||||
E void FDECL(genl_status_enablefield,
|
E void FDECL(genl_status_enablefield, (int, const char *, const char *,
|
||||||
(int, const char *, const char *, BOOLEAN_P));
|
BOOLEAN_P));
|
||||||
E void FDECL(genl_status_update, (int, genericptr_t, int, int, int, unsigned long *));
|
E void FDECL(genl_status_update, (int, genericptr_t, int, int, int,
|
||||||
|
unsigned long *));
|
||||||
|
#ifdef DUMPLOG
|
||||||
|
E char *FDECL(dump_fmtstr, (const char *, char *, BOOLEAN_P));
|
||||||
|
#endif
|
||||||
E void FDECL(dump_open_log, (time_t));
|
E void FDECL(dump_open_log, (time_t));
|
||||||
E void NDECL(dump_close_log);
|
E void NDECL(dump_close_log);
|
||||||
E void FDECL(dump_redirect, (BOOLEAN_P));
|
E void FDECL(dump_redirect, (BOOLEAN_P));
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 decl.c $NHDT-Date: 1571352532 2019/10/17 22:48:52 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.146 $ */
|
/* NetHack 3.6 decl.c $NHDT-Date: 1573869062 2019/11/16 01:51:02 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.149 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Michael Allison, 2009. */
|
/*-Copyright (c) Michael Allison, 2009. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|||||||
10
src/end.c
10
src/end.c
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 end.c $NHDT-Date: 1562532734 2019/07/07 20:52:14 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.179 $ */
|
/* NetHack 3.6 end.c $NHDT-Date: 1573869062 2019/11/16 01:51:02 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.180 $ */
|
||||||
/* 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. */
|
||||||
@@ -238,8 +238,8 @@ NH_panictrace_gdb()
|
|||||||
#ifdef PANICTRACE_GDB
|
#ifdef PANICTRACE_GDB
|
||||||
/* A (more) generic method to get a stack trace - invoke
|
/* A (more) generic method to get a stack trace - invoke
|
||||||
* gdb on ourself. */
|
* gdb on ourself. */
|
||||||
char *gdbpath = GDBVAR;
|
const char *gdbpath = GDBVAR;
|
||||||
char *greppath = GREPVAR;
|
const char *greppath = GREPVAR;
|
||||||
char buf[BUFSZ];
|
char buf[BUFSZ];
|
||||||
FILE *gdb;
|
FILE *gdb;
|
||||||
|
|
||||||
@@ -248,8 +248,8 @@ NH_panictrace_gdb()
|
|||||||
if (greppath == NULL || greppath[0] == 0)
|
if (greppath == NULL || greppath[0] == 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
sprintf(buf, "%s -n -q %s %d 2>&1 | %s '^#'", gdbpath, ARGV0, getpid(),
|
sprintf(buf, "%s -n -q %s %d 2>&1 | %s '^#'",
|
||||||
greppath);
|
gdbpath, ARGV0, getpid(), greppath);
|
||||||
gdb = popen(buf, "w");
|
gdb = popen(buf, "w");
|
||||||
if (gdb) {
|
if (gdb) {
|
||||||
raw_print("Generating more information you may report:\n");
|
raw_print("Generating more information you may report:\n");
|
||||||
|
|||||||
57
src/files.c
57
src/files.c
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 files.c $NHDT-Date: 1573358489 2019/11/10 04:01:29 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.263 $ */
|
/* NetHack 3.6 files.c $NHDT-Date: 1573869063 2019/11/16 01:51:03 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.269 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -2533,13 +2533,12 @@ char *origbuf;
|
|||||||
static boolean ramdisk_specified = FALSE;
|
static boolean ramdisk_specified = FALSE;
|
||||||
#endif
|
#endif
|
||||||
#ifdef SYSCF
|
#ifdef SYSCF
|
||||||
int n;
|
int n, src = iflags.parse_config_file_src;
|
||||||
#endif
|
#endif
|
||||||
char *bufp, buf[4 * BUFSZ];
|
char *bufp, buf[4 * BUFSZ];
|
||||||
uchar translate[MAXPCHARS];
|
uchar translate[MAXPCHARS];
|
||||||
int len;
|
int len;
|
||||||
boolean retval = TRUE;
|
boolean retval = TRUE;
|
||||||
int src = iflags.parse_config_file_src;
|
|
||||||
|
|
||||||
/* convert any tab to space, condense consecutive spaces into one,
|
/* convert any tab to space, condense consecutive spaces into one,
|
||||||
remove leading and trailing spaces (exception: if there is nothing
|
remove leading and trailing spaces (exception: if there is nothing
|
||||||
@@ -4265,16 +4264,16 @@ boolean wildcards;
|
|||||||
void
|
void
|
||||||
reveal_paths(VOID_ARGS)
|
reveal_paths(VOID_ARGS)
|
||||||
{
|
{
|
||||||
const char *fqn, *filep;
|
const char *fqn, *gamename = (g.hname && *g.hname) ? g.hname : "NetHack";
|
||||||
char buf[BUFSZ];
|
char buf[BUFSZ];
|
||||||
#if defined(UNIX)
|
#if defined(SYSCF) || !defined(UNIX)
|
||||||
char *strp;
|
const char *filep;
|
||||||
#endif
|
#endif
|
||||||
#if defined(PREFIXES_IN_USE)
|
#if defined(PREFIXES_IN_USE)
|
||||||
const char *cstrp;
|
const char *cstrp;
|
||||||
#endif
|
#endif
|
||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
char *envp, cwdbuf[PATH_MAX];
|
char *endp, *envp, cwdbuf[PATH_MAX];
|
||||||
#endif
|
#endif
|
||||||
#ifdef PREFIXES_IN_USE
|
#ifdef PREFIXES_IN_USE
|
||||||
int i, maxlen = 0;
|
int i, maxlen = 0;
|
||||||
@@ -4291,12 +4290,12 @@ reveal_paths(VOID_ARGS)
|
|||||||
#ifdef PREFIXES_IN_USE
|
#ifdef PREFIXES_IN_USE
|
||||||
cstrp = fqn_prefix_names[SYSCONFPREFIX];
|
cstrp = fqn_prefix_names[SYSCONFPREFIX];
|
||||||
maxlen = BUFSZ - sizeof " (in )";
|
maxlen = BUFSZ - sizeof " (in )";
|
||||||
if (cstrp && strlen(cstrp) < (size_t) maxlen)
|
if (cstrp && (int) strlen(cstrp) < maxlen)
|
||||||
Sprintf(buf, " (in %s)", cstrp);
|
Sprintf(buf, " (in %s)", cstrp);
|
||||||
#else
|
#else
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
#endif
|
#endif
|
||||||
raw_printf("Your system configuration file%s:", buf);
|
raw_printf("%s system configuration file%s:", s_suffix(gamename), buf);
|
||||||
#ifdef SYSCF_FILE
|
#ifdef SYSCF_FILE
|
||||||
filep = SYSCF_FILE;
|
filep = SYSCF_FILE;
|
||||||
#else
|
#else
|
||||||
@@ -4323,16 +4322,16 @@ reveal_paths(VOID_ARGS)
|
|||||||
cstrp = fqn_prefix_names[HACKPREFIX];
|
cstrp = fqn_prefix_names[HACKPREFIX];
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
maxlen = BUFSZ - sizeof " (in )";
|
maxlen = BUFSZ - sizeof " (in )";
|
||||||
if (cstrp && strlen(cstrp) < (size_t) maxlen)
|
if (cstrp && (int) strlen(cstrp) < maxlen)
|
||||||
Sprintf(buf, " (in %s)", cstrp);
|
Sprintf(buf, " (in %s)", cstrp);
|
||||||
#endif /* PREFIXES_IN_USE */
|
#endif /* PREFIXES_IN_USE */
|
||||||
raw_printf("Your game's loadable symbols file%s:", buf);
|
raw_printf("%s loadable symbols file%s:", s_suffix(gamename), buf);
|
||||||
#endif /* UNIX */
|
#endif /* UNIX */
|
||||||
|
|
||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
envp = getcwd(cwdbuf, PATH_MAX);
|
envp = getcwd(cwdbuf, PATH_MAX);
|
||||||
if (envp) {
|
if (envp) {
|
||||||
raw_print("Your game's loadable symbols file:");
|
raw_printf("%s loadable symbols file:", s_suffix(gamename));
|
||||||
raw_printf(" \"%s/%s\"", envp, SYMBOLS);
|
raw_printf(" \"%s/%s\"", envp, SYMBOLS);
|
||||||
}
|
}
|
||||||
#else /* UNIX */
|
#else /* UNIX */
|
||||||
@@ -4355,7 +4354,7 @@ reveal_paths(VOID_ARGS)
|
|||||||
#ifdef PREFIXES_IN_USE
|
#ifdef PREFIXES_IN_USE
|
||||||
cstrp = fqn_prefix_names[CONFIGPREFIX];
|
cstrp = fqn_prefix_names[CONFIGPREFIX];
|
||||||
maxlen = BUFSZ - sizeof " (in )";
|
maxlen = BUFSZ - sizeof " (in )";
|
||||||
if (cstrp && strlen(cstrp) < (size_t) maxlen)
|
if (cstrp && (int) strlen(cstrp) < maxlen)
|
||||||
Sprintf(buf, " (in %s)", cstrp);
|
Sprintf(buf, " (in %s)", cstrp);
|
||||||
#endif /* PREFIXES_IN_USE */
|
#endif /* PREFIXES_IN_USE */
|
||||||
raw_printf("Your personal configuration file%s:", buf);
|
raw_printf("Your personal configuration file%s:", buf);
|
||||||
@@ -4366,26 +4365,26 @@ reveal_paths(VOID_ARGS)
|
|||||||
copynchars(buf, envp, (int) sizeof buf - 1 - 1);
|
copynchars(buf, envp, (int) sizeof buf - 1 - 1);
|
||||||
Strcat(buf, "/");
|
Strcat(buf, "/");
|
||||||
}
|
}
|
||||||
strp = eos(buf);
|
endp = eos(buf);
|
||||||
copynchars(strp, default_configfile,
|
copynchars(endp, default_configfile,
|
||||||
(int) (sizeof buf - 1 - strlen(buf)));
|
(int) (sizeof buf - 1 - strlen(buf)));
|
||||||
#if defined(__APPLE__) /* UNIX+__APPLE__ => MacOSX aka OSX aka macOS */
|
#if defined(__APPLE__) /* UNIX+__APPLE__ => MacOSX aka OSX aka macOS */
|
||||||
if (envp) {
|
if (envp) {
|
||||||
if (access(buf, 4) == -1) { /* 4: R_OK, -1: failure */
|
if (access(buf, 4) == -1) { /* 4: R_OK, -1: failure */
|
||||||
/* read access to default failed; might be protected excessively
|
/* read access to default failed; might be protected excessively
|
||||||
but more likely it doesn't exist; try first alternate:
|
but more likely it doesn't exist; try first alternate:
|
||||||
"$HOME/Library/Pref..."; 'strp' points past '/' */
|
"$HOME/Library/Pref..."; 'endp' points past '/' */
|
||||||
copynchars(strp, "Library/Preferences/NetHack Defaults",
|
copynchars(endp, "Library/Preferences/NetHack Defaults",
|
||||||
(int) (sizeof buf - 1 - strlen(buf)));
|
(int) (sizeof buf - 1 - strlen(buf)));
|
||||||
if (access(buf, 4) == -1) {
|
if (access(buf, 4) == -1) {
|
||||||
/* first alternate failed, try second:
|
/* first alternate failed, try second:
|
||||||
".../NetHack Defaults.txt"; no 'strp', just append */
|
".../NetHack Defaults.txt"; no 'endp', just append */
|
||||||
copynchars(eos(buf), ".txt",
|
copynchars(eos(buf), ".txt",
|
||||||
(int) (sizeof buf - 1 - strlen(buf)));
|
(int) (sizeof buf - 1 - strlen(buf)));
|
||||||
if (access(buf, 4) == -1) {
|
if (access(buf, 4) == -1) {
|
||||||
/* second alternate failed too, so revert to the
|
/* second alternate failed too, so revert to the
|
||||||
original default ("$HOME/.nethackrc") for message */
|
original default ("$HOME/.nethackrc") for message */
|
||||||
copynchars(strp, default_configfile,
|
copynchars(endp, default_configfile,
|
||||||
(int) (sizeof buf - 1 - strlen(buf)));
|
(int) (sizeof buf - 1 - strlen(buf)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4400,6 +4399,26 @@ reveal_paths(VOID_ARGS)
|
|||||||
#endif
|
#endif
|
||||||
raw_printf(" \"%s\"", fqn ? fqn : default_configfile);
|
raw_printf(" \"%s\"", fqn ? fqn : default_configfile);
|
||||||
#endif /* ?UNIX */
|
#endif /* ?UNIX */
|
||||||
|
|
||||||
|
#ifdef DUMPLOG
|
||||||
|
#ifdef SYSCF
|
||||||
|
fqn = sysopt.dumplogfile;
|
||||||
|
#else /* !SYSCF */
|
||||||
|
#ifdef DUMPLOG_FILE
|
||||||
|
fqn = DUMPLOG_FILE;
|
||||||
|
#else
|
||||||
|
fqn = (char *) 0;
|
||||||
|
#endif
|
||||||
|
#endif /* ?SYSCF */
|
||||||
|
if (fqn) {
|
||||||
|
raw_print("Your end-of-game dump file:");
|
||||||
|
(void) dump_fmtstr(fqn, buf, FALSE);
|
||||||
|
buf[sizeof buf - sizeof " \"\""] = '\0';
|
||||||
|
raw_printf(" \"%s\"", buf);
|
||||||
|
} else
|
||||||
|
#endif /* DUMPLOG */
|
||||||
|
raw_print("No end-of-game dump file.");
|
||||||
|
|
||||||
raw_print("");
|
raw_print("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
64
src/potion.c
64
src/potion.c
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 potion.c $NHDT-Date: 1573346191 2019/11/10 00:36:31 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.166 $ */
|
/* NetHack 3.6 potion.c $NHDT-Date: 1573848199 2019/11/15 20:03:19 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.167 $ */
|
||||||
/* 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. */
|
||||||
@@ -2027,7 +2027,7 @@ dodip()
|
|||||||
around for potionbreathe() [and we can't set obj->in_use
|
around for potionbreathe() [and we can't set obj->in_use
|
||||||
to 'amt' because that's not implemented] */
|
to 'amt' because that's not implemented] */
|
||||||
obj->in_use = 1;
|
obj->in_use = 1;
|
||||||
pline("BOOM! They explode!");
|
pline("%sThey explode!", !Deaf ? "BOOM! " : "");
|
||||||
wake_nearto(u.ux, u.uy, (BOLT_LIM + 1) * (BOLT_LIM + 1));
|
wake_nearto(u.ux, u.uy, (BOLT_LIM + 1) * (BOLT_LIM + 1));
|
||||||
exercise(A_STR, FALSE);
|
exercise(A_STR, FALSE);
|
||||||
if (!breathless(g.youmonst.data) || haseyes(g.youmonst.data))
|
if (!breathless(g.youmonst.data) || haseyes(g.youmonst.data))
|
||||||
@@ -2045,6 +2045,8 @@ dodip()
|
|||||||
if (mixture != STRANGE_OBJECT) {
|
if (mixture != STRANGE_OBJECT) {
|
||||||
obj->otyp = mixture;
|
obj->otyp = mixture;
|
||||||
} else {
|
} else {
|
||||||
|
struct obj *otmp;
|
||||||
|
|
||||||
switch (obj->odiluted ? 1 : rnd(8)) {
|
switch (obj->odiluted ? 1 : rnd(8)) {
|
||||||
case 1:
|
case 1:
|
||||||
obj->otyp = POT_WATER;
|
obj->otyp = POT_WATER;
|
||||||
@@ -2053,17 +2055,15 @@ dodip()
|
|||||||
case 3:
|
case 3:
|
||||||
obj->otyp = POT_SICKNESS;
|
obj->otyp = POT_SICKNESS;
|
||||||
break;
|
break;
|
||||||
case 4: {
|
case 4:
|
||||||
struct obj *otmp = mkobj(POTION_CLASS, FALSE);
|
otmp = mkobj(POTION_CLASS, FALSE);
|
||||||
|
|
||||||
obj->otyp = otmp->otyp;
|
obj->otyp = otmp->otyp;
|
||||||
obfree(otmp, (struct obj *) 0);
|
obfree(otmp, (struct obj *) 0);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
useupall(obj);
|
useupall(obj);
|
||||||
if (!Blind)
|
pline_The("mixture %sevaporates.",
|
||||||
pline_The("mixture glows brightly and evaporates.");
|
!Blind ? "glows brightly and " : "");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2089,11 +2089,16 @@ dodip()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (potion->otyp == POT_ACID && obj->otyp == CORPSE
|
if (potion->otyp == POT_ACID && obj->otyp == CORPSE
|
||||||
&& obj->corpsenm == PM_LICHEN && !Blind) {
|
&& obj->corpsenm == PM_LICHEN) {
|
||||||
pline("%s %s %s around the edges.", The(cxname(obj)),
|
pline("%s %s %s around the edges.", The(cxname(obj)),
|
||||||
otense(obj, "turn"),
|
otense(obj, "turn"), Blind ? "wrinkled"
|
||||||
potion->odiluted ? hcolor(NH_ORANGE) : hcolor(NH_RED));
|
: potion->odiluted ? hcolor(NH_ORANGE)
|
||||||
|
: hcolor(NH_RED));
|
||||||
potion->in_use = FALSE; /* didn't go poof */
|
potion->in_use = FALSE; /* didn't go poof */
|
||||||
|
if (potion->dknown
|
||||||
|
&& !objects[potion->otyp].oc_name_known
|
||||||
|
&& !objects[potion->otyp].oc_uname)
|
||||||
|
docall(potion);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2147,10 +2152,14 @@ dodip()
|
|||||||
} else if ((!is_rustprone(obj) && !is_corrodeable(obj))
|
} else if ((!is_rustprone(obj) && !is_corrodeable(obj))
|
||||||
|| is_ammo(obj) || (!obj->oeroded && !obj->oeroded2)) {
|
|| is_ammo(obj) || (!obj->oeroded && !obj->oeroded2)) {
|
||||||
/* uses up potion, doesn't set obj->greased */
|
/* uses up potion, doesn't set obj->greased */
|
||||||
pline("%s %s with an oily sheen.", Yname2(obj),
|
if (!Blind)
|
||||||
otense(obj, "gleam"));
|
pline("%s %s with an oily sheen.", Yname2(obj),
|
||||||
|
otense(obj, "gleam"));
|
||||||
|
else /*if (!uarmg)*/
|
||||||
|
pline("%s %s oily.", Yname2(obj), otense(obj, "feel"));
|
||||||
} else {
|
} else {
|
||||||
pline("%s %s less %s.", Yname2(obj), otense(obj, "are"),
|
pline("%s %s less %s.", Yname2(obj),
|
||||||
|
otense(obj, !Blind ? "are" : "feel"),
|
||||||
(obj->oeroded && obj->oeroded2)
|
(obj->oeroded && obj->oeroded2)
|
||||||
? "corroded and rusty"
|
? "corroded and rusty"
|
||||||
: obj->oeroded ? "rusty" : "corroded");
|
: obj->oeroded ? "rusty" : "corroded");
|
||||||
@@ -2161,7 +2170,8 @@ dodip()
|
|||||||
wisx = TRUE;
|
wisx = TRUE;
|
||||||
}
|
}
|
||||||
exercise(A_WIS, wisx);
|
exercise(A_WIS, wisx);
|
||||||
makeknown(potion->otyp);
|
if (potion->dknown)
|
||||||
|
makeknown(potion->otyp);
|
||||||
useup(potion);
|
useup(potion);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -2197,7 +2207,8 @@ dodip()
|
|||||||
useup(potion);
|
useup(potion);
|
||||||
exercise(A_WIS, TRUE);
|
exercise(A_WIS, TRUE);
|
||||||
}
|
}
|
||||||
makeknown(POT_OIL);
|
if (potion->dknown)
|
||||||
|
makeknown(POT_OIL);
|
||||||
obj->spe = 1;
|
obj->spe = 1;
|
||||||
update_inventory();
|
update_inventory();
|
||||||
return 1;
|
return 1;
|
||||||
@@ -2235,16 +2246,24 @@ dodip()
|
|||||||
singlepotion->dknown = FALSE;
|
singlepotion->dknown = FALSE;
|
||||||
} else {
|
} else {
|
||||||
singlepotion->dknown = !Hallucination;
|
singlepotion->dknown = !Hallucination;
|
||||||
|
*newbuf = '\0';
|
||||||
if (mixture == POT_WATER && singlepotion->dknown)
|
if (mixture == POT_WATER && singlepotion->dknown)
|
||||||
Sprintf(newbuf, "clears");
|
Sprintf(newbuf, "clears");
|
||||||
else
|
else if (!Blind)
|
||||||
Sprintf(newbuf, "turns %s",
|
Sprintf(newbuf, "turns %s",
|
||||||
hcolor(OBJ_DESCR(objects[mixture])));
|
hcolor(OBJ_DESCR(objects[mixture])));
|
||||||
pline_The("%spotion%s %s.", oldbuf,
|
if (*newbuf)
|
||||||
more_than_one ? " that you dipped into" : "", newbuf);
|
pline_The("%spotion%s %s.", oldbuf,
|
||||||
if (!objects[old_otyp].oc_uname
|
more_than_one ? " that you dipped into" : "",
|
||||||
&& !objects[old_otyp].oc_name_known && old_dknown) {
|
newbuf);
|
||||||
|
else
|
||||||
|
pline("Somehing happens.");
|
||||||
|
|
||||||
|
if (old_dknown
|
||||||
|
&& !objects[old_otyp].oc_name_known
|
||||||
|
&& !objects[old_otyp].oc_uname) {
|
||||||
struct obj fakeobj;
|
struct obj fakeobj;
|
||||||
|
|
||||||
fakeobj = cg.zeroobj;
|
fakeobj = cg.zeroobj;
|
||||||
fakeobj.dknown = 1;
|
fakeobj.dknown = 1;
|
||||||
fakeobj.otyp = old_otyp;
|
fakeobj.otyp = old_otyp;
|
||||||
@@ -2266,7 +2285,8 @@ dodip()
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
poof:
|
poof:
|
||||||
if (!objects[potion->otyp].oc_name_known
|
if (potion->dknown
|
||||||
|
&& !objects[potion->otyp].oc_name_known
|
||||||
&& !objects[potion->otyp].oc_uname)
|
&& !objects[potion->otyp].oc_uname)
|
||||||
docall(potion);
|
docall(potion);
|
||||||
useup(potion);
|
useup(potion);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 windows.c $NHDT-Date: 1526933747 2018/05/21 20:15:47 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.48 $ */
|
/* NetHack 3.6 windows.c $NHDT-Date: 1573869064 2019/11/16 01:51:04 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.58 $ */
|
||||||
/* Copyright (c) D. Cohrs, 1993. */
|
/* Copyright (c) D. Cohrs, 1993. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -1089,12 +1089,13 @@ static FILE *dumplog_file;
|
|||||||
#ifdef DUMPLOG
|
#ifdef DUMPLOG
|
||||||
static time_t dumplog_now;
|
static time_t dumplog_now;
|
||||||
|
|
||||||
static char *FDECL(dump_fmtstr, (const char *, char *));
|
char *
|
||||||
|
dump_fmtstr(fmt, buf, fullsubs)
|
||||||
static char *
|
|
||||||
dump_fmtstr(fmt, buf)
|
|
||||||
const char *fmt;
|
const char *fmt;
|
||||||
char *buf;
|
char *buf;
|
||||||
|
boolean fullsubs; /* True -> full substitution for file name, False ->
|
||||||
|
* partial substitution for '--showpaths' feedback
|
||||||
|
* where there's no game in progress when executed */
|
||||||
{
|
{
|
||||||
const char *fp = fmt;
|
const char *fp = fmt;
|
||||||
char *bp = buf;
|
char *bp = buf;
|
||||||
@@ -1117,7 +1118,7 @@ char *buf;
|
|||||||
* may or may not interfere with that usage.]
|
* may or may not interfere with that usage.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
while (fp && *fp && len < BUFSZ-1) {
|
while (fp && *fp && len < BUFSZ - 1) {
|
||||||
if (*fp == '%') {
|
if (*fp == '%') {
|
||||||
fp++;
|
fp++;
|
||||||
switch (*fp) {
|
switch (*fp) {
|
||||||
@@ -1128,17 +1129,29 @@ char *buf;
|
|||||||
Sprintf(tmpbuf, "%%");
|
Sprintf(tmpbuf, "%%");
|
||||||
break;
|
break;
|
||||||
case 't': /* game start, timestamp */
|
case 't': /* game start, timestamp */
|
||||||
Sprintf(tmpbuf, "%lu", (unsigned long) ubirthday);
|
if (fullsubs)
|
||||||
|
Sprintf(tmpbuf, "%lu", (unsigned long) ubirthday);
|
||||||
|
else
|
||||||
|
Strcpy(tmpbuf, "{game start cookie}");
|
||||||
break;
|
break;
|
||||||
case 'T': /* current time, timestamp */
|
case 'T': /* current time, timestamp */
|
||||||
Sprintf(tmpbuf, "%lu", (unsigned long) now);
|
if (fullsubs)
|
||||||
|
Sprintf(tmpbuf, "%lu", (unsigned long) now);
|
||||||
|
else
|
||||||
|
Strcpy(tmpbuf, "{current time cookie}");
|
||||||
break;
|
break;
|
||||||
case 'd': /* game start, YYYYMMDDhhmmss */
|
case 'd': /* game start, YYYYMMDDhhmmss */
|
||||||
Sprintf(tmpbuf, "%08ld%06ld",
|
if (fullsubs)
|
||||||
yyyymmdd(ubirthday), hhmmss(ubirthday));
|
Sprintf(tmpbuf, "%08ld%06ld",
|
||||||
|
yyyymmdd(ubirthday), hhmmss(ubirthday));
|
||||||
|
else
|
||||||
|
Strcpy(tmpbuf, "{game start date+time}");
|
||||||
break;
|
break;
|
||||||
case 'D': /* current time, YYYYMMDDhhmmss */
|
case 'D': /* current time, YYYYMMDDhhmmss */
|
||||||
Sprintf(tmpbuf, "%08ld%06ld", yyyymmdd(now), hhmmss(now));
|
if (fullsubs)
|
||||||
|
Sprintf(tmpbuf, "%08ld%06ld", yyyymmdd(now), hhmmss(now));
|
||||||
|
else
|
||||||
|
Strcpy(tmpbuf, "{current date+time}");
|
||||||
break;
|
break;
|
||||||
case 'v': /* version, eg. "3.6.2-0" */
|
case 'v': /* version, eg. "3.6.2-0" */
|
||||||
Sprintf(tmpbuf, "%s", version_string(verbuf));
|
Sprintf(tmpbuf, "%s", version_string(verbuf));
|
||||||
@@ -1147,19 +1160,37 @@ char *buf;
|
|||||||
Sprintf(tmpbuf, "%ld", uid);
|
Sprintf(tmpbuf, "%ld", uid);
|
||||||
break;
|
break;
|
||||||
case 'n': /* player name */
|
case 'n': /* player name */
|
||||||
Sprintf(tmpbuf, "%s", *g.plname ? g.plname : "unknown");
|
if (fullsubs)
|
||||||
|
Sprintf(tmpbuf, "%s", *g.plname ? g.plname : "unknown");
|
||||||
|
else
|
||||||
|
Strcpy(tmpbuf, "{hero name}");
|
||||||
break;
|
break;
|
||||||
case 'N': /* first character of player name */
|
case 'N': /* first character of player name */
|
||||||
Sprintf(tmpbuf, "%c", *g.plname ? *g.plname : 'u');
|
if (fullsubs)
|
||||||
|
Sprintf(tmpbuf, "%c", *g.plname ? *g.plname : 'u');
|
||||||
|
else
|
||||||
|
Strcpy(tmpbuf, "{hero initial}");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (fullsubs) {
|
||||||
|
/* replace potentially troublesome characters (including
|
||||||
|
<space> even though it might be an acceptable file name
|
||||||
|
character); user shouldn't be able to get ' ' or '/'
|
||||||
|
or '\\' into plname[] but play things safe */
|
||||||
|
(void) strNsubst(tmpbuf, " ", "_", 0);
|
||||||
|
(void) strNsubst(tmpbuf, "/", "_", 0);
|
||||||
|
(void) strNsubst(tmpbuf, "\\", "_", 0);
|
||||||
|
/* note: replacements are only done on field substitutions,
|
||||||
|
not on the template (from sysconf or DUMPLOG_FILE) */
|
||||||
|
}
|
||||||
|
|
||||||
slen = strlen(tmpbuf);
|
slen = (int) strlen(tmpbuf);
|
||||||
if (len + slen < BUFSZ-1) {
|
if (len + slen < BUFSZ - 1) {
|
||||||
len += slen;
|
len += slen;
|
||||||
Sprintf(bp, "%s", tmpbuf);
|
Sprintf(bp, "%s", tmpbuf);
|
||||||
bp += slen;
|
bp += slen;
|
||||||
if (*fp) fp++;
|
if (*fp)
|
||||||
|
fp++;
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
@@ -1187,9 +1218,9 @@ time_t now;
|
|||||||
#ifdef SYSCF
|
#ifdef SYSCF
|
||||||
if (!sysopt.dumplogfile)
|
if (!sysopt.dumplogfile)
|
||||||
return;
|
return;
|
||||||
fname = dump_fmtstr(sysopt.dumplogfile, buf);
|
fname = dump_fmtstr(sysopt.dumplogfile, buf, TRUE);
|
||||||
#else
|
#else
|
||||||
fname = dump_fmtstr(DUMPLOG_FILE, buf);
|
fname = dump_fmtstr(DUMPLOG_FILE, buf, TRUE);
|
||||||
#endif
|
#endif
|
||||||
dumplog_file = fopen(fname, "w");
|
dumplog_file = fopen(fname, "w");
|
||||||
dumplog_windowprocs_backup = windowprocs;
|
dumplog_windowprocs_backup = windowprocs;
|
||||||
|
|||||||
Reference in New Issue
Block a user