Ejemplo n.º 1
0
    public void StatModifiersCanHaveConditionalModifiers()
    {
        var stat = new BasicStat(10);
        var mod  = new ConditionalStatModifier("vs. Giants", "Skill", 5, "bonus", "Feat");

        stat.AddModifier(mod);
        Assert.AreEqual(10, stat.TotalValue);
        Assert.AreEqual(15, stat.GetConditionalValue("vs. Giants"));
        Assert.AreEqual(1, stat.GetConditions().Count());
        Assert.AreEqual("vs. Giants", stat.GetConditions().First());
    }
Ejemplo n.º 2
0
        public void StatsCanHaveAListOfConditionalModifiers()
        {
            var stat = new BasicStat("TestStat", 10);

            stat.AddModifier(
                new ConditionalStatModifier(new ValueStatModifier("Skill", 3, "bonus"), "vs. Corgis")
                );
            stat.AddModifier(
                new ConditionalStatModifier(new ValueStatModifier("Skill", 3, "bonus"), "vs. Corgis")
                );
            stat.AddModifier(
                new ConditionalStatModifier(new ValueStatModifier("Skill", 3, "bonus"), "Trapfinding")
                );

            Assert.Equal(2, stat.GetConditions().Count());
            Assert.True(stat.GetConditions().Any(x => x == "vs. Corgis"));
            Assert.True(stat.GetConditions().Any(x => x == "Trapfinding"));
        }
Ejemplo n.º 3
0
        public void CastingDoesntBreakConditionalModifiers()
        {
            var stat = new BasicStat("TestStat", 10);
            IValueStatModifier mod = new ConditionalStatModifier(new ValueStatModifier("Attack Bonus", 3, "bonus"), "vs. Thor");

            stat.AddModifier(mod);
            Assert.Equal(1, stat.GetConditions().Count());
            Assert.Equal(10, stat.TotalValue);
            Assert.Equal(13, stat.GetConditionalValue("vs. Thor"));
        }
Ejemplo n.º 4
0
 public IEnumerable <string> GetConditions()
 {
     return(baseRangeAttackBonus.GetConditions());
 }
Ejemplo n.º 5
0
 public IEnumerable <string> GetConditions()
 {
     return(amount.GetConditions());
 }