Пример #1
0
        public void GetHitStep1()
        {
            var attackerLevel = 1;
            var defenderLevel = 1 + Math.Abs(HitHelper.GetHitStep1LevelDiffMin);

            Assert.AreEqual(HitHelper.GetHitStep1CorrectionMin, HitHelper.GetHitStep1(attackerLevel, defenderLevel));
            attackerLevel = 1 + Math.Abs(HitHelper.GetHitStep1LevelDiffMax);
            defenderLevel = 1;
            Assert.AreEqual(HitHelper.GetHitStep1CorrectionMax, HitHelper.GetHitStep1(attackerLevel, defenderLevel));
        }
Пример #2
0
        public void IsHit()
        {
            var attackerLevel = 1;
            var attackerHit   = 100;
            var defenderLevel = 1;
            var defenderHit   = 100;
            var chance        = 100;
            var correction    = HitHelper.GetHitStep1(attackerLevel, defenderLevel);

            correction += HitHelper.GetHitStep2(attackerHit, defenderHit);
            correction  = HitHelper.GetHitStep3(correction);
            var hit = HitHelper.GetHitStep4(chance, correction);

            Assert.AreEqual(hit, HitHelper.IsHit(attackerLevel, attackerHit, defenderLevel, defenderHit, chance));
        }