diff options
-rw-r--r-- | crawl-ref/source/acr.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/decks.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/enum.h | 1 | ||||
-rw-r--r-- | crawl-ref/source/spells2.cc | 14 | ||||
-rw-r--r-- | crawl-ref/source/spells2.h | 2 |
5 files changed, 19 insertions, 8 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 9605fc733f..39f77054b2 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -121,6 +121,7 @@ #include "skills.h" #include "skills2.h" #include "spells1.h" +#include "spells2.h" #include "spells3.h" #include "spells4.h" #include "spl-book.h" @@ -2708,6 +2709,7 @@ static void _decrement_durations() _decrement_a_duration(DUR_SEE_INVISIBLE); // jmf: cute message // handled elsewhere + _decrement_a_duration(DUR_TELEPATHY, "You feel less empathic."); if ( _decrement_a_duration(DUR_CONDENSATION_SHIELD, "Your icy shield evaporates.") ) @@ -3078,6 +3080,9 @@ static void _world_reacts() if (env.cgrid[you.x_pos][you.y_pos] != EMPTY_CLOUD) in_a_cloud(); + if (you.level_type == LEVEL_DUNGEON && you.duration[DUR_TELEPATHY]) + detect_creatures( 1 + you.duration[DUR_TELEPATHY] / 2, true ); + _decrement_durations(); const int food_use = player_hunger_rate(); diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc index 97cb19da72..92471419fc 100644 --- a/crawl-ref/source/decks.cc +++ b/crawl-ref/source/decks.cc @@ -2277,7 +2277,10 @@ static void _dowsing_card(int power, deck_rarity_type rarity) if ( things_to_do[1] ) detect_traps( random2(power/4) ); if ( things_to_do[2] ) - detect_creatures( random2(power/4) ); + { + mpr("You feel telepathic!"); + you.duration[DUR_TELEPATHY] = random2(power/4); + } } static bool _trowel_card(int power, deck_rarity_type rarity) diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 823a364f1c..8b07f4c626 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -1092,6 +1092,7 @@ enum duration_type DUR_MAGIC_SHIELD, DUR_SLEEP, DUR_SAGE, + DUR_TELEPATHY, NUM_DURATIONS }; diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index d4fecd45be..8ecb929176 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -195,20 +195,22 @@ static bool mark_detected_creature(int gridx, int gridy, const monsters *mon, return found_good; } -unsigned char detect_creatures( int pow ) +int detect_creatures( int pow, bool telepathic ) { int fuzz_radius = 0, fuzz_chance = 0; - fuzz_detect_creatures(pow, &fuzz_radius, &fuzz_chance); + if ( !telepathic ) + fuzz_detect_creatures(pow, &fuzz_radius, &fuzz_chance); if (pow > 50) pow = 50; - unsigned char creatures_found = 0; - const int map_radius = 8 + random2(8) + pow; + int creatures_found = 0; + const int map_radius = 8 + random2(8) + pow; // Clear the map so detect creatures is more useful and the detection // fuzz is harder to analyse by averaging. - clear_map(false); + if ( !telepathic ) + clear_map(false); for (int i = you.x_pos - map_radius; i < you.x_pos + map_radius; i++) { @@ -219,7 +221,7 @@ unsigned char detect_creatures( int pow ) if (mgrd[i][j] != NON_MONSTER) { - struct monsters *mon = &menv[ mgrd[i][j] ]; + monsters *mon = &menv[ mgrd[i][j] ]; if (mark_detected_creature(i, j, mon, fuzz_chance, fuzz_radius)) { diff --git a/crawl-ref/source/spells2.h b/crawl-ref/source/spells2.h index c1d0b8fdcb..d718655317 100644 --- a/crawl-ref/source/spells2.h +++ b/crawl-ref/source/spells2.h @@ -74,7 +74,7 @@ int vampiric_drain(int pow, const dist &); /* *********************************************************************** * called from: spell * *********************************************************************** */ -unsigned char detect_creatures( int pow ); +int detect_creatures( int pow, bool telepathic = false ); // last updated 24may2000 {dlb} |