Пример #1
0
        public void EquippedArmorIncreasesYourDefenseAndYourFlatFootedDefenseButNotTouchDefense()
        {
            var bag       = new ComponentContainer();
            var inventory = new Inventory();

            bag.Add(inventory);
            bag.Add(new AbilityScores());
            bag.Add(new SizeStats());
            var def = new DefenseStats();

            def.Initialize(bag);
            var startAC    = def.ArmorClass.TotalValue;
            var startFlat  = def.FlatFootedArmorClass.TotalValue;
            var startTouch = def.TouchArmorClass.TotalValue;

            var armor = new Armor();

            armor.ArmorClass = 10;

            inventory.AddGear(armor);
            inventory.EquipItem(armor);
            Assert.Equal(startAC + 10, def.ArmorClass.TotalValue);
            Assert.Equal(startFlat + 10, def.FlatFootedArmorClass.TotalValue);
            Assert.Equal(startTouch, def.TouchArmorClass.TotalValue);
        }
Пример #2
0
        public void ArmorCanLimitTheMaxDexterityBonus()
        {
            var bag       = new ComponentContainer();
            var inventory = new Inventory();

            bag.Add(inventory);
            var abilities = new AbilityScores();

            abilities.SetScore(AbilityScoreTypes.Dexterity, 18);
            bag.Add(abilities);
            bag.Add(new SizeStats());
            var def = new DefenseStats();

            def.Initialize(bag);

            var armor = new Armor();

            armor.MaximumDexterityBonus = 1;
            inventory.EquipItem(armor);

            Assert.Equal(def.MaxDexterityBonus.TotalValue, 1);
            Assert.Equal(def.ArmorClass.TotalValue, 11);
        }