예제 #1
0
        public void ClassSkillsGetOneTimeBonus()
        {
            var skill = new Skill(
                "Climb",
                AbilityScoreTypes.Strength,
                false
                );
            var charSkill = new CharacterSkill(skill, new AbilityScore(AbilityScoreTypes.Strength, 10), true);

            charSkill.ClassSkill = true;
            charSkill.AddRank();
            Assert.Equal(4, charSkill.Score());
            charSkill.AddRank();
            Assert.Equal(5, charSkill.Score());
        }
예제 #2
0
        public void AddingPointsToSkillsIncreasesTheirScore()
        {
            var skill = new Skill(
                "Swim",
                AbilityScoreTypes.Strength,
                false
                );
            var charSkill = new CharacterSkill(skill, new AbilityScore(AbilityScoreTypes.Strength, 15), false);
            var baseValue = charSkill.Score();

            charSkill.AddRank();
            Assert.Equal(1, charSkill.Ranks);
            Assert.Equal(baseValue + 1, charSkill.Score());
        }
예제 #3
0
        public void AddingARankAllowsToUseTrainingSkill()
        {
            var skill = new Skill(
                "Spellcraft",
                AbilityScoreTypes.Intelligence,
                true
                );
            var charSkill = new CharacterSkill(skill, new AbilityScore(AbilityScoreTypes.Intelligence, 15), false);

            Assert.False(charSkill.AbleToUse);
            charSkill.AddRank();
            Assert.True(charSkill.AbleToUse);
            Assert.Equal(3, charSkill.Score());
        }
예제 #4
0
        public void ConditionalModifiersAndRanksAreCountedOnlyOnce()
        {
            var skill     = new Skill("Eat", AbilityScoreTypes.Intelligence, false);
            var ability   = new AbilityScore(AbilityScoreTypes.Intelligence, 10);
            var charSkill = new CharacterSkill(skill, ability, false);

            charSkill.AddRank();
            var adj = new ConditionalStatModifier(new ValueStatModifier("Eat", 3, "bonus"), "Celery");

            charSkill.AddModifier(adj);
            Assert.Equal(1, charSkill.ConditionalModifiers.Count());
            Assert.Equal(4, charSkill.GetConditionalValue("Celery"));
            Assert.Equal(1, charSkill.Score());
            Assert.Equal("Eat +1 (+4 Celery)", charSkill.ToString());
        }