Beispiel #1
0
 public Gank()
 {
     foreach (Obj_AI_Hero hero in ObjectManager.Get<Obj_AI_Hero>())
     {
         if (hero.IsEnemy)
         {
             Render.Line line = new Render.Line(new Vector2(0,0), new Vector2(0,0), 2, Color.LightGreen);
             InternalGankTracker gank = new InternalGankTracker(line);
             line.StartPositionUpdate = delegate
             {
                 return Drawing.WorldToScreen(ObjectManager.Player.Position);
             };
             line.EndPositionUpdate = delegate
             {
                 return Drawing.WorldToScreen(hero.Position);
             };
             line.VisibleCondition = delegate
             {
                 return Tracker.Trackers.GetActive() && GankTracker.GetActive() &&
                         GankTracker.GetMenuItem("SAssembliesTrackersGankDraw").GetValue<bool>() &&
                        hero.ServerPosition.Distance(ObjectManager.Player.ServerPosition) <
                        GankTracker.GetMenuItem("SAssembliesTrackersGankTrackRange").GetValue<Slider>().Value &&
                        hero.IsVisible && !hero.IsDead &&
                        (GankTracker.GetMenuItem("SAssembliesTrackersGankKillable").GetValue<bool>() && gank.Damage > hero.Health ||
                        !GankTracker.GetMenuItem("SAssembliesTrackersGankKillable").GetValue<bool>());
             };
             line.Add();
             _enemies.Add(hero, gank);
         }
     }
     ThreadHelper.GetInstance().Called += Game_OnGameUpdate;
     //Game.OnGameUpdate += Game_OnGameUpdate;
 }
Beispiel #2
0
 public ChampionInfo(Obj_AI_Hero hero, bool ally)
 {
     index++;
     int textoffset = index * 50;
     _hero = hero;
     Render.Text text = new Render.Text(
         new Vector2(), _hero.ChampionName, 20,
         ally
             ? new Color { R = 205, G = 255, B = 205, A = 255 }
             : new Color { R = 255, G = 205, B = 205, A = 255 })
     {
         PositionUpdate =
             () =>
                 Drawing.WorldToScreen(
                     ObjectManager.Player.Position.Extend(_hero.Position, 300 + textoffset)),
         VisibleCondition = delegate
         {
             float dist = _hero.Distance(ObjectManager.Player.Position);
             return Program.Instance().ShowChampionNames && !_hero.IsDead &&
                    Game.ClockTime - _lineStart < Program.Instance().LineDuration &&
                    (!_hero.IsVisible || !Render.OnScreen(Drawing.WorldToScreen(_hero.Position))) &&
                    dist < Program.Instance().Radius && dist > 300 + textoffset;
         },
         Centered = true,
         OutLined = true,
     };
     text.Add(1);
     _line = new Render.Line(
         new Vector2(), new Vector2(), 5,
         ally ? new Color { R = 0, G = 255, B = 0, A = 125 } : new Color { R = 255, G = 0, B = 0, A = 125 })
     {
         StartPositionUpdate = () => Drawing.WorldToScreen(ObjectManager.Player.Position),
         EndPositionUpdate = () => Drawing.WorldToScreen(_hero.Position),
         VisibleCondition =
             delegate
             {
                 return !_hero.IsDead && Game.ClockTime - _lineStart < Program.Instance().LineDuration &&
                        _hero.Distance(ObjectManager.Player.Position) < (Program.Instance().Radius + 1000);
             }
     };
     _line.Add(0);
     Render.Line minimapLine = new Render.Line(
         new Vector2(), new Vector2(), 2,
         ally ? new Color { R = 0, G = 255, B = 0, A = 255 } : new Color { R = 255, G = 0, B = 0, A = 255 })
     {
         StartPositionUpdate = () => Drawing.WorldToMinimap(ObjectManager.Player.Position),
         EndPositionUpdate = () => Drawing.WorldToMinimap(_hero.Position),
         VisibleCondition =
             delegate
             {
                 return Program.Instance().DrawMinimapLines && !_hero.IsDead && Game.ClockTime - _lineStart < Program.Instance().LineDuration;
             }
     };
     minimapLine.Add(0);
     Game.OnUpdate += Game_OnGameUpdate;
     OnEnterRange += ChampionInfo_OnEnterRange;
 }
Beispiel #3
0
        public void CreateRenderObjects()
        {
            //Create the minimap sprite.

            if (Range == 1100)
            {
                _minimapSprite = new Render.Sprite(WardData.Bitmap, MinimapPosition);
                _minimapSprite.Scale = new Vector2(_scale, _scale);
                _minimapSprite.Add(0);
            }

            //Create the circle:
            _defaultCircle = new Render.Circle(Position, 200, Color, 5, true);
            _defaultCircle.VisibleCondition +=
                sender =>
                    WardTracker.Config.Item("Enabled").GetValue<bool>() &&
                    !WardTracker.Config.Item("Details").GetValue<KeyBind>().Active &&
                    Render.OnScreen(Drawing.WorldToScreen(Position));
            _defaultCircle.Add(0);
            _defaultCircleFilled = new Render.Circle(Position, 200, Color.FromArgb(25, Color), -142857, true);
            _defaultCircleFilled.VisibleCondition +=
                sender =>
                    WardTracker.Config.Item("Enabled").GetValue<bool>() &&
                    !WardTracker.Config.Item("Details").GetValue<KeyBind>().Active &&
                    Render.OnScreen(Drawing.WorldToScreen(Position));
            _defaultCircleFilled.Add(-1);

            //Create the circle that shows the range
            _rangeCircle = new Render.Circle(Position, Range, Color, 10, false);
            _rangeCircle.VisibleCondition +=
                sender =>
                    WardTracker.Config.Item("Enabled").GetValue<bool>() &&
                    WardTracker.Config.Item("Details").GetValue<KeyBind>().Active;
            _rangeCircle.Add(0);

            _rangeCircleFilled = new Render.Circle(Position, Range, Color.FromArgb(25, Color), -142857, true);
            _rangeCircleFilled.VisibleCondition +=
                sender =>
                    WardTracker.Config.Item("Enabled").GetValue<bool>() &&
                    WardTracker.Config.Item("Details").GetValue<KeyBind>().Active;
            _rangeCircleFilled.Add(-1);

            //Missile line;
            if (IsFromMissile)
            {
                _missileLine = new Render.Line(new Vector2(), new Vector2(), 2, new ColorBGRA(255, 255, 255, 255));
                _missileLine.EndPositionUpdate = () => Drawing.WorldToScreen(Position);
                _missileLine.StartPositionUpdate = () => Drawing.WorldToScreen(StartPosition);
                _missileLine.VisibleCondition +=
                    sender =>
                        WardTracker.Config.Item("Enabled").GetValue<bool>() &&
                        WardTracker.Config.Item("Details").GetValue<KeyBind>().Active;
                _missileLine.Add(0);
            }

            //Create the timer text:
            if (Duration != int.MaxValue)
            {
                _timerText = new Render.Text(10, 10, "t", 18, new ColorBGRA(255, 255, 255, 255));
                _timerText.OutLined = true;
                _timerText.PositionUpdate = () => Drawing.WorldToScreen(Position);
                _timerText.Centered = true;
                _timerText.VisibleCondition +=
                    sender =>
                        WardTracker.Config.Item("Enabled").GetValue<bool>() &&
                        Render.OnScreen(Drawing.WorldToScreen(Position));

                _timerText.TextUpdate =
                    () =>
                        (IsFromMissile ? "?? " : "") + Utils.FormatTime((EndT - Environment.TickCount) / 1000f) +
                        (IsFromMissile ? " ??" : "");
                _timerText.Add(2);
            }
        }
Beispiel #4
0
 private void Init()
 {
     foreach (Obj_AI_Hero hero in ObjectManager.Get<Obj_AI_Hero>())
     {
         Render.Text text = new Render.Text(new Vector2(0, 0), hero.IsEnemy ? Language.GetString("DETECTORS_GANK_TEXT_JUNGLER_ENEMY") :
             Language.GetString("DETECTORS_GANK_TEXT_JUNGLER_ALLY"), 28, hero.IsEnemy ? Color.Red : Color.Green);
         text.PositionUpdate = delegate
         {
             if (hero.IsEnemy)
             {
                 Speech.Speak(Language.GetString("DETECTORS_GANK_TEXT_JUNGLER_ENEMY"));
             }
             return Drawing.WorldToScreen(ObjectManager.Player.ServerPosition);
         };
         text.VisibleCondition = sender =>
         {
             return IsVisible(hero);
         };
         text.OutLined = true;
         text.Centered = true;
         text.Add();
         Render.Line line = new Render.Line(new Vector2(1, 1), new Vector2(1, 1), 4, hero.IsEnemy ? Color.Red : Color.Green);
         line.StartPositionUpdate = delegate
         {
             return Drawing.WorldToScreen(ObjectManager.Player.ServerPosition);
         };
         line.EndPositionUpdate = delegate
         {
             return Drawing.WorldToScreen(hero.ServerPosition);
         };
         line.VisibleCondition = sender =>
         {
             return IsVisible(hero);
         };
         line.Add();
         if (hero.IsEnemy)
         {
             Enemies.Add(hero, new InternalGankDetector(text, line));
         }
     }
 }
Beispiel #5
0
        private void Init()
        {
            foreach (Obj_AI_Hero hero in ObjectManager.Get<Obj_AI_Hero>())
            {
                if (!hero.IsEnemy)
                {
                    continue;
                }
                bool hasSmite = false;
                foreach (SpellDataInst spell in hero.Spellbook.Spells)
                {
                    if (spell.Slot.HasFlag(SpellSlot.Summoner1 | SpellSlot.Summoner2))
                    {
                        if (spell.Name.ToLower().Contains("smite"))
                        {
                            hasSmite = true;
                            break;
                        }
                    }
                }
                if (hasSmite)
                {
                    Render.Text text = new Render.Text(new Vector2(0, 0), hero.IsEnemy ? Language.GetString("DETECTORS_GANK_TEXT_JUNGLER_ENEMY") :
                    Language.GetString("DETECTORS_GANK_TEXT_JUNGLER_ALLY"), 28, hero.IsEnemy ? Color.Red : Color.Green);
                    text.PositionUpdate = delegate
                    {
                        return Drawing.WorldToScreen(ObjectManager.Player.ServerPosition);
                    };
                    text.VisibleCondition = sender =>
                    {
                        return IsVisible(hero);
                    };
                    text.OutLined = true;
                    text.Centered = true;
                    text.Add();
                    Render.Line line = new Render.Line(new Vector2(1, 1), new Vector2(1, 1), 4, hero.IsEnemy ? Color.Red : Color.Green);
                    line.StartPositionUpdate = delegate
                    {
                        return Drawing.WorldToScreen(ObjectManager.Player.ServerPosition);
                    };
                    line.EndPositionUpdate = delegate
                    {
                        return Drawing.WorldToScreen(hero.ServerPosition);
                    };
                    line.VisibleCondition = sender =>
                    {
                        return IsVisible(hero);
                    };
                    line.Add();

                    Enemies.Add(hero, new InternalGankDetector(text, line));
                }
                else
                {
                    Enemies.Add(hero, new InternalGankDetector(null, null));
                }
            }
        }
Beispiel #6
0
 public RecallRender(Packet.S2C.Teleport.Struct recall)
 {
     var recWidth = 200;
     Recall = recall;
     Rectangle = new Render.Rectangle(Drawing.Width / 2, Drawing.Height / 4, recWidth, 10, SharpDX.Color.Green);
     Rectangle.PositionUpdate += delegate
     {
         float percent = RecallStatusPercent();
         var newWidth = (int) (recWidth - (recWidth * percent));
         if (!Rectangle.Width.Equals(newWidth))
         {
             Rectangle.Width = newWidth;
         }
         ColorBGRA newCol = Common.PercentColorRedToGreen(percent, (int)(255 - (255 * percent)));
         if (!Equals(newCol, Rectangle.Color))
         {
             Rectangle.Color = newCol;
         }
         return new Vector2(Drawing.Width / 2 - recWidth / 2, Drawing.Height / 1.5f);
     };
     Rectangle.VisibleCondition = delegate
     {
         return IsActive() && Recall.Status == Packet.S2C.Teleport.Status.Start;
     };
     Rectangle.Add(1);
     Line = new Render.Line(new Vector2(0, 0), new Vector2(0, 0), 1, SharpDX.Color.WhiteSmoke);
     Line.StartPositionUpdate += delegate
     {
         return new Vector2(Rectangle.X + Rectangle.Width, Rectangle.Y - 5);
     };
     Line.EndPositionUpdate += delegate
     {
         return new Vector2(Rectangle.X + Rectangle.Width, Rectangle.Y);
     };
     Line.VisibleCondition = delegate
     {
         Color newCol = new Color(255, 255, 255, (int)(255 - (255 * RecallStatusPercent())));
         if (!Equals(newCol, Line.Color))
         {
             Line.Color = newCol;
         }
         return IsActive() && Recall.Status == Packet.S2C.Teleport.Status.Start;
     };
     Line.Add();
     Text = new Render.Text(ObjectManager.GetUnitByNetworkId<Obj_AI_Hero>(Recall.UnitNetworkId).ChampionName, 0 ,0, 18, SharpDX.Color.WhiteSmoke);
     Text.PositionUpdate += delegate
     {
         return new Vector2(Line.Start.X, Line.Start.Y - 15);
     };
     Text.TextUpdate = delegate
     {
         Color newCol = new Color(255, 255, 255, (int)(255 - (150 * RecallStatusPercent())));
         if (!Equals(newCol, Text.Color))
         {
             Text.Color = newCol;
         }
         TimeSpan t = TimeSpan.FromMilliseconds(Recall.Start + Recall.Duration - Environment.TickCount);
         string time = string.Format("{0:D2},{1:D3}", t.Seconds, t.Milliseconds);
         return ObjectManager.GetUnitByNetworkId<Obj_AI_Hero>(Recall.UnitNetworkId).ChampionName + "\n" + time;
     };
     Text.Centered = true;
     Text.VisibleCondition = delegate
     {
         return IsActive() && Recall.Status == Packet.S2C.Teleport.Status.Start;
     };
     Text.Add();
 }