Beispiel #1
0
 public void Init()
 {
     GS.ServerProperties.Properties.DEBUG_LOAD_REGIONS  = "";
     GS.ServerProperties.Properties.DISABLED_REGIONS    = "";
     GS.ServerProperties.Properties.DISABLED_EXPANSIONS = "";
     fakeServer = FakeServer.LoadAndReturn();
 }
Beispiel #2
0
        public void CastSpell_FocusSpellCastAndTicksOnce_AllEventsRemoved()
        {
            var caster = NewFakePlayer();
            var target = NewFakePlayer();
            var spell  = NewFakeSpell();

            spell.fakeIsFocus   = true;
            spell.fakeTarget    = "Realm";
            spell.Duration      = 20;
            spell.fakeFrequency = 20;
            spell.fakeSpellType = "DamageShield";
            spell.fakePulse     = 1;
            var spellHandler    = new SpellHandler(caster, spell, NewSpellLine());
            var gameEventMgrSpy = GameEventMgrSpy.LoadAndReturn();

            FakeServer.LoadAndReturn().FakeServerRules.fakeIsAllowedToAttack = false;

            Assert.IsTrue(spellHandler.CastSpell(target));
            target.fakeRegion.fakeElapsedTime = 2;
            spellHandler.StartSpell(target); //tick
            caster.OnPlayerMove();

            var eventNumberOnCaster = gameEventMgrSpy.GameObjectEventCollection[caster].Count;
            var eventNumberOnTarget = gameEventMgrSpy.GameObjectEventCollection[target].Count;

            Assert.AreEqual(0, eventNumberOnCaster, "Caster has not the right amount of event subscriptions");
            Assert.AreEqual(0, eventNumberOnTarget, "Target has not the right amount of event subscriptions");
        }
 public void SetUp()
 {
     GS.ServerProperties.Properties.DEBUG_LOAD_REGIONS  = "";
     GS.ServerProperties.Properties.DISABLED_REGIONS    = "";
     GS.ServerProperties.Properties.DISABLED_EXPANSIONS = "";
     GS.ServerProperties.Properties.PVE_SPELL_DAMAGE    = 1;
     FakeServer.LoadAndReturn().FakeServerRules.fakeIsAllowedToAttack = true;
 }
Beispiel #4
0
        public void ApplyBuffOnTarget_5ResiPierceOnAnotherPlayer_Has5ResiPierceBaseBuffBonus()
        {
            var caster  = new FakePlayer();
            var target  = new FakePlayer();
            var dbSpell = new DBSpell();

            dbSpell.Value    = 5;
            dbSpell.Target   = "Realm";
            dbSpell.Duration = 10;
            var spell          = new Spell(dbSpell, 0);
            var spellLine      = new SpellLine("", "", "", true);
            var resiPierceBuff = new ResiPierceBuff(caster, spell, spellLine);

            FakeServer.LoadAndReturn().FakeServerRules.fakeIsAllowedToAttack = false;

            resiPierceBuff.ApplyEffectOnTarget(target, 1);

            var actualResiPiercing = target.BaseBuffBonusCategory[eProperty.ResistPierce];

            Assert.AreEqual(5, actualResiPiercing);
        }
Beispiel #5
0
        public void CastSpell_FocusSpell_FiveEventsOnCasterAndOneEventOnTarget()
        {
            var caster = NewFakePlayer();
            var target = NewFakePlayer();
            var spell  = NewFakeSpell();

            spell.fakeIsFocus = true;
            spell.fakeTarget  = "Enemy";
            spell.Duration    = 20;
            var spellHandler    = new SpellHandler(caster, spell, NewSpellLine());
            var gameEventMgrSpy = GameEventMgrSpy.LoadAndReturn();

            FakeServer.LoadAndReturn().FakeServerRules.fakeIsAllowedToAttack = true;
            UtilChanceIsHundredPercent.Enable();

            spellHandler.CastSpell(target);

            var eventNumberOnCaster = gameEventMgrSpy.GameObjectEventCollection[caster].Count;
            var eventNumberOnTarget = gameEventMgrSpy.GameObjectEventCollection[target].Count;

            Assert.AreEqual(5, eventNumberOnCaster, "Caster has not the right amount of event subscriptions");
            Assert.AreEqual(1, eventNumberOnTarget, "Target has not the right amount of event subscriptions");
        }