Beispiel #1
0
        public void GetHitStep2()
        {
            var attackerHit = 1;
            var defenderHit = 100;
            var correction  = HitHelper.GetHitStep2(attackerHit, defenderHit);

            Assert.AreEqual(HitHelper.GetHitStep2AdditionalCorrectionMin, correction);
            attackerHit = 100;
            defenderHit = 1;
            correction  = HitHelper.GetHitStep2(attackerHit, defenderHit);
            Assert.AreEqual(HitHelper.GetHitStep2AdditionalCorrectionMax, correction);
        }
Beispiel #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));
        }