public static WeaponData createWeaponData(WeaponType type) { ItemQuality quality = randQuality(); float level = randLevel(); int damage = Mathf.RoundToInt(type.damage() * level * qualityMultiplier(quality)); float reloadTime = (type.reloadTime() / level) * (quality == ItemQuality.UNIQUE? 0.6f: quality == ItemQuality.SUPERIOR? 0.8f: 1); WeaponData data = new WeaponData(quality, level, type, damage - type.damageRange(), damage + type.damageRange(), reloadTime); data.initCommons(calculateCost(data), calculateEnergy(data)); return(data); }