public int GetCP() { int cpmax = (Class > 0 ? 40 : 0) + JobLevel * 2; int cpused = 0; foreach (CharacterSkill ski in Skills.GetAllItems()) { cpused += ski.Skill.CPCost; } return cpmax - cpused; }