Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-11-29 16:57:23 -05:00
9 changed files with 32 additions and 16 deletions

View File

@@ -314,6 +314,7 @@ clairvoyance showed all monsters in range, then after player viewed the map,
did a normal monster refresh; the 'I' glyph step clobbers remembered
object at same spot, so skip it for locations where monster refresh
is going to immediately redisplay a monster
take holes that you avoided into consideration when you're on the brink
unix: fix double DLB definition in linux hints file
windows: fix --showpaths output for the data file which relies on being
constructed programmatically to incorporate the version suffix

View File

@@ -2631,6 +2631,7 @@ E int FDECL(launch_obj, (SHORT_P, int, int, int, int, int));
E boolean NDECL(launch_in_progress);
E void NDECL(force_launch_placement);
E boolean FDECL(uteetering_at_seen_pit, (struct trap *));
E boolean FDECL(uescaped_shaft, (struct trap *));
E boolean NDECL(lava_effects);
E void NDECL(sink_into_lava);
E void NDECL(sokoban_guilt);

View File

@@ -1167,7 +1167,7 @@ struct obj *obj;
You("cannot stay under%s long enough.",
is_pool(u.ux, u.uy) ? "water" : " the lava");
} else if ((trap = t_at(u.ux, u.uy)) != 0
&& uteetering_at_seen_pit(trap)) {
&& (uteetering_at_seen_pit(trap) || uescaped_shaft(trap))) {
dotrap(trap, FORCEBUNGLE);
/* might escape trap and still be teetering at brink */
if (!u.utrap)

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 do.c $NHDT-Date: 1574722862 2019/11/25 23:01:02 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.193 $ */
/* NetHack 3.6 do.c $NHDT-Date: 1575056306 2019/11/29 19:38:26 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.195 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -244,12 +244,13 @@ const char *verb;
}
return water_damage(obj, NULL, FALSE) == ER_DESTROYED;
} else if (u.ux == x && u.uy == y && (t = t_at(x, y)) != 0
&& uteetering_at_seen_pit(t)) {
&& (uteetering_at_seen_pit(t) || uescaped_shaft(t))) {
if (Blind && !Deaf)
You_hear("%s tumble downwards.", the(xname(obj)));
else
pline("%s %s into %s pit.", The(xname(obj)),
otense(obj, "tumble"), the_your[t->madeby_u]);
pline("%s %s into %s %s.", The(xname(obj)),
otense(obj, "tumble"), the_your[t->madeby_u],
is_pit(t->ttyp) ? "pit" : "hole");
} else if (obj->globby) {
/* Globby things like puddings might stick together */
while (obj && (otmp = obj_nexto_xy(obj, x, y, TRUE)) != 0) {
@@ -996,7 +997,7 @@ dodown()
}
if (!stairs_down && !ladder_down) {
trap = t_at(u.ux, u.uy);
if (trap && uteetering_at_seen_pit(trap)) {
if (trap && (uteetering_at_seen_pit(trap) || uescaped_shaft(trap))) {
dotrap(trap, TOOKPLUNGE);
return 1;
} else if (!trap || !is_hole(trap->ttyp)

View File

@@ -156,7 +156,8 @@ boolean check_pit;
if (u.usteed && P_SKILL(P_RIDING) < P_BASIC)
return FALSE;
if (check_pit && !Flying
&& (t = t_at(u.ux, u.uy)) != 0 && uteetering_at_seen_pit(t))
&& (t = t_at(u.ux, u.uy)) != 0
&& (uteetering_at_seen_pit(t) || uescaped_shaft(t)))
return FALSE;
return (boolean) ((!Levitation || Is_airlevel(&u.uz)

View File

@@ -2634,8 +2634,10 @@ pickup_checks()
}
if (!can_reach_floor(TRUE)) {
struct trap *traphere = t_at(u.ux, u.uy);
if (traphere && uteetering_at_seen_pit(traphere))
You("cannot reach the bottom of the pit.");
if (traphere
&& (uteetering_at_seen_pit(traphere) || uescaped_shaft(traphere)))
You("cannot reach the bottom of the %s.",
is_pit(traphere->ttyp) ? "pit" : "abyss");
else if (u.usteed && P_SKILL(P_RIDING) < P_BASIC)
rider_cant_reach();
else if (Blind && !can_reach_floor(TRUE))

View File

@@ -509,7 +509,7 @@ int what; /* should be a long */
if (!can_reach_floor(TRUE)) {
if ((g.multi && !g.context.run) || (autopickup && !flags.pickup)
|| ((ttmp = t_at(u.ux, u.uy)) != 0
&& uteetering_at_seen_pit(ttmp)))
&& (uteetering_at_seen_pit(ttmp) || uescaped_shaft(ttmp))))
read_engr_at(u.ux, u.uy);
return 0;
}

View File

@@ -67,7 +67,7 @@ dosit()
if (OBJ_AT(u.ux, u.uy)
/* ensure we're not standing on the precipice */
&& !uteetering_at_seen_pit(trap)) {
&& !(uteetering_at_seen_pit(trap) || uescaped_shaft(trap))) {
register struct obj *obj;
obj = g.level.objects[u.ux][u.uy];

View File

@@ -5083,11 +5083,21 @@ boolean
uteetering_at_seen_pit(trap)
struct trap *trap;
{
if (trap && trap->tseen && (!u.utrap || u.utraptype != TT_PIT)
&& is_pit(trap->ttyp))
return TRUE;
else
return FALSE;
return (trap && is_pit(trap->ttyp) && trap->tseen
&& trap->tx == u.ux && trap->ty == u.uy
&& !(u.utrap && u.utraptype == TT_PIT));
}
/*
* Returns TRUE if you didn't fall through a hole or didn't
* release a trap door
*/
boolean
uescaped_shaft(trap)
struct trap *trap;
{
return (trap && is_hole(trap->ttyp) && trap->tseen
&& trap->tx == u.ux && trap->ty == u.uy);
}
/* Destroy a trap that emanates from the floor. */