summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/shout.cc
diff options
context:
space:
mode:
authorPete Hurst <pete@streamuniverse.tv>2013-06-21 20:14:36 +0100
committerPete Hurst <pete@streamuniverse.tv>2013-06-21 20:14:36 +0100
commitf4a2ba3aa3acd31754c7af4afe12397ca8441e7f (patch)
treeacda014a9b602251ccaba1363beae8d73168862d /crawl-ref/source/shout.cc
parent4eb2b4fe26e9279a3b77f0dfc3d07b77b2387c69 (diff)
downloadcrawl-ref-f4a2ba3aa3acd31754c7af4afe12397ca8441e7f.tar.gz
crawl-ref-f4a2ba3aa3acd31754c7af4afe12397ca8441e7f.zip
Handle chimera noises
In monster data it changes to S_RANDOM; this is fine for most purposes for which this is used, e.g. determining whether or not a monster is silent. In handle_monster_shouts itself, the shout type is substituted for the shout of one of the constituent parts. There is a question mark over do_mon_str_replacements -- in most of the places it's called from, chimera are irrelevant, and when it's called from handle_monster_shouts the shout type we already determined is passed in. So there shouldn't be any strange cases, unless perhaps someone made something new that used sentient monsters as chimera components. Would need to refactor mons_shouts to accept a monster instead of a monster_type to make this any better.
Diffstat (limited to 'crawl-ref/source/shout.cc')
-rw-r--r--crawl-ref/source/shout.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/crawl-ref/source/shout.cc b/crawl-ref/source/shout.cc
index f3fcedf6a2..0bfdb5d7f9 100644
--- a/crawl-ref/source/shout.cc
+++ b/crawl-ref/source/shout.cc
@@ -22,6 +22,7 @@
#include "message.h"
#include "misc.h"
#include "mon-behv.h"
+#include "mon-chimera.h"
#include "mon-iter.h"
#include "mon-place.h"
#include "mon-pathfind.h"
@@ -65,6 +66,11 @@ void handle_monster_shouts(monster* mons, bool force)
// choose a random verb and loudness for them.
shout_type s_type = mons_shouts(mons->type, false);
+ // Chimera can take a random shout type from any of their
+ // three components
+ if (mons->type == MONS_CHIMERA)
+ s_type = mons_shouts(random_chimera_part(mons), false);
+
// Silent monsters can give noiseless "visual shouts" if the
// player can see them, in which case silence isn't checked for.
// Muted monsters can't shout at all.