Merge branch 'NetHack-3.6'
This commit is contained in:
@@ -1067,6 +1067,30 @@ int x, y;
|
||||
} /* end case */
|
||||
}
|
||||
|
||||
/*
|
||||
* flash_glyph_at(x, y, glyph)
|
||||
*
|
||||
* Briefly flash between the passed glyph and the glyph that's
|
||||
* meant to be at the location.
|
||||
*/
|
||||
void
|
||||
flash_glyph_at(x, y, tg)
|
||||
int x, y, tg;
|
||||
{
|
||||
int i, glyph[2];
|
||||
|
||||
glyph[0] = tg;
|
||||
glyph[1] = (level.flags.hero_memory)
|
||||
? levl[x][y].glyph
|
||||
: back_to_glyph(x, y);
|
||||
for (i = 0; i < 15; i++) {
|
||||
show_glyph(x, y, glyph[i % 2]);
|
||||
flush_screen(1);
|
||||
delay_output();
|
||||
}
|
||||
newsym(x, y);
|
||||
}
|
||||
|
||||
/*
|
||||
* swallowed()
|
||||
*
|
||||
|
||||
@@ -1957,7 +1957,7 @@ struct monst *mtmp;
|
||||
#ifdef CLIPPING
|
||||
cliparound(mtmp->mx, mtmp->my);
|
||||
#endif
|
||||
show_glyph(mtmp->mx, mtmp->my, mon_to_glyph(mtmp, rn2));
|
||||
show_glyph(mtmp->mx, mtmp->my, mon_to_glyph(mtmp, rn2_on_display_rng));
|
||||
display_self();
|
||||
You_feel("aggravated at %s.", noit_mon_nam(mtmp));
|
||||
display_nhwindow(WIN_MAP, TRUE);
|
||||
|
||||
22
src/read.c
22
src/read.c
@@ -2440,7 +2440,7 @@ struct _create_particular_data {
|
||||
char monclass;
|
||||
boolean randmonst;
|
||||
boolean maketame, makepeaceful, makehostile;
|
||||
boolean sleeping, saddled, invisible;
|
||||
boolean sleeping, saddled, invisible, hidden;
|
||||
};
|
||||
|
||||
boolean
|
||||
@@ -2470,6 +2470,10 @@ struct _create_particular_data *d;
|
||||
d->invisible = TRUE;
|
||||
(void) memset(tmpp, ' ', sizeof "invisible " - 1);
|
||||
}
|
||||
if ((tmpp = strstri(bufp, "hidden ")) != 0) {
|
||||
d->hidden = TRUE;
|
||||
(void) memset(tmpp, ' ', sizeof "hidden " - 1);
|
||||
}
|
||||
/* check "female" before "male" to avoid false hit mid-word */
|
||||
if ((tmpp = strstri(bufp, "female ")) != 0) {
|
||||
d->fem = 1;
|
||||
@@ -2524,9 +2528,9 @@ create_particular_creation(d)
|
||||
struct _create_particular_data *d;
|
||||
{
|
||||
struct permonst *whichpm = NULL;
|
||||
int i, firstchoice = NON_PM;
|
||||
int i, flashglyph, firstchoice = NON_PM;
|
||||
struct monst *mtmp;
|
||||
boolean madeany = FALSE;
|
||||
boolean madeany = FALSE, doflash = FALSE;
|
||||
|
||||
if (!d->randmonst) {
|
||||
firstchoice = d->which;
|
||||
@@ -2555,6 +2559,7 @@ struct _create_particular_data *d;
|
||||
/* otherwise try again */
|
||||
continue;
|
||||
}
|
||||
flashglyph = mon_to_glyph(mtmp, rn2_on_display_rng);
|
||||
/* 'is_FOO()' ought to be called 'always_FOO()' */
|
||||
if (d->fem != -1 && !is_male(mtmp->data) && !is_female(mtmp->data))
|
||||
mtmp->female = d->fem; /* ignored for is_neuter() */
|
||||
@@ -2572,14 +2577,25 @@ struct _create_particular_data *d;
|
||||
}
|
||||
if (d->invisible) {
|
||||
int mx = mtmp->mx, my = mtmp->my;
|
||||
|
||||
mon_set_minvis(mtmp);
|
||||
if (does_block(mx, my, &levl[mx][my]))
|
||||
block_point(mx, my);
|
||||
else
|
||||
unblock_point(mx, my);
|
||||
doflash = TRUE;
|
||||
}
|
||||
if (d->hidden && is_hider(mtmp->data)) {
|
||||
mtmp->mundetected = 1;
|
||||
doflash = TRUE;
|
||||
}
|
||||
if (d->sleeping)
|
||||
mtmp->msleeping = 1;
|
||||
if (doflash) {
|
||||
if (wizard && cansee(mtmp->mx, mtmp->my))
|
||||
if (!canseemon(mtmp) && !sensemon(mtmp))
|
||||
flash_glyph_at(mtmp->mx, mtmp->my, flashglyph);
|
||||
}
|
||||
madeany = TRUE;
|
||||
/* in case we got a doppelganger instead of what was asked
|
||||
for, make it start out looking like what was asked for */
|
||||
|
||||
Reference in New Issue
Block a user