コード例 #1
0
        public void TestSpells()
        {
            TestSpell test = new TestSpell();
            Entity caster = new Wizard(new int[] { 10, 10, 10, 10, 10, 10 });
            caster.SetArmor(Armors.halfPlate);
            caster.SetOffHand(Armors.towerShield);
            ArcaneSpell testArcane = new ArcaneSpell();
            DivineSpell testDivine = new DivineSpell();
            bool fizzled = false;
            for(int i = 0; i < 100; i++)
            {
                if(testArcane.DidFizzle(caster))
                {
                    fizzled = true;
                    break;
                }
            }
            Assert.IsTrue(fizzled, "Arcane spells should fizzle");

            fizzled = false;
            for (int i = 0; i < 100; i++)
            {
                if (testDivine.DidFizzle(caster))
                {
                    fizzled = true;
                    break;
                }
            }
            Assert.IsFalse(fizzled, "Divine spells should not fizzle");
        }