summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorStefan O'Rear <stefanor@cox.net>2010-01-02 15:07:16 -0800
committerStefan O'Rear <stefanor@cox.net>2010-01-02 15:08:50 -0800
commit99aba816a68f0f3c80f0d2e74dac8e3829eaccd5 (patch)
tree31c43ed9c7015c0582f623ceb59a34203d987034 /crawl-ref/source
parent74a7f0850963676d0ee82a427653562980694a78 (diff)
downloadcrawl-ref-99aba816a68f0f3c80f0d2e74dac8e3829eaccd5.tar.gz
crawl-ref-99aba816a68f0f3c80f0d2e74dac8e3829eaccd5.zip
Axe shield leakage [Mantis 300]
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/item_use.cc21
-rw-r--r--crawl-ref/source/spl-book.cc22
-rw-r--r--crawl-ref/source/spl-book.h1
3 files changed, 3 insertions, 41 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 0da1d40a68..816d8a00ba 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -411,21 +411,6 @@ static const char *shield_impact_degree(int impact)
: NULL);
}
-static void warn_rod_shield_interference(const item_def &)
-{
- const int leakage = rod_shield_leakage();
- const char *leak_degree = shield_impact_degree(leakage);
-
- // Any way to avoid the double entendre? :-)
- if (leak_degree)
- {
- mprf(MSGCH_WARN,
- "Your %s %sreduces the effectiveness of your rod.",
- shield_base_name(you.shield()),
- leak_degree);
- }
-}
-
static void warn_launcher_shield_slowdown(const item_def &launcher)
{
const int slowspeed =
@@ -455,14 +440,12 @@ void warn_shield_penalties()
if (!you.shield())
return;
- // Warnings are limited to rods, bows, and quarterstaves at the moment.
+ // Warnings are limited to bows and quarterstaves at the moment.
const item_def *weapon = you.weapon();
if (!weapon)
return;
- if (item_is_rod(*weapon))
- warn_rod_shield_interference(*weapon);
- else if (is_range_weapon(*weapon))
+ if (is_range_weapon(*weapon))
warn_launcher_shield_slowdown(*weapon);
else if (weapon->base_type == OBJ_WEAPONS
&& weapon_skill(*weapon) == SK_STAVES)
diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc
index 2c6618962d..29e3c69d1f 100644
--- a/crawl-ref/source/spl-book.cc
+++ b/crawl-ref/source/spl-book.cc
@@ -1866,33 +1866,13 @@ int count_staff_spells(const item_def &item, bool need_id)
return (nspel);
}
-// Returns a measure of the rod spell power disrupted by a worn shield.
-int rod_shield_leakage()
-{
- const item_def *shield = you.shield();
- int leakage = 100;
-
- if (shield)
- {
- const int shield_type = shield->sub_type;
- leakage = shield_type == ARM_BUCKLER? 125 :
- shield_type == ARM_SHIELD ? 150 :
- 200;
- // Adjust for shields skill.
- leakage -= ((leakage - 100) * 5 / 10) * you.skills[SK_SHIELDS] / 27;
- }
- return (leakage);
-}
-
int staff_spell( int staff )
{
item_def& istaff(you.inv[staff]);
// Spell staves are mostly for the benefit of non-spellcasters, so we're
// not going to involve INT or Spellcasting skills for power. -- bwr
int powc = (5 + you.skills[SK_EVOCATIONS]
- + roll_dice( 2, you.skills[SK_EVOCATIONS] ))
- * 100
- / rod_shield_leakage();
+ + roll_dice( 2, you.skills[SK_EVOCATIONS] ));
if (!item_is_rod(istaff))
{
diff --git a/crawl-ref/source/spl-book.h b/crawl-ref/source/spl-book.h
index fbec92b89a..d809e0d520 100644
--- a/crawl-ref/source/spl-book.h
+++ b/crawl-ref/source/spl-book.h
@@ -56,7 +56,6 @@ int spellbook_contents( item_def &book, read_book_action_type action,
formatted_string *fs = NULL );
int count_staff_spells(const item_def &item, bool need_id);
-int rod_shield_leakage();
bool make_book_level_randart(item_def &book, int level = -1,
int num_spells = -1, std::string owner = "");