Esempio n. 1
0
 public override void Execute()
 {
     if (Character.Target == null)
     {
         return;
     }
     Character.MakeAttack(AspectFactory.Attack());
 }
Esempio n. 2
0
        public void AddDefenderConstitution()
        {
            var melee = AspectFactory.Attack();

            melee.AddAssaulterStrength(20);
            melee.AddDefenderConstitution(30);

            Assert.AreEqual(30, melee.CalculateDamage(60));
        }
Esempio n. 3
0
        public void AddAssaulterAccuracy()
        {
            var melee = AspectFactory.Attack();

            melee.AddAssaulterAccuracy(5);
            Assert.AreEqual(95, melee.CalculateHitChance());

            melee.AddAssaulterAccuracy(5);
            Assert.AreEqual(95, melee.CalculateHitChance());
        }
Esempio n. 4
0
        public void AddAttackerCriticalChance()
        {
            var attack = AspectFactory.Attack();

            attack.AddAssaulterCriticalChance(10);
            Assert.AreEqual(10, attack.assaulterCriticalChance);

            attack.AddAssaulterCriticalChance(4);
            Assert.AreEqual(14, attack.assaulterCriticalChance);
        }
Esempio n. 5
0
        public void AddAssaulterIntellect()
        {
            var attack = AspectFactory.Attack();

            attack.AddAssaulterIntellect(10);
            Assert.AreEqual(10, attack.assaulterIntellect);

            attack.AddAssaulterIntellect(15);
            Assert.AreEqual(25, attack.assaulterIntellect);
        }
Esempio n. 6
0
        public void AddDevenderEvasion()
        {
            var melee = AspectFactory.Attack();

            melee.AddDefenderEvasion(5);
            Assert.AreEqual(5, melee.defenderEvasion);

            melee.AddDefenderEvasion(5);
            Assert.AreEqual(10, melee.defenderEvasion);
        }
Esempio n. 7
0
        public void AddDefenderWisdom()
        {
            var attack = AspectFactory.Attack();

            attack.AddDefenderWisdom(10);
            Assert.AreEqual(10, attack.defenderWisdom);

            attack.AddDefenderWisdom(15);
            Assert.AreEqual(25, attack.defenderWisdom);
        }
Esempio n. 8
0
        public void AddDefenderMagicArmor()
        {
            var attack = AspectFactory.Attack();

            attack.AddDefenderMagicArmor(40);
            Assert.AreEqual(240, attack.defenderMagicArmor);

            attack.AddDefenderMagicArmor(50);
            Assert.AreEqual(290, attack.defenderMagicArmor);
        }
Esempio n. 9
0
        public void AddAssaulterMagicAttack()
        {
            var attack = AspectFactory.Attack();

            attack.AddAssaulterMagicAttack(100);
            Assert.AreEqual(300, attack.assaulterMagicAttack);

            attack.AddAssaulterMagicAttack(120);
            Assert.AreEqual(420, attack.assaulterMagicAttack);
        }
Esempio n. 10
0
        public void CheckCritical()
        {
            var attack = AspectFactory.Attack();

            attack.CheckCritical();
            Assert.IsFalse(attack.CriticalHit);

            attack.AddAssaulterCriticalChance(100);
            attack.CheckCritical();
            Assert.IsTrue(attack.CriticalHit);
        }
Esempio n. 11
0
        public void AddAssaulterDexterety()
        {
            var attack = AspectFactory.Attack();

            attack.AddAssaulterDexterety(20);

            Assert.AreEqual(20, attack.assaulterDexterety);

            attack.AddAssaulterDexterety(5);
            Assert.AreEqual(25, attack.assaulterDexterety);
        }
Esempio n. 12
0
        public void AddAssaulterAttack()
        {
            var melee = AspectFactory.Attack();

            melee.AddAssaulterAttack(100);

            Assert.AreEqual(90, melee.CalculateDamage(60));

            melee.AddAssaulterAttack(100);

            Assert.AreEqual(120, melee.CalculateDamage(60));
        }
Esempio n. 13
0
        public void AddDefenderArmor()
        {
            var melee = AspectFactory.Attack();

            melee.AddDefenderArmor(100);

            Assert.AreEqual(40, melee.CalculateDamage(60));

            melee.AddDefenderArmor(100);

            Assert.AreEqual(30, melee.CalculateDamage(60));
        }
Esempio n. 14
0
        public void NormalizeChance()
        {
            var melee = AspectFactory.Attack();

            Assert.AreEqual(5, melee.NormalizeChance(0));
            Assert.AreEqual(5, melee.NormalizeChance(5));
            Assert.AreEqual(10, melee.NormalizeChance(10));
            Assert.AreEqual(50, melee.NormalizeChance(50));
            Assert.AreEqual(90, melee.NormalizeChance(90));
            Assert.AreEqual(95, melee.NormalizeChance(95));
            Assert.AreEqual(95, melee.NormalizeChance(100));
        }
Esempio n. 15
0
        public void IsHitTest()
        {
            var attack = AspectFactory.Attack();

            attack.AddDefenderEvasion(40);

            var hit = attack.Hit();

            Assert.AreEqual(hit, attack.Hit());
            Assert.AreEqual(hit, attack.Hit());
            Assert.AreEqual(hit, attack.Hit());
            Assert.AreEqual(hit, attack.Hit());
            Assert.AreEqual(hit, attack.Hit());
        }
Esempio n. 16
0
        public void DefenderAttackIgnored()
        {
            var stats = AspectFactory.Stats();

            stats.Attack = 100;

            var ev = Event.Create("ch_is_attacking_this",
                                  EventReturnMethod.None,
                                  new EventArg("ch", null),
                                  new EventArg("ch1", null),
                                  new EventArg("attack", AspectFactory.Attack()));

            stats.ReceiveEvent(ev);

            Assert.AreEqual(60, ev["attack"].CalculateDamage(60));
        }
Esempio n. 17
0
        public void TestFixtureSetUp()
        {
            UnityConfigurator.Configure();

            _attack = AspectFactory.Attack();

            _attack.SetAssaulterWeaponBaseDamage(22);

            _attack.AddAssaulterStrength(22);
            _attack.AddAssaulterIntellect(20);
            _attack.AddAssaulterDexterety(21);

            _attack.AddAssaulterAttack(20);
            _attack.AddAssaulterMagicAttack(0);
            _attack.AddAssaulterAccuracy(20);
            _attack.AddAssaulterCriticalChance(15);

            _attack.AddDefenderArmor(15);
            _attack.AddDefenderMagicArmor(0);
            _attack.AddDefenderEvasion(25);

            _attack.AddDefenderConstitution(22);
            _attack.AddDefenderWisdom(21);
        }