^G of unseen monster
I used ^G to create a monster and specified "invisible owlbear". I then got "An owlbear appears next to you." Except it didn't; it was invisible and I lacked see-invisible. I imagine that newsym() was called for the new-yet-invisible monster, but that remained buffered and was gone overridden by the time pending map update got flushed at some point after the monster was made invisible. Add a new makemon() flag to turn a newly created monster invisible during its creation, before "monster appears" message is delivered. Since that message will now be suppressed in this situation, use the cursor-flash hack that indicates where the new, unseen monster got placed. Creating "1000 invisible <mon>" is something you probably won't do twice.
This commit is contained in:
@@ -1043,6 +1043,7 @@ typedef uint32_t mmflags_nht; /* makemon MM_ flags */
|
|||||||
#define GP_CHECKSCARY 0x200000L /* check monster for onscary() */
|
#define GP_CHECKSCARY 0x200000L /* check monster for onscary() */
|
||||||
#define MM_NOEXCLAM 0x400000L /* more sedate "<mon> appears." mesg for ^G */
|
#define MM_NOEXCLAM 0x400000L /* more sedate "<mon> appears." mesg for ^G */
|
||||||
#define MM_IGNORELAVA 0x800000L /* ignore lava when positioning */
|
#define MM_IGNORELAVA 0x800000L /* ignore lava when positioning */
|
||||||
|
#define MM_MINVIS 0x01000000L /* for ^G/create_particular */
|
||||||
|
|
||||||
/* flags for make_corpse() and mkcorpstat(); 0..7 are recorded in obj->spe */
|
/* flags for make_corpse() and mkcorpstat(); 0..7 are recorded in obj->spe */
|
||||||
#define CORPSTAT_NONE 0x00
|
#define CORPSTAT_NONE 0x00
|
||||||
|
|||||||
@@ -1270,6 +1270,8 @@ makemon(
|
|||||||
mtmp->mcansee = mtmp->mcanmove = TRUE;
|
mtmp->mcansee = mtmp->mcanmove = TRUE;
|
||||||
mtmp->seen_resistance = M_SEEN_NOTHING;
|
mtmp->seen_resistance = M_SEEN_NOTHING;
|
||||||
mtmp->mpeaceful = (mmflags & MM_ANGRY) ? FALSE : peace_minded(ptr);
|
mtmp->mpeaceful = (mmflags & MM_ANGRY) ? FALSE : peace_minded(ptr);
|
||||||
|
if ((mmflags & MM_MINVIS) != 0) /* for ^G */
|
||||||
|
mon_set_minvis(mtmp); /* call after place_monster() */
|
||||||
|
|
||||||
switch (ptr->mlet) {
|
switch (ptr->mlet) {
|
||||||
case S_MIMIC:
|
case S_MIMIC:
|
||||||
|
|||||||
16
src/read.c
16
src/read.c
@@ -3160,6 +3160,9 @@ create_particular_creation(
|
|||||||
/* whichpm = rndmonst(); */
|
/* whichpm = rndmonst(); */
|
||||||
/* mmflags |= (d->fem == FEMALE) ? MM_FEMALE : MM_MALE; */
|
/* mmflags |= (d->fem == FEMALE) ? MM_FEMALE : MM_MALE; */
|
||||||
}
|
}
|
||||||
|
if (d->invisible)
|
||||||
|
mmflags |= MM_MINVIS;
|
||||||
|
|
||||||
mtmp = makemon(whichpm, u.ux, u.uy, mmflags);
|
mtmp = makemon(whichpm, u.ux, u.uy, mmflags);
|
||||||
if (!mtmp) {
|
if (!mtmp) {
|
||||||
/* quit trying if creation failed and is going to repeat */
|
/* quit trying if creation failed and is going to repeat */
|
||||||
@@ -3181,24 +3184,17 @@ create_particular_creation(
|
|||||||
|
|
||||||
put_saddle_on_mon(otmp, mtmp);
|
put_saddle_on_mon(otmp, mtmp);
|
||||||
}
|
}
|
||||||
if (d->invisible) {
|
if (d->hidden
|
||||||
mon_set_minvis(mtmp);
|
|
||||||
if (does_block(mx, my, &levl[mx][my]))
|
|
||||||
block_point(mx, my);
|
|
||||||
else
|
|
||||||
unblock_point(mx, my);
|
|
||||||
}
|
|
||||||
if (d->hidden
|
|
||||||
&& ((is_hider(mtmp->data) && mtmp->data->mlet != S_MIMIC)
|
&& ((is_hider(mtmp->data) && mtmp->data->mlet != S_MIMIC)
|
||||||
|| (hides_under(mtmp->data) && OBJ_AT(mx, my))
|
|| (hides_under(mtmp->data) && OBJ_AT(mx, my))
|
||||||
|| (mtmp->data->mlet == S_EEL && is_pool(mx, my))))
|
|| (mtmp->data->mlet == S_EEL && is_pool(mx, my))))
|
||||||
mtmp->mundetected = 1;
|
mtmp->mundetected = 1;
|
||||||
if (d->sleeping)
|
if (d->sleeping)
|
||||||
mtmp->msleeping = 1;
|
mtmp->msleeping = 1;
|
||||||
/* iff asking for 'hidden', show location of every created monster
|
/* if asking for 'hidden', show location of every created monster
|
||||||
that can't be seen--whether that's due to successfully hiding
|
that can't be seen--whether that's due to successfully hiding
|
||||||
or vision issues (line-of-sight, invisibility, blindness) */
|
or vision issues (line-of-sight, invisibility, blindness) */
|
||||||
if (d->hidden && !canspotmon(mtmp)) {
|
if ((d->hidden || d->invisible) && !canspotmon(mtmp)) {
|
||||||
int count = couldsee(mx, my) ? 8 : 4;
|
int count = couldsee(mx, my) ? 8 : 4;
|
||||||
char saveviz = gv.viz_array[my][mx];
|
char saveviz = gv.viz_array[my][mx];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user