private void ResetConfigXpLevels() { PrintWarning("Resetting xp levels!"); configs.options.itemDatas.Clear(); foreach (ItemDefinition itemDefinition in ItemManager.itemList) { if (itemDefinition.Blueprint != null && itemDefinition.Blueprint.isResearchable && !itemDefinition.Blueprint.defaultBlueprint && !blockedBps.Contains(itemDefinition.shortname)) { float score = 0.0f; Rust.Rarity rarity = itemDefinition.Blueprint.rarity; score += 1.19f * (float)rarity; int workbench = itemDefinition.Blueprint.workbenchLevelRequired; score += 6.34f * (float)workbench; int ingredients = itemDefinition.Blueprint.ingredients.Count; score += 0.13f * (float)ingredients; if (score > 14.0f) { score += (float)Math.Pow(1.25f, score - 14.0f) - 1.0f; } ItemData itemData = new ItemData(); itemData.shortName = itemDefinition.shortname; itemData.englishName = itemDefinition.displayName.english; itemData.unlockLevel = (int)Math.Floor(score); itemData.costXP = (int)(0.7f * itemData.unlockLevel + 1.0f); configs.options.itemDatas.Add(itemData); } } Config.WriteObject(configs, true); }
public Skill(ulong level, Rust.Rarity rarityLevel) { Level = level; CurrentRarityLevel = rarityLevel; }