summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2010-01-12 14:20:47 +0100
committerAdam Borowski <kilobyte@angband.pl>2010-01-12 14:20:47 +0100
commit4368944db52459b6bdd9b17628b96ebe8e642c02 (patch)
tree8cee9f2ee4f204a0f3c14dba41232dba9fd8fdd3 /crawl-ref/source/beam.cc
parent082e5d6cf970a077687b2aff2ffee5eb69479086 (diff)
downloadcrawl-ref-4368944db52459b6bdd9b17628b96ebe8e642c02.tar.gz
crawl-ref-4368944db52459b6bdd9b17628b96ebe8e642c02.zip
Trees don't reflect electricity; for bolts of lightning they ignite instead.
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc24
1 files changed, 22 insertions, 2 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 49b464b608..14edb27806 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -1865,6 +1865,17 @@ void bolt::fire_wall_effect()
finish_beam();
}
+void bolt::elec_wall_effect()
+{
+ const dungeon_feature_type feat = grd(pos());
+ if (feat == DNGN_TREES)
+ {
+ fire_wall_effect();
+ return;
+ }
+ finish_beam();
+}
+
void bolt::nuke_wall_effect()
{
if (env.markers.property_at(pos(), MAT_ANY, "veto_disintegrate") == "veto")
@@ -1934,6 +1945,8 @@ void bolt::affect_wall()
digging_wall_effect();
else if (is_fiery())
fire_wall_effect();
+ else if (flavour == BEAM_ELECTRICITY)
+ elec_wall_effect();
else if (flavour == BEAM_DISINTEGRATION || flavour == BEAM_NUKE)
nuke_wall_effect();
@@ -3010,8 +3023,11 @@ bool bolt::is_bouncy(dungeon_feature_type feat) const
if (is_enchantment())
return (false);
- if (flavour == BEAM_ELECTRICITY && feat != DNGN_METAL_WALL)
+ if (flavour == BEAM_ELECTRICITY && feat != DNGN_METAL_WALL
+ && feat != DNGN_TREES)
+ {
return (true);
+ }
if ((flavour == BEAM_FIRE || flavour == BEAM_COLD)
&& feat == DNGN_GREEN_CRYSTAL_WALL )
@@ -3285,12 +3301,13 @@ bool bolt::is_fiery() const
bool bolt::is_superhot() const
{
- if (!is_fiery())
+ if (!is_fiery() && flavour != BEAM_ELECTRICITY)
return (false);
return (name == "bolt of fire"
|| name == "bolt of magma"
|| name == "fireball"
+ || name == "bolt of lightning"
|| name.find("hellfire") != std::string::npos
&& in_explosion_phase);
}
@@ -3307,6 +3324,9 @@ bool bolt::affects_wall(dungeon_feature_type wall) const
if (is_fiery() && (wall == DNGN_WAX_WALL || wall == DNGN_TREES))
return (true);
+ if (flavour == BEAM_ELECTRICITY && wall == DNGN_TREES)
+ return (true);
+
// eye of devastation?
if (flavour == BEAM_NUKE)
return (true);