From 8d408bcec276c6900302ddb079f17da88456acd3 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sun, 16 Sep 2007 21:51:20 +0000 Subject: 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 --- crawl-ref/source/player.cc | 49 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 11 deletions(-) (limited to 'crawl-ref/source/player.cc') 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 -- cgit v1.2.3-54-g00ecf