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 | |
parent | cf2aa57b5d21f643401c7929e0d1b1be516435ea (diff) | |
download | crawl-ref-ba76ed1fa75887f14d0a9bed89b09d03f47c6512.tar.gz crawl-ref-ba76ed1fa75887f14d0a9bed89b09d03f47c6512.zip |
Chronos' time step.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/abl-show.cc | 35 | ||||
-rw-r--r-- | crawl-ref/source/enum.h | 1 | ||||
-rw-r--r-- | crawl-ref/source/ouch.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/view.cc | 2 |
5 files changed, 40 insertions, 2 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."); +} diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 6ff1c74d74..4acb673342 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -1269,6 +1269,7 @@ enum duration_type DUR_REPEL_STAIRS_MOVE, DUR_REPEL_STAIRS_CLIMB, DUR_SLIMIFY, + DUR_TIME_STEP, NUM_DURATIONS }; diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index 02337d8dc0..bb8136352f 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -915,6 +915,8 @@ void ouch(int dam, int death_source, kill_method_type death_type, const char *aux, bool see_source) { ASSERT(!crawl_state.arena); + if (you.duration[DUR_TIME_STEP]) + return; if (dam != INSTANT_DEATH && you.species == SP_DEEP_DWARF) { diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index c8a99491ec..ae70f9dd20 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -6569,7 +6569,7 @@ bool ponderousify_armour(){ return true; } -int _slouch_monsters(coord_def where, int pow, int, actor* agent) +static int _slouch_monsters(coord_def where, int pow, int, actor* agent) { monsters* mon = monster_at(where); if (mon == NULL) diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 81db0be619..e14b942bbb 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -4077,6 +4077,8 @@ static void _debug_pane_bounds() //--------------------------------------------------------------- void viewwindow(bool draw_it, bool do_updates) { + if (you.duration[DUR_TIME_STEP]) + return; flush_prev_message(); #ifdef USE_TILE |