not being able to wear some kinds of equipment.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1998 c06c8d41-db1a-0410-9941-cceddc491573
3BYA46OYLVN6ZPGAZD5OGIMMH5PRWGNSU3ITJRCVBE6P5HYYYAYQC // checks whether the player's current species can// use (usually wear) a given piece of equipment// Note that EQ_BODY_ARMOUR and EQ_HELMET only check// the ill-fitting variant (i.e. not caps and robes)// Centaurs and Naga are ignored for now, seeing how// Boots are changed to Barding in the % screen.// -------------------------------------------------bool you_can_wear(int eq){// bats cannot use anythingif (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)return false;// these can be used by allif (eq == EQ_LEFT_RING || eq == EQ_RIGHT_RING || eq == EQ_AMULET|| eq == EQ_WEAPON || eq == EQ_SHIELD || eq == EQ_CLOAK){return true;}// these can wear everythingif (player_genus(GENPC_ELVEN))return true;
if (you.is_undead)return true;// if (eq == EQ_BOOTS && (you.species == SP_NAGA || you.species == SP_CENTAUR))// return false;// of the remaining items, these races can't wear anythingif (you.species == SP_TROLL || you.species == SP_SPRIGGAN|| player_genus(GENPC_OGRE) || player_genus(GENPC_DRACONIAN)){return false;}if (you.species == SP_KENKU && (eq == EQ_HELMET || eq == EQ_BOOTS)){return false;}// else no problemsreturn true;}