public Quality getQuality() { sRandom rand = new sRandom(); List<Quality> typeList = qualities; Quality selectedQuality = typeList[rand.next(0, typeList.Count())]; return selectedQuality; }
public Material getMaterial(int rarity, MatTypes type) { sRandom rand = new sRandom(); List<Material> typeList = mats; typeList = typeList.Where(x => x.rarity == rarity && x.type == type).ToList(); Material selectedMat = typeList[rand.next(0, typeList.Count())]; return selectedMat; }
public Weapon createNewWeapon(int rairty) { sRandom rand = new sRandom(); Weapon w = Instantiate(weapons[rand.next(0, weapons.Count)]); w.mat = mCon.getMaterial(rairty, w.matType); w.quality = qCon.getQuality(); w.weaponName = w.quality.qualityName + " " + w.mat.matName + " " + w.weaponName; w.calculateDamage(); return w; }