Esempio n. 1
0
        public void CalculateDamageBase_SpellDamageIs100SourceIsAnimistPetWith100IntAndOwnerWith100Int_ReturnAround119()
        {
            var spell = NewFakeSpell();

            spell.Damage = 100;
            var owner = NewFakePlayer();

            owner.fakeCharacterClass   = new CharacterClassAnimist();
            owner.modifiedIntelligence = 100;
            owner.Level = 50;
            var brain = new FakeControlledBrain();

            brain.fakeOwner = owner;
            GamePet source = new GamePet(brain);

            source.Level        = 50; //temporal coupling through AutoSetStat()
            source.Intelligence = 100;
            var target       = NewFakePlayer();
            var spellLine    = NewSpellLine();
            var spellHandler = new SpellHandler(source, spell, spellLine);

            double actual = spellHandler.CalculateDamageBase(target);

            double expected = 100 * (100 + 200) / 275.0 * (100 + 200) / 275.0;

            Assert.AreEqual(expected, actual, 0.001);
        }
Esempio n. 2
0
        public void CalculateDamageBase_SpellDamageIs100AndCombatStyleEffect_ReturnAround72()
        {
            var spell        = Create.DamageSpell(100);
            var source       = Create.FakePlayer();
            var target       = Create.FakePlayer();
            var spellLine    = new SpellLine(GlobalSpellsLines.Combat_Styles_Effect, "", "", false);
            var spellHandler = new SpellHandler(source, spell, spellLine);

            double actual = spellHandler.CalculateDamageBase(target);

            double expected = 100 * (0 + 200) / 275.0;

            Assert.AreEqual(expected, actual);
        }
Esempio n. 3
0
        public void CalculateDamageBase_SpellDamageIs100SourceIsAnimistWith100Int_ReturnAround109()
        {
            var spell  = Create.DamageSpell(100);
            var source = Create.FakePlayer(new CharacterClassAnimist());

            source.modifiedIntelligence = 100;
            var target       = Create.FakePlayer();
            var spellLine    = new SpellLine("", "", "", false);
            var spellHandler = new SpellHandler(source, spell, spellLine);

            double actual = spellHandler.CalculateDamageBase(target);

            double expected = 100 * (100 + 200) / 275.0;

            Assert.AreEqual(expected, actual, 0.001);
        }
Esempio n. 4
0
        public void CalculateDamageBase_SpellDamageIs100FromGameNPCWithoutOwner_ReturnAround119()
        {
            GameLiving.LoadCalculators(); //temporal coupling and global state
            var spell  = Create.DamageSpell(100);
            var source = Create.FakeNPC();

            source.Level        = 50;
            source.Intelligence = 100;
            var target       = Create.FakePlayer();
            var spellLine    = new SpellLine("", "", "", false);
            var spellHandler = new SpellHandler(source, spell, spellLine);

            double actual = spellHandler.CalculateDamageBase(target);

            double expected = 100 * (100 + 200) / 275.0;

            Assert.AreEqual(expected, actual, 0.001);
        }
Esempio n. 5
0
        public void CalculateDamageBase_SpellDamageIs100SourceIsAnimistPetWith100IntAndOwnerWith100Int_ReturnAround119()
        {
            var spell = Create.DamageSpell(100);
            var owner = Create.FakePlayer(new CharacterClassAnimist());

            owner.modifiedIntelligence = 100;
            owner.Level = 50;
            GamePet source = Create.Pet(owner);

            source.Level        = 50; //temporal coupling through AutoSetStat()
            source.Intelligence = 100;
            var target       = Create.FakePlayer();
            var spellLine    = new SpellLine("", "", "", false);
            var spellHandler = new SpellHandler(source, spell, spellLine);

            double actual = spellHandler.CalculateDamageBase(target);

            double expected = 100 * (100 + 200) / 275.0 * (100 + 200) / 275.0;

            Assert.AreEqual(expected, actual, 0.001);
        }