Exemple #1
0
        public void GetHitStep4()
        {
            var correction     = 1;
            var lowLimitChance = 100;

            Assert.IsFalse(HitHelper.GetHitStep4(lowLimitChance, correction));
            correction     = 100;
            lowLimitChance = 1;
            Assert.IsTrue(HitHelper.GetHitStep4(lowLimitChance, correction));
        }
Exemple #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));
        }