]> granicus.if.org Git - nethack/commitdiff
wishing for water terrain
authorPatR <rankin@nethack.org>
Tue, 8 Feb 2022 19:06:26 +0000 (11:06 -0800)
committerPatR <rankin@nethack.org>
Tue, 8 Feb 2022 19:06:26 +0000 (11:06 -0800)
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.

src/do_name.c
src/objnam.c

index c2103b289b746c8cd0ef62c43f8b9af2f08ed0aa..bdc2a8c6d7ff707905da8d7f0dd63579d381ab19 100644 (file)
@@ -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
index 266cc3b9893b10b57a778e26be4e91c38c98dc26..9e093bc64ea679a4d85916929c6858263f5a54da 100644 (file)
@@ -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;