diff options
author | Charles Otto <ottochar@gmail.com> | 2009-11-15 14:39:35 -0500 |
---|---|---|
committer | Charles Otto <ottochar@gmail.com> | 2009-11-15 23:46:45 -0500 |
commit | 0da3322c570c3e94859b94fe3bc747c01d1e1364 (patch) | |
tree | 88d0cc79fac060d6f02046eab87dece4c9286c8c /crawl-ref/source/spells3.cc | |
parent | 01e5123d492ba9292a52960031c18d8069d25d83 (diff) | |
download | crawl-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/spells3.cc')
-rw-r--r-- | crawl-ref/source/spells3.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 639e7dfa06..89bfa68c43 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -1353,12 +1353,7 @@ bool cast_death_channel(int pow, god_type god) mpr("Malign forces permeate your being, awaiting release."); - int addition = 15 + random2(1 + (pow / 3)); - addition *= BASELINE_DELAY; - you.duration[DUR_DEATH_CHANNEL] += addition; - - if (you.duration[DUR_DEATH_CHANNEL] > 100 * BASELINE_DELAY) - you.duration[DUR_DEATH_CHANNEL] = 100 * BASELINE_DELAY; + you.increase_duration(DUR_DEATH_CHANNEL, 15 + random2(1 + pow/3), 100); if (god != GOD_NO_GOD) you.attribute[ATTR_DIVINE_DEATH_CHANNEL] = static_cast<int>(god); @@ -1396,14 +1391,15 @@ void you_teleport(void) { mpr("You feel strangely unstable."); - you.duration[DUR_TELEPORT] = 3 + random2(3); + int teleport_delay = 3 + random2(3); + if (you.level_type == LEVEL_ABYSS && !one_chance_in(5)) { mpr("You have a feeling this translocation may take a while to kick in..."); - you.duration[DUR_TELEPORT] += 5 + random2(10); + teleport_delay += 5 + random2(10); } - you.duration[DUR_TELEPORT] *= BASELINE_DELAY; + you.set_duration(DUR_TELEPORT, teleport_delay); } } |