From 61bc1cd16bda091d23a1d4d4744f01403377392c Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sat, 27 Dec 2008 19:26:20 +0000 Subject: Also handle EQ_RINGS_PLUS etc. in you_tran_can_wear(). Tweak FAQ. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7995 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/player.cc | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index c4b12e45f1..ae98021ff6 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -655,6 +655,24 @@ bool you_tran_can_wear(const item_def &item) bool you_tran_can_wear(int eq, bool check_mutation) { + if (eq == EQ_NONE) + return (true); + + if (eq == EQ_STAFF) + eq = EQ_WEAPON; + else if (eq >= EQ_RINGS && eq <= EQ_RINGS_PLUS2) + eq = EQ_LEFT_RING; + + const int transform = you.attribute[ATTR_TRANSFORMATION]; + + // Clouds cannot wear anything. + if (transform == TRAN_AIR) + return (false); + + // Everybody else can wear at least some type of armour. + if (eq == EQ_ALL_ARMOUR) + return (true); + // Not a transformation, but also temporary -> check first. if (check_mutation) { @@ -670,22 +688,17 @@ bool you_tran_can_wear(int eq, bool check_mutation) } } - const int transform = you.attribute[ATTR_TRANSFORMATION]; - // No further restrictions. if (transform == TRAN_NONE || transform == TRAN_LICH) return (true); - // Bats cannot wear anything except amulets, clouds obviously nothing. - if (transform == TRAN_BAT && eq != EQ_AMULET || transform == TRAN_AIR) + // Bats cannot wear anything except amulets. + if (transform == TRAN_BAT && eq != EQ_AMULET) return (false); // Everyone else can wear jewellery, at least. - if (eq == EQ_LEFT_RING || eq == EQ_RIGHT_RING || eq == EQ_RINGS - || eq == EQ_AMULET) - { + if (eq == EQ_LEFT_RING || eq == EQ_RIGHT_RING || eq == EQ_AMULET) return (true); - } // These cannot use anything but jewellery. if (transform == TRAN_SPIDER || transform == TRAN_DRAGON -- cgit v1.2.3-54-g00ecf