make display effect code reusable and move it to display.c

This commit is contained in:
nhmall
2019-06-08 23:19:29 -04:00
parent ea9a385d67
commit 54d24d0333
3 changed files with 28 additions and 13 deletions

View File

@@ -2579,21 +2579,13 @@ struct _create_particular_data *d;
if (d->sleeping)
mtmp->msleeping = 1;
if (d->hidden && is_hider(mtmp->data)) {
if (wizard && cansee(mtmp->mx, mtmp->my)) {
int i, glyph[2];
int saveglyph = glyph_at(mtmp->mx, mtmp->my);
glyph[0] = glyph_at(mtmp->mx, mtmp->my);
mtmp->mundetected = 1;
newsym(mtmp->mx, mtmp->my);
glyph[1] = glyph_at(mtmp->mx, mtmp->my);
if (!canseemon(mtmp) && !sensemon(mtmp))
for (i = 0; i < 15; i++) {
show_glyph(mtmp->mx, mtmp->my, glyph[i % 2]);
flush_screen(1);
delay_output();
}
}
mtmp->mundetected = 1;
newsym(mtmp->mx, mtmp->my);
if (wizard && cansee(mtmp->mx, mtmp->my))
if (!canseemon(mtmp) && !sensemon(mtmp))
flash_glyph_at(mtmp->mx, mtmp->my, saveglyph);
}
madeany = TRUE;
/* in case we got a doppelganger instead of what was asked