From 442a5ea7681686ad1a8b65d7043ff69a55f87817 Mon Sep 17 00:00:00 2001 From: dolorous Date: Wed, 16 Jul 2008 02:34:07 +0000 Subject: Add miscellaneous minor fixes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6572 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 4 ++-- crawl-ref/source/player.cc | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 5ab52b9fe1..4b5a3c0071 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -4098,9 +4098,9 @@ static int _affect_player( bolt &beam, item_def *item ) was_affected = true; } - if (one_chance_in( 3 + 2 * player_prot_life() )) + if (one_chance_in(3 + 2 * player_prot_life())) { - potion_effect( POT_SLOWING, 5 ); + potion_effect(POT_SLOWING, 5); was_affected = true; } } diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index f21bba49f5..8b974881a3 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -1781,13 +1781,13 @@ int player_prot_life(bool calc_unid, bool temp) } if (wearing_amulet(AMU_WARDING, calc_unid)) - ++pl; + pl++; // rings - pl += player_equip( EQ_RINGS, RING_LIFE_PROTECTION, calc_unid ); + 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 ); + pl += player_equip_ego_type(EQ_ALL_ARMOUR, SPARM_POSITIVE_ENERGY); // randart wpns pl += scan_randarts(RAP_NEGATIVE_ENERGY, calc_unid); @@ -1795,8 +1795,7 @@ int player_prot_life(bool calc_unid, bool temp) // undead/demonic power pl += player_mutation_level(MUT_NEGATIVE_ENERGY_RESISTANCE); - if (pl > 3) - pl = 3; + pl = std::min(3, pl); return (pl); } -- cgit v1.2.3-54-g00ecf