summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-cast.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-04 17:29:34 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-04 17:29:34 -0800
commitebce0ae5a24d6af41ebb888c50cb14b770d22f89 (patch)
treec78fecb68056e7914babd29a2da7a8d12f627dd6 /crawl-ref/source/spl-cast.cc
parent984882ad632106c8611ceabe9a584d3da400c2c5 (diff)
downloadcrawl-ref-ebce0ae5a24d6af41ebb888c50cb14b770d22f89.tar.gz
crawl-ref-ebce0ae5a24d6af41ebb888c50cb14b770d22f89.zip
Sound overhaul: sound where spell hits
Directed spells now do noise where they hit a monster/player, rather than where they're cast (enchantment spells have 0 noise when they hit); casting these spells generates a noise of loudness 1 where the spell caster is. The noise level is hard-coded in beam.cc's zap_data array (and setup by zapping()), and is constant regardless of the amount of damage done or the beam's power. Beam-ish spells generates a seperate sound event for each target hit. Spells which miss generate no noise.
Diffstat (limited to 'crawl-ref/source/spl-cast.cc')
-rw-r--r--crawl-ref/source/spl-cast.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index c2cbaa6971..6b4c21bd08 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -1258,9 +1258,13 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail)
const bool normal_cast = crawl_state.prev_cmd == CMD_CAST_SPELL
&& god == GOD_NO_GOD;
+ const int loudness = spell_noise(spell);
+ const bool sound_at_caster = !(flags & SPFLAG_TARGETTING_MASK);
+
// Make some noise if it's actually the player casting.
+ // NOTE: zappy() sets up noise for beams.
if (god == GOD_NO_GOD)
- noisy(spell_noise(spell), you.pos());
+ noisy(sound_at_caster ? loudness : 1, you.pos());
if (allow_fail)
{