diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-17 14:50:31 +0200 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-17 16:45:17 +0200 |
commit | 2f62da4f8d850459676d780980dbabb7f25a1488 (patch) | |
tree | 10e56266cb996fff15f0afe504e4d49df814faa6 /crawl-ref/source/spells1.cc | |
parent | e6d4aa80db70499cf1f0dd1b1d6a61c539ba8399 (diff) | |
download | crawl-ref-2f62da4f8d850459676d780980dbabb7f25a1488.tar.gz crawl-ref-2f62da4f8d850459676d780980dbabb7f25a1488.zip |
Remove chain-lightning specific LOS test from beam.cc.
There's now a spell-specific _lightning_los which may require
some fine-tuning -- I'm not quite sure of the intention of the
original check.
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r-- | crawl-ref/source/spells1.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 0e71583ffb..e49807379a 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -297,6 +297,13 @@ void cast_fire_storm(int pow, bolt &beam) viewwindow(true, false); } +bool _lightning_los(const coord_def& source, const coord_def& target) +{ + // XXX: currently bounded by circular LOS radius; + // XXX: adapt opacity -- allow passing clouds. + return (exists_ray(source, target, opc_solid, bds_maxlos)); +} + void cast_chain_lightning(int pow) { bolt beam; @@ -350,7 +357,7 @@ void cast_chain_lightning(int pow) if (dist > min_dist) continue; - if (!check_line_of_sight(source, monster->pos())) + if (_lightning_los(source, monster->pos())) continue; count++; @@ -387,7 +394,7 @@ void cast_chain_lightning(int pow) if ((target.x == -1 || dist < min_dist || (dist == min_dist && one_chance_in(count + 1))) - && check_line_of_sight(source, you.pos())) + && _lightning_los(source, you.pos())) { target = you.pos(); } |