summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-20 19:43:59 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-20 19:43:59 +0000
commitd3203fe26accc477952ee0f72c374494edeaa73d (patch)
tree9c54f07288fe82b10ebce4c0c6e4a7763e9b6705 /crawl-ref/source/beam.cc
parent9edc73ee928aa1299d9716bd4812db1d6c7aaa8c (diff)
downloadcrawl-ref-d3203fe26accc477952ee0f72c374494edeaa73d.tar.gz
crawl-ref-d3203fe26accc477952ee0f72c374494edeaa73d.zip
Fix beam animations leaking information about unknown beam types.
Backport AltGr fix for Tiles. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10359 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc23
1 files changed, 17 insertions, 6 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 7e936bb4c6..30291690b4 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -131,13 +131,13 @@ kill_category bolt::whose_kill() const
// A simple animated flash from Rupert Smith (expanded to be more
// generic).
-void zap_animation(int colour, const monsters *mon, bool force)
+static void _zap_animation(int colour, const monsters *mon, bool force)
{
coord_def p = you.pos();
if (mon)
{
- if (!force && !player_monster_visible( mon ))
+ if (!force && !player_monster_visible(mon))
return;
p = mon->pos();
@@ -181,7 +181,7 @@ static void _ench_animation( int flavour, const monsters *mon, bool force )
|| flavour == BEAM_BLINK) ? ETC_WARP
: ETC_ENCHANT;
- zap_animation(element_colour(elem), mon, force);
+ _zap_animation(element_colour(elem), mon, force);
}
// If needs_tracer is true, we need to check the beam path for friendly
@@ -1586,7 +1586,12 @@ void bolt::draw(const coord_def& p)
#ifdef USE_TILE
if (tile_beam == -1)
- tile_beam = tileidx_bolt(*this);
+ {
+ if (effect_known)
+ tile_beam = tileidx_bolt(*this);
+ else
+ tile_beam = tileidx_zap(ETC_MAGIC);
+ }
if (tile_beam != -1 && in_los_bounds(drawpos))
{
@@ -3559,7 +3564,10 @@ void bolt::affect_player_enchantment()
}
// You didn't resist it.
- _ench_animation( real_flavour );
+ if (effect_known)
+ _ench_animation(real_flavour);
+ else
+ _zap_animation(-1);
bool nasty = true, nice = false;
@@ -4253,7 +4261,10 @@ void bolt::enchantment_affect_monster(monsters* mon)
// Doing this here so that the player gets to see monsters
// "flicker and vanish" when turning invisible....
- _ench_animation( real_flavour, mon );
+ if (effect_known)
+ _ench_animation( real_flavour, mon );
+ else
+ _zap_animation(-1, mon, false);
// Try to hit the monster with the enchantment.
const mon_resist_type ench_result = try_enchant_monster(mon);