git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1961 c06c8d41-db1a-0410-9941-cceddc491573
EEZCC5GUYHETFQV4KSZJSJ6BTTWZHKS7RXQ25XQ6ODGKLDD4XFRAC
X6JLXMSRNWRGP2PVQYX6Z4OUZLDSSQ2VL3EQQM5Q427MXBMRILEQC
LP3U7LC6QK6TCMLAYTRGZ2CDZAHPM6VWDT6NPE5ET4WBBZVHBDXQC
6CZYPP67SB2M3SQS3QIPJWHZY7PJIRTTBH5CLORV3AALVTJIL5MQC
P722Q43MJLCJ5NHF6FA27YM7IYP2ZTP6WP373BAVZPODZW4JLJPQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
L53UJK6PPEZ2IG7TJGHN3Y3A6JYIO6PHBWG4MDAENOXPVFDKK6FQC
74LQ7JXVLAFSHLI7LCBKFX47CNTYSKGUQSXNX5FCIUIGCC2JTR3QC
if (!is_valid_item( you.inv[item] ))
{
if (!quiet)
mpr("You don't have any such object.");
return (false);
}
const object_class_type base_type = you.inv[item].base_type;
const object_class_type base_type = item.base_type;
const int sub_type = you.inv[item].sub_type;
const item_def &invitem = you.inv[item];
const equipment_type slot = get_armour_slot(invitem);
if (item == you.equip[EQ_WEAPON])
{
if (!quiet)
mpr("You are wielding that object!");
return (false);
}
if ( wearing_slot(item) )
{
if (!quiet)
mpr("You are already wearing that!");
return (false);
}
// if you're wielding something,
if (you.equip[EQ_WEAPON] != -1
// attempting to wear a shield,
&& is_shield(you.inv[item])
&& is_shield_incompatible(
you.inv[you.equip[EQ_WEAPON]],
&you.inv[item]))
{
if (!quiet)
mpr("You'd need three hands to do that!");
return (false);
}
return (true);
}
bool do_wear_armour( int item, bool quiet )
{
if (!is_valid_item( you.inv[item] ))
{
if (!quiet)
mpr("You don't have any such object.");
return (false);
}
if (!can_wear_armour(you.inv[item], !quiet, false))
return (false);
const item_def &invitem = you.inv[item];
const equipment_type slot = get_armour_slot(invitem);
if (item == you.equip[EQ_WEAPON])
{
if (!quiet)
mpr("You are wielding that object!");
return (false);
}
if ( wearing_slot(item) )
{
if (!quiet)
mpr("You are already wearing that!");
return (false);
}
// if you're wielding something,
if (you.equip[EQ_WEAPON] != -1
// attempting to wear a shield,
&& is_shield(you.inv[item])
&& is_shield_incompatible(
you.inv[you.equip[EQ_WEAPON]],
&you.inv[item]))
{
if (!quiet)
mpr("You'd need three hands to do that!");
return (false);
}