public static int SelectWeaponType(ref int maxValue)
{
if (maxValue < 1)
{
return BASE_ITEM_INVALID;
}
int maxGen = maxValue;
if (maxGen > 150)
{
maxGen = 150;
}
List<int> possibleWeapons = new List<int>();
foreach (int weap in DroppableWeapons)
{
if (Pricing.BaseItemValues[weap] <= maxValue)
{
possibleWeapons.Add(weap);
}
}
int selection = possibleWeapons[Generation.rand.Next(possibleWeapons.Count)];
maxValue -= Pricing.BaseItemValues[selection];
return selection;
}