^G control
Wizard mode monster creation underwent several changes for 3.4.0 (explicitly create "tame <monster>", create a monster by class letter, repeat the creation for N monsters) and one of them rendered the check to prevent creating orphaned shopkeepers, temple priests, vault guards, and worm tails inoperative. Put that back, and extend the control to allow you to specify "peaceful <monster>" and "hostile <monster>" too.
This commit is contained in:
@@ -352,6 +352,7 @@ really add artifacts inside carried containers to final score (3.3.1 fix
|
|||||||
displayed them them but didn't include any points for them)
|
displayed them them but didn't include any points for them)
|
||||||
drop alternate weapon to terminate twoweapon combat if the alternate
|
drop alternate weapon to terminate twoweapon combat if the alternate
|
||||||
weapon gets cursed
|
weapon gets cursed
|
||||||
|
restore monster creation sanity checks to wizard mode ^G command
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
|
|||||||
50
src/read.c
50
src/read.c
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)read.c 3.4 2002/11/06 */
|
/* SCCS Id: @(#)read.c 3.4 2003/01/09 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -1800,40 +1800,46 @@ boolean
|
|||||||
create_particular()
|
create_particular()
|
||||||
{
|
{
|
||||||
char buf[BUFSZ], monclass = MAXMCLASSES;
|
char buf[BUFSZ], monclass = MAXMCLASSES;
|
||||||
int which = PM_PLAYERMON, tries = 0, i;
|
int which, tries, i;
|
||||||
struct permonst *whichpm = 0;
|
struct permonst *whichpm;
|
||||||
struct monst *mtmp;
|
struct monst *mtmp;
|
||||||
boolean madeany = FALSE;
|
boolean madeany = FALSE;
|
||||||
boolean maketame = FALSE;
|
boolean maketame, makepeaceful, makehostile;
|
||||||
|
|
||||||
|
tries = 0;
|
||||||
do {
|
do {
|
||||||
|
which = urole.malenum; /* an arbitrary index into mons[] */
|
||||||
|
maketame = makepeaceful = makehostile = FALSE;
|
||||||
getlin("Create what kind of monster? [type the name or symbol]",
|
getlin("Create what kind of monster? [type the name or symbol]",
|
||||||
buf);
|
buf);
|
||||||
if (buf[0] == '\033') return FALSE;
|
if (buf[0] == '\033') return FALSE;
|
||||||
(void)mungspaces(buf);
|
(void)mungspaces(buf);
|
||||||
if (strlen(buf) == 1) {
|
if (strlen(buf) == 1) {
|
||||||
monclass = def_char_to_monclass(buf[0]);
|
monclass = def_char_to_monclass(buf[0]);
|
||||||
if (monclass == MAXMCLASSES)
|
if (monclass != MAXMCLASSES) break; /* got one */
|
||||||
pline("I've never heard of such monsters.");
|
|
||||||
else break;
|
|
||||||
} else {
|
} else {
|
||||||
|
i = 0; /* offset into buf[] */
|
||||||
if (!strncmpi(buf, "tame ", 5)) {
|
if (!strncmpi(buf, "tame ", 5)) {
|
||||||
which = name_to_mon(buf+5);
|
i = 5;
|
||||||
maketame = TRUE;
|
maketame = TRUE;
|
||||||
} else {
|
} else if (!strncmpi(buf, "peaceful ", 9)) {
|
||||||
which = name_to_mon(buf);
|
i = 9;
|
||||||
maketame = FALSE;
|
makepeaceful = TRUE;
|
||||||
}
|
} else if (!strncmpi(buf, "hostile ", 8)) {
|
||||||
if (which < LOW_PM) pline("I've never heard of such monsters.");
|
i = 8;
|
||||||
else {
|
makehostile = TRUE;
|
||||||
whichpm = &mons[which];
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
which = name_to_mon(&buf[i]);
|
||||||
|
if (which >= LOW_PM) break; /* got one */
|
||||||
}
|
}
|
||||||
|
pline("I've never heard of such monsters.");
|
||||||
} while (++tries < 5);
|
} while (++tries < 5);
|
||||||
if (tries == 5) pline(thats_enough_tries);
|
|
||||||
else {
|
if (tries == 5) {
|
||||||
|
pline(thats_enough_tries);
|
||||||
|
} else {
|
||||||
(void) cant_create(&which, FALSE);
|
(void) cant_create(&which, FALSE);
|
||||||
|
whichpm = &mons[which];
|
||||||
for (i = 0; i <= multi; i++) {
|
for (i = 0; i <= multi; i++) {
|
||||||
if (monclass != MAXMCLASSES)
|
if (monclass != MAXMCLASSES)
|
||||||
whichpm = mkclass(monclass, 0);
|
whichpm = mkclass(monclass, 0);
|
||||||
@@ -1843,8 +1849,14 @@ create_particular()
|
|||||||
initedog(mtmp);
|
initedog(mtmp);
|
||||||
set_malign(mtmp);
|
set_malign(mtmp);
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
mtmp = makemon(whichpm, u.ux, u.uy, NO_MM_FLAGS);
|
mtmp = makemon(whichpm, u.ux, u.uy, NO_MM_FLAGS);
|
||||||
|
if ((makepeaceful || makehostile) && mtmp) {
|
||||||
|
mtmp->mtame = 0; /* sanity precaution */
|
||||||
|
mtmp->mpeaceful = makepeaceful ? 1 : 0;
|
||||||
|
set_malign(mtmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (mtmp) madeany = TRUE;
|
if (mtmp) madeany = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user