diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-03-12 20:42:42 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-03-12 20:42:42 +0000 |
commit | 6bb8ebbe1d9b86ce5cb492bd0a59cd8b29e831ef (patch) | |
tree | a03f43abc8a2fca032968b7792c6ac6da31fe989 /crawl-ref/source/misc.cc | |
parent | d2037387cfc89ae80196bcbd816a76c910312e7d (diff) | |
download | crawl-ref-6bb8ebbe1d9b86ce5cb492bd0a59cd8b29e831ef.tar.gz crawl-ref-6bb8ebbe1d9b86ce5cb492bd0a59cd8b29e831ef.zip |
Added KFEAT:, KITEM: and KMONS: map directives to allow placing specific
monsters, terrain (named altars, traps, shops) and items all on the same
square.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1028 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r-- | crawl-ref/source/misc.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 94542fff02..8e0845748b 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -2171,3 +2171,31 @@ void run_environment_effects() } } } + +static const char *shop_types[] = { + "weapon", + "armour", + "antique weapon", + "antique armour", + "antiques", + "jewellery", + "wand", + "book", + "food", + "distillery", + "scroll", + "general" +}; + +int str_to_shoptype(const std::string &s) +{ + if (s == "random") + return (SHOP_RANDOM); + + for (unsigned i = 0; i < sizeof(shop_types) / sizeof (*shop_types); ++i) + { + if (s == shop_types[i]) + return (i); + } + return (-1); +} |