summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/initfile.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-12-04 19:38:59 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-12-04 19:43:47 +1000
commitf26b0447e7dea6029ba9d125ce1d3d536f95e67a (patch)
tree86b39db11fd3b7e390505b3b8f907f68a1b3dce6 /crawl-ref/source/initfile.cc
parent24fa1749d2dc82f57d5ce04655f8d934ea767d14 (diff)
downloadcrawl-ref-f26b0447e7dea6029ba9d125ce1d3d536f95e67a.tar.gz
crawl-ref-f26b0447e7dea6029ba9d125ce1d3d536f95e67a.zip
dLua "mark_summoned" wrapper for monsters.
Diffstat (limited to 'crawl-ref/source/initfile.cc')
-rw-r--r--crawl-ref/source/initfile.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index be738cfb0c..158112a087 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -39,6 +39,7 @@
#include "player.h"
#include "religion.h"
#include "species.h"
+#include "spl-util.h"
#include "stash.h"
#include "state.h"
#include "stuff.h"
@@ -234,6 +235,28 @@ int str_to_fprop ( const std::string &str)
return (FPROP_NONE);
}
+// Summon types can be any of mon_summon_type (enum.h), or a relevant summoning
+// spell.
+int str_to_summon_type (const std::string &str)
+{
+ if (str == "clone")
+ return (MON_SUMM_CLONE);
+ if (str == "animate")
+ return (MON_SUMM_ANIMATE);
+ if (str == "chaos")
+ return (MON_SUMM_CHAOS);
+ if (str == "miscast")
+ return (MON_SUMM_MISCAST);
+ if (str == "zot")
+ return (MON_SUMM_ZOT);
+ if (str == "wrath")
+ return (MON_SUMM_WRATH);
+ if (str == "aid")
+ return (MON_SUMM_AID);
+
+ return (spell_by_name(str));
+}
+
static std::string _wand_to_str( int weapon )
{
switch (weapon)