summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-10-22 22:19:45 +0200
committerAdam Borowski <kilobyte@angband.pl>2009-10-22 22:52:16 +0200
commit9b4674477db54f4d807bc0c0a2525fd987e1d7f5 (patch)
tree8f25140401c9ae5180395627d46a814f4d526a22
parente9c4ad3ff54b7cf9f7f05c5cd58c03cd605663b5 (diff)
downloadcrawl-ref-9b4674477db54f4d807bc0c0a2525fd987e1d7f5.tar.gz
crawl-ref-9b4674477db54f4d807bc0c0a2525fd987e1d7f5.zip
Make Time Bend use Invocations for power.
-rw-r--r--crawl-ref/source/abl-show.cc23
-rw-r--r--crawl-ref/source/godabil.cc26
-rw-r--r--crawl-ref/source/godabil.h1
3 files changed, 29 insertions, 21 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index 3766352a23..28825c8407 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -2096,28 +2096,9 @@ static bool _do_ability(const ability_def& abil)
break;
case ABIL_CHRONOS_TIME_BEND:
- {
- mpr("The flow of time bends around you.");
-
- // TODO perhaps make power dependent on invocation?
- // if so, this spell must train invocations too
- // currently, has one-size-fits-all power level and duration,
- // as if a wand of slow monster was zapped at each target
- for (adjacent_iterator ai; ai; ++ai)
- {
- // Tile occupied by monster
- monsters* mon = monster_at(*ai);
- if (mon != NULL)
- {
- simple_god_message(
- make_stringf(" rebukes %s.",
- mon->name(DESC_NOCAP_THE).c_str()).c_str(),
- GOD_CHRONOS);
- do_slow_monster(mon, KC_YOU);
- }
- }
+ chronos_time_bend(16 + you.skills[SK_INVOCATIONS] * 8);
+ exercise(SK_INVOCATIONS, 2 + random2(3));
break;
- }
case ABIL_CHRONOS_SLOUCH:
mpr("You can feel time thicken.");
diff --git a/crawl-ref/source/godabil.cc b/crawl-ref/source/godabil.cc
index a6218eedc1..32b50f7359 100644
--- a/crawl-ref/source/godabil.cc
+++ b/crawl-ref/source/godabil.cc
@@ -23,6 +23,7 @@
#include "shopping.h"
#include "spells1.h"
#include "spells3.h"
+#include "spells4.h"
#include "spl-book.h"
#include "spl-util.h"
#include "stuff.h"
@@ -561,6 +562,31 @@ void lugonu_bends_space()
////////////////////////////////////////////////////////////////////////
+void chronos_time_bend(int pow)
+{
+ mpr("The flow of time bends around you.");
+
+ for (adjacent_iterator ai; ai; ++ai)
+ {
+ monsters* mon = monster_at(*ai);
+ if (mon != NULL)
+ {
+ if (roll_dice(mon->hit_dice, 3) > random2avg(pow, 2))
+ {
+ mprf("%s %s.",
+ mon->name(DESC_CAP_THE).c_str(), mons_resist_string(mon));
+ continue;
+ }
+
+ simple_god_message(
+ make_stringf(" rebukes %s.",
+ mon->name(DESC_NOCAP_THE).c_str()).c_str(),
+ GOD_CHRONOS);
+ do_slow_monster(mon, KC_YOU);
+ }
+ }
+}
+
void chronos_time_step(int pow) // pow is the number of turns to skip
{
coord_def old_pos = you.pos();
diff --git a/crawl-ref/source/godabil.h b/crawl-ref/source/godabil.h
index 8a18698bc4..a88bd226c0 100644
--- a/crawl-ref/source/godabil.h
+++ b/crawl-ref/source/godabil.h
@@ -30,5 +30,6 @@ bool vehumet_supports_spell(spell_type spell);
bool trog_burn_spellbooks();
void lugonu_bends_space();
+void chronos_time_bend(int pow);
void chronos_time_step(int pow);
#endif