Exemplo n.º 1
0
        public Skillshot(DetectionType detectionType, SpellData spellData, int startT, Vector2 start, Vector2 end, Obj_AI_Base unit)
        {
            DetectionType   = detectionType;
            SpellData       = spellData;
            StartTick       = startT;
            Start           = start;
            End             = end;
            MissilePosition = start;
            Direction       = (end - start).Normalized();

            Unit = unit;

            switch (spellData.Type)
            {
            case SkillShotType.SkillshotCircle:
                Circle = new Geometry.Circle(CollisionEnd, spellData.Radius);
                break;

            case SkillShotType.SkillshotLine:
                Rectangle = new Geometry.Rectangle(Start, CollisionEnd, spellData.Radius);
                break;

            case SkillShotType.SkillshotMissileLine:
                Rectangle = new Geometry.Rectangle(Start, CollisionEnd, spellData.Radius);
                break;

            case SkillShotType.SkillshotCone:
                Sector = new Geometry.Sector(
                    start, CollisionEnd - start, spellData.Radius * (float)Math.PI / 180, spellData.Range);
                break;

            case SkillShotType.SkillshotRing:
                Ring = new Geometry.Ring(CollisionEnd, spellData.Radius, spellData.RingRadius);
                break;

            case SkillShotType.SkillshotArc:
                Arc = new Geometry.Arc(start, end,
                                       EvadeManager.SkillShotsExtraRadius + (int)ObjectManager.Player.BoundingRadius);
                break;
            }

            UpdatePolygon();
        }
Exemplo n.º 2
0
 private void SetDrawFlag(int lengthX, int lengthY, int lengthZ, Geometry.Rectangle result)
 {
     foreach (var depthData in _depthDataList)
     {
         for (var x = 0; x < lengthX; x++)
         {
             for (var y = 0; y < lengthY; y++)
             {
                 for (var z = 0; z < lengthZ; z++)
                 {
                     var rectVertex = depthData.ObjectGeometry.Vertices[x, y, z];
                     if (!rectVertex.InRectDepth() || rectVertex.Z < depthData.DepthMap[(int)rectVertex.X, (int)rectVertex.Y])
                     {
                         result.Vertices[x, y, z].DrawFlag = false;
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
        public static bool GetLineAoeCanHit(float spellrange, float spellwidth, AIBaseClient target, HitChance hitChance, Vector3 endRange,
                                            bool boundingRadius = true)
        {
            if (target == null || target.IsDashing())
            {
                return(false);
            }

            var targetPosition = target.PreviousPosition.ToVector2();
            var fromPosition   = ObjectManager.Player.PreviousPosition;
            var width          = spellwidth + (boundingRadius ? target.BoundingRadius * BoundingRadiusMultiplicator : 0);
            var boundradius    = (boundingRadius
                ? target.BoundingRadius * BoundingRadiusMultiplicator
                : target.BoundingRadius);

            var rect = new Geometry.Rectangle(fromPosition, endRange, width);
            var circ = new Geometry.Circle(targetPosition, boundradius);

            return(circ.Points.Select(point => rect.IsInside(point)).FirstOrDefault());
        }
Exemplo n.º 4
0
        public GisSmartTools.Geometry.Rectangle GetRefernectRectangle()
        {
            if (layerlist.Count == 0)
            {
                return(new Geometry.Rectangle(0, 0, 100, 100));
            }
            Geometry.Rectangle rect = new Geometry.Rectangle(Utils.double_max, Utils.double_max, Utils.double_min, Utils.double_min);
            foreach (Layer layer in layerlist)
            {
                if (!layer.visible)
                {
                    continue;
                }

                Geometry.Rectangle layerrect = layer.getEnvelopofLayer();
                // if(layer.featuresource.schema.rs.spetialReference.)///////////////?????????????此处判断数据坐标系统与map坐标系统是否一致,如果不一致,需要转换
                //layerrect = transform...
                ReferenceSystem rs        = layer.getReference();
                RSTransform     transform = RSTransformFactory.getRSTransform(rs, this.srs);
                PointD          minxy     = transform.sourceToTarget(new PointD(layerrect.minX, layerrect.minY));
                PointD          maxxy     = transform.sourceToTarget(new PointD(layerrect.maxX, layerrect.maxY));

                if (minxy.X < rect.minX)
                {
                    rect.minX = minxy.X;
                }
                if (maxxy.X > rect.maxX)
                {
                    rect.maxX = maxxy.X;
                }
                if (minxy.Y < rect.minY)
                {
                    rect.minY = minxy.Y;
                }
                if (maxxy.Y > rect.maxY)
                {
                    rect.maxY = maxxy.Y;
                }
            }
            return(rect);
        }
Exemplo n.º 5
0
        public static void OnUpdate()
        {
            var target = Global.TargetSelector.GetTarget(SpellConfig.Q.Range + 400);

            if (target == null)
            {
                return;
            }

            var dist = target.Distance(Global.Player) - Global.Player.BoundingRadius - target.BoundingRadius;

            if (SpellConfig.Q.Ready &&
                MenuConfig.Harass["Q"].Enabled &&
                Global.Player.ManaPercent() > MenuConfig.Harass["Q"].Value &&
                dist < SpellConfig.Q.Range + 200)
            {
                SpellConfig.CastQ(target);
            }

            if (SpellConfig.W.Ready &&
                MenuConfig.Harass["W"].Enabled &&
                Global.Player.ManaPercent() > MenuConfig.Harass["W"].Value)
            {
                SpellConfig.W.Cast(Global.Player.ServerPosition.Extend(target.ServerPosition, SpellConfig.W.Range));
            }

            if (SpellConfig.E.Ready && MenuConfig.Harass["E"].Enabled && Global.Player.ManaPercent() > MenuConfig.Harass["E"].Value)
            {
                foreach (var soldier in SoldierManager.Soldiers)
                {
                    var rect  = new Geometry.Rectangle(Global.Player.ServerPosition.To2D(), soldier.ServerPosition.To2D(), SpellConfig.E.Width);
                    var count = GameObjects.EnemyHeroes.Count(x => rect.IsInside(x.ServerPosition.To2D()));

                    if (count >= 1)
                    {
                        SpellConfig.E.Cast(soldier.ServerPosition);
                    }
                }
            }
        }
Exemplo n.º 6
0
        private void Form2_Resize(object sender, System.EventArgs e)
        {
            Console.Write("Enter your name: ");

            Control control = (Control)sender;

            // Ensure the Form remains square (Height = Width).
            //if(control.Size.Height != control.Size.Width)
            //{
            //    control.Size = new Size(control.Size.Width, control.Size.Width);
            //}

            var appRect = new Geometry.Rectangle(0f, Size.Width - 10, 0f, Size.Height);
            var boxRect = appRect.RatedRectangle(appRatio);

            systemControls.resizeToWindowRect(boxRect);
            connectionIndicators.resizeToWindowRect(boxRect);
            palleteVisuals.resizeToWindowRect(boxRect);
            servoControls.resizeToWindowRect(boxRect);
            errorBox.resizeToWindowRect(boxRect);
            bg.Reorient((int)boxRect.L, (int)boxRect.T, (int)boxRect.W + 2, (int)boxRect.H);
        }
Exemplo n.º 7
0
        public Fizz()
        {
            Notifications.Add(new Notification("Dao Hung AIO f**k WWapper", "Fizz credit ChewyMoon"));
            Q = new Spell(SpellSlot.Q, 550);
            W = new Spell(SpellSlot.W, Player.GetRealAutoAttackRange());
            E = new Spell(SpellSlot.E, 400);
            R = new Spell(SpellSlot.R, 1300);

            E.SetSkillshot(0.25f, 330, float.MaxValue, false, false, SkillshotType.Circle);
            R.SetSkillshot(0.25f, 80, 1200, false, false, SkillshotType.Line);

            CreateMenu();

            //Utility.HpBarDamageIndicator.DamageToUnit = DamageToUnit;
            //Utility.HpBarDamageIndicator.Enabled = true;

            RRectangle = new Geometry.Rectangle(Player.Position, Player.Position, R.Width);

            Game.OnUpdate += GameOnOnUpdate;
            AIBaseClient.OnProcessSpellCast += ObjAiBaseOnOnProcessSpellCast;
            Drawing.OnDraw += DrawingOnOnDraw;
        }
Exemplo n.º 8
0
        public override PixelBuffer ReadPixels(PixelFormat format, Geometry.Rectangle rect)
        {
            BitmapData data = mImage.LockBits(Interop.Convert(rect), ImageLockMode.ReadOnly,
                                              System.Drawing.Imaging.PixelFormat.Format32bppArgb);

            if (format == PixelFormat.Any)
            {
                format = PixelFormat.BGRA8888;
            }

            PixelBuffer buffer = new PixelBuffer(format, rect.Size);

            byte[] bytes = new byte[4 * rect.Width * rect.Height];

            Marshal.Copy(data.Scan0, bytes, 0, bytes.Length);

            mImage.UnlockBits(data);

            buffer.SetData(bytes, PixelFormat.BGRA8888);

            return(buffer);
        }
Exemplo n.º 9
0
        private Geometry.Rectangle CopyGeometry(int lengthX, int lengthY, int lengthZ)
        {
            var result = new Geometry.Rectangle
            {
                Center   = _mainRectangle.Center,
                Vertices = new DrawablePoint3D[lengthX, lengthY, lengthZ]
            };

            for (var x = 0; x < lengthX; x++)
            {
                for (var y = 0; y < lengthY; y++)
                {
                    for (var z = 0; z < lengthZ; z++)
                    {
                        result.Vertices[x, y, z]          = (DrawablePoint3D)_mainRectangle.Vertices[x, y, z].Clone();
                        result.Vertices[x, y, z].DrawFlag = true;
                    }
                }
            }

            return(result);
        }
Exemplo n.º 10
0
        public IVisio.Shape RenderDoughnut(IVisio.Page page)
        {
            double total_angle = this.Angle;

            if (total_angle == 0.0)
            {
                var p1    = this.GetPointAtRadius(this.Center, this.SectorStartAngle, this.InnerRadius);
                var p2    = this.GetPointAtRadius(this.Center, this.SectorStartAngle, this.Radius);
                var shape = page.DrawLine(p1, p2);
                return(shape);
            }
            else if (total_angle >= System.Math.PI)
            {
                var outer_radius_point = new Geometry.Point(this.Radius, this.Radius);
                var c          = this.Center - outer_radius_point;
                var d          = this.Center + outer_radius_point;
                var outer_rect = new Geometry.Rectangle(c, d);

                var inner_radius_point = new Geometry.Point(this.InnerRadius, this.InnerRadius);
                var a          = this.Center - inner_radius_point - c;
                var b          = this.Center + inner_radius_point - c;
                var inner_rect = new Geometry.Rectangle(a, b);

                var shape = page.DrawOval(outer_rect);
                shape.DrawOval(inner_rect.Left, inner_rect.Bottom, inner_rect.Right, inner_rect.Top);

                return(shape);
            }
            else
            {
                int degree;
                var thickarc = this.GetShapeBezierForDoughnut(out degree);

                // Render the bezier
                var doubles_array = Geometry.Point.ToDoubles(thickarc).ToArray();
                var pie_slice     = page.DrawBezier(doubles_array, (short)degree, 0);
                return(pie_slice);
            }
        }
Exemplo n.º 11
0
        public MainWindow()
            : base(800, 600)
        {
            this.Load                += OnLoad;
            Resize                   += ResizeHandler;
            this.UpdateFrame         += UpdateHandler;
            this.RenderFrame         += RenderHandler;
            this.MouseDown           += OnMouseDown;
            this.MouseUp             += OnMouseUp;
            this.MouseMove           += OnMouseMove;
            this.KeyUp               += OnKeyUp;
            this.Context.SwapInterval = 1;

            _referenceRectangle = new Geometry.Rectangle
            {
                Center = new Vector3(
                    Constants.Constants.HalfRectWidth,
                    Constants.Constants.HalfRectHeight,
                    Constants.Constants.HalfRectDepth),
                Vertices = new DrawablePoint3D[_rectSize, _rectSize, _rectSize]
            };
            for (var x = 0; x < _rectSize; x++)
            {
                for (var y = 0; y < _rectSize; y++)
                {
                    for (var z = 0; z < _rectSize; z++)
                    {
                        _referenceRectangle.Vertices[x, y, z] = new DrawablePoint3D
                        {
                            X        = x,
                            Y        = y,
                            Z        = z,
                            DrawFlag = true,
                        };
                    }
                }
            }
        }
Exemplo n.º 12
0
        public static void OnRender()
        {
            if (Global.Player.IsDead)
            {
                return;
            }

            if (MenuConfig.Drawings["Pred"].Enabled)
            {
                foreach (var shadow in ShadowManager.Shadows.Where(ShadowManager.IsShadow))
                {
                    var enemy = GameObjects.Enemy.FirstOrDefault(x => x.Distance(shadow) <= SpellManager.Q.Range);
                    if (enemy == null)
                    {
                        continue;
                    }

                    var pred     = SpellManager.Q.GetPrediction(enemy, shadow.ServerPosition, shadow.ServerPosition);
                    var extended = shadow.ServerPosition.Extend(pred.CastPosition, SpellManager.Q.Range);
                    var rect     = new Geometry.Rectangle(shadow.ServerPosition.To2D(), extended.To2D(), SpellManager.Q.Width);
                    rect.Draw(Color.Crimson);

                    Render.WorldToScreen(shadow.ServerPosition, out var shadow2D);
                    Render.WorldToScreen(extended, out var extended2D);
                    Render.Line(shadow2D, extended2D, Color.MediumVioletRed);
                }
            }

            if (MenuConfig.Drawings["Range"].Enabled)
            {
                Render.Circle(Global.Player.Position, SpellManager.WCastRange + (Global.Orbwalker.Mode == OrbwalkingMode.Combo ? SpellManager.R.Range : Global.Player.AttackRange), (uint)MenuConfig.Drawings["Segments"].Value, Color.Crimson);
            }

            if (SpellManager.Q.Ready && MenuConfig.Drawings["Q"].Enabled)
            {
                Render.Circle(Global.Player.Position, SpellManager.Q.Range, (uint)MenuConfig.Drawings["Segments"].Value, Color.Cyan);
            }
        }
Exemplo n.º 13
0
        private void CastUlt(Vector3 pos)
        {
            var rectangle = new Geometry.Rectangle(Global.Player.ServerPosition.To2D(), pos.To2D(), _width);

            if (Menu["Collision"].Enabled &&
                GameObjects.EnemyHeroes.Count(x => x.NetworkId != _target.NetworkId && rectangle.IsInside(x.ServerPosition.To2D())) > _maxCollisionObjects ||
                pos.Distance(Global.Player) > _range || pos.Distance(Global.Player) > 15000)
            {
                return;
            }

            Console.WriteLine($"BASEULT SUCCESS | {_target.ChampionName}");

            DelayAction.Queue(1500, () =>
            {
                _lastSeenPosition  = Vector3.Zero;
                _predictedPosition = Vector3.Zero;
            }, new CancellationToken(false));

            _ultimate.Cast(pos);

            Reset();
        }
Exemplo n.º 14
0
        public GenericWarning(string warningText = "ben bir uyarıyım", string buttonText = "onay")
        {
            AutoScaleMode = AutoScaleMode.Font;
            ClientSize    = new Size((int)W, (int)H);
            StartPosition = FormStartPosition.CenterParent;
            Text          = @"Uyarı";

            Geometry.Rectangle v = new Geometry.Rectangle(W * 0.1f, W * 0.9f, 0f, H);

            var a = v.Split(2, 1);

            ModifiedLabel textLabel = new ModifiedLabel("warning text", warningText, 12f);

            textLabel.Reorient(a[0]);
            textLabel.TextAlign = ContentAlignment.MiddleCenter;
            Controls.Add(textLabel);

            ModifiedButton confirm = new ModifiedButton("confirm", buttonText);

            confirm.Reorient(a[1].SubRectangle(new Geometry.Rectangle(0.25f, 0.75f, 0.2f, 0.7f)));
            confirm.ClickAction = Close;
            Controls.Add(confirm);
        }
Exemplo n.º 15
0
        /// <summary>
        ///     Gets the Best position inside the MineField for W Cast.
        /// </summary>
        /// <param name="unit">The unit.</param>
        public Vector3 GetBestBouldersHitPosition(Obj_AI_Base unit)
        {
            var mostBouldersHit    = 0;
            var mostBouldersHitPos = Vector3.Zero;

            foreach (var mine in MineField)
            {
                var unitToMineRectangle = new Geometry.Rectangle((Vector2)unit.Position, (Vector2)unit.Position.Extend((Vector2)mine.Value, WPushDistance), unit.BoundingRadius);
                var bouldersHit         = MineField.Count(o => unitToMineRectangle.IsInside((Vector2)o.Value));
                if (bouldersHit > mostBouldersHit)
                {
                    mostBouldersHit    = bouldersHit;
                    mostBouldersHitPos = mine.Value;

                    if (bouldersHit >= MaxHittableBoulders)
                    {
                        break;
                    }
                }
            }

            return(mostBouldersHitPos);
        }
Exemplo n.º 16
0
        /// <summary>
        /// Initialize the projection.
        /// </summary>
        /// <param name="world">The world that should be transformed to screen coordinates.</param>
        public void Initialize(TRectangle world)
        {
            Level = 1;

            // Bounding box of original (non-normalized) coordinates.
            world_ = world;

            // Scaling factor for normalized coordinates.
            scale_ = Math.Max(world.Width, world.Height);

            // Dimensions in normalized coordinates.
            float ww = (float)(world.Width / scale_);
            float wh = (float)(world.Height / scale_);

            // Add a margin so there's some space around the screen borders.
            float margin = (ww < wh) ? wh * 0.05f : ww * 0.05f;

            int sw = screen.Width;
            int sh = screen.Height;

            float wRatio = ww / wh;
            float sRatio = sw / (float)sh;

            float scale = (sRatio < wRatio) ? (ww + margin) / sw : (wh + margin) / sh;

            // Center in normalized coordinates (left = bottom = 0)
            float centerX = ww / 2;
            float centerY = wh / 2;

            // Get the initial viewport (complete mesh centered on the screen)
            this.world = viewport = new RectangleF(
                centerX - sw * scale / 2,
                centerY - sh * scale / 2,
                sw * scale,
                sh * scale);
        }
Exemplo n.º 17
0
        /// <summary>
        ///     Initializes the menus.
        /// </summary>
        public void Drawings()
        {
            /// <summary>
            ///     Loads the Q drawing.
            /// </summary>
            if (SpellClass.Q.Ready &&
                MenuClass.Drawings["q"].As <MenuBool>().Enabled)
            {
                Render.Circle(UtilityClass.Player.Position, SpellClass.Q.Range, 30, Color.LightGreen);
            }

            /// <summary>
            ///     Loads the Feather linking drawing.
            /// </summary>
            if (!UtilityClass.Player.SpellBook.GetSpell(SpellSlot.E).State.HasFlag(SpellState.Cooldown) &&
                MenuClass.Drawings["feathers"].As <MenuBool>().Enabled)
            {
                foreach (var feather in Feathers)
                {
                    var hitbox = new Geometry.Rectangle((Vector2)UtilityClass.Player.Position, (Vector2)feather.Value, SpellClass.Q.Width);
                    hitbox.Draw(
                        GameObjects.EnemyHeroes.Any(h => hitbox.IsInside((Vector2)h.Position))
                            ? Color.Blue
                            : Color.OrangeRed);
                }
            }

            /// <summary>
            ///     Loads the R drawing.
            /// </summary>
            if (SpellClass.R.Ready &&
                MenuClass.Drawings["r"].As <MenuBool>().Enabled)
            {
                Render.Circle(UtilityClass.Player.Position, SpellClass.R.Range, 30, Color.Red);
            }
        }
Exemplo n.º 18
0
        /// <summary>
        ///     Initializes the menus.
        /// </summary>
        public void Drawings()
        {
            /// <summary>
            ///     Loads the Q range drawing.
            /// </summary>
            if (SpellClass.Q.Ready &&
                MenuClass.Drawings["q"].As <MenuBool>().Enabled)
            {
                Render.Circle(UtilityClass.Player.Position, SpellClass.Q.Range, 30, Color.LightGreen);
            }

            /// <summary>
            ///     Loads the Q path drawing.
            /// </summary>
            if (MenuClass.Drawings["qpath"].As <MenuBool>().Enabled)
            {
                foreach (var axe in Axes)
                {
                    var axeRectangle = new Geometry.Rectangle((Vector2)UtilityClass.Player.Position, (Vector2)axe.Value, 1);
                    Render.Circle(axe.Value, 30f, 30, Color.Yellow);
                    axeRectangle.Draw(Color.Yellow);
                }
            }
        }
Exemplo n.º 19
0
        public ConnectionIndicators(int x, int y, int w, int h, bool asVisual = false)
        {
            _asVisual = asVisual;
            Geometry.Rectangle r = new Geometry.Rectangle(w, h, new Geometry.Point(x, y));

            if (asVisual)
            {
                _plotIndicator = new Indicator("plc", References.ProjectPath + "Images\\placeholder.jpg");
                _plotIndicator.PaintIndicator(Color.Fuchsia);
                Geometry.Rectangle r3 = r.SliceVertical(0f, 1f);
                _plotIndicator.Reorient(r3);
            }
            else
            {
                // indicators
                var a = r.Split(1, 3, 0.05f, 0.05f);
                _plcIndicator = new Indicator("plc", References.ProjectPath + "Images\\plc_on.png");
                _plcIndicator.Reorient(a[0].FittingSquare());
                _barcodeIndicator = new Indicator("barcode", References.ProjectPath + "Images\\barcode_on.png");
                _barcodeIndicator.Reorient(a[1].FittingSquare());
                _taperIndicator = new Indicator("taper", References.ProjectPath + "Images\\tape_on.png");
                _taperIndicator.Reorient(a[2].FittingSquare());
            }
        }
Exemplo n.º 20
0
 public void DecorateTag(string tag, Font tagFont, Rectangle tagPlace, Graphics graphics)
 {
     graphics.DrawString(tag, tagFont, new SolidBrush(Color), (RectangleF)tagPlace);
 }
Exemplo n.º 21
0
        public void resizeToWindowRect(Geometry.Rectangle boxRect)
        {
            var n = makeMyRect(boxRect);

            resize(n);
        }
Exemplo n.º 22
0
 private Geometry.Rectangle makeMyRect(Geometry.Rectangle boxRect)
 {
     return(makeMyRect(boxRect.W, boxRect.H, boxRect.L, boxRect.T));
 }
Exemplo n.º 23
0
 public AreaChart(Geometry.Rectangle rect)
 {
     this.Rectangle  = rect;
     this.DataPoints = new DataPointList();
 }
Exemplo n.º 24
0
 public void FillRectangle(IBrush pBrush, Geometry.Rectangle pRectangle)
 {
 }
Exemplo n.º 25
0
 public void DrawRectangle(IBrush pBrush, Geometry.Rectangle pRectangle, float pLineWidth)
 {
 }
Exemplo n.º 26
0
 public void PushClip(Geometry.Rectangle pRectangle)
 {
 }
Exemplo n.º 27
0
 public void resize(Geometry.Rectangle r)
 {
     _errorHeader.Reorient(new Geometry.Rectangle(r.L, r.L + r.W, r.T, r.T + 30f));
     _errorList.Reorient(new Geometry.Rectangle(r.L, r.L + r.W, r.T + 30f, r.T + r.H - 80f));
     _fixButton.Reorient(new Geometry.Rectangle(r.L + 10f, r.L + r.W - 20f, r.T + r.H - 80f + 10f, r.T + r.H - 14f));
 }
Exemplo n.º 28
0
        private static void AIHeroClient_OnProcessSpellCast(AIBaseClient sender, AIBaseClientProcessSpellCastEventArgs args)
        {
            var targetz   = TargetSelector.GetTarget(W.Range);
            var useW      = ComboMenu["WLowHp"].GetValue <MenuBool>().Enabled;
            var MinHealth = ComboMenu["minHealth"].GetValue <MenuSlider>().Value;

            if (useW && !_Player.IsRecalling() && targetz.IsValidTarget(425))
            {
                if (Player.Instance.HealthPercent <= MinHealth)
                {
                    W.Cast();
                }
            }

            if ((args.Slot == SpellSlot.Q || args.Slot == SpellSlot.W || args.Slot == SpellSlot.E ||
                 args.Slot == SpellSlot.R) && sender.IsEnemy && Q.IsReady() && _Player.Distance(sender) <= args.SData.CastRange && Orbwalker.ActiveMode.HasFlag(OrbwalkerMode.Combo))
            {
                if (args.SData.TargettingType == SpellDataTargetType.Unit || args.SData.TargettingType == SpellDataTargetType.SelfAndUnit || args.SData.TargettingType == SpellDataTargetType.Self)
                {
                    if ((args.Target.NetworkId == Player.Instance.NetworkId && args.Time < 1.5 ||
                         args.End.Distance(Player.Instance.Position) <= Player.Instance.BoundingRadius * 3) &&
                        Evade[args.SData.Name].GetValue <MenuBool>().Enabled)
                    {
                        QEvade();
                    }
                }
                else if (args.SData.TargettingType == SpellDataTargetType.LocationAoe)
                {
                    var castvector =
                        new Geometry.Circle(args.End, args.SData.CastRadius).IsInside(
                            Player.Instance.Position);

                    if (castvector && Evade[args.SData.Name].GetValue <MenuBool>().Enabled)
                    {
                        QEvade();
                    }
                }

                else if (args.SData.TargettingType == SpellDataTargetType.Cone)
                {
                    var castvector =
                        new Geometry.Arc(args.Start, args.End, args.SData.CastConeAngle, args.SData.CastRange)
                        .IsInside(Player.Instance.Position);

                    if (castvector && Evade[args.SData.Name].GetValue <MenuBool>().Enabled)
                    {
                        QEvade();
                    }
                }

                else if (args.SData.TargettingType == SpellDataTargetType.SelfAoe)
                {
                    var castvector =
                        new Geometry.Circle(sender.Position, args.SData.CastRadius).IsInside(
                            Player.Instance.Position);

                    if (castvector && Evade[args.SData.Name].GetValue <MenuBool>().Enabled)
                    {
                        QEvade();
                    }
                }
                else
                {
                    var castvector =
                        new Geometry.Rectangle(args.Start, args.End, args.SData.LineWidth).IsInside(
                            Player.Instance.Position);

                    if (castvector && Evade[args.SData.Name].GetValue <MenuBool>().Enabled)
                    {
                        QEvade();
                    }
                }

                if (args.SData.Name == "yasuoq3w")
                {
                    QEvade();
                }

                if (args.SData.Name == "ZedR")
                {
                    if (Q.IsReady())
                    {
                        QEvade();
                    }
                    else
                    {
                        if (W.IsReady())
                        {
                            W.Cast();
                        }
                    }
                }

                if (args.SData.Name == "KarthusFallenOne")
                {
                    QEvade();
                }

                if (args.SData.Name == "SoulShackles")
                {
                    QEvade();
                }

                if (args.SData.Name == "AbsoluteZero")
                {
                    QEvade();
                }

                if (args.SData.Name == "NocturneUnspeakableHorror")
                {
                    QEvade();
                }
            }
        }
Exemplo n.º 29
0
        public void resizeToWindowRect(Geometry.Rectangle boxRect)
        {
            var myRect = makeMyRect(boxRect);

            resize((int)myRect.Centre().X, (int)myRect.Centre().Y, (int)myRect.W, (int)myRect.H);
        }
Exemplo n.º 30
0
        public void Render(IVisio.Page page)
        {
            this.TotalMarginWidth     = this.Rectangle.Width * (0.10);
            this.TotalBarSpacingWidth = this.Rectangle.Width * (0.10);
            this.TotalBarWidth        = this.Rectangle.Width * (0.80);

            int num_points = this.DataPoints.Count;

            double bar_spacing = num_points > 1 ? this.TotalBarSpacingWidth / num_points : 0.0;
            double bar_width   = num_points > 0 ? this.TotalBarWidth / num_points : this.TotalBarWidth;

            double cur_x = this.Rectangle.Left + (this.TotalMarginWidth / 2.0);

            double max   = this.DataPoints.Select(i => i.Value).Max();
            double min   = this.DataPoints.Select(i => i.Value).Min();
            var    range = ChartUtil.GetValueRangeDistance(min, max);

            double base_y = this.Rectangle.Bottom;

            if (min < 0.0)
            {
                base_y += System.Math.Abs(this.Rectangle.Height * (min / range));
            }

            var category_axis_start_point = new Geometry.Point(this.Rectangle.Left, base_y);
            var category_axis_end_point   = new Geometry.Point(this.Rectangle.Right, base_y);
            var category_axis_shape       = page.DrawLine(category_axis_start_point, category_axis_end_point);

            foreach (var p in this.DataPoints)
            {
                var value_height = System.Math.Abs(this.Rectangle.Height * (p.Value / range));

                Geometry.Point bar_p0;
                Geometry.Point bar_p1;

                if (p.Value >= 0.0)
                {
                    bar_p0 = new Geometry.Point(cur_x, base_y);
                    bar_p1 = new Geometry.Point(cur_x + bar_width, base_y + value_height);
                }
                else
                {
                    bar_p0 = new Geometry.Point(cur_x, base_y - value_height);
                    bar_p1 = new Geometry.Point(cur_x + bar_width, base_y);
                }

                var bar_rect = new Geometry.Rectangle(bar_p0, bar_p1);
                var shape    = page.DrawRectangle(bar_rect);
                p.VisioShape = shape;

                if (p.Label != null)
                {
                    shape.Text = p.Label;
                }

                cur_x += bar_width + bar_spacing;
            }

            var allshapes = this.DataPoints.Select(dp => dp.VisioShape).Where(s => s != null).ToList();

            allshapes.Add(category_axis_shape);

            ChartUtil.GroupShapesIfNeeded(page, allshapes);
        }