]> granicus.if.org Git - nethack/commitdiff
Implement wishing for walls in wizmode
authorPasi Kallinen <paxed@alt.org>
Fri, 30 Jul 2021 17:50:45 +0000 (20:50 +0300)
committerPasi Kallinen <paxed@alt.org>
Fri, 30 Jul 2021 17:52:46 +0000 (20:52 +0300)
doc/fixes37.0
src/objnam.c

index c84c3a7b5907e65cab7c166b6a878ce954ca15ce..01a3c7903e522101046986e11d9a76edf67326c8 100644 (file)
@@ -983,7 +983,7 @@ when hallucinating, see hallucinated liquids when looking at water or lava
 applying a spellbook hints about read charges left
 wizard mode wishing for level topology can now create hidden doors (ask for
        "secret door" when at a door or wall location), hidden corridor
-       spots ("secret corridor" at a corridor location), and clouds
+       spots ("secret corridor" at a corridor location), clouds and walls
 tiny chance for randomly created spellbooks to be Discworld novels instead
        of having only one in the first book or scroll shop created (won't
        occur in hero's initial inventory or NPC priest inventory or be
index af45f14eafa0d548c780182b99b6938a887d28ca..bcf43ef49cf7337f18daa8404969a581dd9492a3 100644 (file)
@@ -3211,8 +3211,16 @@ wizterrainwish(struct _readobjnam_data *d)
         }
     } else if (!BSTRCMPI(bp, p - 4, "wall")
                          && (bp == p - 4 || p[-4] == ' ')) {
-        pline("Wishing for walls is not implemented.");
-        badterrain = TRUE;
+        schar wall = HWALL;
+
+        if ((isok(u.ux, u.uy-1) && IS_WALL(levl[u.ux][u.uy-1].typ))
+            || (isok(u.ux, u.uy+1) && IS_WALL(levl[u.ux][u.uy+1].typ)))
+            wall = VWALL;
+        madeterrain = TRUE;
+        lev->typ = wall;
+        fix_wall_spines(max(0,u.ux-1), max(0,u.uy-1),
+                        min(COLNO,u.ux+1), min(ROWNO,u.uy+1));
+        pline("A wall.");
     } else if (!BSTRCMPI(bp, p - 15, "secret corridor")) {
         if (lev->typ == CORR) {
             lev->typ = SCORR;