public void ChoosesSkillsBasedOnTheStrategyRecommendation() { var strategy = new WeightedOptionTable <string>(); strategy.AddEntry("Climb", 20); distributor.AssignSkillPoints(skills, strategy, 1, 1); Assert.Equal(1, skills.GetSkill("Climb").Ranks); }
public void SettingAProfessionsSkillAsClassSkillSetsAllProfessionsSkills() { _skillList.Add(new Skill("Profession (Bouncer)", AbilityScoreTypes.Intelligence, false)); _skillList.Add(new Skill("Profession (Turnip Farmer)", AbilityScoreTypes.Intelligence, false)); var ranks = new SkillRanks(_skillList, new AbilityScores()); ranks.SetClassSkill("Profession"); Assert.True(ranks.GetSkill("Profession (Bouncer)").ClassSkill); Assert.True(ranks.GetSkill("Profession (Turnip Farmer)").ClassSkill); }
public void SettingACraftSkillAsClassSkillSetsAllCraftSkills() { _skillList.Add(new Skill("Craft (Shoes)", AbilityScoreTypes.Intelligence, false)); _skillList.Add(new Skill("Craft (Jewelry)", AbilityScoreTypes.Intelligence, false)); var ranks = new SkillRanks(_skillList, new AbilityScores()); ranks.SetClassSkill("Craft"); Assert.True(ranks.GetSkill("Craft (Shoes)").ClassSkill); Assert.True(ranks.GetSkill("Craft (Jewelry)").ClassSkill); }
public void SettingAPerformSkillAsClassSkillSetsAllPerformSkills() { _skillList.Add(new Skill("Perform (Debate)", AbilityScoreTypes.Intelligence, false)); _skillList.Add(new Skill("Perform (Art)", AbilityScoreTypes.Intelligence, false)); var ranks = new SkillRanks(_skillList, new AbilityScores()); ranks.SetClassSkill("Perform"); Assert.True(ranks.GetSkill("Perform (Debate)").ClassSkill); Assert.True(ranks.GetSkill("Perform (Art)").ClassSkill); }
private CharacterSkill ChooseSkill(SkillRanks skills, WeightedOptionTable <string> preferredSkills, int maxLevel) { if (!preferredSkills.IsEmpty) { var option = preferredSkills.ChooseRandomly(); var skill = skills.GetSkill(option); if (skill.Ranks < maxLevel) { return(skill); } else { preferredSkills.Disable(option); } } else { // no preferred skills so just pick class skills var skill = skills.GetSkills().Where( x => x.ClassSkill && x.Ranks < maxLevel ).ToList().ChooseOne(); // Background skills require special attention // In general just take one background skill if (skill.Skill.IsBackgroundSkill) { if (skill.Ranks > 0 || skills.GetSkills().Where(x => x.Skill.IsBackgroundSkill).All(x => x.Ranks == 0)) { return(skill); } } else { return(skill); } } return(null); }
private void AssignClassSkill(SkillRanks skillRanks, CharacterStrategy strategy) { var chooseSkill = classSkillOptions.ChooseOne(); skillRanks.GetSkill(chooseSkill).ClassSkill = true; }