summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/areas.cc
diff options
context:
space:
mode:
authorBrendan Hickey <brendan@bhickey.net>2012-11-17 09:54:47 -0800
committerAdam Borowski <kilobyte@angband.pl>2012-11-18 01:49:19 +0100
commitf42eaf392e9765c9eb890e05fa5f6d902062ea47 (patch)
treeb81cddb3f5a7eb90a4a62859f0d8df9bb5129adc /crawl-ref/source/areas.cc
parentc09303161bb72cb5fe4a535ed348e09d6a648628 (diff)
downloadcrawl-ref-f42eaf392e9765c9eb890e05fa5f6d902062ea47.tar.gz
crawl-ref-f42eaf392e9765c9eb890e05fa5f6d902062ea47.zip
Disjunction
Level 8 translocation spell. Blinks away everything with diminishing probability with: P(~blink) = 0.8^(1/(dist+1)/(dist-1)) Over 10 ticks, a monster adjacent to the caster will blink with probability 0.9. Monsters may be blinked repeatedly.
Diffstat (limited to 'crawl-ref/source/areas.cc')
-rw-r--r--crawl-ref/source/areas.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/crawl-ref/source/areas.cc b/crawl-ref/source/areas.cc
index c200e6322a..3e80a9d2c9 100644
--- a/crawl-ref/source/areas.cc
+++ b/crawl-ref/source/areas.cc
@@ -42,6 +42,7 @@ enum areaprop_flag
APROP_UMBRA = (1 << 7),
APROP_SUPPRESSION = (1 << 8),
APROP_QUAD = (1 << 9),
+ APROP_DISJUNCTION = (1 << 10),
};
struct area_centre
@@ -198,6 +199,18 @@ static void _update_agrid()
no_areas = false;
}
+ if (you.duration[DUR_DISJUNCTION])
+ {
+ const int r = 27;
+ _agrid_centres.push_back(area_centre(AREA_DISJUNCTION, you.pos(), r));
+ for (radius_iterator ri(you.pos(), r, C_CIRCLE, you.get_los());
+ ri; ++ri)
+ {
+ _set_agrid_flag(*ri, APROP_DISJUNCTION);
+ }
+ no_areas = false;
+ }
+
if (!env.sunlight.empty())
{
for (size_t i = 0; i < env.sunlight.size(); ++i)
@@ -691,6 +704,20 @@ bool quad_haloed(const coord_def& p)
}
/////////////
+// Disjunction Glow
+//
+
+bool disjunction_haloed(const coord_def& p)
+{
+ if (!map_bounds(p))
+ return false;
+ if (!_agrid_valid)
+ _update_agrid();
+
+ return _check_agrid_flag(p, APROP_DISJUNCTION);
+}
+
+/////////////
// Umbra
//