summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/target.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2014-02-25 21:28:50 -0700
committerSteve Melenchuk <smelenchuk@gmail.com>2014-02-25 22:26:09 -0700
commita674fa1aae7bf4b3b1aada265c5a508bf048c456 (patch)
tree5d757c1d6d3458dd66d789d0e98aaebcd64fb6a5 /crawl-ref/source/target.cc
parentbfda3da51aaee884b17f1828b9c3c30042064e90 (diff)
downloadcrawl-ref-a674fa1aae7bf4b3b1aada265c5a508bf048c456.tar.gz
crawl-ref-a674fa1aae7bf4b3b1aada265c5a508bf048c456.zip
Fancy animations for Glaciate.
Diffstat (limited to 'crawl-ref/source/target.cc')
-rw-r--r--crawl-ref/source/target.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/crawl-ref/source/target.cc b/crawl-ref/source/target.cc
index 129f0bda9e..cf5f9ae5ea 100644
--- a/crawl-ref/source/target.cc
+++ b/crawl-ref/source/target.cc
@@ -1198,6 +1198,8 @@ bool targetter_cone::set_aim(coord_def a)
{
aim = a;
zapped.clear();
+ for (int i = 0; i < LOS_RADIUS + 1; i++)
+ sweep[i].clear();
if (a == origin)
return false;
@@ -1220,7 +1222,10 @@ bool targetter_cone::set_aim(coord_def a)
if (!map_bounds(p) || opc_solid_see(p) >= OPC_OPAQUE)
hit = false;
if (hit && p != origin && zapped[p] <= 0)
+ {
zapped[p] = AFF_YES;
+ sweep[isqrt((origin - p).abs())][p] = AFF_YES;
+ }
ray.advance();
}
@@ -1231,7 +1236,10 @@ bool targetter_cone::set_aim(coord_def a)
if (!map_bounds(p) || opc_solid_see(p) >= OPC_OPAQUE)
hit = false;
if (hit && p != origin && zapped[p] <= 0)
+ {
zapped[p] = AFF_YES;
+ sweep[isqrt((origin - p).abs())][p] = AFF_YES;
+ }
ray.advance();
}
@@ -1255,11 +1263,13 @@ bool targetter_cone::set_aim(coord_def a)
&& cell_see_cell(origin, p, LOS_NO_TRANS))
{
zapped[p] = AFF_YES;
+ sweep[isqrt((origin - p).abs())][p] = AFF_YES;
}
}
}
zapped[origin] = AFF_NO;
+ sweep[0].clear();
return true;
}