floor access

A post-3.4.3 change dealing with reaching into pits resulted in "you
sit on the air" if you used the #sit command after escaping a pit trap.
Change can_reach_floor() so that caller explicitly controls whether being
on the brink of a pit is a condition that prevents reaching the floor.
This also splits a fairly common message about not being able to reach the
floor into a separate routine.

     There is still oddness here:  if you're polymorphed into a flyer,
#sit yields "you sit down" followed by "you fly over a pit" (latter occurs
when escaping trap activation).  A ceiling hider behaves similarly, but
the second message is "you escape a pit" and doesn't sound quite as silly.
Perhaps #sit should pass TOOKPLUNGE to dotrap(), or maybe there's some
better way to handle this?
This commit is contained in:
nethack.rankin
2005-06-04 05:25:28 +00:00
parent ff54d82b00
commit ff16502d67
13 changed files with 83 additions and 60 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)potion.c 3.5 2005/04/23 */
/* SCCS Id: @(#)potion.c 3.5 2005/06/02 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -342,7 +342,9 @@ dodrink()
return 0;
}
/* Is there a fountain to drink from here? */
if (IS_FOUNTAIN(levl[u.ux][u.uy].typ) && can_reach_floor()) {
if (IS_FOUNTAIN(levl[u.ux][u.uy].typ) &&
/* not as low as floor level but similar restrictions apply */
can_reach_floor(FALSE)) {
if(yn("Drink from the fountain?") == 'y') {
drinkfountain();
return 1;
@@ -350,7 +352,9 @@ dodrink()
}
#ifdef SINKS
/* Or a kitchen sink? */
if (IS_SINK(levl[u.ux][u.uy].typ) && can_reach_floor()) {
if (IS_SINK(levl[u.ux][u.uy].typ) &&
/* not as low as floor level but similar restrictions apply */
can_reach_floor(FALSE)) {
if (yn("Drink from the sink?") == 'y') {
drinksink();
return 1;