summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-speak.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-11-23 14:15:41 +0100
committerAdam Borowski <kilobyte@angband.pl>2009-11-23 15:04:33 +0100
commit3bea6e2e7aadb7df468b8a00c3a8fb42dde3dfb5 (patch)
treebeb4d7dcd257ffb407f21e9a713bc74b2ec93c97 /crawl-ref/source/mon-speak.cc
parent2d3e3d3d42a7d5efcceaad43b06abe2e026d3346 (diff)
downloadcrawl-ref-3bea6e2e7aadb7df468b8a00c3a8fb42dde3dfb5.tar.gz
crawl-ref-3bea6e2e7aadb7df468b8a00c3a8fb42dde3dfb5.zip
Move _polyd_can_speak() to monsters::can_speak() so others can use it.
Diffstat (limited to 'crawl-ref/source/mon-speak.cc')
-rw-r--r--crawl-ref/source/mon-speak.cc26
1 files changed, 4 insertions, 22 deletions
diff --git a/crawl-ref/source/mon-speak.cc b/crawl-ref/source/mon-speak.cc
index 6d17ec3e11..be75705372 100644
--- a/crawl-ref/source/mon-speak.cc
+++ b/crawl-ref/source/mon-speak.cc
@@ -331,27 +331,6 @@ static std::string _player_ghost_speak_str(const monsters *monster,
return msg;
}
-// If the monster was originally a unique which has been polymorphed into
-// a non-unique, is its current monter type capable of using its old
-// speech?
-static bool _polyd_can_speak(const monsters* monster)
-{
- // Priest and wizard monsters can always speak.
- if (monster->is_priest() || monster->is_actual_spellcaster())
- return (true);
-
- // Silent or non-sentient monsters can't use the original speech.
- if (mons_intel(monster) < I_NORMAL
- || mons_shouts(monster->type) == S_SILENT)
- {
- return (false);
- }
-
- // Does it have the proper vocal equipment?
- const mon_body_shape shape = get_mon_shape(monster);
- return (shape >= MON_SHAPE_HUMANOID && shape <= MON_SHAPE_NAGA);
-}
-
// Returns true if the monster did speak, false otherwise.
// Maybe monsters will speak!
void maybe_mons_speaks (monsters *monster)
@@ -579,7 +558,10 @@ bool mons_speaks(monsters *monster)
}
else
{
- if (!monster->mname.empty() && _polyd_can_speak(monster))
+ // If the monster was originally a unique which has been polymorphed
+ // into a non-unique, is its current monter type capable of using its
+ // old speech?
+ if (!monster->mname.empty() && monster->can_speak())
{
msg = _get_speak_string(prefixes, monster->name(DESC_PLAIN),
monster, no_player, no_foe, no_foe_name,