コード例 #1
0
        protected override void Update(GameTime gameTime)
        {
            Update_Frame();

            Debug.Add(string.Format("CurrentFrameIntervalIndex: {0}/{1}", CurrentFrameIntervalIndex, (FrameIntervals.Length - 1)));
            Debug.Add(string.Format("IsRepeating: {0} ({1}/{2})", (isRepeating ? "Yes" : "No"), CurrentRepeatCount, (RepeatCount == REPEAT_FOREVER ? "~" : RepeatCount.ToString())));
        }
コード例 #2
0
        public void Update(GameTime gameTime, bool startIfNeeded = true)
        {
            if (IsComplete)
            {
                return;
            }
            else if (!IsRunning)
            {
                if (startIfNeeded)
                {
                    Start(gameTime);
                }
                else
                {
                    return;
                }
            }

            LastGameTime    = CurrentGameTime;
            CurrentGameTime = gameTime.TotalGameTime;

            Debug.Add(LogName);
            Update(gameTime);

            if (IsComplete && OnComplete != null)
            {
                IsRunning = false;
                OnComplete();
            }
        }
コード例 #3
0
 public void AddDebug(string key, string value)
 {
     Debug.Add(new
     {
         key   = key,
         value = value
     });
 }
コード例 #4
0
        public void WriteDebug(string text)
        {
            _statusMessage = text;
            CheckForCancellation();

            if (Debug.IsOpen && Debug.Count < MaxRecords)
            {
                Debug.Add(new DebugRecord(text));
            }
        }
コード例 #5
0
ファイル: FoxUIElements.cs プロジェクト: filgreen3/MonoEmpty
        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);
            Debug.Add(this, Rect.Location);
            var child = GetChild();

            for (int i = 0; i < child.Length; i++)
            {
                Debug.Add(this, child[i].Rect.Location);
            }
        }
コード例 #6
0
ファイル: FoxUIElements.cs プロジェクト: filgreen3/MonoEmpty
        public override void Draw(SpriteBatch spriteBatch)
        {
            if (Font == null)
            {
                Font = Debug.DefaultFont;
            }
            if (text == null)
            {
                text = "Text";
            }

            Debug.Add(this, Position.ToString());
            Debug.Add(this, LocalPosition + "Raw");
            spriteBatch.DrawString(Font, text, Position - new Vector2(text.Length * 4, 0), FontColor);
        }
コード例 #7
0
ファイル: Game1.cs プロジェクト: filgreen3/MonoEmpty
        protected override void Update(GameTime gameTime)
        {
            camera.UpdateCamera(GraphicsDevice.Viewport);
            inputOffset.X = camera.Transform.Translation.X;
            inputOffset.Y = camera.Transform.Translation.Y;

            Debug.Add(this, inputOffset);

            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            GameCenter.Update();
            UIManager.UpdateUI();

            base.Update(gameTime);
        }
コード例 #8
0
        public void AddDebug(string iValue)
        {
            if (Debug == null || string.IsNullOrEmpty(iValue))
            {
                return;
            }
            var isExist = false;

            foreach (var loop in Debug)
            {
                if (iValue.Equals(loop) != true)
                {
                    continue;
                }
                isExist = true;
                break;
            }
            if (isExist == false)
            {
                Debug.Add(iValue);
            }
        }
コード例 #9
0
        private void Update_Y()
        {
            if (!IsCompleteY && YPerSecond != 0)
            {
                var yPerSecondFactor = GetPerSecondFactor(yEasings, CurrentYPercent);
                var newCurrentY      = CurrentY + (float)(currentToLastGameTimeDelta * YPerSecond * yPerSecondFactor);

                Debug.Add("yPerSecondFactor: " + yPerSecondFactor);
                Debug.Add("newCurrentY: " + newCurrentY);

                if (YPerSecond > 0)
                {
                    CurrentY = Math.Min(newCurrentY, EndY);
                }
                else if (YPerSecond < 0)
                {
                    CurrentY = Math.Max(newCurrentY, EndY);
                }

                Debug.Add("CurrentY: " + CurrentY);

                IsCompleteY = (CurrentY == EndY);
            }
        }
コード例 #10
0
        private void Update_X()
        {
            if (!IsCompleteX && XPerSecond != 0)
            {
                var xPerSecondPercent = GetPerSecondFactor(xEasings, CurrentXPercent);
                var newCurrentX       = CurrentX + (float)(currentToLastGameTimeDelta * XPerSecond * xPerSecondPercent);

                Debug.Add("XPerSecondPercent: " + xPerSecondPercent);
                Debug.Add("newCurrentX: " + newCurrentX);

                if (XPerSecond > 0)
                {
                    CurrentX = Math.Min(newCurrentX, EndX);
                }
                else if (XPerSecond < 0)
                {
                    CurrentX = Math.Max(newCurrentX, EndX);
                }

                Debug.Add("CurrentX: " + CurrentX);

                IsCompleteX = (CurrentX == EndX);
            }
        }
コード例 #11
0
ファイル: Program.cs プロジェクト: volder1/EloBuddy
        /// <summary>
        /// Load when game starts.
        /// </summary>
        /// <param name="args"></param>
        private static void Loading_OnLoadingComplete(EventArgs args)
        {
            // Checks if Player is Teemo
            if (Player.Instance.BaseSkinName != ChampionName)
            {
                return;
            }

            Bootstrap.Init(null);

            Q = new Spell.Targeted(SpellSlot.Q, 680);
            W = new Spell.Active(SpellSlot.W);
            E = new Spell.Active(SpellSlot.E);
            R = new Spell.Skillshot(SpellSlot.R, 300, SkillShotType.Circular, 500, 1000, 120);

            // Menu
            PandaTeemo = MainMenu.AddMenu("PandaTeemo", "PandaTeemo");
            PandaTeemo.AddGroupLabel("This addon is made by KarmaPanda and should not be redistributed in any way.");
            PandaTeemo.AddGroupLabel(
                "Any unauthorized redistribution without credits will result in severe consequences.");
            PandaTeemo.AddGroupLabel("Thank you for using this addon and have a fun time!");

            // Combo Menu
            ComboMenu = PandaTeemo.AddSubMenu("Combo", "Combo");
            ComboMenu.AddGroupLabel("Combo Settings");
            ComboMenu.Add("qcombo", new CheckBox("Use Q in Combo"));
            ComboMenu.Add("wcombo", new CheckBox("Use W in Combo"));
            ComboMenu.Add("rcombo", new CheckBox("Kite with R in Combo"));
            ComboMenu.Add("useqADC", new CheckBox("Use Q only on ADC during Combo", false));
            ComboMenu.Add("wCombat", new CheckBox("Use W if enemy is in range only"));
            ComboMenu.Add("rCharge", new Slider("Charges of R before using R", 2, 1, 3));
            ComboMenu.Add("checkCamo", new CheckBox("Prevents combo being activated while stealth in brush", false));

            // Harass Menu
            HarassMenu = PandaTeemo.AddSubMenu("Harass", "Harass");
            HarassMenu.AddGroupLabel("Harass Settings");
            HarassMenu.Add("qharass", new CheckBox("Harass with Q"));

            // LaneClear Menu
            LaneClearMenu = PandaTeemo.AddSubMenu("LaneClear", "LaneClear");
            LaneClearMenu.AddGroupLabel("LaneClear Settings");
            LaneClearMenu.Add("qclear", new CheckBox("LaneClear with Q", false));
            LaneClearMenu.Add("qManaManager", new Slider("Q Mana Manager", 50));
            LaneClearMenu.Add("attackTurret", new CheckBox("Attack Turret"));
            LaneClearMenu.Add("attackWard", new CheckBox("Attack Ward"));
            LaneClearMenu.Add("rclear", new CheckBox("LaneClear with R"));
            LaneClearMenu.Add("minionR", new Slider("Minion for R", 3, 1, 4));

            // JungleClear Menu
            JungleClearMenu = PandaTeemo.AddSubMenu("JungleClear", "JungleClear");
            JungleClearMenu.AddGroupLabel("JungleClear Settings");
            JungleClearMenu.Add("qclear", new CheckBox("JungleClear with Q"));
            JungleClearMenu.Add("rclear", new CheckBox("JungleClear with R"));
            JungleClearMenu.Add("qManaManager", new Slider("Q Mana Manager", 25));

            // Interrupter && Gapcloser
            InterruptMenu = PandaTeemo.AddSubMenu("Interrupt / Gapcloser", "Interrupt");
            InterruptMenu.AddGroupLabel("Interruptter and Gapcloser Setting");
            InterruptMenu.Add("intq", new CheckBox("Interrupt with Q"));
            InterruptMenu.Add("gapR", new CheckBox("Gapclose with R"));

            // KillSteal Menu
            KillStealMenu = PandaTeemo.AddSubMenu("KillSteal", "KSMenu");
            KillStealMenu.AddGroupLabel("KillSteal Settings");
            KillStealMenu.Add("KSQ", new CheckBox("KillSteal with Q"));
            KillStealMenu.Add("KSR", new CheckBox("KillSteal with R"));

            // Flee Menu
            FleeMenu = PandaTeemo.AddSubMenu("Flee Menu", "Flee");
            FleeMenu.AddGroupLabel("Flee Settings");
            FleeMenu.Add("w", new CheckBox("Use W while Flee"));
            FleeMenu.Add("r", new CheckBox("Use R while Flee"));
            FleeMenu.Add("rCharge", new Slider("Charges of R before using R", 2, 1, 3));

            // Drawing Menu
            DrawingMenu = PandaTeemo.AddSubMenu("Drawing", "Drawing");
            DrawingMenu.AddGroupLabel("Drawing Settings");
            DrawingMenu.Add("drawQ", new CheckBox("Draw Q Range"));
            DrawingMenu.Add("drawR", new CheckBox("Draw R Range"));
            DrawingMenu.Add("colorBlind", new CheckBox("Colorblind Mode", false));
            DrawingMenu.Add("drawautoR", new CheckBox("Draw Important Shroom Areas"));
            DrawingMenu.Add("DrawVision", new Slider("Shroom Vision", 1500, 2500, 1000));

            // Debug Menu
            Debug = PandaTeemo.AddSubMenu("Debug", "debug");
            Debug.AddGroupLabel("Debug Settings");
            Debug.Add("debugdraw", new CheckBox("Draw Coords", false));
            Debug.Add("x", new Slider("Where to draw X", 500, 0, 3840));
            Debug.Add("y", new Slider("Where to draw Y", 500, 0, 2160));
            Debug.Add("debugpos", new CheckBox("Draw Custom Shroom Locations Coordinates"));

            // Misc
            MiscMenu = PandaTeemo.AddSubMenu("Misc", "Misc");
            MiscMenu.AddGroupLabel("Misc Settings");
            MiscMenu.Add("autoQ", new CheckBox("Automatic Q", false));
            MiscMenu.Add("autoW", new CheckBox("Automatic W", false));
            MiscMenu.Add("autoR", new CheckBox("Auto Place Shrooms in Important Places"));
            MiscMenu.Add("rCharge", new Slider("Charges of R before using R in AutoShroom", 2, 1, 3));
            MiscMenu.Add("autoRPanic", new KeyBind("Panic Key for Auto R", false, KeyBind.BindTypes.HoldActive, 84));
            MiscMenu.Add("customLocation", new CheckBox("Use Custom Location for Auto Shroom (Requires Reload)"));
            MiscMenu.AddSeparator();
            MiscMenu.Add("checkAA", new CheckBox("Subtract Range for Q (checkAA)"));
            MiscMenu.Add("checkaaRange", new Slider("How many to subtract from Q Range (checkAA)", 100, 0, 180));

            // Events
            Game.OnTick += Game_OnTick;
            Interrupter.OnInterruptableSpell += Interrupter_OnInterruptableSpell;
            Gapcloser.OnGapcloser            += Gapcloser_OnGapcloser;
            Orbwalker.OnPreAttack            += Orbwalker_OnPreAttack;
            Drawing.OnDraw += Drawing_OnDraw;
            Obj_AI_Base.OnProcessSpellCast += Obj_AI_Base_OnProcessSpellCast;

            Chat.Print("PandaTeemo EloBuddy Edition Loaded by KarmaPanda", Color.LightBlue);

            // Loads ShroomPosition
            Handler         = new FileHandler();
            ShroomPositions = new ShroomTables();
        }
コード例 #12
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            gameState.Update();

            if (gameState.CurrentKeyboardState.IsKeyDown(Keys.Escape) && OnEscape != null)
            {
                OnEscape();
                return;
            }

            if (!this.gameState.IsConnected)
            {
                return;
            }

            if (gameState.CreateEffect)
            {
                gameState.CreateEffect = false;

                if (this.effect != null)
                {
                    this.effect.Dispose();
                }

                var aspect = (float)this.gameState.ActualClientWidth / (float)this.gameState.ActualClientHeight;
                effect = new BasicEffect(GraphicsDevice)
                {
                    World              = Matrix.Identity,
                    View               = Matrix.CreateLookAt(new Vector3(0, 0, 1), Vector3.Zero, Vector3.Up),
                    Projection         = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, aspect, 1, 100),
                    VertexColorEnabled = true
                };
            }

            // TODO: This stinks, because we need to check the condition every single update... Have to do this until I figure out how to post to the Game thread.
            if (gameState.UpdateTitle)
            {
                gameState.UpdateTitle            = false;
                SharedResources.GameWindow.Title = string.Format("DnDCS Client - Connected to {0}:{1}", gameState.Connection.Address, gameState.Connection.Port);
            }

            // TODO: This is the biggest piece of garbage I've written for this entire thing. Currently disabled because I can't stand it.
            if (gameState.ConsumeFogUpdates)
            {
                gameState.ConsumeFogUpdates = false;
                FogUpdate[] newFogUpdates;
                lock (fogUpdatesLock)
                {
                    newFogUpdates = this.fogUpdates.ToArray();
                    this.fogUpdates.Clear();
                }

                using (var g = System.Drawing.Graphics.FromImage(gameState.FogImage))
                {
                    // Draw all Fog Updates into the Bitmap.
                    foreach (var newFogUpdate in newFogUpdates)
                    {
                        g.FillPolygon((newFogUpdate.IsClearing) ? System.Drawing.Brushes.White : System.Drawing.Brushes.Black, newFogUpdate.Points.Select(p => new System.Drawing.Point(p.X, p.Y)).ToArray());
                    }

                    // Push the Bitmap into a Texture2D instance
                    using (var ms = new System.IO.MemoryStream())
                    {
                        gameState.FogImage.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
                        var newFogTexture = Texture2D.FromStream(GraphicsDevice, ms);

                        // TODO: The Bitmap uses White to simulate Transparency. This is stupid but acceptable for now.
                        ReplaceNonBlackWithTransparent(newFogTexture);

                        // Finally push the fog into the next Game State.
                        gameState.Fog = newFogTexture;
                    }
                }
            }

            if (gameState.CurrentMouseState.ScrollWheelValue != lastWheelValue)
            {
                Update_HandleScroll();
                Update_HandleZoom();
            }

            lastWheelValue = gameState.CurrentMouseState.ScrollWheelValue;

            Debug.Add("Zoom Factor: " + gameState.ZoomFactor);
            Debug.Add("Vertical Scroll Position: " + gameState.VerticalScrollPosition);
            Debug.Add("Horizontal Scroll Position: " + gameState.HorizontalScrollPosition);
            if (gameState.Map != null)
            {
                Debug.Add("Map Size: " + gameState.Map.Width + "x" + gameState.Map.Height);
                Debug.Add("Map Bounds: " + gameState.ActualMapWidth + "x" + gameState.ActualMapHeight);
                Debug.Add("Logical Map Bounds: " + gameState.LogicalMapWidth + "x" + gameState.LogicalMapHeight);
            }
            Debug.Add("Client Bounds: " + gameState.ActualClientWidth + "x" + gameState.ActualClientHeight);
            Debug.Add("Logical Client Bounds: " + gameState.LogicalClientWidth + "x" + gameState.LogicalClientHeight);
            base.Update(gameTime);
        }
コード例 #13
0
 protected virtual void OnDebug(string debug)
 {
     Debug.Add(new DebugRecord(debug));
 }
コード例 #14
0
        /// <summary>
        /// Given an input manifest of named values between zero and one, generate a drawing.
        /// </summary>
        /// <param name="input"></param>
        public DrawingManifest(InputManifest input)
        {
            // Parse adjacent

            // Generate anchor points from input.Adjacent
            var position    = 0.4 * input.Adjacent;
            var BottomLeft  = new Point3d(0.5 - position, 0, 0);
            var TopLeft     = new Point3d(0.5 - position, 1, 0);
            var BottomRight = new Point3d(0.5 + position, 0, 0);
            var TopRight    = new Point3d(0.5 + position, 1, 0);

            // Generate interior points from input.Openings
            var    pointCount  = Convert.ToInt32(Math.Round(input.Openings * 9)) + 3;
            double step        = 1.0 / pointCount;
            var    leftPoints  = new List <Point3d>();
            var    rightPoints = new List <Point3d>();

            var r = new Random(Convert.ToInt32(input.Tutorial * 100));

            var rotateL = Transform.Rotation((input.Parallel * 20) * (Math.PI / 180), Vector3d.ZAxis, new Point3d(input.Adjacent, input.Adjacent, 0));
            var rotateR = Transform.Rotation((input.Parallel * -20) * (Math.PI / 180), Vector3d.ZAxis, new Point3d(1 - input.Adjacent, 1 - input.Adjacent, 0));

            for (var i = 1; i < pointCount; i++)
            {
                var y = i * step;
                var x = r.NextDouble() * (input.Openings * 0.25);

                var ptLeft  = new Point3d((0.5 - position - x), y, 0);
                var ptRight = new Point3d((0.5 + position + x), y, 0);

                ptLeft.Transform(rotateL);
                ptRight.Transform(rotateR);

                leftPoints.Add(ptLeft);
                rightPoints.Add(ptRight);
            }

            var leftEdgePoints = new List <Point3d>()
            {
                BottomLeft
            };

            leftEdgePoints.AddRange(leftPoints);
            leftEdgePoints.Add(TopLeft);

            var rightEdgePoints = new List <Point3d>()
            {
                BottomRight
            };

            rightEdgePoints.AddRange(rightPoints);
            rightEdgePoints.Add(TopRight);

            // Generate polylines
            var leftEdge  = new Polyline(leftEdgePoints);
            var rightEdge = new Polyline(rightEdgePoints);

            // Push lines to output
            Debug.Add(RhinoPolylineToSvgar(leftEdge));
            Debug.Add(RhinoPolylineToSvgar(rightEdge));

            // Thicken polylines
            var thickenL = Transform.Translation(new Vector3d(-0.001, 0, 0));
            var thickenR = Transform.Translation(new Vector3d(0.001, 0, 0));

            var leftThicken = new Polyline(leftEdgePoints);

            leftThicken.Transform(thickenL);
            var rightThicken = new Polyline(rightEdgePoints);

            rightThicken.Transform(thickenR);

            Debug.Add(RhinoPolylineToSvgar(leftThicken));
            Debug.Add(RhinoPolylineToSvgar(rightThicken));

            var leftThicken2 = new Polyline(leftEdgePoints);

            leftThicken2.Transform(thickenL);
            leftThicken2.Transform(thickenL);
            var rightThicken2 = new Polyline(rightEdgePoints);

            rightThicken2.Transform(thickenR);
            rightThicken2.Transform(thickenR);

            Debug.Add(RhinoPolylineToSvgar(leftThicken2));
            Debug.Add(RhinoPolylineToSvgar(rightThicken2));

            // Offset polylines
            var offsetL = Transform.Translation(new Vector3d(-0.01, 0, 0));
            var offsetR = Transform.Translation(new Vector3d(0.01, 0, 0));

            var leftOffset = new Polyline(leftEdgePoints);

            leftOffset.Transform(offsetL);
            var rightOffset = new Polyline(rightEdgePoints);

            rightOffset.Transform(offsetR);

            Debug.Add(RhinoPolylineToSvgar(leftOffset));
            Debug.Add(RhinoPolylineToSvgar(rightOffset));

            var leftOffsetThicken = new Polyline(leftEdgePoints);

            leftOffsetThicken.Transform(offsetL);
            leftOffsetThicken.Transform(thickenL);
            var rightOffsetThicken = new Polyline(rightEdgePoints);

            rightOffsetThicken.Transform(offsetR);
            rightOffsetThicken.Transform(thickenR);

            Debug.Add(RhinoPolylineToSvgar(leftOffsetThicken));
            Debug.Add(RhinoPolylineToSvgar(rightOffsetThicken));

            //Edges.Add(RhinoPolylineToSvgar(leftEdge));
            //Edges.Add(RhinoPolylineToSvgar(rightEdge));

            // Extend line segments
            var lex = new List <Line>();
            var rex = new List <Line>();

            for (var i = 0; i < leftEdge.SegmentCount; i++)
            {
                var l  = input.Disjoint * 0.15;
                var cL = leftEdge.SegmentAt(i);
                var cR = rightEdge.SegmentAt(i);

                var cLextended = new Line(cL.From, cL.To);
                cLextended.Extend(l, l);
                var cRextended = new Line(cR.From, cR.To);
                cRextended.Extend(l, l);

                var cLexA = new Line(cL.From, cLextended.From);
                var cLexB = new Line(cL.To, cLextended.To);
                var cRexA = new Line(cR.From, cRextended.From);
                var cRexB = new Line(cR.To, cRextended.To);

                lex.AddRange(new List <Line>()
                {
                    cLexA, cLexB
                });
                rex.AddRange(new List <Line>()
                {
                    cRexA, cRexB
                });
            }

            var movedLex = new List <Line>();
            var movedRex = new List <Line>();

            lex.ForEach(x =>
            {
                var tx = Transform.Translation(new Vector3d(x.To - x.From) * 0.25);

                x.Transform(tx);

                movedLex.Add(x);
            });

            rex.ForEach(x =>
            {
                var tx = Transform.Translation(new Vector3d(x.To - x.From) * 0.25);

                x.Transform(tx);

                movedRex.Add(x);
            });

            for (var i = 0; i < movedLex.Count; i++)
            {
                Debug.Add(RhinoPolylineToSvgar(new Polyline(new List <Point3d>()
                {
                    movedLex[i].From, movedLex[i].To
                })));
                Debug.Add(RhinoPolylineToSvgar(new Polyline(new List <Point3d>()
                {
                    movedRex[i].From, movedRex[i].To
                })));

                //var lexSegs = PolylineToDashedLine(new Polyline(new List<Point3d>() { movedLex[i].From, movedLex[i].To }), 0.15);
                //var rexSegs = PolylineToDashedLine(new Polyline(new List<Point3d>() { movedRex[i].From, movedRex[i].To }), 0.15);

                //var segs = new List<Polyline>();
                //segs.AddRange(lexSegs);
                //segs.AddRange(rexSegs);

                //segs.ForEach(x =>
                //{
                //    Debug.Add(RhinoPolylineToSvgar(x));
                //});

                //Extensions.Add(RhinoPolylineToSvgar(new Polyline(new List<Point3d>() { movedLex[i].From, movedLex[i].To })));
                //Extensions.Add(RhinoPolylineToSvgar(new Polyline(new List<Point3d>() { movedRex[i].From, movedRex[i].To })));
            }

            for (var i = 0; i < movedLex.Count; i += 2)
            {
                var crvA    = movedLex[i];
                var targetA = crvA.To.X > crvA.From.X ? new Point3d(rightEdge.SegmentAt(i / 2).To.X, crvA.To.Y, 0) : new Point3d(0, crvA.To.Y, 0);

                var crvB    = movedLex[i + 1];
                var targetB = crvB.To.X > crvB.From.X ? new Point3d(rightEdge.SegmentAt(i / 2).From.X, crvB.To.Y, 0) : new Point3d(0, crvB.To.Y, 0);

                var crvC    = movedRex[i];
                var targetC = crvC.To.X < crvC.From.X ? new Point3d(leftEdge.SegmentAt(i / 2).To.X, crvC.To.Y, 0) : new Point3d(1, crvC.To.Y, 0);

                var crvD    = movedRex[i + 1];
                var targetD = crvD.To.X < crvD.From.X ? new Point3d(leftEdge.SegmentAt(i / 2).From.X, crvD.To.Y, 0) : new Point3d(1, crvD.To.Y, 0);

                var ext = new List <Line>()
                {
                    new Line(crvA.To, targetA),
                    new Line(crvB.To, targetB),
                    new Line(crvC.To, targetC),
                    new Line(crvD.To, targetD)
                };

                var allExtensions = new List <Polyline>();

                ext.ForEach(x =>
                {
                    var scale = Transform.Scale(x.From, input.Disjoint);
                    if (x.To.X > 0 && x.To.X < 1)
                    {
                        x.Transform(scale);
                    }
                    allExtensions.Add(new Polyline(new List <Point3d>()
                    {
                        x.From, x.To
                    }));
                });

                allExtensions.ForEach(x =>
                {
                    Debug.Add(RhinoPolylineToSvgar(x));

                    //PolylineToDashedLine(x, 0.15).ForEach(y =>
                    //{
                    //    Debug.Add(RhinoPolylineToSvgar(y));
                    //});

                    //Extensions.Add(RhinoPolylineToSvgar(x));
                });
            }

            var largeLines = new List <Polyline>();

            for (var i = 0; i < leftEdge.SegmentCount; i++)
            {
                var lc = leftEdge.SegmentAt(i);
                var rc = rightEdge.SegmentAt(i);

                var threshold = input.Largethreshold;

                if (lc.ToNurbsCurve().GetLength() > threshold / 2)
                {
                    var largeC = new Line(lc.From, lc.To);
                    largeC.ExtendThroughBox(new BoundingBox(new Point3d(0, 0, 0), new Point3d(1, 1, 1)));
                    var largeCL = new Line(largeC.From, largeC.To);
                    var largeCR = new Line(largeC.From, largeC.To);

                    var moveR = Transform.Translation(new Vector3d(0.04, 0, 0));
                    var moveL = Transform.Translation(new Vector3d(-0.04, 0, 0));

                    largeCL.Transform(moveL);
                    largeCR.Transform(moveR);

                    largeLines.Add(new Polyline(new List <Point3d>()
                    {
                        new Point3d(largeCL.From.X - (0.04 * input.Parallel), largeCL.From.Y, 0), largeCL.To
                    }));
                    //largeLines.Add(new Polyline(new List<Point3d>() { largeC.From, largeC.To }));
                    //largeLines.Add(new Polyline(new List<Point3d>() { new Point3d(largeCR.From.X + (0.04 * input.Parallel), largeCR.From.Y, 0), largeCR.To }));
                }

                if (rc.ToNurbsCurve().GetLength() > threshold / 2)
                {
                    var largeC = new Line(rc.From, rc.To);
                    largeC.ExtendThroughBox(new BoundingBox(new Point3d(0, 0, 0), new Point3d(1, 1, 1)));
                    var largeCL = new Line(largeC.From, largeC.To);
                    var largeCR = new Line(largeC.From, largeC.To);

                    var moveR = Transform.Translation(new Vector3d(0.02, 0, 0));
                    var moveL = Transform.Translation(new Vector3d(-0.02, 0, 0));

                    largeCL.Transform(moveL);
                    largeCR.Transform(moveR);

                    //largeLines.Add(new Polyline(new List<Point3d>() { largeCL.From, new Point3d(largeCL.To.X - (0.04 * input.Parallel), largeCL.To.Y, 0) }));
                    //largeLines.Add(new Polyline(new List<Point3d>() { largeC.From, largeC.To }));
                    largeLines.Add(new Polyline(new List <Point3d>()
                    {
                        largeCR.From, new Point3d(largeCR.To.X + (0.04 * input.Parallel), largeCR.To.Y, 0)
                    }));
                }
            }

            largeLines.ForEach(x =>
            {
                PolylineToDashedLine(x, 0.02).ForEach(y =>
                {
                    Debug.Add(RhinoPolylineToSvgar(y));
                });

                //Parallels.Add(RhinoPolylineToSvgar(x));
            });

            var proportion = leftEdge.ToNurbsCurve().GetLength() / rightEdge.ToNurbsCurve().GetLength();
            var sL         = 0.25 * input.Porosity * proportion;
            var sR         = 0.25 * input.Porosity * (1 / proportion);

            var iL = new Interval(-sL / 2, sL / 2);
            var iR = new Interval(-sR / 2, sR / 2);

            var anchorL  = new Plane(new Point3d(0.2 * (1 - input.Adjacent), 0.3 * (1 - input.Adjacent), 0), Vector3d.ZAxis);
            var rectL    = new Rectangle3d(anchorL, iL, iL);
            var rotL     = Transform.Rotation((-90 * input.Parallel) * (Math.PI / 180), anchorL.Origin);
            var stretchL = Transform.Scale(anchorL, 1, 1 + (input.Porosity * proportion), 1);

            rectL.Transform(rotL);
            rectL.Transform(stretchL);

            var rectL2 = rectL.ToPolyline().Duplicate();

            rectL2.Transform(Transform.Translation(rectL.Plane.YAxis * -0.2));
            var rectL3 = rectL.ToPolyline().Duplicate();

            rectL3.Transform(Transform.Translation(rectL.Plane.YAxis * -0.4));

            var anchorR  = new Plane(new Point3d(1 - (0.2 * (1 - input.Adjacent)), 1 - (0.3 * (1 - input.Adjacent)), 0), Vector3d.ZAxis);
            var rectR    = new Rectangle3d(anchorR, iR, iR);
            var rotR     = Transform.Rotation((-90 * input.Parallel) * (Math.PI / 180), anchorR.Origin);
            var stretchR = Transform.Scale(anchorR, 1, 1 + (input.Porosity * (1 / proportion)), 1);

            rectR.Transform(rotR);
            rectR.Transform(stretchR);

            var rectR2 = rectR.ToPolyline().Duplicate();

            rectR2.Transform(Transform.Translation(rectR.Plane.YAxis * 0.2));
            var rectR3 = rectR.ToPolyline().Duplicate();

            rectR3.Transform(Transform.Translation(rectR.Plane.YAxis * 0.4));

            var allRects = new List <Polyline>()
            {
                rectL.ToPolyline(),
                rectL2,
                rectL3,
                rectR.ToPolyline(),
                rectR2,
                rectR3
            };

            var allRectsThickened = new List <Polyline>(allRects);

            allRectsThickened.ForEach(x =>
            {
                var left = new Polyline(x);
                left.Transform(thickenL);
                allRects.Add(left);
                var right = new Polyline(x);
                right.Transform(thickenR);
                allRects.Add(right);
            });

            var mPlane = Plane.WorldZX;

            mPlane.Origin = new Point3d(0.5, 0.5, 0);
            var mirror = Transform.Mirror(mPlane);

            allRects.ForEach(x =>
            {
                Debug.Add(RhinoPolylineToSvgar(x));
                //Holes.Add(RhinoPolylineToSvgar(x));
                var mx = x.Duplicate();
                mx.Transform(mirror);
                Debug.Add(RhinoPolylineToSvgar(mx));
                //Holes.Add(RhinoPolylineToSvgar(mx));
            });
        }
コード例 #15
0
ファイル: FoxUIElements.cs プロジェクト: filgreen3/MonoEmpty
 public void OnDrag(PointData point)
 {
     Debug.Add(this, Rect.Location.ToString());
     Offset   = AnchorUtility.GetPivot(ScreenAnchor.Middle_Middle) * Rect.Size.ToVector2();
     Position = point.Position.ToVector2() - Offset - (originAnchor - Offset);
 }
コード例 #16
0
ファイル: Program.cs プロジェクト: tekintr/Elobuddy
        /// <summary>
        /// Load when game starts.
        /// </summary>
        /// <param name="args"></param>
        private static void Loading_OnLoadingComplete(EventArgs args)
        {
            // Checks if Player is Teemo
            if (Player.Instance.BaseSkinName != ChampionName)
            {
                return;
            }

            Bootstrap.Init(null);

            Q = new Spell.Targeted(SpellSlot.Q, 680);
            W = new Spell.Active(SpellSlot.W);
            E = new Spell.Active(SpellSlot.E);
            R = new Spell.Skillshot(SpellSlot.R, 300, SkillShotType.Circular, 500, 1000, 120);

            // Menu
            TekinTeemo = MainMenu.AddMenu("TekinTeemo", "TekinTeemo");
            TekinTeemo.AddGroupLabel("Bu addon TekinTR tarafından üretilmiştir ve herhangi bir şekilde yeniden dağıtılmamalıdır.");
            TekinTeemo.AddGroupLabel("Kredisi olmayan herhangi bir izinsiz yeniden dağıtım, ciddi sonuçlar doğuracaktır.");
            TekinTeemo.AddGroupLabel("Bu eklentiyi kullandığınız ve eğlendiğiniz için teşekkür ederiz!");

            // Combo Menu
            ComboMenu = TekinTeemo.AddSubMenu("Combo", "Combo");
            ComboMenu.AddGroupLabel("Combo Settings");
            ComboMenu.Add("qcombo", new CheckBox("Combo'da Q kullanin"));
            ComboMenu.Add("wcombo", new CheckBox("Combo'da W kullanin"));
            ComboMenu.Add("rcombo", new CheckBox("Combo'da R ile Sektirme"));
            ComboMenu.Add("useqADC", new CheckBox("Combo sirasinda Q'yu yalnızca ADC'de kullanin", false));
            ComboMenu.Add("wCombat", new CheckBox("Dusman yalnızca menzilde ise W kullanin."));
            ComboMenu.Add("rCharge", new Slider("R kullanmadan önce R giderleri", 2, 1, 3));
            ComboMenu.Add("checkCamo", new CheckBox("Pasif Aktif iken combo engelle", false));

            // Harass Menu
            HarassMenu = TekinTeemo.AddSubMenu("Harass", "Harass");
            HarassMenu.AddGroupLabel("Harass Settings");
            HarassMenu.Add("qharass", new CheckBox("Q ile Durt"));

            // LaneClear Menu
            LaneClearMenu = TekinTeemo.AddSubMenu("LaneClear", "LaneClear");
            LaneClearMenu.AddGroupLabel("LaneClear Settings");
            LaneClearMenu.Add("qclear", new CheckBox("Q ile Koridor temizle", false));
            LaneClearMenu.Add("qManaManager", new Slider("Q Mana Ayari", 50));
            LaneClearMenu.Add("attackTurret", new CheckBox("Kuleye Saldir"));
            LaneClearMenu.Add("attackWard", new CheckBox("Toteme Saldir"));
            LaneClearMenu.Add("rclear", new CheckBox("R ile koridor temizleme"));
            LaneClearMenu.Add("minionR", new Slider("Minyon Sayisi R icin", 3, 1, 4));

            // JungleClear Menu
            JungleClearMenu = TekinTeemo.AddSubMenu("JungleClear", "JungleClear");
            JungleClearMenu.AddGroupLabel("JungleClear Settings");
            JungleClearMenu.Add("qclear", new CheckBox("Q ile orman temizle"));
            JungleClearMenu.Add("rclear", new CheckBox("R ile orman temizle"));
            JungleClearMenu.Add("qManaManager", new Slider("Q Mana Ayari", 25));

            // Interrupter && Gapcloser
            InterruptMenu = TekinTeemo.AddSubMenu("Interrupt / Gapcloser", "Interrupt");
            InterruptMenu.AddGroupLabel("Interruptter and Gapcloser Setting");
            InterruptMenu.Add("intq", new CheckBox("Q ile Kesme"));
            InterruptMenu.Add("gapR", new CheckBox("Ani Yaklasmada R"));
            InterruptMenu.Add("gapQ", new CheckBox("Ani Yaklasmada Q"));

            // KillSteal Menu
            KillStealMenu = TekinTeemo.AddSubMenu("KillSteal", "KSMenu");
            KillStealMenu.AddGroupLabel("KillSteal Settings");
            KillStealMenu.Add("KSQ", new CheckBox("Q ile Oldur"));
            KillStealMenu.Add("KSR", new CheckBox("R ile Oldur"));

            // Flee Menu
            FleeMenu = TekinTeemo.AddSubMenu("Flee Menu", "Flee");
            FleeMenu.AddGroupLabel("Flee Settings");
            FleeMenu.Add("w", new CheckBox("Kacarken W kullan"));
            FleeMenu.Add("r", new CheckBox("Kacarken R kullan"));
            FleeMenu.Add("rCharge", new Slider("R kullanmadan once R giderleri", 2, 1, 3));

            // Drawing Menu
            DrawingMenu = TekinTeemo.AddSubMenu("Drawing", "Drawing");
            DrawingMenu.AddGroupLabel("Drawing Settings");
            DrawingMenu.Add("drawQ", new CheckBox("Q menzilini goster"));
            DrawingMenu.Add("drawR", new CheckBox("R menzilini goster"));
            DrawingMenu.Add("colorBlind", new CheckBox("Colorblind Mode", false));
            DrawingMenu.Add("drawautoR", new CheckBox("Draw Important Shroom Areas"));
            DrawingMenu.Add("DrawVision", new Slider("Shroom Vision", 1500, 2500, 1000));

            // Debug Menu
            Debug = TekinTeemo.AddSubMenu("Debug", "debug");
            Debug.AddGroupLabel("Debug Settings");
            Debug.Add("debugdraw", new CheckBox("Draw Coords", false));
            Debug.Add("x", new Slider("Where to draw X", 500, 0, 3840));
            Debug.Add("y", new Slider("Where to draw Y", 500, 0, 2160));
            Debug.Add("debugpos", new CheckBox("Draw Custom Shroom Locations Coordinates"));

            // Misc
            MiscMenu = TekinTeemo.AddSubMenu("Misc", "Misc");
            MiscMenu.AddGroupLabel("Misc Settings");
            MiscMenu.Add("autoQ", new CheckBox("Otomatik Q", false));
            MiscMenu.Add("autoW", new CheckBox("Otomatik W", false));
            MiscMenu.Add("autoR", new CheckBox("Mantarlari Otomatik Yerlestir"));
            MiscMenu.Add("rCharge", new Slider("Mantarlari Otomatik Yerlestirmek Icin R Sayisi", 2, 1, 3));
            MiscMenu.Add("autoRPanic", new KeyBind("Otomatik R için Panik Anahtarı", false, KeyBind.BindTypes.HoldActive, 84));
            MiscMenu.Add("customLocation", new CheckBox("Otomatik Mantar için Özel Konum Kullan (Yeniden Yükleme Gerektirir)"));
            MiscMenu.AddSeparator();
            MiscMenu.Add("checkAA", new CheckBox("Subtract Range for Q (checkAA)"));
            MiscMenu.Add("checkaaRange", new Slider("How many to subtract from Q Range (checkAA)", 100, 0, 180));

            // Events
            Game.OnTick += Game_OnTick;
            Interrupter.OnInterruptableSpell += Interrupter_OnInterruptableSpell;
            Gapcloser.OnGapcloser            += Gapcloser_OnGapcloser;
            Orbwalker.OnPreAttack            += Orbwalker_OnPreAttack;
            Drawing.OnDraw += Drawing_OnDraw;
            Obj_AI_Base.OnProcessSpellCast += Obj_AI_Base_OnProcessSpellCast;

            Chat.Print("TekinTeemo EloBuddy Edition Loaded by TekinTR 7.1.172", Color.LightBlue);

            // Loads ShroomPosition
            Handler         = new FileHandler();
            ShroomPositions = new ShroomTables();
        }
コード例 #17
0
        private static void onLoad(object sender)
        {
            r        = new Random();
            allyIds  = new List <int>();
            enemyIds = new List <int>();

            gameStart = now;
            Chat.Print("<font size='30'>AramDetFull</font> <font color='#b756c5'>ported by Hesa & Ouija</font>");
            try
            {
                defaultOut = Console.Out;
                Console.SetOut(new ErrorLogger(defaultOut));

                Config = MainMenu.AddMenu("ARAM", "aramDet");

                Debug = Config.AddSubMenu("Debug", "aramDetDebug");
                Debug.Add("botOff", new CheckBox("Bot off", false));
                Debug.Add("debugDraw", new CheckBox("Debug draw", false));

                Drawing.OnDraw += onDraw;
                Game.OnUpdate  += OnGameUpdate;
                Game.OnNotify  += Game_OnNotify;

                var gameEndNotified = false;

                OnGameEnd += ARAMDetFull_OnGameEnd;

                Game.OnTick += delegate
                {
                    if (gameEndNotified)
                    {
                        return;
                    }
                    var nexus = ObjectManager.Get <Obj_HQ>();
                    if (nexus == null)
                    {
                        return;
                    }
                    if (nexus.Any(n => n.IsDead || n.Health.Equals(0)))
                    {
                        var win = ObjectManager.Get <Obj_HQ>().Any(n => n.Health.Equals(0));
                        OnGameEnd?.Invoke(win);
                        gameEndNotified = true;
                    }
                };

                ARAMSimulator.setupARMASimulator();

                foreach (AIHeroClient ally in EloBuddy.SDK.EntityManager.Heroes.Allies)
                {
                    allyIds.Add(ally.NetworkId);
                }

                foreach (AIHeroClient enemy in EloBuddy.SDK.EntityManager.Heroes.Enemies)
                {
                    enemyIds.Add(enemy.NetworkId);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }