当前位置: 首页>>代码示例>>C#>>正文


C# Armor.RecalculateDamage方法代码示例

本文整理汇总了C#中Armor.RecalculateDamage方法的典型用法代码示例。如果您正苦于以下问题:C# Armor.RecalculateDamage方法的具体用法?C# Armor.RecalculateDamage怎么用?C# Armor.RecalculateDamage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Armor的用法示例。


在下文中一共展示了Armor.RecalculateDamage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HeavyArmorDamageRecalculation

        public void HeavyArmorDamageRecalculation()
        {
            //Test with an amount of 0
            Armor heavy = new Armor(ArmorType.Heavy, 0);

            Assert.AreEqual(80, heavy.RecalculateDamage(Pierce));
            Assert.AreEqual(120, heavy.RecalculateDamage(Siege));
            Assert.AreEqual(90, heavy.RecalculateDamage(Magic));
            Assert.AreEqual(100, heavy.RecalculateDamage(Chaos));

            //Test with an amount of 10
            heavy = new Armor(ArmorType.Heavy, 10);

            Assert.AreEqual(64, heavy.RecalculateDamage(Pierce));
            Assert.AreEqual(111, heavy.RecalculateDamage(Siege));
            Assert.AreEqual(85, heavy.RecalculateDamage(Magic));
            Assert.AreEqual(93, heavy.RecalculateDamage(Chaos));

            //Test with a high amount
            heavy = new Armor(ArmorType.Heavy, 10000);

            Assert.IsTrue(heavy.RecalculateDamage(Pierce) > 0);
            Assert.IsTrue(heavy.RecalculateDamage(Siege) > 0);
            Assert.IsTrue(heavy.RecalculateDamage(Magic) > 0);
            Assert.IsTrue(heavy.RecalculateDamage(Chaos) > 0);
        }
开发者ID:JonasGoldt,项目名称:TDGD_TD,代码行数:26,代码来源:TestArmor.cs

示例2: LightArmorDamageRecalculation

        public void LightArmorDamageRecalculation()
        {
            //Test with an amount of 0
            Armor light = new Armor(ArmorType.Light, 0);

            Assert.AreEqual(120, light.RecalculateDamage(Pierce));
            Assert.AreEqual(80, light.RecalculateDamage(Siege));
            Assert.AreEqual(110, light.RecalculateDamage(Magic));
            Assert.AreEqual(100, light.RecalculateDamage(Chaos));

            //Test with an amount of 10
            light = new Armor(ArmorType.Light, 10);

            Assert.AreEqual(111, light.RecalculateDamage(Pierce));
            Assert.AreEqual(76, light.RecalculateDamage(Siege));
            Assert.AreEqual(99, light.RecalculateDamage(Magic));
            Assert.AreEqual(93, light.RecalculateDamage(Chaos));

            //Test with a high amount
            light = new Armor(ArmorType.Light, 10000);

            Assert.IsTrue(light.RecalculateDamage(Pierce) > 0);
            Assert.IsTrue(light.RecalculateDamage(Siege) > 0);
            Assert.IsTrue(light.RecalculateDamage(Magic) > 0);
            Assert.IsTrue(light.RecalculateDamage(Chaos) > 0);
        }
开发者ID:JonasGoldt,项目名称:TDGD_TD,代码行数:26,代码来源:TestArmor.cs

示例3: UnarmoredArmorDamageRecalculation

        public void UnarmoredArmorDamageRecalculation()
        {
            //Test with an amount of 0
            Armor unarmored = new Armor(ArmorType.Unarmored, 0);

            Assert.AreEqual(150, unarmored.RecalculateDamage(Pierce));
            Assert.AreEqual(120, unarmored.RecalculateDamage(Siege));
            Assert.AreEqual(100, unarmored.RecalculateDamage(Magic));
            Assert.AreEqual(100, unarmored.RecalculateDamage(Chaos));

            //Test with an amount of 10
            unarmored = new Armor(ArmorType.Unarmored, 10);

            Assert.AreEqual(142, unarmored.RecalculateDamage(Pierce));
            Assert.AreEqual(108, unarmored.RecalculateDamage(Siege));
            Assert.AreEqual(97, unarmored.RecalculateDamage(Magic));
            Assert.AreEqual(95, unarmored.RecalculateDamage(Chaos));

            //Test with a high amount
            unarmored = new Armor(ArmorType.Unarmored, 10000);

            Assert.IsTrue(unarmored.RecalculateDamage(Pierce) > 0);
            Assert.IsTrue(unarmored.RecalculateDamage(Siege) > 0);
            Assert.IsTrue(unarmored.RecalculateDamage(Magic) > 0);
            Assert.IsTrue(unarmored.RecalculateDamage(Chaos) > 0);
        }
开发者ID:JonasGoldt,项目名称:TDGD_TD,代码行数:26,代码来源:TestArmor.cs

示例4: MediumArmorDamageRecalculation

        public void MediumArmorDamageRecalculation()
        {
            //Test with an amount of 0
            Armor medium = new Armor(ArmorType.Medium, 0);

            Assert.AreEqual(90, medium.RecalculateDamage(Pierce));
            Assert.AreEqual(110, medium.RecalculateDamage(Siege));
            Assert.AreEqual(80, medium.RecalculateDamage(Magic));
            Assert.AreEqual(100, medium.RecalculateDamage(Chaos));

            //Test with an amount of 10
            medium = new Armor(ArmorType.Medium, 10);

            Assert.AreEqual(81, medium.RecalculateDamage(Pierce));
            Assert.AreEqual(104, medium.RecalculateDamage(Siege));
            Assert.AreEqual(77, medium.RecalculateDamage(Magic));
            Assert.AreEqual(90, medium.RecalculateDamage(Chaos));

            //Test with a high amount
            medium = new Armor(ArmorType.Medium, 10000);

            Assert.IsTrue(medium.RecalculateDamage(Pierce) > 0);
            Assert.IsTrue(medium.RecalculateDamage(Siege) > 0);
            Assert.IsTrue(medium.RecalculateDamage(Magic) > 0);
            Assert.IsTrue(medium.RecalculateDamage(Chaos) > 0);
        }
开发者ID:JonasGoldt,项目名称:TDGD_TD,代码行数:26,代码来源:TestArmor.cs


注:本文中的Armor.RecalculateDamage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。