From: PatR Date: Tue, 8 Feb 2022 19:06:26 +0000 (-0800) Subject: wishing for water terrain X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed606cae8c1aaac0a57b33e3c063f89383d46c64;p=nethack wishing for water terrain Allow a wizard mode wish for "wall of water" to create WATER terrain. Previously there was no way to do that. Wishing for "pool" and "moat" work but "water" for terrain isn't supported because it yields a potion. --- diff --git a/src/do_name.c b/src/do_name.c index c2103b289..bdc2a8c6d 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 do_name.c $NHDT-Date: 1625885761 2021/07/10 02:56:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.213 $ */ +/* NetHack 3.7 do_name.c $NHDT-Date: 1644347168 2022/02/08 19:06:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.231 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Pasi Kallinen, 2018. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2341,7 +2341,9 @@ const char * hliquid( const char *liquidpref) /* use as-is when not hallucintg (unless empty) */ { - if (Hallucination || !liquidpref || !*liquidpref) { + boolean hallucinate = Hallucination && !g.program_state.gameover; + + if (hallucinate || !liquidpref || !*liquidpref) { int indx, count = SIZE(hliquids); /* if we have a non-hallucinatory default value, include it diff --git a/src/objnam.c b/src/objnam.c index 266cc3b98..9e093bc64 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 objnam.c $NHDT-Date: 1634584224 2021/10/18 19:10:24 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.336 $ */ +/* NetHack 3.7 objnam.c $NHDT-Date: 1644347179 2022/02/08 19:06:19 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.343 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2011. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3170,11 +3170,21 @@ wizterrainwish(struct _readobjnam_data *d) /* ("water" matches "potion of water" rather than terrain) */ } else if (!BSTRCMPI(bp, p - 4, "pool") - || !BSTRCMPI(bp, p - 4, "moat")) { - lev->typ = !BSTRCMPI(bp, p - 4, "pool") ? POOL : MOAT; + || !BSTRCMPI(bp, p - 4, "moat") + || !BSTRCMPI(bp, p - 13, "wall of water")) { + long save_prop; + const char *new_water; + + lev->typ = !BSTRCMPI(bp, p - 4, "pool") ? POOL + : !BSTRCMPI(bp, p - 4, "moat") ? MOAT + : WATER; lev->flags = 0; del_engr_at(x, y); - pline("A %s.", (lev->typ == POOL) ? "pool" : "moat"); + save_prop = EHalluc_resistance; + EHalluc_resistance = 1; + new_water = waterbody_name(x, y); + EHalluc_resistance = save_prop; + pline("%s.", An(new_water)); /* Must manually make kelp! */ water_damage_chain(g.level.objects[x][y], TRUE); madeterrain = TRUE;