more monster/door interaction
Apply visibility fixups for monsters triggering door trap explosions or digging through doors similar to the monster-opens- door-handling from a couple of days. Again, the issue is that hero/player can see a closed door in situations where they can't see an open one, and messages about the door being opened or destroyed need to take that into account when seeing a closed door go away. Not as thoroughly tested as monster just opening closed door.
This commit is contained in:
20
src/dig.c
20
src/dig.c
@@ -1254,6 +1254,7 @@ boolean
|
||||
mdig_tunnel(struct monst *mtmp)
|
||||
{
|
||||
register struct rm *here;
|
||||
boolean sawit, seeit, trapped;
|
||||
int pile = rnd(12);
|
||||
|
||||
here = &levl[mtmp->mx][mtmp->my];
|
||||
@@ -1264,19 +1265,24 @@ mdig_tunnel(struct monst *mtmp)
|
||||
if (closed_door(mtmp->mx, mtmp->my)) {
|
||||
if (*in_rooms(mtmp->mx, mtmp->my, SHOPBASE))
|
||||
add_damage(mtmp->mx, mtmp->my, 0L);
|
||||
/* sawit: closed door location is more visible than an open one */
|
||||
sawit = canseemon(mtmp); /* before door state change and unblock_pt */
|
||||
trapped = (here->doormask & D_TRAPPED) ? TRUE : FALSE;
|
||||
here->doormask = trapped ? D_NODOOR : D_BROKEN;
|
||||
unblock_point(mtmp->mx, mtmp->my); /* vision */
|
||||
if (here->doormask & D_TRAPPED) {
|
||||
here->doormask = D_NODOOR;
|
||||
if (mb_trapped(mtmp)) { /* mtmp is killed */
|
||||
newsym(mtmp->mx, mtmp->my);
|
||||
if (trapped) {
|
||||
seeit = canseemon(mtmp);
|
||||
if (mb_trapped(mtmp, sawit || seeit)) { /* mtmp is killed */
|
||||
newsym(mtmp->mx, mtmp->my);
|
||||
return TRUE;
|
||||
}
|
||||
} else {
|
||||
if (!rn2(3) && flags.verbose) /* not too often.. */
|
||||
draft_message(TRUE); /* "You feel an unexpected draft." */
|
||||
here->doormask = D_BROKEN;
|
||||
if (flags.verbose) {
|
||||
if (!Unaware && !rn2(3)) /* not too often.. */
|
||||
draft_message(TRUE); /* "You feel an unexpected draft." */
|
||||
}
|
||||
}
|
||||
newsym(mtmp->mx, mtmp->my);
|
||||
return FALSE;
|
||||
} else if (here->typ == SCORR) {
|
||||
here->typ = CORR, here->flags = 0;
|
||||
|
||||
Reference in New Issue
Block a user