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; 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, Config.SkillShotsExtraRadius + (int)ObjectManager.Player.BoundingRadius); break; } UpdatePolygon(); }
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; 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, Config.SkillShotsExtraRadius + (int) ObjectManager.Player.BoundingRadius); break; } UpdatePolygon(); }