summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-chimera.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/mon-chimera.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/mon-chimera.cc')
-rw-r--r--crawl-ref/source/mon-chimera.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-chimera.cc b/crawl-ref/source/mon-chimera.cc
index 2d0c4aa3cf..1d87ee6ac0 100644
--- a/crawl-ref/source/mon-chimera.cc
+++ b/crawl-ref/source/mon-chimera.cc
@@ -106,6 +106,12 @@ monster_type get_chimera_part(const monster_info* mi, int partnum)
return MONS_PROGRAM_BUG;
}
+monster_type random_chimera_part(const monster* mon)
+{
+ ASSERT(mon->type == MONS_CHIMERA);
+ return get_chimera_part(mon, random2(3) + 1);
+}
+
bool chimera_is_batty(const monster* mon)
{
return mon->props.exists("chimera_batty");