From f26b0447e7dea6029ba9d125ce1d3d536f95e67a Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Fri, 4 Dec 2009 19:38:59 +1000 Subject: dLua "mark_summoned" wrapper for monsters. --- crawl-ref/source/initfile.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'crawl-ref/source/initfile.cc') 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) -- cgit v1.2.3-54-g00ecf