summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--crawl-ref/docs/changelog.txt1
-rw-r--r--crawl-ref/source/beam.cc23
-rw-r--r--crawl-ref/source/tilesdl.cc4
3 files changed, 20 insertions, 8 deletions
diff --git a/crawl-ref/docs/changelog.txt b/crawl-ref/docs/changelog.txt
index 383a06a386..4d6a5fa7e5 100644
--- a/crawl-ref/docs/changelog.txt
+++ b/crawl-ref/docs/changelog.txt
@@ -14,6 +14,7 @@ Disclaimer: These are merely the highlights, not an exhaustive list of changes.
* Fixed certain incorporeal monsters flying instead of levitating.
* Fixed inconvenient electrical eels in entry vaults.
* Fixed magic mapping not showing altars/gates in the Tiles version.
+* Fixed AltGr not being recognized in Windows Tiles version.
* Once entered, the gate to Zot remains open even without carrying runes.
* Really allow uniques to retain their spells when polymorphed.
* Improve Yredelemnul's Enslave Soul, no longer uses random resistance checks.
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);
diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc
index c65c540d6b..ebae54a1a2 100644
--- a/crawl-ref/source/tilesdl.cc
+++ b/crawl-ref/source/tilesdl.cc
@@ -492,14 +492,14 @@ static int _translate_keysym(SDL_keysym &keysym)
mod |= MOD_SHIFT;
if (keysym.mod & KMOD_CTRL)
mod |= MOD_CTRL;
- if (keysym.mod & KMOD_ALT)
+ if (keysym.mod & KMOD_LALT)
mod |= MOD_ALT;
// This is arbitrary, but here's the current mappings.
// 0-256: ASCII, Crawl arrow keys
// 0-1k : Other SDL keys (F1, Windows keys, etc...) and modifiers
// 1k-3k: Non-ASCII with modifiers other than just shift or just ctrl.
- // 3k+ : ASCII with the alt modifier.
+ // 3k+ : ASCII with the left alt modifier.
int offset = mod ? 1000 + 256 * mod : 0;
int numpad_offset = 0;