]> granicus.if.org Git - nethack/commitdiff
debug mode monster creation [trunk only]
authornethack.allison <nethack.allison>
Thu, 30 Oct 2003 02:52:29 +0000 (02:52 +0000)
committernethack.allison <nethack.allison>
Thu, 30 Oct 2003 02:52:29 +0000 (02:52 +0000)
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.

doc/fixes35.0
src/read.c

index 303d3c17ef9b39f9cb7fe6ac1fca6d729ccf6973..5087f0fd6bdd1a2c054e248ca7cc8caf96a2d74a 100644 (file)
@@ -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
index 9c9499c1455406e3cdd23b7bf2d16d130fdb481c..4db3d8ff23ec8118d199741ad86fe795a1c9ac56 100644 (file)
@@ -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) {