Gremlin wailing in agony should wake up nearby monsters

Also allow wizmode ^G create sleeping monsters
This commit is contained in:
Pasi Kallinen
2016-05-29 09:35:51 +03:00
parent 0c70b1bd06
commit d45d475468
2 changed files with 10 additions and 2 deletions

View File

@@ -2371,7 +2371,8 @@ create_particular()
struct permonst *whichpm = NULL;
struct monst *mtmp;
boolean madeany = FALSE, randmonst = FALSE,
maketame, makepeaceful, makehostile, saddled, invisible;
maketame, makepeaceful, makehostile, saddled, invisible,
sleeping;
int fem;
tryct = 5;
@@ -2379,7 +2380,7 @@ create_particular()
monclass = MAXMCLASSES;
which = urole.malenum; /* an arbitrary index into mons[] */
maketame = makepeaceful = makehostile = FALSE;
saddled = invisible = FALSE;
sleeping = saddled = invisible = FALSE;
fem = -1; /* gender not specified */
getlin("Create what kind of monster? [type the name or symbol]", buf);
bufp = mungspaces(buf);
@@ -2389,6 +2390,10 @@ create_particular()
saddled = TRUE;
(void) memset(tmpp, ' ', sizeof "saddled " - 1);
}
if ((tmpp = strstri(bufp, "sleeping ")) != 0) {
sleeping = TRUE;
(void) memset(tmpp, ' ', sizeof "sleeping " - 1);
}
if ((tmpp = strstri(bufp, "invisible ")) != 0) {
invisible = TRUE;
(void) memset(tmpp, ' ', sizeof "invisible " - 1);
@@ -2478,6 +2483,8 @@ create_particular()
}
if (invisible)
mon_set_minvis(mtmp);
if (sleeping)
mtmp->msleeping = 1;
madeany = TRUE;
/* in case we got a doppelganger instead of what was asked
for, make it start out looking like what was asked for */

View File

@@ -2695,6 +2695,7 @@ int dmg;
pline("%s %s!", Monnam(mon),
(dmg > mon->mhp / 2) ? "wails in agony" : "cries out in pain");
mon->mhp -= dmg;
wake_nearto(mon->mx, mon->my, 30);
if (mon->mhp <= 0) {
if (context.mon_moving)
monkilled(mon, (char *) 0, AD_BLND);