mons_is_wall_shielded() to determine whether a monster can pass through/be shielded by walls, as it's a more flexible approach. The function currently only checks for a monster class with a rock habitat, but it could be expanded to allow for other cases.
Replace the M_WALL_SHIELDED flag with the M_INSUBSTANTIAL flag, and check for the latter instead of hardcoding a list of monsters in mons_is_insubstantial().
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3201 c06c8d41-db1a-0410-9941-cceddc491573
OPNCHI4UGN7WBIYPAXVV2C4N22ZSWROA435FJCY5UZVXKWRYQ42QC
35TYXBLIHC45BQJX6VNVICEVZ35KR2VRA7EWW2JWVHX4XZPTHGPQC
AY3TQCPUUX7KA64V23KUW3PZD4M6DW5DZNJGWS7X2V7ANSU6LREQC
KPDKVLAO5Y2XM22ZETGEK2JJBNMAYEPL66VOSY5ANSAFDIY6BTGAC
HSN6H5HDKBALFSBCGJMCNEG6M5KSCXGWPPHJGHUWOZI5EIERCBFQC
FLDIOEND63BONSOAIZ7WYAVNQLJ35O3VFY3PTVRWWYOJL4JXREHAC
SELQ6AD2GNYLGHJVONUUFDHSCMGYMMNQF5D72D7KTAYOV36T2BBAC
5NV5FF4MDZFC5E3UQQSGX2CTESAGBSSEVCR5UIPRZRBYL6TSDGBQC
AS2IQQJNNCEQNXXKTGYHLB7RO3ZKCF4F7GK6FJH66BOOKDDRGNIQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
3PY3L3A4QRW3Z5Y7SHO4TMVOOP2VNCO27X2MX4DTOP2SADLBQUOAC
X76YXE6RFL7QY5WL6MSSS44WHVA5FQMDQY3XTYP2UL6UZB4E6XMQC
3V52MSSK7QX7FWLLUW63DTWCBAJEK674EFZLKP45FLZ5KZKVARHAC
HH3HFWVXABJ4IRMN22PPJCREMULZSN6DA7VYKOGECGMNUQTZ5QNQC
K2MLPJIAXXZRWEWZCNSGICCBNIU2WAAPT7SPIMOH7FLLTOB4QFRAC
FUEEIUKGHHFPIRZCN3N753GONWAZTWQ2ZWR53IBJAAZ6FZUNGOMAC
// a wall and is immune to most attacks while in a wall
// (M_WALL_SHIELDED), unless the monster has a spell or special/nearby
// ability which isn't affected by M_WALL_SHIELDED.
// a wall and is immune to most attacks while in a wall, unless
// the monster has a spell or special/nearby ability which isn't
// affected by the wall.
// it can move through. If it has M_WALL_SHIELDED is will
// be (mostly) safe as soon as it enters the wall, and even
// if it doesn't once it moves again it will be on the other
// side of the wall and likely beyond the reach of the player.
// it can move through. It will be (mostly) safe as soon as
// it enters the wall, and even if it isn't, once it moves
// again it will be on the other side of the wall and likely
// beyond the reach of the player.
switch (mc)
{
// vortices
case MONS_FIRE_VORTEX:
case MONS_SPATIAL_VORTEX:
// elementals
case MONS_FIRE_ELEMENTAL:
case MONS_AIR_ELEMENTAL:
case MONS_WATER_ELEMENTAL:
// vapours
case MONS_INSUBSTANTIAL_WISP:
case MONS_VAPOUR:
// ghosts and some undead
case MONS_PLAYER_GHOST:
case MONS_HUNGRY_GHOST:
case MONS_SHADOW:
case MONS_SMOKE_DEMON:
case MONS_SHADOW_WRAITH:
// others
case MONS_BALL_LIGHTNING:
case MONS_GIANT_SPORE:
case MONS_ORB_OF_FIRE:
return true;
default:
return false;
}
return mons_class_flag(mc, M_INSUBSTANTIAL);
// Affect monster in wall unless it can shield itself using the wall
// (M_WALL_SHIELDED). The wall will always shield the monster if the
// beam bounces off the wall, and a monster can't use a metal wall to
// shield itself from electricity.
// Affect monster in wall unless it can shield itself using the wall.
// The wall will always shield the monster if the beam bounces off the
// wall, and a monster can't use a metal wall to shield itself from
// electricity.