diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-27 19:26:20 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-27 19:26:20 +0000 |
commit | 61bc1cd16bda091d23a1d4d4744f01403377392c (patch) | |
tree | 3ecaac7cf2eaf026e85df4b2d9b3a4a2d40d7fae /crawl-ref/source/player.cc | |
parent | 62b50aa8705d2228a82657f8aca0a297194aa0e9 (diff) | |
download | crawl-ref-61bc1cd16bda091d23a1d4d4744f01403377392c.tar.gz crawl-ref-61bc1cd16bda091d23a1d4d4744f01403377392c.zip |
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
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 29 |
1 files changed, 21 insertions, 8 deletions
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 |