public bool ModifyRank(bool isLevelUp) { var result = true; if (isLevelUp && Rank != 4) { var currentSkillLevel = TotalSkillModifiers.Where(x => x.Id == Rank).FirstOrDefault(); //finds the current aptidude TotalSkillModifiers.Remove(currentSkillLevel); //removes this Rank += 1; TotalSkillModifiers.Add(World.GetSkillLevelsById(Rank)); //Replace with the next level up. //TotalSkillModifiers.Add(World.SkillLevelsList.FirstOrDefault(x => x.Id == Rank)); result = true; } else { //return a warning? you cannot level up any further result = false; } if (!isLevelUp && Rank != 0) { var currentSkillLevel = TotalSkillModifiers.Where(x => x.Id == Rank).FirstOrDefault(); //finds the current aptidude TotalSkillModifiers.Remove(currentSkillLevel); //removes this Rank -= 1; TotalSkillModifiers.Add(World.GetSkillLevelsById(Rank)); //Replace with the next level up. //TotalSkillModifiers.Add(World.SkillLevelsList.FirstOrDefault(x => x.Id == Rank)); result = true; } return(result); }
//contstructor public InvestigationSkills(int id, string name, string description, double actioncost = 1, int rank = 0, bool isopposedcheck = false) : base(id, name, description, isopposedcheck, actioncost) { TotalSkillModifiers.Add(World.GetSkillLevelsById(rank)); }
//contstructor public SkillsCombat(int id, string name, string description, CharacterStat stat, double actioncost = 1, int rank = 0, bool isopposedcheck = false) : base(id, name, stat, description, isopposedcheck, actioncost) { TotalSkillModifiers.Add(World.GetSkillLevelsById(rank)); }