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/spells4.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/spells4.cc') diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index bf66ec1c74..670a9eb99f 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -2381,6 +2381,13 @@ bool cast_sandblast(int pow, bolt &beam) return (success); } +void remove_condensation_shield() +{ + mpr("Your icy shield dissipates!", MSGCH_DURATION); + you.duration[DUR_CONDENSATION_SHIELD] = 0; + you.redraw_armour_class = true; +} + void cast_condensation_shield(int pow) { if (you.shield() || you.duration[DUR_FIRE_SHIELD]) @@ -2395,16 +2402,13 @@ void cast_condensation_shield(int pow) else { mpr("A crackling disc of dense vapour forms in the air!"); - you.redraw_armour_class = true; - you.duration[DUR_CONDENSATION_SHIELD] = 10 + roll_dice(2, pow / 5); + you.redraw_armour_class = true; } if (you.duration[DUR_CONDENSATION_SHIELD] > 30) you.duration[DUR_CONDENSATION_SHIELD] = 30; } - - return; } void remove_divine_shield() @@ -2424,7 +2428,8 @@ void cast_divine_shield() if (!you.duration[DUR_DIVINE_SHIELD]) { you.redraw_armour_class = true; - if (you.shield() || you.duration[DUR_FIRE_SHIELD] + if (you.shield() + || you.duration[DUR_FIRE_SHIELD] || you.duration[DUR_CONDENSATION_SHIELD]) { mprf("Your shield is strengthened by %s's divine power.", -- cgit v1.2.3-54-g00ecf