observing monster become invisible
Requested by one of the beta testers 13 months ago... when a visible monster becomes invisible and vanishes, mark its map location with the remembered, unseen monster glyph. (When the player zaps a monster with a wand of make invisible, that only happens if the wand type is known. I'm not sure that's right but didn't alter it....) The request suggested also doing it for a monster who disappears by teleporting away, but I haven't attempted to implement that.
This commit is contained in:
@@ -314,6 +314,8 @@ for #tip inside shop, credit was incorrectly given for spilled gold if that
|
|||||||
gold's stale location coordinates didn't happen to be inside the shop
|
gold's stale location coordinates didn't happen to be inside the shop
|
||||||
when confused scroll of light summoned lights, player would be asked what to
|
when confused scroll of light summoned lights, player would be asked what to
|
||||||
call the scroll even if scroll of light was already identified
|
call the scroll even if scroll of light was already identified
|
||||||
|
if a visible monster becomes invisible, mark its spot with the 'remembered,
|
||||||
|
unseen monster' glyph ('I' character or '?' tile)
|
||||||
|
|
||||||
|
|
||||||
Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
|
Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
|
||||||
|
|||||||
@@ -443,6 +443,8 @@ int spellnum;
|
|||||||
pline("%s suddenly %s!", Monnam(mtmp),
|
pline("%s suddenly %s!", Monnam(mtmp),
|
||||||
!See_invisible ? "disappears" : "becomes transparent");
|
!See_invisible ? "disappears" : "becomes transparent");
|
||||||
mon_set_minvis(mtmp);
|
mon_set_minvis(mtmp);
|
||||||
|
if (cansee(mtmp->mx, mtmp->my) && !canspotmon(mtmp))
|
||||||
|
map_invisible(mtmp->mx, mtmp->my);
|
||||||
dmg = 0;
|
dmg = 0;
|
||||||
} else
|
} else
|
||||||
impossible("no reason for monster to cast disappear spell?");
|
impossible("no reason for monster to cast disappear spell?");
|
||||||
|
|||||||
+6
-3
@@ -1207,8 +1207,8 @@ register struct monst *mtmp;
|
|||||||
register struct obj *otmp;
|
register struct obj *otmp;
|
||||||
{
|
{
|
||||||
int tmp;
|
int tmp;
|
||||||
|
|
||||||
boolean reveal_invis = FALSE;
|
boolean reveal_invis = FALSE;
|
||||||
|
|
||||||
if (mtmp != &youmonst) {
|
if (mtmp != &youmonst) {
|
||||||
mtmp->msleeping = 0;
|
mtmp->msleeping = 0;
|
||||||
if (mtmp->m_ap_type)
|
if (mtmp->m_ap_type)
|
||||||
@@ -1819,12 +1819,15 @@ struct monst *mtmp;
|
|||||||
Strcpy(nambuf, mon_nam(mtmp));
|
Strcpy(nambuf, mon_nam(mtmp));
|
||||||
mon_set_minvis(mtmp);
|
mon_set_minvis(mtmp);
|
||||||
if (vismon && mtmp->minvis) { /* was seen, now invisible */
|
if (vismon && mtmp->minvis) { /* was seen, now invisible */
|
||||||
if (canspotmon(mtmp))
|
if (canspotmon(mtmp)) {
|
||||||
pline("%s body takes on a %s transparency.",
|
pline("%s body takes on a %s transparency.",
|
||||||
upstart(s_suffix(nambuf)),
|
upstart(s_suffix(nambuf)),
|
||||||
Hallucination ? "normal" : "strange");
|
Hallucination ? "normal" : "strange");
|
||||||
else
|
} else {
|
||||||
pline("Suddenly you cannot see %s.", nambuf);
|
pline("Suddenly you cannot see %s.", nambuf);
|
||||||
|
if (vis)
|
||||||
|
map_invisible(mtmp->mx, mtmp->my);
|
||||||
|
}
|
||||||
if (oseen)
|
if (oseen)
|
||||||
makeknown(otmp->otyp);
|
makeknown(otmp->otyp);
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -1379,10 +1379,15 @@ boolean your_fault;
|
|||||||
if (!resist(mon, POTION_CLASS, 0, NOTELL))
|
if (!resist(mon, POTION_CLASS, 0, NOTELL))
|
||||||
mon->mconf = TRUE;
|
mon->mconf = TRUE;
|
||||||
break;
|
break;
|
||||||
case POT_INVISIBILITY:
|
case POT_INVISIBILITY: {
|
||||||
|
boolean sawit = canspotmon(mon);
|
||||||
|
|
||||||
angermon = FALSE;
|
angermon = FALSE;
|
||||||
mon_set_minvis(mon);
|
mon_set_minvis(mon);
|
||||||
|
if (sawit && !canspotmon(mon) && cansee(mon->mx, mon->my))
|
||||||
|
map_invisible(mon->mx, mon->my);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case POT_SLEEPING:
|
case POT_SLEEPING:
|
||||||
/* wakeup() doesn't rouse victims of temporary sleep */
|
/* wakeup() doesn't rouse victims of temporary sleep */
|
||||||
if (sleep_monst(mon, rnd(12), POTION_CLASS)) {
|
if (sleep_monst(mon, rnd(12), POTION_CLASS)) {
|
||||||
|
|||||||
+6
-8
@@ -956,11 +956,9 @@ struct monst *mtmp;
|
|||||||
*
|
*
|
||||||
* Pulls a monster from its current position and places a monster at
|
* Pulls a monster from its current position and places a monster at
|
||||||
* a new x and y. If oldx is 0, then the monster was not in the
|
* a new x and y. If oldx is 0, then the monster was not in the
|
||||||
* levels.monsters
|
* levels.monsters array. However, if oldx is 0, oldy may still have
|
||||||
* array. However, if oldx is 0, oldy may still have a value because mtmp is
|
* a value because mtmp is a migrating_mon. Worm tails are always
|
||||||
* a
|
* placed randomly around the head of the worm.
|
||||||
* migrating_mon. Worm tails are always placed randomly around the head of
|
|
||||||
* the worm.
|
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
rloc_to(mtmp, x, y)
|
rloc_to(mtmp, x, y)
|
||||||
@@ -974,15 +972,15 @@ register int x, y;
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (oldx) { /* "pick up" monster */
|
if (oldx) { /* "pick up" monster */
|
||||||
if (mtmp->wormno)
|
if (mtmp->wormno) {
|
||||||
remove_worm(mtmp);
|
remove_worm(mtmp);
|
||||||
else {
|
} else {
|
||||||
remove_monster(oldx, oldy);
|
remove_monster(oldx, oldy);
|
||||||
newsym(oldx, oldy); /* update old location */
|
newsym(oldx, oldy); /* update old location */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(mtmp->mtrack, 0, sizeof(mtmp->mtrack));
|
memset(mtmp->mtrack, 0, sizeof mtmp->mtrack);
|
||||||
place_monster(mtmp, x, y); /* put monster down */
|
place_monster(mtmp, x, y); /* put monster down */
|
||||||
update_monster_region(mtmp);
|
update_monster_region(mtmp);
|
||||||
|
|
||||||
|
|||||||
@@ -280,6 +280,7 @@ struct obj *otmp;
|
|||||||
mon_set_minvis(mtmp);
|
mon_set_minvis(mtmp);
|
||||||
if (!oldinvis && knowninvisible(mtmp)) {
|
if (!oldinvis && knowninvisible(mtmp)) {
|
||||||
pline("%s turns transparent!", nambuf);
|
pline("%s turns transparent!", nambuf);
|
||||||
|
reveal_invis = TRUE;
|
||||||
learn_it = TRUE;
|
learn_it = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user