summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/initfile.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-01-30 11:59:23 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-01-30 11:59:23 +0000
commit17d8bd89a7e6f4884334c0a8aa38907c43df5f81 (patch)
treeafac3746a2146ac097c8d31426af07db1e7a1170 /crawl-ref/source/initfile.cc
parentb92ab27580d7d18a9458e3478d85ff8b8633106c (diff)
downloadcrawl-ref-17d8bd89a7e6f4884334c0a8aa38907c43df5f81.tar.gz
crawl-ref-17d8bd89a7e6f4884334c0a8aa38907c43df5f81.zip
Added autopickup_exceptions option modeled on NetHack's, so that it's easy to
request stuff to pick up without inscribing with =g. ban_pickup is now semi-deprecated. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@908 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/initfile.cc')
-rw-r--r--crawl-ref/source/initfile.cc34
1 files changed, 26 insertions, 8 deletions
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index 84e41f56f4..d5ae9102d1 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -741,7 +741,8 @@ void game_options::reset_options()
mp_colour.push_back(std::pair<int, int>(100, LIGHTGREY));
mp_colour.push_back(std::pair<int, int>(50, YELLOW));
mp_colour.push_back(std::pair<int, int>(25, RED));
- banned_objects.clear();
+ never_pickup.clear();
+ always_pickup.clear();
note_monsters.clear();
note_messages.clear();
autoinscriptions.clear();
@@ -1802,22 +1803,39 @@ void game_options::read_option_line(const std::string &str, bool runscript)
}
else if (key == "ban_pickup")
{
- append_vector(banned_objects, split_string(",", field));
+ append_vector(never_pickup, split_string(",", field));
+ }
+ else if (key == "autopickup_exceptions")
+ {
+ std::vector<std::string> args = split_string(",", field);
+ for (int i = 0, size = args.size(); i < size; ++i)
+ {
+ const std::string &s = args[i];
+ if (s.empty())
+ continue;
+
+ if (s[0] == '>')
+ never_pickup.push_back( s.substr(1) );
+ else if (s[0] == '<')
+ always_pickup.push_back( s.substr(1) );
+ else
+ never_pickup.push_back( s );
+ }
}
else if (key == "note_items")
{
- append_vector(note_items, split_string(",", field));
+ append_vector(note_items, split_string(",", field));
}
else if (key == "autoinscribe")
{
- std::vector<std::string> thesplit = split_string(":", field);
- autoinscriptions.push_back(
- std::pair<text_pattern,std::string>(thesplit[0],
- thesplit[1]));
+ std::vector<std::string> thesplit = split_string(":", field);
+ autoinscriptions.push_back(
+ std::pair<text_pattern,std::string>(thesplit[0],
+ thesplit[1]));
}
else if (key == "map_file_name")
{
- map_file_name = field;
+ map_file_name = field;
}
else if (key == "hp_colour" || key == "hp_color")
{