diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-22 18:36:03 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-22 18:36:03 +0000 |
commit | 752b66f301b0bfbc911f3c7f42fcef1d64f7d9ed (patch) | |
tree | 0941572143127178147551f551d751e442f2b295 /crawl-ref/source/randart.cc | |
parent | 461b3e21bdc62c92c0237ac61960489771579fbb (diff) | |
download | crawl-ref-752b66f301b0bfbc911f3c7f42fcef1d64f7d9ed.tar.gz crawl-ref-752b66f301b0bfbc911f3c7f42fcef1d64f7d9ed.zip |
Commit patch by castamir:
* allow placement of fixedarts and damaged/cursed items in vaults
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8699 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/randart.cc')
-rw-r--r-- | crawl-ref/source/randart.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc index 66f724c739..78b82ab0c7 100644 --- a/crawl-ref/source/randart.cc +++ b/crawl-ref/source/randart.cc @@ -1817,6 +1817,18 @@ static const char* _get_fixedart_name(const item_def &item) return (item_type_known(item) ? "Unnamed Artefact" : "buggy fixedart"); } +int get_fixedart_num( const char *name ) +{ + for (unsigned int i = 0; i < ARRAYSZ(fixedarts); ++i) + { + std::string art = fixedarts[i].name; + lowercase(art); + if (replace_all(art, " ", "_") == name) + return fixedarts[i].which; + } + return SPWPN_NORMAL; +} + // which == 0 (default) gives random fixed artefact. // Returns true if successful. bool make_item_fixed_artefact( item_def &item, bool in_abyss, int which ) |