Add wizmode command to recreate current level

This commit is contained in:
Pasi Kallinen
2016-10-11 17:26:32 +03:00
parent 63487e8dbd
commit 56e51b9b6b
3 changed files with 21 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ Debug-Mode Quick Reference:
#timeout == look at timeout queue #timeout == look at timeout queue
#vision == show vision array #vision == show vision array
#vanquished == disclose counts of dead monsters #vanquished == disclose counts of dead monsters
#wizmakemap == recreate the current level
#wizsmell == smell a monster #wizsmell == smell a monster
#wizintrinsic == set selected intrinsic timeouts #wizintrinsic == set selected intrinsic timeouts
#wizrumorcheck == validate first and last rumor for true and false set #wizrumorcheck == validate first and last rumor for true and false set

View File

@@ -348,6 +348,7 @@ give quest guardians some equipment
hero polyed into ghoul can only eat non-veggy corpses or eggs hero polyed into ghoul can only eat non-veggy corpses or eggs
kicking activates statue traps kicking activates statue traps
pets start with apport equal to your charisma 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 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 give feedback just before timed levitation runs out
travel accepts 'm' (request menu) prefix travel accepts 'm' (request menu) prefix
pressing a or A when cursor positioning shows menu of "interesting" features 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 Platform- and/or Interface-Specific New Features

View File

@@ -3,6 +3,7 @@
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
#include "hack.h" #include "hack.h"
#include "lev.h"
#include "func_tab.h" #include "func_tab.h"
#ifdef ALTMETA #ifdef ALTMETA
@@ -123,6 +124,7 @@ STATIC_PTR int NDECL(wiz_wish);
STATIC_PTR int NDECL(wiz_identify); STATIC_PTR int NDECL(wiz_identify);
STATIC_PTR int NDECL(wiz_intrinsic); STATIC_PTR int NDECL(wiz_intrinsic);
STATIC_PTR int NDECL(wiz_map); STATIC_PTR int NDECL(wiz_map);
STATIC_PTR int NDECL(wiz_makemap);
STATIC_PTR int NDECL(wiz_genesis); STATIC_PTR int NDECL(wiz_genesis);
STATIC_PTR int NDECL(wiz_where); STATIC_PTR int NDECL(wiz_where);
STATIC_PTR int NDECL(wiz_detect); STATIC_PTR int NDECL(wiz_detect);
@@ -610,6 +612,21 @@ wiz_identify(VOID_ARGS)
return 0; 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 */ /* ^F command - reveal the level map and any traps on it */
STATIC_PTR int STATIC_PTR int
wiz_map(VOID_ARGS) 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 }, { C('i'), "wizidentify", "identify all items in inventory", wiz_identify, IFBURIED|AUTOCOMPLETE|WIZMODECMD },
{ '\0', "wizintrinsic", "set intrinsic", wiz_intrinsic, 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 }, { 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 }, { C('f'), "wizmap", "map the level", wiz_map, IFBURIED|AUTOCOMPLETE|WIZMODECMD },
{ '\0', "wizrumorcheck", "verify rumor boundaries", wiz_rumor_check, IFBURIED|AUTOCOMPLETE|WIZMODECMD }, { '\0', "wizrumorcheck", "verify rumor boundaries", wiz_rumor_check, IFBURIED|AUTOCOMPLETE|WIZMODECMD },
{ '\0', "wizsmell", "smell monster", wiz_smell, IFBURIED|AUTOCOMPLETE|WIZMODECMD }, { '\0', "wizsmell", "smell monster", wiz_smell, IFBURIED|AUTOCOMPLETE|WIZMODECMD },