summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-10-25 02:50:24 +0200
committerAdam Borowski <kilobyte@angband.pl>2009-10-25 02:59:07 +0200
commitf88b5e0414497f46acbe8865fd4ef34cb6dfe29f (patch)
tree963913c8c973425c49cc0df5204bda5320c9351f /crawl-ref/source/effects.cc
parent5ed2653977325b3ca325890ff9e8a07b357ed421 (diff)
downloadcrawl-ref-f88b5e0414497f46acbe8865fd4ef34cb6dfe29f.tar.gz
crawl-ref-f88b5e0414497f46acbe8865fd4ef34cb6dfe29f.zip
Factor the shields skill while determining handedness during weapon acquirement [FR 2885568]
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 2446309443..0f1ecf5046 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1298,15 +1298,27 @@ static int _acquirement_weapon_subtype()
count = 0;
item_def item_considered;
item_considered.base_type = OBJ_WEAPONS;
+ int want_shield = you.skills[SK_SHIELDS] + 10;
+ int dont_shield = you.experience_level - want_shield + 20;
+ if (dont_shield < 5)
+ dont_shield = 5;
+ // At XL 10, weapons of the handedness you want get weight *2, those of
+ // opposite handedness 1/2, assuming your shields skill is respectively
+ // 0 or equal to the experience level. At XL 25 that's *3.5 .
for (int i = 0; i < NUM_WEAPONS; ++i)
{
item_considered.sub_type = i;
- const int acqweight = property(item_considered, PWPN_ACQ_WEIGHT);
+ int acqweight = property(item_considered, PWPN_ACQ_WEIGHT);
if (!acqweight)
continue;
+ if (hands_reqd(item_considered, you.body_size()) >= HANDS_TWO) // HANDS_DOUBLE > HANDS_TWO
+ acqweight = acqweight * dont_shield / want_shield;
+ else
+ acqweight = acqweight * want_shield / dont_shield;
+
int wskill = range_skill(OBJ_WEAPONS, i);
if (wskill == SK_THROWING)
wskill = weapon_skill(OBJ_WEAPONS, i);