]> granicus.if.org Git - nethack/commitdiff
Add wizmode command to recreate current level
authorPasi Kallinen <paxed@alt.org>
Tue, 11 Oct 2016 14:26:32 +0000 (17:26 +0300)
committerPasi Kallinen <paxed@alt.org>
Tue, 11 Oct 2016 14:26:32 +0000 (17:26 +0300)
dat/wizhelp
doc/fixes36.1
src/cmd.c

index 941ad50b2c619e39826d5394e09c09fb0465dc8c..b85d301ce2aa793e5837867ed71c7d0445eb2e04 100644 (file)
@@ -20,6 +20,7 @@ Debug-Mode Quick Reference:
 #timeout == look at timeout queue
 #vision == show vision array
 #vanquished == disclose counts of dead monsters
+#wizmakemap == recreate the current level
 #wizsmell == smell a monster
 #wizintrinsic == set selected intrinsic timeouts
 #wizrumorcheck == validate first and last rumor for true and false set
index 47995a24fec5129b34a64601c9c5e4873a120fa2..efc7afa1e2a483013f13a474c0661c900a84cfb0 100644 (file)
@@ -348,6 +348,7 @@ give quest guardians some equipment
 hero polyed into ghoul can only eat non-veggy corpses or eggs
 kicking activates statue traps
 pets start with apport equal to your charisma
+sometimes generate the random mazes with wide corridors or thick walls
 
 
 Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
@@ -502,6 +503,7 @@ random horses have a tiny chance of being generated saddled
 give feedback just before timed levitation runs out
 travel accepts 'm' (request menu) prefix
 pressing a or A when cursor positioning shows menu of "interesting" features
+wizard-mode command #wizmakemap to recreate the current level
 
 
 Platform- and/or Interface-Specific New Features
index 8444fbfae1dfb3abc59c81c42c75619a6f45d262..47d072f42c4ca4ad01241e167204aff984e2cc3f 100644 (file)
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -3,6 +3,7 @@
 /* NetHack may be freely redistributed.  See license for details. */
 
 #include "hack.h"
+#include "lev.h"
 #include "func_tab.h"
 
 #ifdef ALTMETA
@@ -123,6 +124,7 @@ STATIC_PTR int NDECL(wiz_wish);
 STATIC_PTR int NDECL(wiz_identify);
 STATIC_PTR int NDECL(wiz_intrinsic);
 STATIC_PTR int NDECL(wiz_map);
+STATIC_PTR int NDECL(wiz_makemap);
 STATIC_PTR int NDECL(wiz_genesis);
 STATIC_PTR int NDECL(wiz_where);
 STATIC_PTR int NDECL(wiz_detect);
@@ -610,6 +612,21 @@ wiz_identify(VOID_ARGS)
     return 0;
 }
 
+STATIC_PTR int
+wiz_makemap(VOID_ARGS)
+{
+    if (wizard) {
+        savelev(-1, ledger_no(&u.uz), FREE_SAVE);
+        mklev();
+        reglyph_darkroom();
+        vision_reset();
+        vision_full_recalc = 1;
+        (void) safe_teleds(TRUE);
+        docrt();
+        flush_screen(1);
+    }
+}
+
 /* ^F command - reveal the level map and any traps on it */
 STATIC_PTR int
 wiz_map(VOID_ARGS)
@@ -2812,6 +2829,7 @@ struct ext_func_tab extcmdlist[] = {
     { C('i'), "wizidentify", "identify all items in inventory", wiz_identify, IFBURIED|AUTOCOMPLETE|WIZMODECMD },
     { '\0', "wizintrinsic", "set intrinsic", wiz_intrinsic, IFBURIED|AUTOCOMPLETE|WIZMODECMD },
     { C('v'), "wizlevelport", "teleport to another level", wiz_level_tele, IFBURIED|AUTOCOMPLETE|WIZMODECMD },
+    { '\0', "wizmakemap", "recreate the current level", wiz_makemap, IFBURIED|WIZMODECMD },
     { C('f'), "wizmap", "map the level", wiz_map, IFBURIED|AUTOCOMPLETE|WIZMODECMD },
     { '\0', "wizrumorcheck", "verify rumor boundaries", wiz_rumor_check, IFBURIED|AUTOCOMPLETE|WIZMODECMD },
     { '\0', "wizsmell", "smell monster", wiz_smell, IFBURIED|AUTOCOMPLETE|WIZMODECMD },