Moved weapon acquirement probability numbers into itemprop.cc.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@980 c06c8d41-db1a-0410-9941-cceddc491573
RZLMIEOHITWGYNVBHDVVWS24YQ5SD5HG3T3JCMIBCD2VA5TEPHCQC
// skipping clubs, knives, blowguns
for (int i = WPN_MACE; i < NUM_WEAPONS; i++)
{
// FIXME: Add a flag to itemprop.cc to do these exclusions
// skipping giant clubs
if (i == WPN_GIANT_CLUB || i == WPN_GIANT_SPIKED_CLUB)
continue;
item_def item_considered;
item_considered.base_type = OBJ_WEAPONS;
for (int i = 0; i < NUM_WEAPONS; ++i)
{
item_considered.sub_type = i;
// "rare" weapons are only considered some of the time...
// still, the chance is higher than actual random creation
int wskill = range_skill(OBJ_WEAPONS, i);
if (wskill == SK_RANGED_COMBAT)
wskill = weapon_skill(OBJ_WEAPONS, i);
if (wskill == skill
&& (i < WPN_EVENINGSTAR || i > WPN_BROAD_AXE
|| (i >= WPN_HAMMER && i <= WPN_SABRE)
|| one_chance_in(4)))
{
count++;
if (one_chance_in( count ))
type_wanted = i;
}
}
if (wskill == skill && random2(count += acqweight) < acqweight)
type_wanted = i;