fix #K2617 - metallivores eating iron bars
Monsters with rust attacks (rust monster) and corrosion attacks (black pudding, gray ooze) can eat or otherwise destroy iron bars but xorns could only move through the iron bars spot without being able to eat the metal there. Change xorn to eat bars instead of phazing through them. Lets rock moles eat bars too. Hero polymorphed into a rust monster would eat bars if trying to move to their location but couldn't do so if already there (maybe was in xorn form and now in rust monster form). Xorns could pass through them but not eat them. Allow hero metallivores to eat bars at the current location via 'e', similar to eating food off the floor. Hero as rock mole behaves like rust monster.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 monmove.c $NHDT-Date: 1600469618 2020/09/18 22:53:38 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.143 $ */
|
||||
/* NetHack 3.7 monmove.c $NHDT-Date: 1603507386 2020/10/24 02:43:06 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.146 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Michael Allison, 2006. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1477,9 +1477,12 @@ register int after;
|
||||
add_damage(mtmp->mx, mtmp->my, 0L);
|
||||
}
|
||||
} else if (levl[mtmp->mx][mtmp->my].typ == IRONBARS) {
|
||||
/* 3.6.2: was using may_dig() but it doesn't handle bars */
|
||||
/* 3.6.2: was using may_dig() but that doesn't handle bars;
|
||||
AD_RUST catches rust monsters but metallivorous() is
|
||||
needed for xorns and rock moles */
|
||||
if (!(levl[mtmp->mx][mtmp->my].wall_info & W_NONDIGGABLE)
|
||||
&& (dmgtype(ptr, AD_RUST) || dmgtype(ptr, AD_CORR))) {
|
||||
&& (dmgtype(ptr, AD_RUST) || dmgtype(ptr, AD_CORR)
|
||||
|| metallivorous(ptr))) {
|
||||
if (canseemon(mtmp))
|
||||
pline("%s eats through the iron bars.", Monnam(mtmp));
|
||||
dissolve_bars(mtmp->mx, mtmp->my);
|
||||
@@ -1631,6 +1634,8 @@ register int x, y;
|
||||
levl[x][y].typ = (Is_special(&u.uz) || *in_rooms(x, y, 0)) ? ROOM : CORR;
|
||||
levl[x][y].flags = 0;
|
||||
newsym(x, y);
|
||||
if (x == u.ux && y == u.uy)
|
||||
switch_terrain();
|
||||
}
|
||||
|
||||
boolean
|
||||
|
||||
Reference in New Issue
Block a user