From: nethack.allison Date: Wed, 10 Sep 2003 01:16:23 +0000 (+0000) Subject: U638 Juiblex's "moat" X-Git-Tag: MOVE2GIT~1801 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b7a64afdd7985ccd3f6e44b8b35b776d9ede8b15;p=nethack U638 Juiblex's "moat" > NetHack feedback form submitted by > > on Tuesday, September 9, 2003 at 06:41:34 > Hi, Just thought I'd point out a sort of inappropriate word > choice or typo that I came across in Juiblex's Swamp. I got this > message, after pushing a boulder into the swamp: There is a large > splash as the boulder falls into the moat. Obviously it's a swamp > and not a moat so that sounds a bit wrong. It says the same sort > of thing when I #dip a scroll in the swamp as well. --- diff --git a/include/dungeon.h b/include/dungeon.h index 46e863671..24ba41367 100644 --- a/include/dungeon.h +++ b/include/dungeon.h @@ -106,6 +106,7 @@ typedef struct branch { #define Is_medusa_level(x) (on_level(x, &medusa_level)) #define Is_oracle_level(x) (on_level(x, &oracle_level)) #define Is_valley(x) (on_level(x, &valley_level)) +#define Is_juiblex_level(x) (on_level(x, &juiblex_level)) #define Is_asmo_level(x) (on_level(x, &asmodeus_level)) #define Is_baal_level(x) (on_level(x, &baalzebub_level)) #define Is_wiz1_level(x) (on_level(x, &wiz1_level)) diff --git a/include/extern.h b/include/extern.h index 4887d8884..e77a2aa4a 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1033,6 +1033,7 @@ E void NDECL(movebubbles); E void NDECL(water_friction); E void FDECL(save_waterlevel, (int,int)); E void FDECL(restore_waterlevel, (int)); +E const char *FDECL(waterbody_name, (XCHAR_P,XCHAR_P)); /* ### mkobj.c ### */ diff --git a/src/do.c b/src/do.c index fa2932133..50e3989be 100644 --- a/src/do.c +++ b/src/do.c @@ -55,7 +55,7 @@ boolean pushing; impossible("Not a boulder?"); else if (!Is_waterlevel(&u.uz) && (is_pool(rx,ry) || is_lava(rx,ry))) { boolean lava = is_lava(rx,ry), fills_up; - const char *what = lava ? "lava" : "water"; + const char *what = waterbody_name(rx,ry); schar ltyp = levl[rx][ry].typ; int chance = rn2(10); /* water: 90%; lava: 10% */ fills_up = lava ? chance == 0 : chance != 0; @@ -88,8 +88,7 @@ boolean pushing; There("is a large splash as %s %s the %s.", the(xname(otmp)), fills_up? "fills":"falls into", - lava ? "lava" : ltyp==POOL ? "pool" : - moat ? "moat" : "water"); + what); } else if (flags.soundok) You_hear("a%s splash.", lava ? " sizzling" : ""); wake_nearto(rx, ry, 40); diff --git a/src/mkmaze.c b/src/mkmaze.c index f15c46761..3f81832f9 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -1144,6 +1144,34 @@ register int fd; was_waterlevel = TRUE; } +const char *waterbody_name(x, y) +xchar x,y; +{ + register struct rm *lev; + schar ltyp; + + if (!isok(x,y)) + return "drink"; /* should never happen */ + lev = &levl[x][y]; + ltyp = lev->typ; + + if (is_lava(x,y)) + return "lava"; + else if (ltyp == ICE || + (ltyp == DRAWBRIDGE_UP && + (levl[x][y].drawbridgemask & DB_UNDER) == DB_ICE)) + return "ice"; + else if (((ltyp != POOL) && (ltyp != WATER) && + !Is_medusa_level(&u.uz) && !Is_waterlevel(&u.uz) && !Is_juiblex_level(&u.uz)) || + (ltyp == DRAWBRIDGE_UP && (levl[x][y].drawbridgemask & DB_UNDER) == DB_MOAT)) + return "moat"; + else if ((ltyp != POOL) && (ltyp != WATER) && Is_juiblex_level(&u.uz)) + return "swamp"; + else if (ltyp == POOL) + return "pool of water"; + else return "water"; +} + STATIC_OVL void set_wportal() { diff --git a/src/potion.c b/src/potion.c index bc5f20a91..1ad5abe2f 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1542,7 +1542,7 @@ dodip() return(1); } } else if (is_pool(u.ux,u.uy)) { - tmp = (here == POOL) ? "pool" : "moat"; + tmp = waterbody_name(u.ux,u.uy); Sprintf(qbuf, "Dip it into the %s?", tmp); if (yn(qbuf) == 'y') { if (Levitation) {