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>2009-01-17 17:26:46 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-17 17:26:46 +0000
commit4cb403f3211066a2c2e131e824ed50f9a83d9c4a (patch)
tree11fed7ea793ea5ffc06d74f085da37fc8c3eba6f /crawl-ref/source/player.cc
parent7e4d7e95e692aa3fa32430cd9ddaece5ad96e2fa (diff)
downloadcrawl-ref-4cb403f3211066a2c2e131e824ed50f9a83d9c4a.tar.gz
crawl-ref-4cb403f3211066a2c2e131e824ed50f9a83d9c4a.zip
* 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
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc28
1 files changed, 16 insertions, 12 deletions
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)
{