summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells2.cc
diff options
context:
space:
mode:
authorCharles Otto <ottochar@gmail.com>2009-11-15 14:39:35 -0500
committerCharles Otto <ottochar@gmail.com>2009-11-15 23:46:45 -0500
commit0da3322c570c3e94859b94fe3bc747c01d1e1364 (patch)
tree88d0cc79fac060d6f02046eab87dece4c9286c8c /crawl-ref/source/spells2.cc
parent01e5123d492ba9292a52960031c18d8069d25d83 (diff)
downloadcrawl-ref-0da3322c570c3e94859b94fe3bc747c01d1e1364.tar.gz
crawl-ref-0da3322c570c3e94859b94fe3bc747c01d1e1364.zip
On second thought abstract increasing/setting durations a little.
Add (and use) player methods for setting/increasing durations.
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r--crawl-ref/source/spells2.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index 649c516bf0..21e67164f8 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -366,12 +366,8 @@ bool brand_weapon(brand_type which_brand, int power)
else
mprf("%s flashes.", weapon.name(DESC_CAP_YOUR).c_str());
- const int dur_change = duration_affected + roll_dice(2, power);
-
- you.duration[DUR_WEAPON_BRAND] += dur_change * BASELINE_DELAY;
-
- if (you.duration[DUR_WEAPON_BRAND] > 50 * BASELINE_DELAY)
- you.duration[DUR_WEAPON_BRAND] = 50 * BASELINE_DELAY;
+ you.increase_duration(DUR_WEAPON_BRAND,
+ duration_affected + roll_dice(2, power), 50);
return (true);
}