wielding them. However, if a monster wields or unwields a weapon and it gives a message like "The dagger is surrounded by flames!", that still id's the ego.
Also, wand zaps by visible monster now update the wand's zap count.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2167 c06c8d41-db1a-0410-9941-cceddc491573
WUTE7R6SROKLIWR3QASJSH2IZDJNPAIMWJRUSISQTN4YMKNFTODQC
6BO27PEAAOYJEOL5F5RWDMSLU7WUYSKC4LCANVIDMRZRMZWCEYUAC
PFEJ4LMDNEKLMGRCMWQ7EIRVU4JMYGICI4G7X4WVWOROVXQCBZ7QC
L254F6ZIU2HWGLFFGPIORTN4C3TDQ3E5JZ7Z7GQA5AEDIKL6PKDAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
ANOEQTM6IGCBTESKKQ5PCBSDTZ7VGRCMDIOAFEH4R7DJHKWKDFAAC
QS3ZRS3E6KL3YJHPKYEWCWJYRBJSXD5OOYF6Y25HZVECGPJRDB5QC
74LQ7JXVLAFSHLI7LCBKFX47CNTYSKGUQSXNX5FCIUIGCC2JTR3QC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
CIPVRZGLOZHCERK6YPOBV3P2E4IAB4H6D5EHLRQE2O5E4P4VCBUAC
}
}
static void learn_visible_mon_eq_egos(monsters *mon)
{
for (int i = 0; i < NUM_MONSTER_SLOTS; i++)
{
mon_inv_type slot = static_cast<mon_inv_type>(i);
int index = mon->inv[slot];
if (index == NON_ITEM)
continue;
// Alternate weapons aren't wielded (and thus have no
// visible differences) unless the monster can wield two
// weapons at once.
if (slot == MSLOT_ALT_WEAPON && !mons_wields_two_weapons(mon))
continue;
item_def &item = mitm[index];
if (mons_eq_obvious_ego(item, mon))
set_ident_flags(item, ISFLAG_KNOW_TYPE);
}
}
bool mons_eq_obvious_ego(const item_def &item, const struct monsters *mon)
{
if (is_artefact(item))
return false;
// Only do weapons for now
if (item.base_type != OBJ_WEAPONS)
return false;
int ego = item.special;
switch(ego)
{
case SPWPN_FLAMING:
case SPWPN_FREEZING:
case SPWPN_HOLY_WRATH:
case SPWPN_VENOM:
// Electric branded weapons are constantly crackling
case SPWPN_ELECTROCUTION:
// Unlike SPWPN_FLAME, SPWPN_FROST has a persistant visual effect.
case SPWPN_FROST:
return true;
// SPWPN_FLAME just "glows red for a moment" when first equipped,
// so it isn't obvious after that.
case SPWPN_FLAME:
return false;