summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-10-28 07:39:19 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-10-28 07:39:19 +0000
commit41a734363d2e0a2b5f26650e342fe4163910873d (patch)
tree6968c757bdd50574f368eab23020d709c4b47afb
parentf364055c63c9f1bd08fab30e4eb3b048219e3ed9 (diff)
downloadcrawl-ref-41a734363d2e0a2b5f26650e342fe4163910873d.tar.gz
crawl-ref-41a734363d2e0a2b5f26650e342fe4163910873d.zip
Refixed shield delays to be consistent for wear/takeoff.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup@298 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/item_use.cc30
1 files changed, 16 insertions, 14 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 0a035bc706..1bc6f2d003 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -639,6 +639,20 @@ void wear_armour(void)
do_wear_armour( armour_wear_2, false );
}
+static int armour_equip_delay(const item_def &item)
+{
+ int delay = property( item, PARM_AC );
+
+ // Shields are comparatively easy to wear.
+ if (is_shield( item ))
+ delay = delay / 2 + 1;
+
+ if (delay < 1)
+ delay = 1;
+
+ return (delay);
+}
+
bool do_wear_armour( int item, bool quiet )
{
if (!is_valid_item( you.inv[item] ))
@@ -865,15 +879,7 @@ bool do_wear_armour( int item, bool quiet )
you.turn_is_over = true;
- int delay = property( you.inv[item], PARM_AC );
-
- // Shields are comparatively easy to wear.
- if (is_shield( you.inv[item] ))
- delay /= 2;
-
- if (delay < 1)
- delay = 1;
-
+ int delay = armour_equip_delay( you.inv[item] );
if (delay)
start_delay( DELAY_ARMOUR_ON, delay, item );
@@ -987,11 +993,7 @@ bool takeoff_armour(int item)
you.turn_is_over = true;
- int delay = property( you.inv[item], PARM_AC );
-
- if (delay < 1)
- delay = 1;
-
+ int delay = armour_equip_delay( you.inv[item] );
start_delay( DELAY_ARMOUR_OFF, delay, item );
if (removedCloak)