extern void water_friction(void);
extern void save_waterlevel(NHFILE *);
extern void restore_waterlevel(NHFILE *);
-extern const char *waterbody_name(xchar, xchar);
/* ### mkobj.c ### */
extern char *monhealthdescr(struct monst *mon, boolean, char *);
extern void mhidden_description(struct monst *, boolean, char *);
extern boolean object_from_map(int,int,int,struct obj **);
+extern const char *waterbody_name(xchar, xchar);
extern int do_screen_description(coord, boolean, int, char *, const char **,
struct permonst **);
extern int do_look(int, coord *);
b->next = (struct bubble *) 0;
}
-const char *
-waterbody_name(xchar x, xchar y)
-{
- struct rm *lev;
- schar ltyp;
-
- if (!isok(x, y))
- return "drink"; /* should never happen */
- lev = &levl[x][y];
- ltyp = lev->typ;
- if (ltyp == DRAWBRIDGE_UP)
- ltyp = db_under_typ(lev->drawbridgemask);
-
- if (ltyp == LAVAPOOL)
- return hliquid("lava");
- else if (ltyp == ICE)
- return "ice";
- else if (ltyp == POOL)
- return "pool of water";
- else if (ltyp == WATER || Is_waterlevel(&u.uz))
- ; /* fall through to default return value */
- else if (Is_juiblex_level(&u.uz))
- return "swamp";
- else if (ltyp == MOAT && !Is_medusa_level(&u.uz)
- /* samurai has two moat spots on quest home level that seem
- silly if described as such (maybe change them to pools?) */
- && !(Role_if(PM_SAMURAI) && Is_qstart(&u.uz)))
- return "moat";
-
- return hliquid("water");
-}
-
static void
set_wportal(void)
{
} /* monbuf is non-null */
}
+/* describe a pool location's contents; might return a static buffer so
+ caller should use it or copy it before calling waterbody_name() again
+ [3.7: moved here from mkmaze.c] */
+const char *
+waterbody_name(xchar x, xchar y)
+{
+ static char pooltype[40];
+ struct rm *lev;
+ schar ltyp;
+
+ if (!isok(x, y))
+ return "drink"; /* should never happen */
+ lev = &levl[x][y];
+ ltyp = lev->typ;
+ if (ltyp == DRAWBRIDGE_UP)
+ ltyp = db_under_typ(lev->drawbridgemask);
+
+ if (ltyp == LAVAPOOL) {
+ if (!Hallucination)
+ return "lava";
+ Snprintf(pooltype, sizeof pooltype, "molten %s", hliquid("lava"));
+ return pooltype;
+ } else if (ltyp == ICE) {
+ return "ice";
+ } else if (ltyp == POOL) {
+ Snprintf(pooltype, sizeof pooltype, "pool of %s", hliquid("water"));
+ return pooltype;
+ } else if (ltyp == MOAT) {
+ /* a bit of extra flavor over general moat */
+ if (Is_medusa_level(&u.uz))
+ /* somewhat iffy since ordinary stairs can take you beneath,
+ but previous generic "water" was rather anti-climactic */
+ return "shallow sea";
+ else if (Is_juiblex_level(&u.uz))
+ return "swamp";
+ else if (Role_if(PM_SAMURAI) && Is_qstart(&u.uz))
+ /* samurai quest home level has two isolated moat spots;
+ they sound silly if farlook describes them as such */
+ return "pond";
+ else
+ return "moat";
+ } else if (ltyp == WATER) {
+ Snprintf(pooltype, sizeof pooltype, "%s %s",
+ !Is_waterlevel(&u.uz) ? "wall of" : "limitless",
+ hliquid("water"));
+ return pooltype;
+ }
+ /* default; should be unreachable */
+ return "water"; /* don't hallucinate this as some other liquid */
+}
+
/*
* Return the name of the glyph found at (x,y).
* If not hallucinating and the glyph is a monster, also monster data.
}
if (!u.uinwater) {
- You("%s into the %s%s%c", is_solid ? "plunge" : "fall",
- is_solid ? "wall of " : "",
- hliquid("water"),
- Amphibious || Swimming ? '.' : '!');
+ You("%s into the %s%c", is_solid ? "plunge" : "fall",
+ waterbody_name(u.ux, u.uy), (Amphibious || Swimming) ? '.' : '!');
if (!Swimming && !is_solid)
You("sink like %s.", Hallucination ? "the Titanic" : "a rock");
}
goto burn_stuff;
}
} else
- You("fall into the %s!", hliquid("lava"));
+ You("fall into the %s!", waterbody_name(u.ux, u.uy));
usurvive = Lifesaved || discover;
if (wizard)
hero needs to escape immediately */
set_utrap((unsigned) (rn1(4, 4) + ((boil_away ? 2 : rn1(4, 12)) << 8)),
TT_LAVA);
- You("sink into the %s%s!", hliquid("lava"),
+ You("sink into the %s%s!", waterbody_name(u.ux, u.uy),
!boil_away ? ", but it only burns slightly"
: " and are about to be immolated");
if (Fire_resistance)