]> granicus.if.org Git - nethack/commitdiff
U638 Juiblex's "moat"
authornethack.allison <nethack.allison>
Wed, 10 Sep 2003 01:16:23 +0000 (01:16 +0000)
committernethack.allison <nethack.allison>
Wed, 10 Sep 2003 01:16:23 +0000 (01:16 +0000)
> NetHack feedback form submitted by
> <email deleted>
> 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.

include/dungeon.h
include/extern.h
src/do.c
src/mkmaze.c
src/potion.c

index 46e86367165389458043c52dbf6935155d4c4c32..24ba413672366c6bea3821336b29de083206cf8f 100644 (file)
@@ -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))
index 4887d88842ad35639fd67bb03b7087bb169282fd..e77a2aa4aecd21e231a62ccc98ee53db20c8fee4 100644 (file)
@@ -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 ### */
 
index fa29321332e1f6fd105eeebc865c684f3ea3c08a..50e3989be928411a23352856489c834a4153fefc 100644 (file)
--- 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);
index f15c4676154daf33cf4da254e096d33ee85120a0..3f81832f9c4525992c35985f217fb045ca44085a 100644 (file)
@@ -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()
 {
index bc5f20a914b3f09a0e294b92863d6d573a3782df..1ad5abe2f4efd2693696b2d833dac9b01a0306dc 100644 (file)
@@ -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) {