summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-stuff.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-12-07 03:04:10 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-12-07 03:04:10 -0800
commite0d592b0a5e032d7d35551907c4af69014e48b10 (patch)
tree8d8d3f1c0d1e75b05b184a04815b66b2ef709139 /crawl-ref/source/mon-stuff.cc
parenta2285dbfa468cca31b2d724db38ccb102c487675 (diff)
downloadcrawl-ref-e0d592b0a5e032d7d35551907c4af69014e48b10.tar.gz
crawl-ref-e0d592b0a5e032d7d35551907c4af69014e48b10.zip
New monster props "speech_func" and "shout_func"
MonPropsMarker can be used to set "speech_func" and "shout_func" on a monster, functions which return a string to be used as the monster's speech/shout message.
Diffstat (limited to 'crawl-ref/source/mon-stuff.cc')
-rw-r--r--crawl-ref/source/mon-stuff.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc
index 0d4c374ce2..fc109c5aee 100644
--- a/crawl-ref/source/mon-stuff.cc
+++ b/crawl-ref/source/mon-stuff.cc
@@ -2509,6 +2509,12 @@ bool monster_polymorph(monsters *monster, monster_type targetc,
monster->flags = flags;
monster->god = god;
+ // Forget various speech/shout Lua functions.
+ monster->props.erase("speech_key");
+ monster->props.erase("speech_prefix");
+ monster->props.erase("speech_func");
+ monster->props.erase("shout_func");
+
// Keep spells for named monsters, but don't override innate ones
// for dragons and the like. This means that Sigmund polymorphed
// into a goblin will still cast spells, but if he ends up as a