示例#1
0
        public void WillOnlySetSecondaryAbilityOnce()
        {
            AbilitiesManager manager = AbilitiesManager.GetInstance();

            Engine.Player = new PlayerMobile(0x01);

            Engine.InternalPacketSentEvent += ExpectAbilityPacket;

            AbilitiesCommands.SetAbility("secondary", "on");

            bool result = _are.WaitOne(5000);

            if (!result)
            {
                Assert.Fail();
            }

            Assert.AreEqual(AbilityType.Secondary, manager.Enabled);
            Assert.IsTrue(manager.IsSecondaryEnabled);

            Engine.InternalPacketSentEvent -= ExpectAbilityPacket;
            Engine.InternalPacketSentEvent += NotExpectAbilityPacket;

            AbilitiesCommands.SetAbility("secondary", "on");

            Engine.InternalPacketSentEvent -= NotExpectAbilityPacket;

            AbilitiesCommands.ClearAbility();

            Engine.Player = null;
        }
示例#2
0
        public void WontSetAbilitySetOff()
        {
            Engine.Player = new PlayerMobile(0x01);

            Engine.InternalPacketSentEvent += NotExpectAbilityPacket;

            AbilitiesCommands.SetAbility("primary", "off");

            Assert.AreEqual(AbilityType.None, AbilitiesManager.GetInstance().Enabled);

            Engine.Player = null;
        }
        public override void OnResponse(int buttonID, int[] switches)
        {
            switch (buttonID)
            {
            case 1:
                AbilitiesCommands.SetAbility("primary");
                break;

            case 2:
                AbilitiesCommands.SetAbility("secondary");
                break;
            }

            base.OnResponse(buttonID, switches);
        }
示例#4
0
        public override void OnResponse(int buttonID, int[] switches, Dictionary <int, string> textEntries = null)
        {
            switch (buttonID)
            {
            case 1:
                AbilitiesCommands.SetAbility("primary");
                break;

            case 2:
                AbilitiesCommands.SetAbility("secondary");
                break;
            }

            base.OnResponse(buttonID, switches, textEntries);
        }
示例#5
0
        public void WillTogglePrimaryAbility()
        {
            AbilitiesManager manager = AbilitiesManager.GetInstance();

            Engine.Player = new PlayerMobile(0x01);

            manager.Enabled = AbilityType.None;

            Engine.InternalPacketSentEvent += ExpectAbilityPacket;

            AbilitiesCommands.SetAbility("primary");

            bool result = _are.WaitOne(5000);

            if (!result)
            {
                Assert.Fail();
            }

            Assert.AreEqual(AbilityType.Primary, manager.Enabled);
            Assert.IsTrue(manager.IsPrimaryEnabled);

            AbilitiesCommands.SetAbility("primary");

            result = _are.WaitOne(5000);

            if (!result)
            {
                Assert.Fail();
            }

            Assert.AreEqual(AbilityType.None, manager.Enabled);
            Assert.IsFalse(manager.IsPrimaryEnabled);

            Engine.InternalPacketSentEvent -= ExpectAbilityPacket;

            Engine.Player = null;
        }
示例#6
0
        public void WillClearAbilities()
        {
            Engine.Player = new PlayerMobile(0x01);

            AbilitiesManager manager = AbilitiesManager.GetInstance();

            Engine.InternalPacketSentEvent += ExpectAbilityPacket;

            manager.Enabled = AbilityType.Primary;

            AbilitiesCommands.ClearAbility();

            bool result = _are.WaitOne(5000);

            if (!result)
            {
                Assert.Fail();
            }

            Assert.AreEqual(AbilityType.None, manager.Enabled);

            manager.Enabled = AbilityType.Secondary;

            AbilitiesCommands.ClearAbility();

            result = _are.WaitOne(5000);

            if (!result)
            {
                Assert.Fail();
            }

            Assert.AreEqual(AbilityType.None, manager.Enabled);

            Engine.InternalPacketSentEvent -= ExpectAbilityPacket;

            Engine.Player = null;
        }
 public override void Execute()
 {
     AbilitiesCommands.SetAbility("primary", "on");
 }
 public override void Execute()
 {
     AbilitiesCommands.ClearAbility();
 }
 public override void Execute()
 {
     AbilitiesCommands.SetAbility("secondary");
 }
示例#10
0
        public override void OnResponse(int buttonID, int[] switches)
        {
            switch (buttonID)
            {
            case 1:
                AbilitiesCommands.SetAbility("primary");
                break;

            case 2:
                AbilitiesCommands.SetAbility("secondary");
                break;

            case 4:
            {
                Editing = !Editing;
                WeaponAbilitiesGump gump =
                    new WeaponAbilitiesGump(_primaryId, _primaryEnable, _secondaryId, _secondaryEnable);
                gump.SendGump();
                break;
            }

            case 5:
            {
                Options.CurrentOptions.AbilitiesGumpY -= 100;

                if (Options.CurrentOptions.AbilitiesGumpY < 0)
                {
                    Options.CurrentOptions.AbilitiesGumpY = 0;
                }

                ResendGump();
                break;
            }

            case 6:
            {
                Options.CurrentOptions.AbilitiesGumpX -= 100;

                if (Options.CurrentOptions.AbilitiesGumpX < 0)
                {
                    Options.CurrentOptions.AbilitiesGumpX = 0;
                }

                ResendGump();
                break;
            }

            case 7:
            {
                Options.CurrentOptions.AbilitiesGumpX += 100;

                ResendGump();
                break;
            }

            case 8:
            {
                Options.CurrentOptions.AbilitiesGumpY += 100;

                ResendGump();
                break;
            }
            }
        }