Merge branch 'NetHack-3.6'
This commit is contained in:
20
src/do.c
20
src/do.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 do.c $NHDT-Date: 1576181796 2019/12/12 20:16:36 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.197 $ */
|
||||
/* NetHack 3.6 do.c $NHDT-Date: 1576638499 2019/12/18 03:08:19 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.198 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -994,6 +994,24 @@ dodown()
|
||||
: surface(u.ux, u.uy));
|
||||
return 0; /* didn't move */
|
||||
}
|
||||
|
||||
if (Upolyd && ceiling_hider(&mons[u.umonnum]) && u.uundetected) {
|
||||
u.uundetected = 0;
|
||||
if (Flying) { /* lurker above */
|
||||
You("fly out of hiding.");
|
||||
} else { /* piercer */
|
||||
You("drop to the %s.", surface(u.ux, u.uy));
|
||||
if (is_pool_or_lava(u.ux, u.uy)) {
|
||||
pooleffects(FALSE);
|
||||
} else {
|
||||
(void) pickup(1);
|
||||
if ((trap = t_at(u.ux, u.uy)) != 0)
|
||||
dotrap(trap, TOOKPLUNGE);
|
||||
}
|
||||
}
|
||||
return 1; /* came out of hiding; might need '>' again to go down */
|
||||
}
|
||||
|
||||
if (!stairs_down && !ladder_down) {
|
||||
trap = t_at(u.ux, u.uy);
|
||||
if (trap && (uteetering_at_seen_pit(trap) || uescaped_shaft(trap))) {
|
||||
|
||||
26
src/files.c
26
src/files.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 files.c $NHDT-Date: 1576096997 2019/12/11 20:43:17 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.301 $ */
|
||||
/* NetHack 3.7 files.c $NHDT-Date: 1576626110 2019/12/17 23:41:50 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.276 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -2595,12 +2595,6 @@ char *origbuf;
|
||||
if (sysopt.dumplogfile)
|
||||
free((genericptr_t) sysopt.dumplogfile);
|
||||
sysopt.dumplogfile = dupstr(bufp);
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
} else if (src == SET_IN_SYS && match_varname(buf, "portable_device_top", 8)) {
|
||||
if (sysopt.portable_device_top)
|
||||
free((genericptr_t) sysopt.portable_device_top);
|
||||
sysopt.portable_device_top = dupstr(bufp);
|
||||
#endif
|
||||
} else if (src == SET_IN_SYS && match_varname(buf, "GENERICUSERS", 12)) {
|
||||
if (sysopt.genericusers)
|
||||
@@ -2741,6 +2735,16 @@ char *origbuf;
|
||||
return FALSE;
|
||||
}
|
||||
sysopt.accessibility = n;
|
||||
#ifdef WIN32
|
||||
} else if (src == SET_IN_SYS
|
||||
&& match_varname(buf, "portable_device_paths", 8)) {
|
||||
n = atoi(bufp);
|
||||
if (n < 0 || n > 1) {
|
||||
config_error_add("Illegal value in portable_device_paths (not 0,1).");
|
||||
return FALSE;
|
||||
}
|
||||
sysopt.portable_device_paths = n;
|
||||
#endif
|
||||
#endif /* SYSCF */
|
||||
|
||||
} else if (match_varname(buf, "BOULDER", 3)) {
|
||||
@@ -3296,7 +3300,8 @@ boolean FDECL((*proc), (char *));
|
||||
free(buf);
|
||||
}
|
||||
buf = strcat(tmpbuf, ep);
|
||||
buf[sizeof inbuf - 1] = '\0';
|
||||
if (strlen(buf) >= sizeof inbuf)
|
||||
buf[sizeof inbuf - 1] = '\0';
|
||||
}
|
||||
|
||||
if (morelines || (ignoreline && !oldline))
|
||||
@@ -4338,11 +4343,10 @@ reveal_paths(VOID_ARGS)
|
||||
raw_printf("No end-of-game disclosure file (%s).", nodumpreason);
|
||||
|
||||
#ifdef WIN32
|
||||
if (sysopt.portable_device_top) {
|
||||
if (sysopt.portable_device_paths) {
|
||||
const char *pd = get_portable_device();
|
||||
|
||||
raw_printf("Writable folder for portable device config (sysconf %s):",
|
||||
"portable_device_top");
|
||||
raw_printf("portable_device_paths (set in sysconf):");
|
||||
raw_printf(" \"%s\"", pd);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 hack.c $NHDT-Date: 1568509227 2019/09/15 01:00:27 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.216 $ */
|
||||
/* NetHack 3.6 hack.c $NHDT-Date: 1576638500 2019/12/18 03:08:20 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.220 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -2123,6 +2123,10 @@ boolean newspot; /* true if called by spoteffects */
|
||||
}
|
||||
/* not mounted */
|
||||
|
||||
/* if hiding on ceiling then don't automatically enter pool */
|
||||
if (Upolyd && ceiling_hider(&mons[u.umonnum]) && u.uundetected)
|
||||
return FALSE;
|
||||
|
||||
/* drown(),lava_effects() return true if hero changes
|
||||
location while surviving the problem */
|
||||
if (is_lava(u.ux, u.uy)) {
|
||||
|
||||
99
src/objnam.c
99
src/objnam.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 objnam.c $NHDT-Date: 1575768412 2019/12/08 01:26:52 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.273 $ */
|
||||
/* NetHack 3.7 objnam.c $NHDT-Date: 1576638500 2019/12/18 03:08:20 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.257 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -3675,14 +3675,17 @@ struct obj *no_wish;
|
||||
goto typfnd;
|
||||
}
|
||||
}
|
||||
/* Let wizards wish for traps and furniture.
|
||||
* Must come after objects check so wizards can still wish for
|
||||
* trap objects like beartraps.
|
||||
* Disallow such topology tweaks for WIZKIT startup wishes.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Let wizards wish for traps and furniture.
|
||||
* Must come after objects check so wizards can still wish for
|
||||
* trap objects like beartraps.
|
||||
* Disallow such topology tweaks for WIZKIT startup wishes.
|
||||
*/
|
||||
wiztrap:
|
||||
if (wizard && !g.program_state.wizkit_wishing) {
|
||||
struct rm *lev;
|
||||
boolean madeterrain = FALSE;
|
||||
int trap, x = u.ux, y = u.uy;
|
||||
|
||||
for (trap = NO_TRAP + 1; trap < TRAPNUM; trap++) {
|
||||
@@ -3705,7 +3708,8 @@ struct obj *no_wish;
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
|
||||
/* furniture and terrain */
|
||||
/* furniture and terrain (use at your own risk; can clobber stairs
|
||||
or place furniture on existing traps which shouldn't be allowed) */
|
||||
lev = &levl[x][y];
|
||||
p = eos(bp);
|
||||
if (!BSTRCMPI(bp, p - 8, "fountain")) {
|
||||
@@ -3714,43 +3718,36 @@ struct obj *no_wish;
|
||||
if (!strncmpi(bp, "magic ", 6))
|
||||
lev->blessedftn = 1;
|
||||
pline("A %sfountain.", lev->blessedftn ? "magic " : "");
|
||||
newsym(x, y);
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
if (!BSTRCMPI(bp, p - 6, "throne")) {
|
||||
madeterrain = TRUE;
|
||||
} else if (!BSTRCMPI(bp, p - 6, "throne")) {
|
||||
lev->typ = THRONE;
|
||||
pline("A throne.");
|
||||
newsym(x, y);
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
if (!BSTRCMPI(bp, p - 4, "sink")) {
|
||||
madeterrain = TRUE;
|
||||
} else if (!BSTRCMPI(bp, p - 4, "sink")) {
|
||||
lev->typ = SINK;
|
||||
g.level.flags.nsinks++;
|
||||
pline("A sink.");
|
||||
newsym(x, y);
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
madeterrain = TRUE;
|
||||
|
||||
/* ("water" matches "potion of water" rather than terrain) */
|
||||
if (!BSTRCMPI(bp, p - 4, "pool") || !BSTRCMPI(bp, p - 4, "moat")) {
|
||||
} else if (!BSTRCMPI(bp, p - 4, "pool")
|
||||
|| !BSTRCMPI(bp, p - 4, "moat")) {
|
||||
lev->typ = !BSTRCMPI(bp, p - 4, "pool") ? POOL : MOAT;
|
||||
del_engr_at(x, y);
|
||||
pline("A %s.", (lev->typ == POOL) ? "pool" : "moat");
|
||||
/* Must manually make kelp! */
|
||||
water_damage_chain(g.level.objects[x][y], TRUE);
|
||||
newsym(x, y);
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
if (!BSTRCMPI(bp, p - 4, "lava")) { /* also matches "molten lava" */
|
||||
madeterrain = TRUE;
|
||||
|
||||
/* also matches "molten lava" */
|
||||
} else if (!BSTRCMPI(bp, p - 4, "lava")) {
|
||||
lev->typ = LAVAPOOL;
|
||||
del_engr_at(x, y);
|
||||
pline("A pool of molten lava.");
|
||||
if (!(Levitation || Flying))
|
||||
(void) lava_effects();
|
||||
newsym(x, y);
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
|
||||
if (!BSTRCMPI(bp, p - 5, "altar")) {
|
||||
pooleffects(FALSE);
|
||||
madeterrain = TRUE;
|
||||
} else if (!BSTRCMPI(bp, p - 5, "altar")) {
|
||||
aligntyp al;
|
||||
|
||||
lev->typ = ALTAR;
|
||||
@@ -3763,37 +3760,43 @@ struct obj *no_wish;
|
||||
else if (!strncmpi(bp, "unaligned ", 10))
|
||||
al = A_NONE;
|
||||
else /* -1 - A_CHAOTIC, 0 - A_NEUTRAL, 1 - A_LAWFUL */
|
||||
al = (!rn2(6)) ? A_NONE : rn2((int) A_LAWFUL + 2) - 1;
|
||||
al = !rn2(6) ? A_NONE : (rn2((int) A_LAWFUL + 2) - 1);
|
||||
lev->altarmask = Align2amask(al);
|
||||
pline("%s altar.", An(align_str(al)));
|
||||
newsym(x, y);
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
|
||||
if (!BSTRCMPI(bp, p - 5, "grave")
|
||||
|| !BSTRCMPI(bp, p - 9, "headstone")) {
|
||||
madeterrain = TRUE;
|
||||
} else if (!BSTRCMPI(bp, p - 5, "grave")
|
||||
|| !BSTRCMPI(bp, p - 9, "headstone")) {
|
||||
make_grave(x, y, (char *) 0);
|
||||
pline("%s.", IS_GRAVE(lev->typ) ? "A grave"
|
||||
: "Can't place a grave here");
|
||||
newsym(x, y);
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
|
||||
if (!BSTRCMPI(bp, p - 4, "tree")) {
|
||||
madeterrain = TRUE;
|
||||
} else if (!BSTRCMPI(bp, p - 4, "tree")) {
|
||||
lev->typ = TREE;
|
||||
pline("A tree.");
|
||||
newsym(x, y);
|
||||
block_point(x, y);
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
|
||||
if (!BSTRCMPI(bp, p - 4, "bars")) {
|
||||
madeterrain = TRUE;
|
||||
} else if (!BSTRCMPI(bp, p - 4, "bars")) {
|
||||
lev->typ = IRONBARS;
|
||||
pline("Iron bars.");
|
||||
newsym(x, y);
|
||||
madeterrain = TRUE;
|
||||
}
|
||||
|
||||
if (madeterrain) {
|
||||
feel_newsym(x, y); /* map the spot where the wish occurred */
|
||||
/* hero started at <x,y> but might not be there anymore (create
|
||||
lava, decline to die, and get teleported away to safety) */
|
||||
if (u.uinwater && !is_pool(u.ux, u.uy)) {
|
||||
u.uinwater = 0; /* leave the water */
|
||||
docrt();
|
||||
g.vision_full_recalc = 1;
|
||||
} else if (u.utrap && u.utraptype == TT_LAVA
|
||||
&& !is_lava(u.ux, u.uy)) {
|
||||
reset_utrap(FALSE);
|
||||
}
|
||||
/* cast 'const' away; caller won't modify this */
|
||||
return (struct obj *) &cg.zeroobj;
|
||||
}
|
||||
}
|
||||
} /* end of wizard mode traps and terrain */
|
||||
|
||||
if (!oclass && !typ) {
|
||||
if (!strncmpi(bp, "polearm", 7)) {
|
||||
|
||||
12
src/sys.c
12
src/sys.c
@@ -34,9 +34,6 @@ sys_early_init()
|
||||
#endif
|
||||
#ifdef DUMPLOG
|
||||
sysopt.dumplogfile = (char *) 0;
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
sysopt.portable_device_top = (char *) 0;
|
||||
#endif
|
||||
sysopt.env_dbgfl = 0; /* haven't checked getenv("DEBUGFILES") yet */
|
||||
sysopt.shellers = (char *) 0;
|
||||
@@ -86,6 +83,9 @@ sys_early_init()
|
||||
/* default to little-endian in 3.7 */
|
||||
sysopt.saveformat[0] = sysopt.bonesformat[0] = lendian;
|
||||
sysopt.accessibility = 0;
|
||||
#ifdef WIN32
|
||||
sysopt.portable_device_paths = 0;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -108,12 +108,6 @@ sysopt_release()
|
||||
#ifdef DUMPLOG
|
||||
if (sysopt.dumplogfile)
|
||||
free((genericptr_t)sysopt.dumplogfile), sysopt.dumplogfile=(char *)0;
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
if (sysopt.portable_device_top) {
|
||||
free((genericptr_t) sysopt.portable_device_top);
|
||||
sysopt.portable_device_top = (char *) 0;
|
||||
}
|
||||
#endif
|
||||
if (sysopt.genericusers)
|
||||
free((genericptr_t) sysopt.genericusers),
|
||||
|
||||
14
src/trap.c
14
src/trap.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 trap.c $NHDT-Date: 1576274483 2019/12/13 22:01:23 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.325 $ */
|
||||
/* NetHack 3.6 trap.c $NHDT-Date: 1576638501 2019/12/18 03:08:21 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.329 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -486,8 +486,9 @@ unsigned ftflags;
|
||||
; /* KMH -- You can't escape the Sokoban level traps */
|
||||
else if (Levitation || u.ustuck
|
||||
|| (!Can_fall_thru(&u.uz) && !levl[u.ux][u.uy].candig)
|
||||
|| ((Flying || is_clinger(g.youmonst.data))
|
||||
&& !(ftflags & TOOKPLUNGE))
|
||||
|| ((Flying || is_clinger(g.youmonst.data)
|
||||
|| (ceiling_hider(g.youmonst.data) && u.uundetected))
|
||||
&& !(ftflags & TOOKPLUNGE))
|
||||
|| (Inhell && !u.uevent.invoked && newlevel == bottom)) {
|
||||
dont_fall = "don't fall in.";
|
||||
} else if (g.youmonst.data->msize >= MZ_HUGE) {
|
||||
@@ -3725,6 +3726,7 @@ drown()
|
||||
boolean inpool_ok = FALSE, crawl_ok;
|
||||
int i, x, y;
|
||||
|
||||
feel_newsym(u.ux, u.uy); /* in case Blind, map the water here */
|
||||
/* happily wading in the same contiguous pool */
|
||||
if (u.uinwater && is_pool(u.ux - u.dx, u.uy - u.dy)
|
||||
&& (Swimming || Amphibious)) {
|
||||
@@ -5241,6 +5243,7 @@ lava_effects()
|
||||
int dmg = d(6, 6); /* only applicable for water walking */
|
||||
boolean usurvive, boil_away;
|
||||
|
||||
feel_newsym(u.ux, u.uy); /* in case Blind, map the lava here */
|
||||
burn_away_slime();
|
||||
if (likes_lava(g.youmonst.data))
|
||||
return FALSE;
|
||||
@@ -5365,7 +5368,10 @@ sink_into_lava()
|
||||
static const char sink_deeper[] = "You sink deeper into the lava.";
|
||||
|
||||
if (!u.utrap || u.utraptype != TT_LAVA) {
|
||||
; /* do nothing; this shouldn't happen */
|
||||
; /* do nothing; this usually won't happen but could after
|
||||
* polymorphing from a flier into a ceiling hider and then hiding;
|
||||
* allmain() only checks whether the hero is at a lava location,
|
||||
* not whether he or she is currently sinking */
|
||||
} else if (!is_lava(u.ux, u.uy)) {
|
||||
reset_utrap(FALSE); /* this shouldn't happen either */
|
||||
} else if (!u.uinvulnerable) {
|
||||
|
||||
Reference in New Issue
Block a user