short GetMaxLevel() { var costToMax = VCalculator.Calculate(StartingCost, IncrementCost, DesiredLevel, MaxLevelCore); if (costToMax <= PerkCollection.Loadout.RemainingPerkPoints) { return(MaxLevelCore); } return(GetHighestLevelPPCanAfford()); }
short GetHighestLevelPPCanAfford() { var remainingPP = PerkCollection.Loadout.RemainingPerkPoints; for (var i = MaxLevelCore; i >= DesiredLevel; i--) { if (VCalculator.Calculate(StartingCost, IncrementCost, DesiredLevel, i) <= remainingPP) { return(i); } } return(DesiredLevel); }