summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/target.cc
diff options
context:
space:
mode:
authorDracoOmega <draco_omega@live.com>2013-02-03 18:02:37 -0330
committerSteve Melenchuk <smelenchuk@gmail.com>2013-02-03 18:15:02 -0700
commit28ec47a2991a06eeb4235e1c3bfa445599abb8cd (patch)
tree19e20daaa9b76d73d5434a2709b05786635a66b4 /crawl-ref/source/target.cc
parent1b3b8f75068327047dacdff1e96aa0217cbff86c (diff)
downloadcrawl-ref-28ec47a2991a06eeb4235e1c3bfa445599abb8cd.tar.gz
crawl-ref-28ec47a2991a06eeb4235e1c3bfa445599abb8cd.zip
Make targeters aware of monsters their beams cannot hit
Previously there was no way for beam targeters to know that they could never hit certain things, such as orbs of destruction or plants under Fedhas and would imply that explosion spells would terminate upon them, if the player was trying to aim through them. Now they should properly match the path the beam will actually take.
Diffstat (limited to 'crawl-ref/source/target.cc')
-rw-r--r--crawl-ref/source/target.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/crawl-ref/source/target.cc b/crawl-ref/source/target.cc
index b65ea24874..7e9f9cfc88 100644
--- a/crawl-ref/source/target.cc
+++ b/crawl-ref/source/target.cc
@@ -106,7 +106,7 @@ bool targetter_beam::set_aim(coord_def a)
break;
tempbeam2.target = *i;
if (anyone_there(*i)
- && !fedhas_shoot_through(tempbeam, monster_at(*i)))
+ && !tempbeam.ignores_monster(monster_at(*i)))
{
break;
}
@@ -174,8 +174,8 @@ aff_type targetter_beam::is_affected(coord_def loc)
return current;
}
if (anyone_there(*i)
- && !fedhas_shoot_through(beam, monster_at(*i))
- && !penetrates_targets)
+ && !penetrates_targets
+ && !beam.ignores_monster(monster_at(*i)))
{
// We assume an exploding spell will always stop here.
if (max_expl_rad > 0)
@@ -229,7 +229,7 @@ bool targetter_imb::set_aim(coord_def a)
c = *i;
cur_path.push_back(c);
if (!(anyone_there(c)
- && !fedhas_shoot_through(beam, monster_at(c)))
+ && !beam.ignores_monster((monster_at(c))))
&& c != end)
continue;
@@ -243,7 +243,7 @@ bool targetter_imb::set_aim(coord_def a)
which_splash->push_back(*ai);
if (!cell_is_solid(*ai)
&& !(anyone_there(*ai)
- && !fedhas_shoot_through(beam, monster_at(*ai))))
+ && !beam.ignores_monster(monster_at(*ai))))
{
which_splash->push_back(c + (*ai - c) * 2);
}
@@ -864,7 +864,7 @@ aff_type targetter_spray::is_affected(coord_def loc)
break;
}
else if (anyone_there(*i)
- && !fedhas_shoot_through(beams[n], monster_at(*i)))
+ && !beams[n].ignores_monster(monster_at(*i)))
{
beam_affect = AFF_MAYBE;
}