summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-cast.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-13 10:06:40 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-13 10:06:40 +0000
commitf41f4cb56e95d2e36fa21b9504282d9e34eddc75 (patch)
tree81876ac3e22161d7ca0db22df06ce714faf31868 /crawl-ref/source/spl-cast.cc
parent0b90b4a00a7f9ce543bd3af0ac9388e7f1453509 (diff)
downloadcrawl-ref-f41f4cb56e95d2e36fa21b9504282d9e34eddc75.tar.gz
crawl-ref-f41f4cb56e95d2e36fa21b9504282d9e34eddc75.zip
First draft of the spell noisyness system: spells cast by the player and by
wizard/priest monsters now make noise, with the loudness depending upon level and spell disciplines: conjuration spells have a loudness equal to their level, spells containing only air and/or poison equal to 50% of their level (rounded up), and everything else to 75% of the level (rounded up). This undoudedtly needs rebalancing, and a better level+disciplines -> loudness formula. Also, each spell can have it's loudness tweaked from the default via the noise_mod field of the spell_desc field in spl-data.h, for those spells whose desired loudness don't quite fit into whatever formula is used. The messages used to announce a spell have been moved out to source/dat/database/monspell.txt, which uses the same format and conventions as monspeak.txt. So far this has just been used to make invisible wizard/priest monsters give a message to the player if the player can hear them cast, and also to make curse skulls and Murray not "gesture wildly". However, it could be used to give a greater variety of spell announcement messages based upon the spell used or the monster's type/species/genus, and/or to give multi-part messages. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7820 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-cast.cc')
-rw-r--r--crawl-ref/source/spl-cast.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 0a51a49333..738810e43d 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -1067,6 +1067,14 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail)
if (powc == 0)
powc = calc_spell_power( spell, true );
+ const god_type god =
+ (crawl_state.is_god_acting()) ? crawl_state.which_god_acting()
+ : GOD_NO_GOD;
+
+ // Make some noise if it's actually the player casting.
+ if (god == GOD_NO_GOD)
+ noisy( spell_noise(spell), you.pos() );
+
if (allow_fail)
{
int spfl = random2avg(100, 3);
@@ -1136,10 +1144,6 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail)
mprf(MSGCH_DIAGNOSTICS, "Spell #%d, power=%d", spell, powc);
#endif
- const god_type god =
- (crawl_state.is_god_acting()) ? crawl_state.which_god_acting()
- : GOD_NO_GOD;
-
switch (spell)
{
// spells using burn_freeze()