public static Item Random(Vec pos, ItemType type, int level) { Item item = new Item(pos, type); // let the level wander level = Rng.WalkLevel(level); // randomly give it a power if (Rng.Int(150) <= level) { PowerType powerType = type.Content.Powers.Random(level, item.Type.Supercategory, item.Type.Subcategory); if (powerType != null) { item.mPower = new Power(powerType); } } return(item); }