From: nethack.allison Date: Thu, 30 Oct 2003 02:52:29 +0000 (+0000) Subject: debug mode monster creation [trunk only] X-Git-Tag: MOVE2GIT~1617 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=863de70092d3bd45ad9dad5298720d36e97c7054;p=nethack debug mode monster creation [trunk only] Allow '*' with control-g to create a random monster species, or several different monster species if a multi count was specified on the control-g command. --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 303d3c17e..5087f0fd6 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -80,6 +80,7 @@ the following actions can now be continued after save/restore: digging, hero-created and monster-created ice will eventually melt away extend Warning to include ice danger wishing for particular variety of tin contents (deep fried, broiled, etc.) +debug-mode wishing for random monster(s) via '*' Platform- and/or Interface-Specific New Features diff --git a/src/read.c b/src/read.c index 9c9499c14..4db3d8ff2 100644 --- a/src/read.c +++ b/src/read.c @@ -1847,6 +1847,7 @@ create_particular() struct monst *mtmp; boolean madeany = FALSE; boolean maketame, makepeaceful, makehostile; + boolean randmonst = FALSE; tries = 0; do { @@ -1869,6 +1870,12 @@ create_particular() } /* decide whether a valid monster was chosen */ if (strlen(bufp) == 1) { +#ifdef WIZARD + if (wizard && *bufp == '*') { + randmonst = TRUE; + break; + } +#endif monclass = def_char_to_monclass(*bufp); if (monclass != MAXMCLASSES) break; /* got one */ } else { @@ -1882,9 +1889,13 @@ create_particular() if (tries == 5) { pline(thats_enough_tries); } else { - (void) cant_create(&which, FALSE); - whichpm = &mons[which]; + if (!randmonst) { + (void) cant_create(&which, FALSE); + whichpm = &mons[which]; + } for (i = 0; i <= multi; i++) { + if (randmonst) + whichpm = rndmonst(); if (monclass != MAXMCLASSES) whichpm = mkclass(monclass, 0); if (maketame) {