コード例 #1
0
        public void AddsSneakAttackDiceToComponents()
        {
            var yaml = @"---
dice-stat:
  name: Sneak Attack Dice
  dice: 1d6";

            var sneakAttack = new SneakAttack(yaml.ParseYaml());
            var rogue       = CharacterTestTemplates.Rogue();

            rogue.Add(sneakAttack);
            Assert.NotNull(rogue.Components.FindStat("Sneak Attack Dice"));
            Assert.Equal("1d6", rogue.Components.FindStat <IDiceStatistic>("Sneak Attack Dice").Dice.ToString());
        }
コード例 #2
0
        public void AddingSneakAttackConfiguresASpecialAttack()
        {
            var yaml = @"---
dice-stat:
  name: Sneak Attack Dice
  dice: 1d6";

            var sneakAttack = new SneakAttack(yaml.ParseYaml());
            var rogue       = CharacterTestTemplates.Rogue();

            rogue.Add(sneakAttack);
            var attack = rogue.Offense.Attacks().First(x => x.Name.Contains("Sneak Attack"));

            Assert.Equal(attack.Damage.ToString(), "1d6");
        }