diff options
author | Adam Borowski <kilobyte@angband.pl> | 2009-10-21 23:20:45 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2009-10-21 23:21:29 +0200 |
commit | ba76ed1fa75887f14d0a9bed89b09d03f47c6512 (patch) | |
tree | d88f58825661188c748aaf4d53ba3d422f63b429 /crawl-ref/source/abl-show.cc | |
parent | cf2aa57b5d21f643401c7929e0d1b1be516435ea (diff) | |
download | crawl-ref-ba76ed1fa75887f14d0a9bed89b09d03f47c6512.tar.gz crawl-ref-ba76ed1fa75887f14d0a9bed89b09d03f47c6512.zip |
Chronos' time step.
Diffstat (limited to 'crawl-ref/source/abl-show.cc')
-rw-r--r-- | crawl-ref/source/abl-show.cc | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index e8c880e9f8..cf7c26f81e 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -23,6 +23,7 @@ #include "abyss.h" #include "artefact.h" #include "beam.h" +#include "cloud.h" #include "database.h" #include "decks.h" #include "delay.h" @@ -81,6 +82,7 @@ static bool _activate_talent(const talent& tal); static bool _do_ability(const ability_def& abil); static void _pay_ability_costs(const ability_def& abil); static std::string _describe_talent(const talent& tal); +static void _chronos_time_step(int pow); // this all needs to be split into data/util/show files // and the struct mechanism here needs to be rewritten (again) @@ -2096,7 +2098,7 @@ static bool _do_ability(const ability_def& abil) break; case ABIL_CHRONOS_TIME_STEP: - mpr("You step out of the flow of time."); + _chronos_time_step(you.skills[SK_INVOCATIONS]*you.piety/10); break; case ABIL_CHRONOS_TIME_BEND: @@ -2751,3 +2753,34 @@ int generic_cost::cost() const { return (base + (add > 0 ? random2avg(add, rolls) : 0)); } + +static void _chronos_time_step(int pow) // pow is the number of turns to skip +{ + coord_def old_pos = you.pos(); + + mpr("You step out of the flow of time."); + you.flash_colour = LIGHTCYAN; + viewwindow(true, true); + you.moveto(coord_def(0, 0)); + you.duration[DUR_TIME_STEP] = pow; + + you.time_taken = 10; + while(you.duration[DUR_TIME_STEP]-- > 0) + { + run_environment_effects(); + handle_monsters(); + manage_clouds(); + } + // Update corpses, etc. This does also shift monsters, but only by a tiny bit. + update_level(pow*10); + +#ifndef USE_TILE + delay(1000); +#endif + + you.flash_colour = 0; + you.moveto(old_pos); + you.duration[DUR_TIME_STEP] = 0; + viewwindow(true, false); + mpr("You return into the normal time flow."); +} |