From de73a32d7d31f309360508d872c52c8267faf7d0 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 30 Jul 2021 20:50:45 +0300 Subject: [PATCH] Implement wishing for walls in wizmode --- doc/fixes37.0 | 2 +- src/objnam.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index c84c3a7b5..01a3c7903 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -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 diff --git a/src/objnam.c b/src/objnam.c index af45f14ea..bcf43ef49 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -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;