From 4cb403f3211066a2c2e131e824ed50f9a83d9c4a Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sat, 17 Jan 2009 17:26:46 +0000 Subject: * Tweak FAQ as suggested in FR 2472030. * Fix 2515108: stash tracker not being initialized at game start. * Fix 2514024: melded armour hindering melee. * Fix 2512301: =regeneration described as useless for Mummies. * Fix weapon swap prompt when untransforming with monsters in view. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8503 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/player.cc | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index cb1a22ace2..1c181b0223 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -1812,7 +1812,7 @@ int player_energy() // If temp is set to false, temporary sources of resistance won't be // counted. -int player_prot_life(bool calc_unid, bool temp) +int player_prot_life(bool calc_unid, bool temp, bool items) { int pl = 0; @@ -1863,17 +1863,20 @@ int player_prot_life(bool calc_unid, bool temp) } } - if (wearing_amulet(AMU_WARDING, calc_unid)) - pl++; + if (items) + { + if (wearing_amulet(AMU_WARDING, calc_unid)) + pl++; - // rings - pl += player_equip(EQ_RINGS, RING_LIFE_PROTECTION, calc_unid); + // rings + pl += player_equip(EQ_RINGS, RING_LIFE_PROTECTION, calc_unid); - // armour (checks body armour only) - pl += player_equip_ego_type(EQ_ALL_ARMOUR, SPARM_POSITIVE_ENERGY); + // armour (checks body armour only) + pl += player_equip_ego_type(EQ_ALL_ARMOUR, SPARM_POSITIVE_ENERGY); - // randart wpns - pl += scan_randarts(RAP_NEGATIVE_ENERGY, calc_unid); + // randart wpns + pl += scan_randarts(RAP_NEGATIVE_ENERGY, calc_unid); + } // undead/demonic power pl += player_mutation_level(MUT_NEGATIVE_ENERGY_RESISTANCE); @@ -2284,11 +2287,12 @@ bool is_light_armour( const item_def &item ) bool player_light_armour(bool with_skill) { - const int arm = you.equip[EQ_BODY_ARMOUR]; - - if (arm == -1) + if (!player_wearing_slot(EQ_BODY_ARMOUR)) return (true); + // We're wearing some kind of body armour and it's not melded. + const int arm = you.equip[EQ_BODY_ARMOUR]; + if (with_skill && property(you.inv[arm], PARM_EVASION) + you.skills[SK_ARMOUR]/3 >= 0) { -- cgit v1.2.3-54-g00ecf