Some monsters can eat through iron bars

Any monster with rusting or corrosion attack can eat through
the bars. This includes rust monsters, grey oozes, and black puddings.

Original patch by Malcolm Ryan
This commit is contained in:
Pasi Kallinen
2015-04-13 19:36:49 +03:00
parent 6209d458f9
commit 1c970b171e
5 changed files with 34 additions and 6 deletions

View File

@@ -1180,7 +1180,14 @@ postmov:
add_damage(mtmp->mx, mtmp->my, 0L);
}
} else if (levl[mtmp->mx][mtmp->my].typ == IRONBARS) {
if (flags.verbose && canseemon(mtmp))
if (may_dig(mtmp->mx,mtmp->my) &&
(dmgtype(ptr, AD_RUST) || dmgtype(ptr, AD_CORR))) {
if (canseemon(mtmp))
pline("%s eats through the iron bars.",
Monnam(mtmp));
dissolve_bars(mtmp->mx, mtmp->my);
return(3);
} else if (flags.verbose && canseemon(mtmp))
Norep("%s %s %s the iron bars.", Monnam(mtmp),
/* pluralization fakes verb conjugation */
makeplural(locomotion(ptr, "pass")),
@@ -1266,6 +1273,14 @@ postmov:
return(mmoved);
}
void
dissolve_bars(x, y)
register int x, y;
{
levl[x][y].typ = (Is_special(&u.uz) || *in_rooms(x,y,0)) ? ROOM : CORR;
newsym(x, y);
}
boolean
closed_door(x, y)
register int x, y;