From b141fc02667821e0673eb96219214cdbc080d854 Mon Sep 17 00:00:00 2001 From: haranp Date: Mon, 25 Dec 2006 13:45:00 +0000 Subject: Implemented 1617200: Changed armour skill training. Once the original EV penalty is gone (i.e., at an armour skill of 3 * EV penalty), passive training will train stealth instead of armour (as if the player were wearing light armour); also, getting hit in this situation can train both dodging and armour. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@705 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/player.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index d1bc61c891..90aaa62a3d 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -1722,12 +1722,18 @@ bool is_light_armour( const item_def &item ) } } -bool player_light_armour(void) +bool player_light_armour(bool with_skill) { - if (you.equip[EQ_BODY_ARMOUR] == -1) + const int arm = you.equip[EQ_BODY_ARMOUR]; + + if (arm == -1) + return true; + + if (with_skill && + property(you.inv[arm], PARM_EVASION) + you.skills[SK_ARMOUR]/3 >= 0) return true; - return (is_light_armour( you.inv[you.equip[EQ_BODY_ARMOUR]] )); + return (is_light_armour(you.inv[arm])); } // end player_light_armour() // -- cgit v1.2.3-54-g00ecf