From 240b2002466a12e06d9b00444898a8f6e355c2ff Mon Sep 17 00:00:00 2001 From: ShineSharp Date: Sat, 6 Feb 2016 13:40:52 +0200 Subject: [PATCH] Special Skillshots --- .../Skillshots/_AlZaharCalloftheVoid.cs | 41 ++++++++++ .../Spells/Tracker/Skillshots/_DianaArc.cs | 31 ++++++++ .../Spells/Tracker/Skillshots/_JarvanIVEQ.cs | 66 +++++++++++++++++ .../Spells/Tracker/Skillshots/_OriannaQEnd.cs | 37 ++++++++++ .../Spells/Tracker/Skillshots/_SionR.cs | 41 ++++++++++ .../Spells/Tracker/Skillshots/_SyndraE.cs | 74 +++++++++++++++++++ .../Spells/Tracker/Skillshots/_UFSlash.cs | 32 ++++++++ .../Tracker/Skillshots/_VelkozQSplit.cs | 44 +++++++++++ .../Spells/Tracker/Skillshots/_ZiggsR.cs | 17 +++++ .../Spells/Tracker/Skillshots/_syndrae5.cs | 73 ++++++++++++++++++ LeagueSharp.SDK.csproj | 9 +++ 11 files changed, 465 insertions(+) create mode 100644 Core/Wrappers/Spells/Tracker/Skillshots/_AlZaharCalloftheVoid.cs create mode 100644 Core/Wrappers/Spells/Tracker/Skillshots/_DianaArc.cs create mode 100644 Core/Wrappers/Spells/Tracker/Skillshots/_JarvanIVEQ.cs create mode 100644 Core/Wrappers/Spells/Tracker/Skillshots/_OriannaQEnd.cs create mode 100644 Core/Wrappers/Spells/Tracker/Skillshots/_SionR.cs create mode 100644 Core/Wrappers/Spells/Tracker/Skillshots/_SyndraE.cs create mode 100644 Core/Wrappers/Spells/Tracker/Skillshots/_UFSlash.cs create mode 100644 Core/Wrappers/Spells/Tracker/Skillshots/_VelkozQSplit.cs create mode 100644 Core/Wrappers/Spells/Tracker/Skillshots/_syndrae5.cs diff --git a/Core/Wrappers/Spells/Tracker/Skillshots/_AlZaharCalloftheVoid.cs b/Core/Wrappers/Spells/Tracker/Skillshots/_AlZaharCalloftheVoid.cs new file mode 100644 index 0000000..d753f3c --- /dev/null +++ b/Core/Wrappers/Spells/Tracker/Skillshots/_AlZaharCalloftheVoid.cs @@ -0,0 +1,41 @@ +namespace LeagueSharp.SDK.Core.Wrappers.Spells.Tracker.Skillshots +{ + using SharpDX; + + public class _AlZaharCalloftheVoid : Skillshot + { + private RectanglePoly Rectangle; + + #region Constructors and Destructors + + public _AlZaharCalloftheVoid() + : base("AlZaharCalloftheVoid") + { + } + + #endregion + + #region Public Properties + + public new Vector2 Direction => base.Direction.Perpendicular(); + public new Vector2 StartPosition => base.EndPosition - this.Direction * 400; + public new Vector2 EndPosition => base.EndPosition + this.Direction * 400; + + #endregion + + #region Public Methods and Operators + + internal override void UpdatePolygon() + { + Rectangle = new RectanglePoly(this.StartPosition, this.EndPosition, 85); + this.UpdatePath(); + } + + internal override void UpdatePath() + { + this.Path = Rectangle.ToClipperPath(); + } + + #endregion + } +} diff --git a/Core/Wrappers/Spells/Tracker/Skillshots/_DianaArc.cs b/Core/Wrappers/Spells/Tracker/Skillshots/_DianaArc.cs new file mode 100644 index 0000000..8e1e156 --- /dev/null +++ b/Core/Wrappers/Spells/Tracker/Skillshots/_DianaArc.cs @@ -0,0 +1,31 @@ +namespace LeagueSharp.SDK.Core.Wrappers.Spells.Tracker.Skillshots +{ + public class _DianaArc : Skillshot + { + private ArcPoly Arc; + + #region Constructors and Destructors + + public _DianaArc() + : base("DianaArc") + { + } + + #endregion + + #region Public Methods and Operators + + internal override void UpdatePolygon() + { + Arc = new ArcPoly(this.StartPosition, this.EndPosition, this.SData.ArcAngle, this.SData.Radius); + this.UpdatePath(); + } + + internal override void UpdatePath() + { + this.Path = Arc.ToClipperPath(); + } + + #endregion + } +} \ No newline at end of file diff --git a/Core/Wrappers/Spells/Tracker/Skillshots/_JarvanIVEQ.cs b/Core/Wrappers/Spells/Tracker/Skillshots/_JarvanIVEQ.cs new file mode 100644 index 0000000..ae69f8d --- /dev/null +++ b/Core/Wrappers/Spells/Tracker/Skillshots/_JarvanIVEQ.cs @@ -0,0 +1,66 @@ +namespace LeagueSharp.SDK.Core.Wrappers.Spells.Tracker.Skillshots +{ + using LeagueSharp.SDK; + + using SharpDX; + + public class _JarvanIVEQ : Skillshot + { + private RectanglePoly Rectangle; + + #region Constructors and Destructors + + public _JarvanIVEQ() + : base("JarvanIVEQ") + { + } + + #endregion + + #region Public Properties + + public new Vector2 EndPosition + { + get + { + var extendedE = new RectanglePoly(this.StartPosition, base.EndPosition + this.Direction * 100, this.SData.Width); + foreach (var skillshot in Tracker.DetectedSkillshots) + { + if (skillshot.Caster.NetworkId == this.Caster.NetworkId && skillshot.SData.Slot == SpellSlot.E) + { + if (extendedE.IsInside(skillshot.EndPosition)) + return skillshot.EndPosition; + } + } + + foreach (var minion in ObjectManager.Get()) + { + if (minion.CharData.BaseSkinName == "jarvanivstandard" && minion.Team == this.Caster.Team) + { + if(extendedE.IsInside(minion.Position)) + return minion.Position.ToVector2(); + } + } + + return base.EndPosition; + } + } + + #endregion + + #region Public Methods and Operators + + internal override void UpdatePolygon() + { + Rectangle = new RectanglePoly(this.StartPosition, this.EndPosition, this.SData.Radius); + this.UpdatePath(); + } + + internal override void UpdatePath() + { + this.Path = Rectangle.ToClipperPath(); + } + + #endregion + } +} diff --git a/Core/Wrappers/Spells/Tracker/Skillshots/_OriannaQEnd.cs b/Core/Wrappers/Spells/Tracker/Skillshots/_OriannaQEnd.cs new file mode 100644 index 0000000..22f3025 --- /dev/null +++ b/Core/Wrappers/Spells/Tracker/Skillshots/_OriannaQEnd.cs @@ -0,0 +1,37 @@ +namespace LeagueSharp.SDK.Core.Wrappers.Spells.Tracker.Skillshots +{ + public class _OriannaQEnd : Skillshot + { + private CirclePoly Circle; + + #region Constructors and Destructors + + public _OriannaQEnd() + : base("OriannasQ") + { + } + + #endregion + + #region Public Properties + + public new int Delay => this.SData.Delay + (int)this.StartPosition.Distance(this.EndPosition) / this.SData.MissileSpeed; + + #endregion + + #region Public Methods and Operators + + internal override void UpdatePolygon() + { + Circle = new CirclePoly(this.EndPosition, 80); + this.UpdatePath(); + } + + internal override void UpdatePath() + { + this.Path = Circle.ToClipperPath(); + } + + #endregion + } +} \ No newline at end of file diff --git a/Core/Wrappers/Spells/Tracker/Skillshots/_SionR.cs b/Core/Wrappers/Spells/Tracker/Skillshots/_SionR.cs new file mode 100644 index 0000000..65e87f4 --- /dev/null +++ b/Core/Wrappers/Spells/Tracker/Skillshots/_SionR.cs @@ -0,0 +1,41 @@ +namespace LeagueSharp.SDK.Core.Wrappers.Spells.Tracker.Skillshots +{ + using SharpDX; + + public class _SionR : Skillshot + { + private RectanglePoly Rectangle; + #region Constructors and Destructors + + public _SionR() + : base("SionR") + { + this.SData.MissileSpeed = (int)this.Caster.MoveSpeed; + } + + #endregion + + #region Public Properties + + public new Vector2 Direction => this.Caster.Direction.ToVector2(); + public new Vector2 StartPosition => this.Caster.ServerPosition.ToVector2(); + public new Vector2 EndPosition => this.StartPosition + this.Direction * this.SData.Radius; + + #endregion + + #region Public Methods and Operators + + internal override void UpdatePolygon() + { + Rectangle = new RectanglePoly(this.StartPosition, this.EndPosition, this.SData.Width); + this.UpdatePath(); + } + + internal override void UpdatePath() + { + this.Path = Rectangle.ToClipperPath(); + } + + #endregion + } +} diff --git a/Core/Wrappers/Spells/Tracker/Skillshots/_SyndraE.cs b/Core/Wrappers/Spells/Tracker/Skillshots/_SyndraE.cs new file mode 100644 index 0000000..ca47ac7 --- /dev/null +++ b/Core/Wrappers/Spells/Tracker/Skillshots/_SyndraE.cs @@ -0,0 +1,74 @@ +namespace LeagueSharp.SDK.Core.Wrappers.Spells.Tracker.Skillshots +{ + using System; + using System.Linq; + using System.Collections.Generic; + using LeagueSharp.SDK; + + using Clipper; + using SharpDX; + + public class _SyndraE : Skillshot + { + private Polygon Polygon; + + #region Constructors and Destructors + + public _SyndraE() + : base("SyndraE") + { + } + + #endregion + + #region Public Methods and Operators + + internal override void UpdatePolygon() + { + Polygon = new Polygon(); + + var angle = 60; + var edge1 = + (this.EndPosition - this.Caster.ServerPosition.ToVector2()).Rotated( + -angle / 2 * (float)Math.PI / 180); + var edge2 = edge1.Rotated(angle * (float)Math.PI / 180); + + var positions = new List(); + + //detect syndra q which havent exploded yet + var explodingQ = Tracker.DetectedSkillshots.FirstOrDefault(p => p.SData.SpellName == "SyndraQ"); + if (explodingQ != null) + positions.Add(explodingQ.EndPosition); + + //detect syndra qs which have already exploded + var seeds = ObjectManager.Get().Where(p => p.Name == "Seed" && !p.IsDead && p.Team == this.Caster.Team).Select(q => q.ServerPosition.ToVector2()); + foreach (var seed in seeds) + positions.Add(seed); + + foreach (var position in positions) + { + var v = position - this.Caster.ServerPosition.ToVector2(); + if (edge1.CrossProduct(v) > 0 && v.CrossProduct(edge2) > 0 && + position.Distance(this.Caster.ServerPosition) < 800) + { + var start = position; + var end = this.Caster.ServerPosition.ToVector2() + .Extend( + position, + this.Caster.Distance(position) > 200 ? 1300 : 1000); + + Polygon.Add(new RectanglePoly(start, end, this.SData.Width)); + } + } + + this.UpdatePath(); + } + + internal override void UpdatePath() + { + this.Path = Polygon.ToClipperPath(); + } + + #endregion + } +} diff --git a/Core/Wrappers/Spells/Tracker/Skillshots/_UFSlash.cs b/Core/Wrappers/Spells/Tracker/Skillshots/_UFSlash.cs new file mode 100644 index 0000000..c8f6bf8 --- /dev/null +++ b/Core/Wrappers/Spells/Tracker/Skillshots/_UFSlash.cs @@ -0,0 +1,32 @@ +namespace LeagueSharp.SDK.Core.Wrappers.Spells.Tracker.Skillshots +{ + public class _UFSlash : Skillshot + { + private CirclePoly Circle; + + #region Constructors and Destructors + + public _UFSlash() + : base("UFSlash") + { + this.SData.MissileSpeed += (int)this.Caster.MoveSpeed; + } + + #endregion + + #region Public Methods and Operators + + internal override void UpdatePolygon() + { + Circle = new CirclePoly(this.EndPosition, this.SData.Radius); + this.UpdatePath(); + } + + internal override void UpdatePath() + { + this.Path = Circle.ToClipperPath(); + } + + #endregion + } +} diff --git a/Core/Wrappers/Spells/Tracker/Skillshots/_VelkozQSplit.cs b/Core/Wrappers/Spells/Tracker/Skillshots/_VelkozQSplit.cs new file mode 100644 index 0000000..4460eba --- /dev/null +++ b/Core/Wrappers/Spells/Tracker/Skillshots/_VelkozQSplit.cs @@ -0,0 +1,44 @@ +namespace LeagueSharp.SDK.Core.Wrappers.Spells.Tracker.Skillshots +{ + using System.Linq; + using LeagueSharp.SDK; + + using SharpDX; + + public class _VelkozQSplit : Skillshot + { + private RectanglePoly Rectangle; + + #region Constructors and Destructors + + public _VelkozQSplit() + : base("VelkozQSplit") + { + } + + #endregion + + #region Public Properties + + public new Vector2 Direction => Tracker.DetectedSkillshots.Where(p => p.Caster.NetworkId == this.Caster.NetworkId && p.SData.SpellName == "VelkozQ").FirstOrDefault().Direction.Perpendicular(); + public new Vector2 StartPosition => base.StartPosition - this.Direction * 1100; + public new Vector2 EndPosition => base.StartPosition + this.Direction * 1100; + + #endregion + + #region Public Methods and Operators + + internal override void UpdatePolygon() + { + Rectangle = new RectanglePoly(this.StartPosition, this.EndPosition, 55); + this.UpdatePath(); + } + + internal override void UpdatePath() + { + this.Path = Rectangle.ToClipperPath(); + } + + #endregion + } +} diff --git a/Core/Wrappers/Spells/Tracker/Skillshots/_ZiggsR.cs b/Core/Wrappers/Spells/Tracker/Skillshots/_ZiggsR.cs index dc149fa..5f2bad4 100644 --- a/Core/Wrappers/Spells/Tracker/Skillshots/_ZiggsR.cs +++ b/Core/Wrappers/Spells/Tracker/Skillshots/_ZiggsR.cs @@ -2,6 +2,8 @@ { public class _ZiggsR : Skillshot { + private CirclePoly Circle; + #region Constructors and Destructors public _ZiggsR() @@ -16,5 +18,20 @@ public _ZiggsR() public new int Delay => (int)(1500 + 1500 * this.EndPosition.Distance(this.StartPosition) / this.SData.Range); #endregion + + #region Public Methods and Operators + + internal override void UpdatePolygon() + { + Circle = new CirclePoly(this.EndPosition, this.SData.Radius); + this.UpdatePath(); + } + + internal override void UpdatePath() + { + this.Path = Circle.ToClipperPath(); + } + + #endregion } } \ No newline at end of file diff --git a/Core/Wrappers/Spells/Tracker/Skillshots/_syndrae5.cs b/Core/Wrappers/Spells/Tracker/Skillshots/_syndrae5.cs new file mode 100644 index 0000000..f9aaed3 --- /dev/null +++ b/Core/Wrappers/Spells/Tracker/Skillshots/_syndrae5.cs @@ -0,0 +1,73 @@ +namespace LeagueSharp.SDK.Core.Wrappers.Spells.Tracker.Skillshots +{ + using System; + using System.Linq; + using System.Collections.Generic; + using LeagueSharp.SDK; + + using Clipper; + using SharpDX; + + public class _syndrae5 : Skillshot + { + private Polygon Polygon; + + #region Constructors and Destructors + + public _syndrae5() + : base("syndrae5") + { + } + + #endregion + + #region Public Methods and Operators + + internal override void UpdatePolygon() + { + Polygon = new Polygon(); + + var angle = 60; + var edge1 = + (this.EndPosition - this.Caster.ServerPosition.ToVector2()).Rotated( + -angle / 2 * (float)Math.PI / 180); + var edge2 = edge1.Rotated(angle * (float)Math.PI / 180); + + var positions = new List(); + + //detect syndra q which havent exploded yet + var explodingQ = Tracker.DetectedSkillshots.FirstOrDefault(p => p.SData.SpellName == "SyndraQ"); + if (explodingQ != null) + positions.Add(explodingQ.EndPosition); + + //detect syndra qs which have already exploded + var seeds = ObjectManager.Get().Where(p => p.Name == "Seed" && !p.IsDead && p.Team == this.Caster.Team).Select(q => q.ServerPosition.ToVector2()); + foreach (var seed in seeds) + positions.Add(seed); + + foreach (var position in positions) + { + var v = position - this.Caster.ServerPosition.ToVector2(); + if (edge1.CrossProduct(v) > 0 && v.CrossProduct(edge2) > 0 && + position.Distance(this.Caster.ServerPosition) < 800) + { + var start = position; + var end = this.Caster.ServerPosition.ToVector2() + .Extend( + position, + this.Caster.Distance(position) > 200 ? 1300 : 1000); + + Polygon.Add(new RectanglePoly(start, end, this.SData.Width)); + } + } + this.UpdatePath(); + } + + internal override void UpdatePath() + { + this.Path = Polygon.ToClipperPath(); + } + + #endregion + } +} diff --git a/LeagueSharp.SDK.csproj b/LeagueSharp.SDK.csproj index ee8ff05..70a938f 100644 --- a/LeagueSharp.SDK.csproj +++ b/LeagueSharp.SDK.csproj @@ -303,6 +303,15 @@ + + + + + + + + +