diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-15 20:32:00 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2009-11-15 20:35:49 +1000 |
commit | 18b78b0ccc1ba5da714e355c94275498a24f3f67 (patch) | |
tree | 94bdede1d563745ec7281eda80fbc08dbf17f5e4 /crawl-ref | |
parent | 8aec1a6bc351ddeee0605028e718436a1804ca62 (diff) | |
download | crawl-ref-18b78b0ccc1ba5da714e355c94275498a24f3f67.tar.gz crawl-ref-18b78b0ccc1ba5da714e355c94275498a24f3f67.zip |
Allow monsters to specify a speech prefix.
Setting monster->props["speech_key"] to a string value will add that
string to the monster speech lookup prefixes.
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/mon-speak.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-speak.cc b/crawl-ref/source/mon-speak.cc index 5d780e8317..7e1cb37394 100644 --- a/crawl-ref/source/mon-speak.cc +++ b/crawl-ref/source/mon-speak.cc @@ -480,6 +480,10 @@ bool mons_speaks(monsters *monster) if (confused) prefixes.push_back("confused"); + // Allows monster speech to be altered slightly on-the-fly. + if (monster->props.exists("speech_key")) + prefixes.push_back(monster->props["speech_key"].get_string()); + const actor* foe = (!crawl_state.arena && monster->wont_attack() && invalid_monster_index(monster->foe)) ? &you : monster->get_foe(); |