diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-09 12:27:58 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-09 12:27:58 +0000 |
commit | 1a2b6ba98ba8ffd482ac94c4e7fa76910c446ffb (patch) | |
tree | e88605e60a9e3f0aac5089a4b4617e87b65a6406 /crawl-ref/source/mapdef.cc | |
parent | fd80ba19d0a9cf334b3dcd34098db1bf9843477f (diff) | |
download | crawl-ref-1a2b6ba98ba8ffd482ac94c4e7fa76910c446ffb.tar.gz crawl-ref-1a2b6ba98ba8ffd482ac94c4e7fa76910c446ffb.zip |
Allow alternating items with "nothing" to control generation chance. Example:
ITEM: heal wounds / nothing
Generation weight can be set with the weight: tag, which defaults to 10, so:
ITEM: weight:1 heal wounds / nothing
generates a potion of heal wounds 1 in 11 times it is used.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@601 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mapdef.cc')
-rw-r--r-- | crawl-ref/source/mapdef.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index 59a6c9289f..0463a13049 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -710,6 +710,12 @@ item_spec item_list::parse_single_spec(std::string s) if (s == "random" || s == "any") return (result); + if (s == "nothing") + { + result.base_type = OBJ_UNASSIGNED; + return (result); + } + // Check for "any objclass" if (s.find("any ") == 0) { |