diff options
author | Chris Campbell <chriscampbell89@gmail.com> | 2014-02-09 16:35:23 +0000 |
---|---|---|
committer | Chris Campbell <chriscampbell89@gmail.com> | 2014-02-09 19:37:45 +0000 |
commit | 2167526f646833d6384f32fd61fe1a753a8df7b2 (patch) | |
tree | 09484faf4e2bbac8a0e4e8fafc931362ac172ff9 /crawl-ref/source/acquire.cc | |
parent | 2b0288b017874b531edc7170ef78c41c9fceec94 (diff) | |
download | crawl-ref-2167526f646833d6384f32fd61fe1a753a8df7b2.tar.gz crawl-ref-2167526f646833d6384f32fd61fe1a753a8df7b2.zip |
Adjust missile acquirement, don't look at inventory items
The check for whether to include needles as a possibility checks stealth
skill rather than the presence of a blowgun. Not sure that this check is
great either but it's an improvement over checking for specific carried
items (since that has been removed from all other types of acquirement).
Diffstat (limited to 'crawl-ref/source/acquire.cc')
-rw-r--r-- | crawl-ref/source/acquire.cc | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/crawl-ref/source/acquire.cc b/crawl-ref/source/acquire.cc index da2662d5a0..3170133187 100644 --- a/crawl-ref/source/acquire.cc +++ b/crawl-ref/source/acquire.cc @@ -524,20 +524,6 @@ static int _acquirement_weapon_subtype(bool divine) return result; } -static bool _have_item_with_types(object_class_type basetype, int subtype) -{ - for (int i = 0; i < ENDOFPACK; i++) - { - const item_def& item = you.inv[i]; - if (item.defined() - && item.base_type == basetype && item.sub_type == subtype) - { - return true; - } - } - return false; -} - static missile_type _acquirement_missile_subtype() { int count = 0; @@ -567,10 +553,11 @@ static missile_type _acquirement_missile_subtype() // Only give needles if they have a blowgun in inventory. vector<pair<missile_type, int> > missile_weights; - missile_weights.push_back(make_pair(MI_DART, 100)); - missile_weights.push_back(make_pair(MI_TOMAHAWK, 100)); + missile_weights.push_back(make_pair(MI_DART, 50)); + missile_weights.push_back(make_pair(MI_TOMAHAWK, 75)); - if (_have_item_with_types(OBJ_WEAPONS, WPN_BLOWGUN)) + // Include the possibility of needles if they have some stealth skill. + if (x_chance_in_y(you.skills[SK_STEALTH], 15)) missile_weights.push_back(make_pair(MI_NEEDLE, 100)); if (you.body_size() >= SIZE_MEDIUM) |