public static int GetPerkLineLevel(PerkLine perkLine) { List <Perk> trainedPerksInLine = GetFullPerkMap() .Where(p => p.PerkLine == perkLine) .Where(p => p.IsTrained()) .OrderBy(p => p.Instance) .ToList(); if (trainedPerksInLine.Count == 0) { return(0); } return(trainedPerksInLine.Max(p => p.Level)); }
private Perk(int instance, int templateInstance, int prerequisitePerkInstance, int perkType, int allowedProfessions, int actionInstance, int requiredExperience) { Instance = instance; TemplateInstance = templateInstance; PrerequisitePerkInstance = prerequisitePerkInstance; PerkType = (PerkType)perkType; AllowedProfessions = (ProfessionFlag)allowedProfessions; ActionInstance = actionInstance; RequiredExperience = requiredExperience; //Remaining is not returned by GetFullPerkMap Name = N3EngineClientAnarchy.GetName(new Identity(IdentityType.None, TemplateInstance)); string sanitizedName = Name.Replace(" ", "").Replace("-", "").Replace("'", ""); PerkLine = (PerkLine)Enum.Parse(typeof(PerkLine), sanitizedName); }
public static bool IsTrained(PerkLine perkLine, int level) { return(GetFullPerkMap() .Any(p => p.PerkLine == perkLine && p.Level == level && p.IsTrained())); }