summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-08-14 09:19:12 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-08-14 09:19:12 +0000
commitcd555474f03d4a288c2dbd87fe4ab848590873ee (patch)
tree75c3c2c11838540710cb49c2542083032eb30666 /crawl-ref/source/player.cc
parent40bbbb4b3e78a9d6d87fb6b9ce3426ec1b5e8e5f (diff)
downloadcrawl-ref-cd555474f03d4a288c2dbd87fe4ab848590873ee.tar.gz
crawl-ref-cd555474f03d4a288c2dbd87fe4ab848590873ee.zip
More equipment information on the % screen, this time for
transformations, plus additional curse checks. Also added "mutation" messages for hungry vampires. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1999 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc53
1 files changed, 49 insertions, 4 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index da0ed6aa3f..5ac9124d99 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -438,10 +438,6 @@ bool player_genus(unsigned char which_genus, unsigned char species)
// -------------------------------------------------
bool you_can_wear(int eq)
{
- // bats cannot use anything
- if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
- return false;
-
// these can be used by all
if (eq == EQ_LEFT_RING || eq == EQ_RIGHT_RING || eq == EQ_AMULET
|| eq == EQ_WEAPON || eq == EQ_SHIELD || eq == EQ_CLOAK)
@@ -475,6 +471,55 @@ bool you_can_wear(int eq)
return true;
}
+bool you_tran_can_wear(int eq)
+{
+ int transform = you.attribute[ATTR_TRANSFORMATION];
+
+ // no further restrictions
+ if (transform == TRAN_NONE || transform == TRAN_LICH)
+ return true;
+
+ // bats cannot use anything, clouds obviously so
+ if (transform == TRAN_BAT || transform == TRAN_AIR)
+ return false;
+
+ // everyone else can wear jewellery, at least
+ 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
+ || transform == TRAN_SERPENT_OF_HELL)
+ {
+ return false;
+ }
+
+ if (transform == TRAN_BLADE_HANDS)
+ {
+ if (eq == EQ_WEAPON || eq == EQ_GLOVES || eq == EQ_SHIELD)
+ return false;
+ return true;
+ }
+
+ if (transform == TRAN_ICE_BEAST)
+ {
+ if (eq != EQ_CLOAK)
+ {
+ return false;
+ }
+ return true;
+ }
+
+ if (transform == TRAN_STATUE)
+ {
+ if (eq == EQ_BODY_ARMOUR || eq == EQ_GLOVES || eq == EQ_SHIELD)
+ return false;
+ return true;
+ }
+
+ return true;
+}
+
// Returns the item in the given equipment slot, NULL if the slot is empty.
// eq must be in [EQ_WEAPON, EQ_AMULET], or bad things will happen.
item_def *player_slot_item(equipment_type eq)