Beispiel #1
0
        public void ModificationToAnAdjustmentAreReflectedInTotalScore()
        {
            var skill     = new Skill("Chew", AbilityScoreTypes.Strength, false);
            var ability   = new AbilityScore(AbilityScoreTypes.Strength, 10);
            var charSkill = new CharacterSkill(skill, ability, false);
            var adj       = new ValueStatModifier("Chew", 0, "Teeth");

            charSkill.AddModifier(adj);
            Assert.Equal(0, charSkill.Score());
            adj.Modifier = 5;
            Assert.Equal(5, charSkill.Score());
        }
Beispiel #2
0
        public void SkillsCanHaveConditionalModifiers()
        {
            var skill     = new Skill("Eat", AbilityScoreTypes.Intelligence, false);
            var ability   = new AbilityScore(AbilityScoreTypes.Intelligence, 10);
            var charSkill = new CharacterSkill(skill, ability, false);
            var adj       = new ConditionalStatModifier(new ValueStatModifier("Eat", 3, "bonus"), "Celery");

            charSkill.AddModifier(adj);
            Assert.Equal(1, charSkill.ConditionalModifiers.Count());
            Assert.Equal(3, charSkill.GetConditionalValue("Celery"));
            Assert.Equal(0, charSkill.Score());
            Assert.Equal("Eat +0 (+3 Celery)", charSkill.ToString());
        }
Beispiel #3
0
        public void SkillsCanHaveAdjustmentsFromTraitsOrFeats()
        {
            var adjust = new ValueStatModifier(
                "Fly",
                2,
                "Bonus");
            var flySkill  = new Skill("Fly", AbilityScoreTypes.Dexterity, false);
            var charSkill = new CharacterSkill(flySkill, new AbilityScore(AbilityScoreTypes.Dexterity, 10), false);

            charSkill.AddModifier(adjust);

            Assert.Equal(2, charSkill.Score());
        }
Beispiel #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());
        }