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-13 19:34:42 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-08-13 19:34:42 +0000
commit40bbbb4b3e78a9d6d87fb6b9ce3426ec1b5e8e5f (patch)
tree5a90287539638a96296c47a057a61e9564bd29af /crawl-ref/source/player.cc
parente788bbaa89ad9aa5a0cd56b5a705996c040b0090 (diff)
downloadcrawl-ref-40bbbb4b3e78a9d6d87fb6b9ce3426ec1b5e8e5f.tar.gz
crawl-ref-40bbbb4b3e78a9d6d87fb6b9ce3426ec1b5e8e5f.zip
Added message to mutation and overview screen about
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
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc50
1 files changed, 50 insertions, 0 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index ebaa18142c..da0ed6aa3f 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -417,6 +417,10 @@ bool player_genus(unsigned char which_genus, unsigned char species)
case SP_MOUNTAIN_DWARF:
return (which_genus == GENPC_DWARVEN);
+
+ case SP_OGRE:
+ case SP_OGRE_MAGE:
+ return (which_genus == GENPC_OGRE);
default:
break;
@@ -425,6 +429,52 @@ bool player_genus(unsigned char which_genus, unsigned char species)
return (false);
} // end player_genus()
+// 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 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)
+ {
+ return true;
+ }
+
+ // these can wear everything
+ if (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 anything
+ if (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 problems
+ 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)