From 56e51b9b6bdc3f9f4f6b134b729fbf75e7f486da Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 11 Oct 2016 17:26:32 +0300 Subject: [PATCH] Add wizmode command to recreate current level --- dat/wizhelp | 1 + doc/fixes36.1 | 2 ++ src/cmd.c | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/dat/wizhelp b/dat/wizhelp index 941ad50b2..b85d301ce 100644 --- a/dat/wizhelp +++ b/dat/wizhelp @@ -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 diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 47995a24f..efc7afa1e 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -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 diff --git a/src/cmd.c b/src/cmd.c index 8444fbfae..47d072f42 100644 --- 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 }, -- 2.40.0