From 61aa2965b3dbd9f20ea7cedcb85d143ccf5c4e7d Mon Sep 17 00:00:00 2001 From: dolorous Date: Fri, 7 Nov 2008 20:56:57 +0000 Subject: Consolidate the routines to remove the player's condensation shield into one function. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7403 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells1.cc | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'crawl-ref/source/spells1.cc') diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index aa10be5b51..b26296c2de 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -182,11 +182,8 @@ int blink(int pow, bool high_level_controlled_blink, bool wizard_blink) contaminate_player( 1, true ); } - if (you.duration[DUR_CONDENSATION_SHIELD] > 0 && !wizard_blink) - { - you.duration[DUR_CONDENSATION_SHIELD] = 0; - you.redraw_armour_class = true; - } + if (!wizard_blink && you.duration[DUR_CONDENSATION_SHIELD] > 0) + remove_condensation_shield(); } crawl_state.cancel_cmd_again(); @@ -197,8 +194,8 @@ int blink(int pow, bool high_level_controlled_blink, bool wizard_blink) void random_blink(bool allow_partial_control, bool override_abyss) { + bool success = false; coord_def target; - bool succ = false; if (scan_randarts(RAP_PREVENT_TELEPORTATION)) mpr("You feel a weird sense of stasis."); @@ -222,10 +219,9 @@ void random_blink(bool allow_partial_control, bool override_abyss) { mpr("You may select the general direction of your translocation."); cast_semi_controlled_blink(100); - succ = true; + success = true; } #endif - else { mpr("You blink."); @@ -233,22 +229,19 @@ void random_blink(bool allow_partial_control, bool override_abyss) // No longer held in net. clear_trapping_net(); - succ = true; + success = true; you.moveto(target); if (you.level_type == LEVEL_ABYSS) { - abyss_teleport( false ); + abyss_teleport(false); if (you.pet_target != MHITYOU) you.pet_target = MHITNOT; } } - if (succ && you.duration[DUR_CONDENSATION_SHIELD] > 0) - { - you.duration[DUR_CONDENSATION_SHIELD] = 0; - you.redraw_armour_class = true; - } + if (success && you.duration[DUR_CONDENSATION_SHIELD] > 0) + remove_condensation_shield(); } bool fireball(int pow, bolt &beam) -- cgit v1.2.3-54-g00ecf