-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.396 $ $NHDT-Date: 1608335163 2020/12/18 23:46:03 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.399 $ $NHDT-Date: 1608673688 2020/12/22 21:48:08 $
General Fixes and Modified Features
-----------------------------------
best possible armor class reduced from -127 to -99; worst from +127 to +99;
charged or enchanted individual items also capped at +/- 99 (affects
wizard mode wishing, negligible effect on normal play)
+fix several inconsistencies for objects at hole locations
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
-/* NetHack 3.7 do.c $NHDT-Date: 1601595709 2020/10/01 23:41:49 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.249 $ */
+/* NetHack 3.7 do.c $NHDT-Date: 1608673689 2020/12/22 21:48:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.256 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
pline("%s %s into %s %s.", The(xname(obj)),
otense(obj, "tumble"), the_your[t->madeby_u],
is_pit(t->ttyp) ? "pit" : "hole");
+ if (is_hole(t->ttyp) && ship_object(obj, x, y, FALSE))
+ return TRUE;
} else if (obj->globby) {
/* Globby things like puddings might stick together */
while (obj && (otmp = obj_nexto_xy(obj, x, y, TRUE)) != 0) {
if (obj == uswapwep)
setuswapwep((struct obj *) 0);
- if (!u.uswallow && flooreffects(obj, u.ux, u.uy, "drop"))
- return;
if (u.uswallow) {
/* hero has dropped an item while inside an engulfer */
if (obj != uball) { /* mon doesn't pick up ball */
(void) mpickobj(u.ustuck, obj);
}
} else {
+ if (flooreffects(obj, u.ux, u.uy, "drop"))
+ return;
place_object(obj, u.ux, u.uy);
if (with_impact)
container_impact_dmg(obj, u.ux, u.uy);
-/* NetHack 3.7 dokick.c $NHDT-Date: 1606343576 2020/11/25 22:32:56 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.160 $ */
+/* NetHack 3.7 dokick.c $NHDT-Date: 1608673689 2020/12/22 21:48:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.162 $ */
/* Copyright (c) Izchak Miller, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
g.gate_str = 0;
/* this matches the player restriction in goto_level() */
- if (on_level(&u.uz, &qstart_level) && !ok_to_quest())
+ if (on_level(&u.uz, &qstart_level) && !ok_to_quest()) {
return MIGR_NOWHERE;
-
+ }
if (stway && !stway->up && !stway->isladder) {
g.gate_str = "down the stairs";
return (stway->tolev.dnum == u.uz.dnum) ? MIGR_STAIRS_UP
- : MIGR_SSTAIRS;
+ : MIGR_SSTAIRS;
}
if (stway && !stway->up && stway->isladder) {
g.gate_str = "down the ladder";
return MIGR_LADDER_UP;
}
-
- if (((ttmp = t_at(x, y)) != 0 && ttmp->tseen)
- && is_hole(ttmp->ttyp)) {
+ /* hole will always be flagged as seen; trap drop might or might not */
+ if ((ttmp = t_at(x, y)) != 0 && ttmp->tseen && is_hole(ttmp->ttyp)) {
g.gate_str = (ttmp->ttyp == TRAPDOOR) ? "through the trap door"
- : "through the hole";
+ : "through the hole";
return MIGR_RANDOM;
}
return MIGR_NOWHERE;
-/* NetHack 3.7 dothrow.c $NHDT-Date: 1607200366 2020/12/05 20:32:46 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.191 $ */
+/* NetHack 3.7 dothrow.c $NHDT-Date: 1608673690 2020/12/22 21:48:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.192 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
dropy(obj);
return;
}
- if (IS_ALTAR(levl[u.ux][u.uy].typ))
+ if (IS_ALTAR(levl[u.ux][u.uy].typ)) {
doaltarobj(obj);
- else if (verbosely)
- pline("%s %s the %s.", Doname2(obj), otense(obj, "hit"),
- surface(u.ux, u.uy));
+ } else if (verbosely) {
+ const char *surf = surface(u.ux, u.uy);
+ struct trap *t = t_at(u.ux, u.uy);
+
+ /* describe something that might keep the object where it is
+ or precede next message stating that it falls */
+ if (t && t->tseen) {
+ switch (t->ttyp) {
+ case TRAPDOOR:
+ surf = "trap door";
+ break;
+ case HOLE:
+ surf = "edge of the hole";
+ break;
+ case PIT:
+ case SPIKED_PIT:
+ surf = "edge of the pit";
+ break;
+ default:
+ break;
+ }
+ }
+ pline("%s %s the %s.", Doname2(obj), otense(obj, "hit"), surf);
+ }
if (hero_breaks(obj, u.ux, u.uy, TRUE))
return;
-/* NetHack 3.7 engrave.c $NHDT-Date: 1596498167 2020/08/03 23:42:47 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.98 $ */
+/* NetHack 3.7 engrave.c $NHDT-Date: 1608673691 2020/12/22 21:48:11 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.99 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
{
struct trap *t;
- if (u.uswallow)
+ if (u.uswallow || (u.ustuck && !sticks(g.youmonst.data))
+ || (Levitation && !(Is_airlevel(&u.uz) || Is_waterlevel(&u.uz))))
return FALSE;
/* Restricted/unskilled riders can't reach the floor */
if (u.usteed && P_SKILL(P_RIDING) < P_BASIC)
return FALSE;
- if (check_pit && !Flying
- && (t = t_at(u.ux, u.uy)) != 0
+ if (u.uundetected && ceiling_hider(g.youmonst.data))
+ return FALSE;
+
+ if (Flying || g.youmonst.data->msize >= MZ_HUGE)
+ return TRUE;
+
+ if (check_pit && (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)
- || Is_waterlevel(&u.uz))
- && (!u.uundetected || !is_hider(g.youmonst.data)
- || u.umonnum == PM_TRAPPER));
+ return TRUE;
}
/* give a message after caller has determined that hero can't reach */
-/* NetHack 3.7 hack.c $NHDT-Date: 1608335164 2020/12/18 23:46:04 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.273 $ */
+/* NetHack 3.7 hack.c $NHDT-Date: 1608673692 2020/12/22 21:48:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.274 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
static int
pickup_checks()
{
+ struct trap *traphere;
+
/* uswallow case added by GAN 01/29/87 */
if (u.uswallow) {
if (!u.ustuck->minvent) {
}
}
if (is_pool(u.ux, u.uy)) {
- if (Wwalking || is_floater(g.youmonst.data) || is_clinger(g.youmonst.data)
- || (Flying && !Breathless)) {
+ if (Wwalking || is_floater(g.youmonst.data)
+ || is_clinger(g.youmonst.data) || (Flying && !Breathless)) {
You("cannot dive into the %s to pick things up.",
hliquid("water"));
return 0;
}
}
if (is_lava(u.ux, u.uy)) {
- if (Wwalking || is_floater(g.youmonst.data) || is_clinger(g.youmonst.data)
- || (Flying && !Breathless)) {
+ if (Wwalking || is_floater(g.youmonst.data)
+ || is_clinger(g.youmonst.data) || (Flying && !Breathless)) {
You_cant("reach the bottom to pick things up.");
return 0;
} else if (!likes_lava(g.youmonst.data)) {
There("is nothing here to pick up.");
return 0;
}
- if (!can_reach_floor(TRUE)) {
- struct trap *traphere = t_at(u.ux, u.uy);
- 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)
+ traphere = t_at(u.ux, u.uy);
+ if (!can_reach_floor(traphere && is_pit(traphere->ttyp))) {
+ /* it here's a hole here, any objects here clearly aren't at
+ the bottom so only check for pits */
+ if (traphere && uteetering_at_seen_pit(traphere)) {
+ You("cannot reach the bottom of the pit.");
+ } else if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) {
rider_cant_reach();
- else if (Blind && !can_reach_floor(TRUE))
+ } else if (Blind) {
You("cannot reach anything here.");
- else
- You("cannot reach the %s.", surface(u.ux, u.uy));
+ } else {
+ const char *surf = surface(u.ux, u.uy);
+
+ if (traphere) {
+ if (traphere->ttyp == HOLE)
+ surf = "edge of the hole";
+ else if (traphere->ttyp == TRAPDOOR)
+ surf = "trap door";
+ }
+ You("cannot reach the %s.", surf);
+ }
return 0;
}
return -1; /* can do normal pickup */
-/* NetHack 3.7 pickup.c $NHDT-Date: 1601595711 2020/10/01 23:41:51 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.272 $ */
+/* NetHack 3.7 pickup.c $NHDT-Date: 1608673693 2020/12/22 21:48:13 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.273 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
return 0;
}
/* no pickup if levitating & not on air or water level */
- if (!can_reach_floor(TRUE)) {
+ t = t_at(u.ux, u.uy);
+ if (!can_reach_floor(t && is_pit(t->ttyp))) {
(void) describe_decor(); /* even when !flags.mention_decor */
if ((g.multi && !g.context.run) || (autopickup && !flags.pickup)
- || ((t = t_at(u.ux, u.uy)) != 0
- && (uteetering_at_seen_pit(t) || uescaped_shaft(t))))
+ || (t && (uteetering_at_seen_pit(t) || uescaped_shaft(t))))
read_engr_at(u.ux, u.uy);
return 0;
}
boolean looting; /* loot vs tip */
{
const char *verb = looting ? "loot" : "tip";
+ struct trap *t = t_at(x, y);
- if (!can_reach_floor(TRUE)) {
+ if (!can_reach_floor(t && is_pit(t->ttyp))) {
if (u.usteed && P_SKILL(P_RIDING) < P_BASIC)
rider_cant_reach(); /* not skilled enough to reach */
else