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-09-16 21:51:20 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-16 21:51:20 +0000
commit8d408bcec276c6900302ddb079f17da88456acd3 (patch)
treec8ee030ed6d180a4f197da7782ebc5b811a64b08 /crawl-ref/source/player.cc
parent1179b3508f5782efb790562af87fde58859792ee (diff)
downloadcrawl-ref-8d408bcec276c6900302ddb079f17da88456acd3.tar.gz
crawl-ref-8d408bcec276c6900302ddb079f17da88456acd3.zip
Applying patches by dolorous:
1794789: Move "Xom is BORED" message into god channel 1795785: remove redundant check for potions of blood 1795673: claw-related clean-ups and enforcing consistency in transformations and claws (Lich and Statue retain claws, Ice Beast doesn't). I also added a check for hooves and claws mutation for the % and [ you_can_wear output. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2114 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc49
1 files changed, 38 insertions, 11 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 49c0b2abc4..d432fa0e86 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -475,9 +475,6 @@ bool you_can_wear(int eq, bool special_armour)
if (player_genus(GENPC_ELVEN))
return true;
- if (you.is_undead)
- return true;
-
// anyone can wear caps/hats and robes and at least one of buckler/shield
if (special_armour
&& (eq == EQ_HELMET || eq == EQ_BODY_ARMOUR || eq == EQ_SHIELD))
@@ -496,19 +493,34 @@ bool you_can_wear(int eq, bool special_armour)
}
if (you.species == SP_KENKU && (eq == EQ_HELMET || eq == EQ_BOOTS))
- {
return false;
- }
if (you.species == SP_MINOTAUR && eq == EQ_HELMET)
return false;
+ if (you.species == SP_GHOUL && eq == EQ_GLOVES)
+ return false;
+
// else no problems
return true;
}
-bool you_tran_can_wear(int eq)
+bool you_tran_can_wear(int eq, bool check_mutation)
{
+ // not a transformation, but also temporary -> check first
+ if (check_mutation)
+ {
+ if (you.mutation[MUT_CLAWS] >= 3 && eq == EQ_GLOVES)
+ return false;
+
+ if (eq == EQ_BOOTS
+ && (player_is_swimming() && you.species == SP_MERFOLK
+ || you.mutation[MUT_HOOVES] >= 2))
+ {
+ return false;
+ }
+ }
+
int transform = you.attribute[ATTR_TRANSFORMATION];
// no further restrictions
@@ -5729,13 +5741,28 @@ void player::slow_down(int str)
::slow_player( str );
}
+bool player::has_claws() const
+{
+ // these transformations bring claws with them
+ if (attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON
+ || attribute[ATTR_TRANSFORMATION] == TRAN_SERPENT_OF_HELL)
+ {
+ return true;
+ }
+
+ // these are the only other sources for claws
+ if (species != SP_TROLL && species != SP_GHOUL && !mutation[MUT_CLAWS])
+ return false;
+
+ // transformations other than these will override claws
+ return ( attribute[ATTR_TRANSFORMATION] == TRAN_NONE
+ || attribute[ATTR_TRANSFORMATION] == TRAN_STATUE
+ || attribute[ATTR_TRANSFORMATION] == TRAN_LICH );
+}
+
bool player::has_usable_claws() const
{
- return (equip[EQ_GLOVES] == -1 &&
- (attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON
- || mutation[MUT_CLAWS]
- || species == SP_TROLL
- || species == SP_GHOUL));
+ return (equip[EQ_GLOVES] == -1 && has_claws());
}
god_type player::deity() const