Merge branch 'NetHack-3.6'
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 display.c $NHDT-Date: 1556835736 2019/05/02 22:22:16 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.101 $ */
|
||||
/* NetHack 3.6 display.c $NHDT-Date: 1560085863 2019/06/09 13:11:03 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.104 $ */
|
||||
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
|
||||
/* and Dave Cohrs, 1990. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1068,27 +1068,30 @@ int x, y;
|
||||
}
|
||||
|
||||
/*
|
||||
* flash_glyph_at(x, y, glyph)
|
||||
* flash_glyph_at(x, y, glyph, repeatcount)
|
||||
*
|
||||
* 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;
|
||||
flash_glyph_at(x, y, tg, rpt)
|
||||
int x, y;
|
||||
int tg, rpt;
|
||||
{
|
||||
int i, glyph[2];
|
||||
int i, glyph[2];
|
||||
|
||||
glyph[0] = tg;
|
||||
glyph[1] = (g.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);
|
||||
rpt *= 2; /* two loop iterations per 'count' */
|
||||
glyph[0] = tg;
|
||||
glyph[1] = (g.level.flags.hero_memory) ? levl[x][y].glyph
|
||||
: back_to_glyph(x, y);
|
||||
/* even iteration count (guaranteed) ends with glyph[1] showing;
|
||||
caller might want to override that, but no newsym() calls here
|
||||
in case caller has tinkered with location visibility */
|
||||
for (i = 0; i < rpt; i++) {
|
||||
show_glyph(x, y, glyph[i % 2]);
|
||||
flush_screen(1);
|
||||
delay_output();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
37
src/read.c
37
src/read.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 read.c $NHDT-Date: 1559679496 2019/06/04 20:18:16 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.165 $ */
|
||||
/* NetHack 3.6 read.c $NHDT-Date: 1560085864 2019/06/09 13:11:04 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.171 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -2456,7 +2456,7 @@ struct _create_particular_data *d;
|
||||
d->fem = -1; /* gender not specified */
|
||||
d->randmonst = FALSE;
|
||||
d->maketame = d->makepeaceful = d->makehostile = FALSE;
|
||||
d->sleeping = d->saddled = d->invisible = FALSE;
|
||||
d->sleeping = d->saddled = d->invisible = d->hidden = FALSE;
|
||||
|
||||
if ((tmpp = strstri(bufp, "saddled ")) != 0) {
|
||||
d->saddled = TRUE;
|
||||
@@ -2528,9 +2528,9 @@ create_particular_creation(d)
|
||||
struct _create_particular_data *d;
|
||||
{
|
||||
struct permonst *whichpm = NULL;
|
||||
int i, flashglyph, firstchoice = NON_PM;
|
||||
int i, mx, my, firstchoice = NON_PM;
|
||||
struct monst *mtmp;
|
||||
boolean madeany = FALSE, doflash = FALSE;
|
||||
boolean madeany = FALSE;
|
||||
|
||||
if (!d->randmonst) {
|
||||
firstchoice = d->which;
|
||||
@@ -2559,7 +2559,7 @@ struct _create_particular_data *d;
|
||||
/* otherwise try again */
|
||||
continue;
|
||||
}
|
||||
flashglyph = mon_to_glyph(mtmp, rn2_on_display_rng);
|
||||
mx = mtmp->mx, my = mtmp->my;
|
||||
/* '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() */
|
||||
@@ -2576,25 +2576,32 @@ struct _create_particular_data *d;
|
||||
put_saddle_on_mon(otmp, mtmp);
|
||||
}
|
||||
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)) {
|
||||
if (d->hidden
|
||||
&& ((is_hider(mtmp->data) && mtmp->data->mlet != S_MIMIC)
|
||||
|| (hides_under(mtmp->data) && OBJ_AT(mx, my))
|
||||
|| (mtmp->data->mlet == S_EEL && is_pool(mx, my))))
|
||||
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);
|
||||
/* iff asking for 'hidden', show locaton of every created monster
|
||||
that can't be seen--whether that's due to successfully hiding
|
||||
or vision issues (line-of-sight, invisibility, blindness) */
|
||||
if (d->hidden && !canspotmon(mtmp)) {
|
||||
int count = couldsee(mx, my) ? 8 : 4;
|
||||
char saveviz = viz_array[my][mx];
|
||||
|
||||
if (!flags.sparkle)
|
||||
count /= 2;
|
||||
viz_array[my][mx] |= (IN_SIGHT | COULD_SEE);
|
||||
flash_glyph_at(mx, my, mon_to_glyph(mtmp, newsym_rn2), count);
|
||||
viz_array[my][mx] = saveviz;
|
||||
newsym(mx, my);
|
||||
}
|
||||
madeany = TRUE;
|
||||
/* in case we got a doppelganger instead of what was asked
|
||||
|
||||
Reference in New Issue
Block a user