本文整理汇总了C#中LeagueSharp.Common.Geometry.Polygon.Circle类的典型用法代码示例。如果您正苦于以下问题:C# Geometry.Polygon.Circle类的具体用法?C# Geometry.Polygon.Circle怎么用?C# Geometry.Polygon.Circle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Geometry.Polygon.Circle类属于LeagueSharp.Common命名空间,在下文中一共展示了Geometry.Polygon.Circle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnCreate
private static void OnCreate(GameObject sender, EventArgs args)
{
// Game.PrintChat(sender.Name);
if (sender.Name.ToLower().Contains("veigar_base_e_cage"))
{
Cage = sender;
if (Cage != null)
newCircle = new Geometry.Polygon.Circle(Cage.Position, 450);
}
}
开发者ID:Faqer,项目名称:LeagueSharp-3,代码行数:11,代码来源:Veigar.cs
示例2: GetDashPosition
public static Vector3 GetDashPosition(Spell spell, Obj_AI_Hero target, float safetyDistance)
{
var distance = target.Distance(ObjectManager.Player);
var dashPoints = new Geometry.Polygon.Circle(ObjectManager.Player.Position, spell.Range).Points;
if (distance < safetyDistance)
{
dashPoints.AddRange(
new Geometry.Polygon.Circle(ObjectManager.Player.Position, safetyDistance - distance).Points);
}
dashPoints = dashPoints.Where(p => !p.IsWall()).OrderBy(p => p.Distance(Game.CursorPos)).ToList();
foreach (var point in dashPoints)
{
var allies =
GameObjects.AllyHeroes.Where(
hero => !hero.IsDead && hero.Distance(point.To3D()) < ObjectManager.Player.AttackRange).ToList();
var enemies =
GameObjects.EnemyHeroes.Where(
hero => hero.IsValidTarget(ObjectManager.Player.AttackRange, true, point.To3D())).ToList();
var lowEnemies = enemies.Where(hero => hero.HealthPercent <= 15).ToList();
if (!point.To3D().IsUnderTurret(false))
{
if (enemies.Count == 1 &&
(!target.IsMelee ||
(target.HealthPercent <= ObjectManager.Player.HealthPercent - 25 ||
target.Position.Distance(point.To3D()) >= safetyDistance)) ||
allies.Count >
enemies.Count -
(ObjectManager.Player.HealthPercent >= (10 * lowEnemies.Count) ? lowEnemies.Count : 0))
{
return point.To3D();
}
}
else
{
if (enemies.Count == 1 && lowEnemies.Any(t => t.NetworkId.Equals(target.NetworkId)))
{
return point.To3D();
}
}
}
return Vector3.Zero;
}
开发者ID:JelloBeans,项目名称:LeagueSharp-Dev,代码行数:44,代码来源:Utils.cs
示例3: OnCreate
private static void OnCreate(GameObject sender, EventArgs args)
{
// if (args == EventArgs.Empty) return;
// Game.PrintChat(sender.Name);
if (sender.Name.ToLower().Contains("gragas_base_q"))
{
if (sender.Name.ToLower().Contains("ally"))
{
Barrel = sender;
if (Barrel != null)
CirclePoly = new Geometry.Polygon.Circle(Barrel.Position, 300);
}
if (!sender.Name.ToLower().Contains("end")) return;
Barrel = null;
CirclePoly = null;
}
}
开发者ID:Faqer,项目名称:LeagueSharp-3,代码行数:19,代码来源:Gragas.cs
示例4: GetUltimateExplosionHits
/// <summary>
/// Get the ultimate explosion hit count with best location
/// </summary>
/// <param name="target"></param>
/// <returns></returns>
private Tuple<int, List<Obj_AI_Hero>, Vector3> GetUltimateExplosionHits(Obj_AI_Hero target)
{
var hits = new List<Obj_AI_Hero>();
var castPosition = Vector3.Zero;
try
{
var prediction = R.GetPrediction(target);
if (prediction.Hitchance >= R.GetHitChance("combo"))
{
castPosition = prediction.CastPosition;
hits.Add(target);
var explosion = new PredictionInput
{
Range = UltimateExplosion.Range,
Delay = Player.Position.Distance(castPosition) / R.Speed + 0.1f,
From = castPosition,
RangeCheckFrom = castPosition,
Radius = UltimateExplosion.Width,
Type = SkillshotType.SkillshotCircle,
Speed = UltimateExplosion.Speed
};
var explosionCircle = new Geometry.Polygon.Circle(castPosition, UltimateExplosion.Width);
foreach (var enemy in GameObjects.EnemyHeroes.Where(e => e.IsValidTarget() && e.NetworkId != target.NetworkId))
{
explosion.Unit = enemy;
var explosionPrediction = Prediction.GetPrediction(explosion);
if (!explosionPrediction.UnitPosition.Equals(Vector3.Zero))
{
var enemyPosition = new Geometry.Polygon.Circle(enemy.Position, enemy.BoundingRadius);
if (enemyPosition.Points.Any(p => explosionCircle.IsInside(p)))
{
hits.Add(enemy);
}
}
}
}
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
return new Tuple<int, List<Obj_AI_Hero>, Vector3>(hits.Count, hits, castPosition);
}
开发者ID:JelloBeans,项目名称:LeagueSharp-Dev,代码行数:53,代码来源:Jinx.cs
示例5: BestQPosition
private Tuple<int, Vector3> BestQPosition(Obj_AI_Base target, List<Obj_AI_Base> targets, HitChance hitChance)
{
var castPos = Vector3.Zero;
var totalHits = 0;
try
{
var enemies = targets.Where(e => e.IsValidTarget(Q.Range * 1.5f)).ToList();
var enemyPositions = new List<Tuple<Obj_AI_Base, Vector3>>();
var circle = new Geometry.Polygon.Circle(Player.Position, Player.BoundingRadius, 30).Points;
foreach (var h in enemies)
{
var ePred = Q.GetPrediction(h);
if (ePred.Hitchance >= hitChance)
{
circle.Add(Player.Position.Extend(ePred.UnitPosition, Player.BoundingRadius).To2D());
enemyPositions.Add(new Tuple<Obj_AI_Base, Vector3>(h, ePred.UnitPosition));
}
}
var targetPos = target == null ? Vector3.Zero : target.Position;
if (target == null)
{
var possibilities =
ListExtensions.ProduceEnumeration(enemyPositions).Where(p => p.Count > 0).ToList();
var count = 0;
foreach (var possibility in possibilities)
{
var mec = MEC.GetMec(possibility.Select(p => p.Item2.To2D()).ToList());
if (mec.Radius < Q.Width && possibility.Count > count)
{
count = possibility.Count;
targetPos = mec.Center.To3D();
}
}
}
if (targetPos.Equals(Vector3.Zero))
{
return new Tuple<int, Vector3>(totalHits, castPos);
}
circle = circle.OrderBy(c => c.Distance(targetPos)).ToList();
if (!enemyPositions.Any())
{
return new Tuple<int, Vector3>(totalHits, castPos);
}
foreach (var point in circle)
{
var hits = 0;
var containsTarget = false;
var direction = Q.Range * (point.To3D() - ObjectManager.Player.Position).Normalized().To2D();
var rect1 = new Geometry.Polygon.Rectangle(
Player.Position, Player.Position.Extend(Player.Position + direction.To3D(), Q.Range), Q.Width);
var rect2 = new Geometry.Polygon.Rectangle(
Player.Position,
Player.Position.Extend(Player.Position + direction.Rotated(QAngle).To3D(), Q.Range), Q.Width);
var rect3 = new Geometry.Polygon.Rectangle(
Player.Position,
Player.Position.Extend(Player.Position + direction.Rotated(-QAngle).To3D(), Q.Range), Q.Width);
foreach (var enemy in enemyPositions)
{
var bounding = new Geometry.Polygon.Circle(enemy.Item2, enemy.Item1.BoundingRadius * 0.85f);
if (bounding.Points.Any(p => rect1.IsInside(p) || rect2.IsInside(p) || rect3.IsInside(p)))
{
hits++;
if (target != null && enemy.Item1.NetworkId.Equals(target.NetworkId))
{
containsTarget = true;
}
}
}
if ((containsTarget || target == null) && hits > totalHits)
{
totalHits = hits;
castPos = Player.Position.Extend(point.To3D(), Q.Range);
if (totalHits >= enemies.Count)
{
break;
}
}
}
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
return new Tuple<int, Vector3>(totalHits, castPos);
}
开发者ID:4859aa,项目名称:LeagueSharp-Dev,代码行数:87,代码来源:TwistedFate.cs
示例6: BestRFollowLocation
private Vector3 BestRFollowLocation(Vector3 position)
{
try
{
var center = Vector2.Zero;
float radius = -1;
var count = 0;
var moveDistance = -1f;
var maxRelocation = IsSpellUpgraded(R) ? R.Width * 1.2f : R.Width * 0.8f;
var targets = GameObjects.EnemyHeroes.Where(t => t.IsValidTarget(1500f)).ToList();
var circle = new Geometry.Polygon.Circle(position, R.Width);
if (targets.Any())
{
var minDistance = targets.Any(t => circle.IsInside(t)) ? targets.Min(t => t.BoundingRadius) * 2 : 0;
var possibilities =
ListExtensions.ProduceEnumeration(targets.Select(t => t.Position.To2D()).ToList())
.Where(p => p.Count > 1)
.ToList();
if (possibilities.Any())
{
foreach (var possibility in possibilities)
{
var mec = MEC.GetMec(possibility);
var distance = position.Distance(mec.Center.To3D());
if (mec.Radius < R.Width && distance < maxRelocation && distance > minDistance)
{
if (possibility.Count > count ||
possibility.Count == count && (mec.Radius < radius || distance < moveDistance))
{
moveDistance = position.Distance(mec.Center.To3D());
center = mec.Center;
radius = mec.Radius;
count = possibility.Count;
}
}
}
if (!center.Equals(Vector2.Zero))
{
return center.To3D();
}
}
var dTarget = targets.OrderBy(t => t.Distance(position)).FirstOrDefault();
if (dTarget != null && position.Distance(dTarget.Position) > minDistance)
{
return dTarget.Position;
}
}
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
return Vector3.Zero;
}
开发者ID:juan2202,项目名称:LeagueSharp-Standalones,代码行数:54,代码来源:Viktor.cs
示例7: GetBestQLocation
private Tuple<int, Vector3> GetBestQLocation(Obj_AI_Hero target, HitChance hitChance)
{
try
{
if (target == null)
{
return new Tuple<int, Vector3>(0, Vector3.Zero);
}
var hits = new List<Obj_AI_Hero>();
var center = Vector3.Zero;
var radius = float.MaxValue;
var range = Q.Range + Q.Width + target.BoundingRadius * 0.85f;
var positions = (from t in GameObjects.EnemyHeroes
where t.IsValidTarget(range, true, Q.RangeCheckFrom)
let prediction = Q.GetPrediction(t)
where prediction.Hitchance >= (hitChance - 1)
select new CPrediction.Position(t, prediction.UnitPosition)).ToList();
if (positions.Any())
{
var mainTarget = positions.FirstOrDefault(p => p.Hero.NetworkId == target.NetworkId);
var possibilities =
ListExtensions.ProduceEnumeration(
positions.Where(p => p.UnitPosition.Distance(mainTarget.UnitPosition) <= Q.Width * 0.85f)
.ToList())
.Where(p => p.Count > 0 && p.Any(t => t.Hero.NetworkId == mainTarget.Hero.NetworkId))
.ToList();
var rReady = R.IsReady();
var wReady = W.IsReady();
foreach (var possibility in possibilities)
{
var mec = MEC.GetMec(possibility.Select(p => p.UnitPosition.To2D()).ToList());
var distance = Q.From.Distance(mec.Center.To3D());
if (distance < range)
{
if (mec.Radius < R.Width * 0.85f && possibility.Count >= 3 && rReady ||
mec.Radius < W.Width * 0.9f && possibility.Count >= 2 && wReady ||
mec.Radius < Q.Width * 0.9f && possibility.Count >= 1)
{
var lHits = new List<Obj_AI_Hero>();
var circle =
new Geometry.Polygon.Circle(
Q.From.Extend(mec.Center.To3D(), Q.Range > distance ? distance : Q.Range),
Q.Width);
lHits.AddRange(
(from position in positions
where
new Geometry.Polygon.Circle(
position.UnitPosition, (position.Hero.BoundingRadius * 0.85f)).Points
.Any(p => circle.IsInside(p))
select position.Hero));
if ((lHits.Count > hits.Count || lHits.Count == hits.Count && mec.Radius < radius ||
lHits.Count == hits.Count &&
Q.From.Distance(circle.Center.To3D()) < Q.From.Distance(center)) &&
lHits.Any(p => p.NetworkId == target.NetworkId))
{
center = circle.Center.To3D2();
radius = mec.Radius;
hits.Clear();
hits.AddRange(lHits);
}
}
}
}
if (!center.Equals(Vector3.Zero))
{
return new Tuple<int, Vector3>(hits.Count, center);
}
}
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
return new Tuple<int, Vector3>(0, Vector3.Zero);
}
开发者ID:k88173,项目名称:LeagueSharp-Dev,代码行数:77,代码来源:Orianna.cs
示例8: WPPolygon
private static Paths WPPolygon(Obj_AI_Hero Hero)
{
List<Vector2Time> HeroPath = Hero.GetWaypointsWithTime();
Vector2 myPath;
Paths WPPaths = new Paths();
for (var i = 0; i < HeroPath.Count() - 1; i++)
{
if (HeroPath.ElementAt<Vector2Time>(i + 1).Time <= 0.6f)
{
Geometry.Polygon.Rectangle WPRectangle = new Geometry.Polygon.Rectangle(HeroPath.ElementAt<Vector2Time>(i).Position, HeroPath.ElementAt<Vector2Time>(i + 1).Position, Hero.BoundingRadius);
Geometry.Polygon.Circle Box = new Geometry.Polygon.Circle(HeroPath.ElementAt<Vector2Time>(i).Position, Hero.BoundingRadius);
WPPaths.Add(Box.ToClipperPath());
WPPaths.Add(WPRectangle.ToClipperPath());
}
else
{
myPath = PositionAfter(Hero, 0.6f, Hero.MoveSpeed);
Geometry.Polygon.Rectangle WPRectangle = new Geometry.Polygon.Rectangle(HeroPath.ElementAt<Vector2Time>(i).Position, myPath, Hero.BoundingRadius);
Geometry.Polygon.Circle Box = new Geometry.Polygon.Circle(myPath, Hero.BoundingRadius);
WPPaths.Add(Box.ToClipperPath());
WPPaths.Add(WPRectangle.ToClipperPath());
break;
}
}
Geometry.Polygon.Circle WPFirstBox = new Geometry.Polygon.Circle(HeroPath.First<Vector2Time>().Position, Hero.BoundingRadius);
WPPaths.Add(WPFirstBox.ToClipperPath());
return WPPaths;
}
开发者ID:BaFuSs,项目名称:test,代码行数:28,代码来源:Program.cs
示例9: ELogicFarm
private void ELogicFarm(List<Obj_AI_Base> targets, HitChance hitChance, int minHits)
{
try
{
var input = new PredictionInput
{
Range = ELength,
Delay = E.Delay,
Radius = E.Width,
Speed = E.Speed,
Type = E.Type
};
var input2 = new PredictionInput
{
Range = E.Range + ELength,
Delay = E.Delay,
Radius = E.Width,
Speed = E.Speed,
Type = E.Type
};
var startPos = Vector3.Zero;
var endPos = Vector3.Zero;
var hits = 0;
targets = targets.Where(t => t.IsValidTarget((E.Range + ELength + E.Width) * 1.1f)).ToList();
var targetCount = targets.Count;
foreach (var target in targets)
{
var lTarget = target;
if (target.ServerPosition.Distance(Player.ServerPosition) <= E.Range)
{
var cCastPos = target.ServerPosition;
foreach (var t in targets.Where(t => t.NetworkId != lTarget.NetworkId))
{
var count = 1;
input.Unit = t;
input.From = cCastPos;
input.RangeCheckFrom = cCastPos;
var pred = Prediction.GetPrediction(input);
var rect = new Geometry.Polygon.Rectangle(
cCastPos.To2D(), cCastPos.Extend(pred.CastPosition, ELength).To2D(), E.Width);
foreach (var c in targets.Where(c => c.NetworkId != lTarget.NetworkId))
{
input.Unit = c;
var cPredPos = c.Position;
if (
new Geometry.Polygon.Circle(
cPredPos, (c.IsMoving ? (c.BoundingRadius / 2f) : (c.BoundingRadius) * 0.9f))
.Points.Any(p => rect.IsInside(p)))
{
count++;
}
}
if (pred.Hitchance >= (hitChance - 1))
{
count++;
if (count > hits)
{
hits = count;
startPos = cCastPos;
endPos = cCastPos.Extend(pred.CastPosition, ELength);
if (hits == targetCount)
{
break;
}
}
}
}
if (endPos.Equals(Vector3.Zero))
{
startPos = cCastPos;
if (IsSpellUpgraded(E))
{
if (target.Path.Length > 0)
{
var newPos = target.Path[0];
if (target.Path.Length > 1 && newPos.Distance(target.ServerPosition) <= 150)
{
newPos = newPos.Extend(target.Path[1], 50);
}
startPos = target.ServerPosition.Extend(newPos, -(lTarget.BoundingRadius * 0.85f));
}
else if (target.IsFacing(Player))
{
startPos = target.ServerPosition.Extend(
Player.ServerPosition, -(lTarget.BoundingRadius * 0.85f));
}
else
{
startPos = cCastPos;
}
}
if (startPos.Distance(Player.ServerPosition) > E.Range)
{
startPos = Player.ServerPosition.Extend(startPos, E.Range);
}
if (target.Path.Length > 0)
{
endPos = startPos.Extend(target.Path[0], ELength);
}
//.........这里部分代码省略.........
开发者ID:zombiesing,项目名称:LeagueSharp-Standalones,代码行数:101,代码来源:Viktor.cs
示例10: Skillshot
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.Polygon.Circle(CollisionEnd, spellData.Radius, 22);
break;
case SkillShotType.SkillshotLine:
case SkillShotType.SkillshotMissileLine:
Rectangle = new Geometry.Polygon.Rectangle(Start, CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotCone:
Sector = new Geometry.Polygon.Sector(
start, CollisionEnd - start, spellData.Radius * (float) Math.PI / 180, spellData.Range, 22);
break;
case SkillShotType.SkillshotRing:
Ring = new Geometry.Polygon.Ring(CollisionEnd, spellData.Radius, spellData.RingRadius, 22);
break;
}
UpdatePolygon();
}
开发者ID:WTayllor,项目名称:LeagueSharp-6,代码行数:33,代码来源:Skillshot.cs
示例11: Skillshot
public Skillshot(
DetectionType detectionType,
SpellData spellData,
int startT,
Vector2 start,
Vector2 end,
Obj_AI_Base unit)
{
this.DetectionType = detectionType;
this.SpellData = spellData;
this.StartTick = startT;
this.Start = start;
this.End = end;
this.Direction = (end - start).Normalized();
this.Unit = unit;
switch (spellData.Type)
{
case SkillShotType.SkillshotCircle:
this.Circle = new Geometry.Polygon.Circle(this.CollisionEnd, spellData.Radius, 22);
break;
case SkillShotType.SkillshotLine:
case SkillShotType.SkillshotMissileLine:
this.Rectangle = new Geometry.Polygon.Rectangle(this.Start, this.CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotCone:
this.Sector = new Geometry.Polygon.Sector(
start,
this.CollisionEnd - start,
spellData.Radius * (float)Math.PI / 180,
spellData.Range,
22);
break;
case SkillShotType.SkillshotRing:
this.Ring = new Geometry.Polygon.Ring(this.CollisionEnd, spellData.Radius, spellData.RingRadius, 22);
break;
case SkillShotType.SkillshotArc:
this.Arc = new Geometry.Polygon.Arc(
start,
end,
Configs.SkillShotsExtraRadius + (int)ObjectManager.Player.BoundingRadius,
22);
break;
}
this.UpdatePolygon();
}
开发者ID:pandaChoi,项目名称:LeagueSharp-3,代码行数:45,代码来源:Skillshot.cs
示例12: GetHits
private Tuple<int, List<Obj_AI_Hero>> GetHits(Spell spell)
{
try
{
var hits = new List<Obj_AI_Hero>();
var positions = (from t in GameObjects.EnemyHeroes
where t.IsValidTarget(spell.Width * 4, true, spell.RangeCheckFrom)
let prediction = spell.GetPrediction(t)
where prediction.Hitchance >= HitChance.High
select new CPrediction.Position(t, prediction.UnitPosition)).ToList();
if (positions.Any())
{
var circle = new Geometry.Polygon.Circle(Ball.Position, spell.Width);
hits.AddRange(
from position in positions
where
!position.Hero.IsDashing() ||
(position.Hero.Distance(Ball.Position) >= 100f &&
position.Hero.Position.Distance(Ball.Position) >
position.Hero.GetDashInfo().EndPos.Distance(Ball.Position) - 50f)
where
new Geometry.Polygon.Circle(
position.UnitPosition,
(position.Hero.BoundingRadius * CPrediction.BoundingRadiusMultiplicator)).Points.Any(
p => circle.IsInside(p))
select position.Hero);
return new Tuple<int, List<Obj_AI_Hero>>(hits.Count, hits);
}
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
return new Tuple<int, List<Obj_AI_Hero>>(0, null);
}
开发者ID:hprobotic,项目名称:LeagueSharp-Dev,代码行数:35,代码来源:Orianna.cs
示例13: CastMec
private static void CastMec(Spell spell, int minHit)
{
if (!spell.IsReady() || ObjectManager.Player.HealthPercent <= 10)
return;
foreach (var target in HeroManager.Enemies.Where(x => x.IsValidTarget(spell.Range)))
{
var pred = spell.GetPrediction(target, true);
var nearByEnemies = 1;
if (spell.Type == SkillshotType.SkillshotLine && spell.Collision)
{
var poly = new Geometry.Polygon.Circle(pred.UnitPosition, spell.Width);
nearByEnemies +=
HeroManager.Enemies.Where(x => x.NetworkId != target.NetworkId)
.Count(enemy => poly.IsInside(enemy.ServerPosition));
}
else
{
nearByEnemies = pred.AoeTargetsHitCount;
}
if (nearByEnemies >= minHit)
{
spell.Cast(target);
return;
}
}
}
开发者ID:leenam0910,项目名称:LSharp,代码行数:33,代码来源:AOESpellManager.cs
示例14: CastComboMec
private static void CastComboMec(Spell spell, int minHit)
{
if (!spell.IsReady() || !E.IsReady() || ObjectManager.Player.HealthPercent <= 10)
return;
const int gateDis = 200;
foreach (var target in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range)))
{
var tarPred = spell.GetPrediction(target, true);
Vector3 gateVector = ObjectManager.Player.Position + Vector3.Normalize(target.ServerPosition - ObjectManager.Player.Position)*gateDis;
var nearByEnemies = 1;
var poly = new Geometry.Polygon.Circle(tarPred.UnitPosition, spell.Width);
nearByEnemies += HeroManager.Enemies.Where(x => x.NetworkId != target.NetworkId).Count(enemy => poly.IsInside(enemy.ServerPosition));
if (ObjectManager.Player.Distance(tarPred.CastPosition) < spell.Range + 100 && nearByEnemies >= minHit)
{
if (Jayce.HammerTime && R.IsReady() && Jayce.CanQcd == 0 && Jayce.CanEcd == 0)
R.Cast();
else if(Jayce.HammerTime)
return;
Console.WriteLine("Hit Combo: " + nearByEnemies);
E.Cast(gateVector);
spell.Cast(tarPred.CastPosition);
return;
}
}
}
开发者ID:leenam0910,项目名称:LSharp,代码行数:33,代码来源:AOESpellManager.cs
示例15: GetMaxRHits
private Tuple<List<Obj_AI_Hero>, Vector3> GetMaxRHits(HitChance hitChance, Vector3 fromCheck = default(Vector3))
{
if (fromCheck.Equals(default(Vector3)))
{
fromCheck = ObjectManager.Player.Position;
}
var input = new PredictionInput
{
Collision = true,
CollisionObjects = new[] { CollisionableObjects.YasuoWall },
From = fromCheck,
RangeCheckFrom = fromCheck,
Type = R.Type,
Radius = R.Width,
Delay = R.Delay,
Speed = R.Speed,
Range = R.Range,
Aoe = true
};
var castPosition = Vector3.Zero;
var totalHits = new List<Obj_AI_Hero>();
try
{
var positions = new List<CPrediction.Position>();
foreach (var t in GameObjects.EnemyHeroes)
{
if (t.IsValidTarget(R.Range * 1.5f, true, fromCheck))
{
input.Unit = t;
var prediction = Prediction.GetPrediction(input);
if (prediction.Hitchance >= hitChance)
{
positions.Add(new CPrediction.Position(t, prediction.UnitPosition));
}
}
}
var circle = new Geometry.Polygon.Circle(fromCheck, R.Range).Points;
foreach (var point in circle)
{
var hits = new List<Obj_AI_Hero>();
foreach (var position in positions)
{
R.UpdateSourcePosition(fromCheck, fromCheck);
if (R.WillHit(position.UnitPosition, point.To3D()))
{
hits.Add(position.Hero);
}
R.UpdateSourcePosition();
}
if (hits.Count > totalHits.Count)
{
castPosition = point.To3D();
totalHits = hits;
}
}
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
return new Tuple<List<Obj_AI_Hero>, Vector3>(totalHits, castPosition);
}
开发者ID:julianrolandi,项目名称:LeagueSharp-Dev,代码行数:64,代码来源:Cassiopeia.cs
示例16: Circle
public static Result Circle(Spell spell, Obj_AI_Hero target, HitChance hitChance, bool boundingRadius = true)
{
try
{
if (spell == null || target == null)
{
return new Result(Vector3.Zero, new List<Obj_AI_Hero>());
}
var hits = new List<Obj_AI_Hero>();
var center = Vector3.Zero;
var radius = float.MaxValue;
var range = spell.Range + spell.Width +
(boundingRadius ? target.BoundingRadius * BoundingRadiusMultiplicator : 0);
var positions = (from t in GameObjects.EnemyHeroes
where t.IsValidTarget(range, true, spell.RangeCheckFrom)
let prediction = spell.GetPrediction(t)
where prediction.Hitchance >= hitChance
select new Position(t, prediction.UnitPosition)).ToList();
var spellWidth = spell.Width;
//+ (boundingRadius ? positions.Select(p => p.Hero).Min(p => p.BoundingRadius) : 0);
if (positions.Any())
{
var mainTarget = positions.FirstOrDefault(p => p.Hero.NetworkId == target.NetworkId);
var possibilities =
ListExtensions.ProduceEnumeration(
positions.Where(
p => p.UnitPosition.Distance(mainTarget.UnitPosition) <= spell.Width * 0.85f).ToList())
.Where(p => p.Count > 0 && p.Any(t => t.Hero.NetworkId == mainTarget.Hero.NetworkId))
.ToList();
foreach (var possibility in possibilities)
{
var mec = MEC.GetMec(possibility.Select(p => p.UnitPosition.To2D()).ToList());
var distance = spell.From.Distance(mec.Center.To3D());
if (mec.Radius < spellWidth && distance < range)
{
var lHits = new List<Obj_AI_Hero>();
var circle =
new Geometry.Polygon.Circle(
spell.From.Extend(
mec.Center.To3D(), spell.Range > distance ? distance : spell.Range), spell.Width);
if (boundingRadius)
{
lHits.AddRange(
(from position in positions
where
new Geometry.Polygon.Circle(
position.UnitPosition,
(position.Hero.BoundingRadius * BoundingRadiusMultiplicator)).Points.Any
(p => circle.IsInside(p))
select position.Hero));
}
else
{
lHits.AddRange(
from position in positions
where circle.IsInside(position.UnitPosition)
select position.Hero);
}
if ((lHits.Count > hits.Count || lHits.Count == hits.Count && mec.Radius < radius ||
lHits.Count == hits.Count &&
spell.From.Distance(circle.Center.To3D()) < spell.From.Distance(center)) &&
lHits.Any(p => p.NetworkId == target.NetworkId))
{
center = circle.Center.To3D2();
radius = mec.Radius;
hits.Clear();
hits.AddRange(lHits);
}
}
}
if (!center.Equals(Vector3.Zero))
{
return new Result(center, hits);
}
}
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
return new Result(Vector3.Zero, new List<Obj_AI_Hero>());
}
开发者ID:hprobotic,项目名称:LeagueSharp-Dev,代码行数:84,代码来源:CPrediction.cs
示例17: Obj_AI_Hero_OnProcessSpellCast
void Obj_AI_Hero_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
{
//Patented by XcxooxL
if (!sender.IsEnemy || !sender.IsValidTarget() || !sender.IsVisible) return;
if (args.Target != null && !args.Target.IsAlly) return;
double damage = 0;
//if it is an Auto Attack !
if (args.SData.IsAutoAttack())
{
var Target = args.Target as Obj_AI_Hero;
if (Target == null)
return; //must be a champion
if (args.SData.Name.ToLower().Contains("crit"))
{
damage += sender.GetAutoAttackDamage(Target) * 2;
//Console.WriteLine("Critical " + damage);
if (sender.InventoryItems.Any(item => item.Id.Equals(3031)))
{
Console.WriteLine("Infinity Edge");
damage += damage * 1.25;
}
//Infinity edge
}
else
{
damage += sender.GetAutoAttackDamage(Target, true);
}
damage += 2; //to be on the safe side
Add(Target, damage, sender.Distance(Target) / args.SData.MissileSpeed + 1 / sender.AttackDelay);
Console.WriteLine(
"Target : " + Target.Name + "Damage : " + damage + " Time To Hit : " +
sender.Distance(Target) / args.SData.MissileSpeed * 1000);
}
else //if its a Spell
{
float delay = 0;
var missileSpeed = args.SData.MissileSpeed;
foreach (var spellInfo in
SpellDatabase.Spells.Where(spellInfo => spellInfo.spellName.Equals(args.SData.Name)))
{
if (spellInfo.spellType.Equals(SpellType.Line))
{
_myPoly = new Geometry.Polygon.Rectangle(
args.Start, args.Start.Extend(args.End, spellInfo.range), spellInfo.radius);
}
else if (spellInfo.spellType.Equals(SpellType.Circular))
{
var pos = sender.Distance(args.End) > spellInfo.range
? sender.Position.Extend(args.End, spellInfo.range)
: args.End;
_myPoly = new Geometry.Polygon.Circle(pos, spellInfo.radius);
}
missileSpeed = spellInfo.projectileSpeed;
delay += spellInfo.spellDelay;
break;
}
//Patented by xcxooxl ALL OF THIS IS MINE ! YOU WANT IT? CREDIT ME!
if (sender is Obj_AI_Hero)
{
var enemy = sender as Obj_AI_Hero;
foreach (var ally in TrackList)
{
var timeToHit = delay + ally.Distance(args.Start) / missileSpeed * 1000 +
args.SData.ChannelDuration + args.SData.DelayTotalTimePercent * -1;
if (args.SData.TargettingType.Equals(SpellDataTa
|
请发表评论