Exemplo n.º 1
0
 public WSStart(RectangleZone start)
 {
     left  = start.Left;
     right = start.Right;
     up    = start.Up;
     down  = start.Down;
 }
Exemplo n.º 2
0
        public override bool RunQuest(Host host)
        {
            if (!base.RunQuest(host))
            {
                return(false);
            }

            if (getQuest() == null)
            {
                if (!host.movementModule.GpsMove("Headlands_Shatam"))
                {
                    return(false);
                }
                Thread.Sleep(1000);
                host.StartQuest(id);
                Thread.Sleep(1000);
            }

            ArcheBuddy.Bot.Classes.Quest quest = getQuest();

            if (!checkQuestCompletedOrAccepted(3661))
            {
                return(false);
            }

            if (quest != null && quest.status == QuestStatus.Accepted)
            {
                Zone zone = new RectangleZone(16751.24, 8470.07, 16608.87, 8527.43);
                if (!host.movementModule.GpsMove("Quest_3663_1"))
                {
                    return(false);
                }
                host.farmModule.SetFarmMobs(zone, new uint[] { 2916 });
                while (host.farmModule.farmState == Modules.FarmState.Enabled && quest.status == QuestStatus.Accepted)
                {
                    Thread.Sleep(100);
                }
                host.farmModule.StopFarm();
                Thread.Sleep(1000);
            }

            if (!checkQuestCompletedOrPerfomed(3661))
            {
                return(false);
            }

            if (quest != null && quest.status == QuestStatus.Performed)
            {
                if (!host.movementModule.GpsMove("Headlands_Shatam"))
                {
                    return(false);
                }
                Thread.Sleep(1000);
                host.CompleteQuest(id);
                Thread.Sleep(1000);
            }

            return(true);
        }
Exemplo n.º 3
0
        public void RectangleZoneSizeTest()
        {
            RectangleZone zone = new RectangleZone(4, 2, 1, 4);

            Assert.AreEqual(zone.AreaSize(), 12);
            zone = new RectangleZone(3, 5, 6, 1);
            Assert.AreEqual(zone.AreaSize(), 18);
        }
Exemplo n.º 4
0
        public void ZoneTest()
        {
            DiscreteCoordinates coords = new DiscreteCoordinates(1, 2);
            Zone z1 = new RectangleZone(4, 5, 5, 6);
            Zone z2 = new RectangleZone(-1, 7, -3, 8);

            Assert.IsFalse(z1.IsInZone(coords));
            Assert.IsTrue(z2.IsInZone(coords));
        }
Exemplo n.º 5
0
        /// <summary>
        /// 在物理世界创建一个矩形区域作用力
        /// </summary>
        /// <param name="world">物理世界</param>
        /// <param name="particleForceGenerator">作用力发生器</param>
        /// <param name="x1"></param>
        /// <param name="y1"></param>
        /// <param name="x2"></param>
        /// <param name="y2"></param>
        /// <returns></returns>
        public static RectangleZone CreateRectangleZone(
            this World world,
            ParticleForceGenerator particleForceGenerator,
            double x1,
            double y1,
            double x2,
            double y2)
        {
            var zone = new RectangleZone(x1, y1, x2, y2);

            return(world.CreateZone(zone, particleForceGenerator));
        }
Exemplo n.º 6
0
        public override bool RunQuest(Host host)
        {
            if (!base.RunQuest(host))
                return false;

            if (getQuest() == null)
            {
                if (!host.movementModule.GpsMove("Headlands_Shatam")) return false;
                Thread.Sleep(1000);
                host.StartQuest(id);
                Thread.Sleep(1000);
            }

            ArcheBuddy.Bot.Classes.Quest quest = getQuest();

            if (!checkQuestCompletedOrAccepted(3661))
                return false;

            if (quest != null && quest.status == QuestStatus.Accepted)
            {
                Zone zone = new RectangleZone(16751.24, 8470.07, 16608.87, 8527.43);
                if (!host.movementModule.GpsMove("Quest_3663_1")) return false;
                host.farmModule.SetFarmMobs(zone, new uint[] { 2916 });
                while (host.farmModule.farmState == Modules.FarmState.Enabled && quest.status == QuestStatus.Accepted)
                    Thread.Sleep(100);
                host.farmModule.StopFarm();
                Thread.Sleep(1000);
            }

            if (!checkQuestCompletedOrPerfomed(3661))
                return false;

            if (quest != null && quest.status == QuestStatus.Performed)
            {
                if (!host.movementModule.GpsMove("Headlands_Shatam")) return false;
                Thread.Sleep(1000);
                host.CompleteQuest(id);
                Thread.Sleep(1000);
            }

            return true;
        }
Exemplo n.º 7
0
        public WSStartGame(Field f)
        {
            characters = new List <WSCharacter>();
            traps      = new List <WSTrap>();
            field      = new WSField(f);
            List <Character> chars = f.CharacterList;
            Dictionary <Modificator, int> trapList = f.TrapList;
            RectangleZone start  = (RectangleZone)f.StartZone;
            RectangleZone finish = (RectangleZone)f.FinishZone;

            for (int i = 0; i < chars.Count; i++)
            {
                characters.Add(new WSCharacter(chars[i]));
            }
            foreach (var trap in trapList)
            {
                traps.Add(new WSTrap(trap.Key, trap.Value));
            }
            this.start  = new WSStart(start);
            this.finish = new WSFinish(finish);
        }
Exemplo n.º 8
0
        public static Field GenerateSimpleField(INotifier notifier)
        {
            Field field = new Field(notifier);

            //field.CreateEmptyField(10, 10);
            field.CreateTestField();

            Zone start  = new RectangleZone(3, 1, 1, 6);
            Zone finish = new RectangleZone(7, 7, 4, 4);

            field.SetStartFinish(start, finish);

            Random r            = new Random();
            int    bombCount    = r.Next(1, 3);
            int    pitfallCount = r.Next(2, 3);

            field.InitializeNewTrap(Modificator.Ice, bombCount);
            field.InitializeNewTrap(Modificator.Pitfall, pitfallCount);

            return(field);
        }
Exemplo n.º 9
0
        public void TestTryApplyTo()
        {
            var pIn = new Particle
            {
                Position = new Vector2D(2, 3),
                Mass     = 1
            };
            var pOut = new Particle
            {
                Position = new Vector2D(6, 6),
                Mass     = 1
            };
            var zone = new RectangleZone(0, 0, 5, 5);

            zone.Add(new ParticleConstantForce(new Vector2D(5, 0)));

            zone.TryApplyTo(pIn, 1 / 60.0);
            zone.TryApplyTo(pOut, 1 / 60.0);
            pIn.Update(1 / 60.0);
            pOut.Update(1 / 60.0);

            Assert.AreEqual(new Vector2D(5, 0), pIn.Acceleration);
            Assert.AreEqual(new Vector2D(0, 0), pOut.Acceleration);
        }
Exemplo n.º 10
0
        public void IsNotInZoneTest()
        {
            RectangleZone zone = new RectangleZone(1, 4, 1, 4);

            Assert.IsFalse(zone.IsInZone(10, 12));
        }
Exemplo n.º 11
0
        public void IsInZoneTest()
        {
            RectangleZone zone = new RectangleZone(1, 4, 1, 4);

            Assert.IsTrue(zone.IsInZone(3, 2));
        }
        public ViewportControl( )
            : base()
        {
            Camera = new CameraEd( this );

            _selectionBox = new RectangleZone( Color.White, 0, 0, 1, 1 );
            _selectionBox.BorderColor = Consts.Viewport.ACTOR_SELECTION_BORDER_COLOR;
            _selectionBox.FillColor = Consts.Viewport.ACTOR_SELECTION_COLOR;

            _selectionBlueprint = new RectangleZone( Color.White, 0, 0, 1, 1 );
            _selectionBlueprint.BorderColor = Consts.Viewport.ACTOR_SELECTION_BLUEPRINT_BORDER_COLOR;
            _selectionBlueprint.FillColor = Consts.Viewport.ACTOR_SELECTION_BLUEPRINT_COLOR;

            MouseDown += new MouseEventHandler( ViewportMouseDown );
            MouseMove += new MouseEventHandler( ViewportMouseMove );
            MouseUp += new MouseEventHandler( ViewportMouseUp );
            //KeyPress += new KeyPressEventHandler( ViewportKeyPress );
        }
Exemplo n.º 13
0
 public WSFinish(RectangleZone finish)
 {
     xpos = finish.Left;
     ypos = finish.Up;
 }