本文整理汇总了C#中LeagueSharp.Common.Spell.IsInRange方法的典型用法代码示例。如果您正苦于以下问题:C# Spell.IsInRange方法的具体用法?C# Spell.IsInRange怎么用?C# Spell.IsInRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LeagueSharp.Common.Spell
的用法示例。
在下文中一共展示了Spell.IsInRange方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Minions
public static Vector2 Minions(Spell spell, MobTypes mobTypes = MobTypes.All, int minMobCount = 1)
{
var rangedMinionsE = LeagueSharp.Common.MinionManager.GetMinions(
ObjectManager.Player.ServerPosition,
Spells.E.Range);
var minionsE = Spells.E.GetCircularFarmLocation(rangedMinionsE, spell.Range);
if (minionsE.MinionsHit < minMobCount || !spell.IsInRange(minionsE.Position))
{
return new Vector2();
}
return minionsE.Position;
}
示例2: GetCircularFarmLocation
public static Vector2 GetCircularFarmLocation(Spell spell, MobTypes mobTypes = MobTypes.All,
int minMobCount = 1)
{
var cVector = new Vector2();
var rangedMinionsE = LeagueSharp.Common.MinionManager.GetMinions(ObjectManager.Player.ServerPosition,
spell.Range);
var minionsE = spell.GetCircularFarmLocation(rangedMinionsE, spell.Range);
if (minionsE.MinionsHit > minMobCount && spell.IsInRange(minionsE.Position))
{
cVector = minionsE.Position;
}
return cVector;
}
示例3: SpellPrediction
public static bool SpellPrediction(Spell spell, Obj_AI_Hero target,bool collisionable)
{
//
var dist = ObjectManager.Player.Distance(target.Position);
var pos1 = LeagueSharp.Common.Prediction.GetPrediction(target, dist / spell.Speed).UnitPosition;
var e = pos1.Distance(target.GetWaypoints()[1].To3D());
pos1.Extend(target.GetWaypoints()[1].To3D(), -e);
Render.Circle.DrawCircle(pos1, 10, System.Drawing.Color.BlueViolet, 2);
//
var point = PointsAroundTheTarget(target.Position, target.BoundingRadius + 50).FirstOrDefault(t => t.IsWall());
if (point.X != 0 && point.Y != 0 && point.Z != 0)
{
if (MinionCollideLine(ObjectManager.Player.Position, ExtendWallpos(target, point), spell,collisionable)) return false;
Render.Circle.DrawCircle(ExtendWallpos(target, point), 10, System.Drawing.Color.Brown, 2);
spell.Cast(ExtendWallpos(target, point));
return true;
}
else
{
var range = spell.Range;
if (target.Position.Distance(ObjectManager.Player.Position) < target.GetWaypoints()[1].Distance(ObjectManager.Player.Position))
{
range -= 100;
}
if (!spell.IsInRange(target, range)) return false;
if (target.IsFacing(ObjectManager.Player) && target.Position.Distance(ObjectManager.Player.Position) > target.GetWaypoints()[1].Distance(ObjectManager.Player.Position))
{
if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;
spell.Cast(target.Position);
return true;
}
// float speed =
if (target.IsImmovable) // check for cc guys
{
if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;
spell.Cast(target.Position);
return true;
}
// if(target.IsChannelingImportantSpell())
if (target.IsWindingUp && !target.IsMelee())
{
if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;
spell.Cast(target.Position);
return true;
}
if (target.Position.Distance(ObjectManager.Player.Position) <= 300)
{
CastToDirection( target, spell,collisionable);
}
else
{
var oldPos = target.GetWaypoints()[0].To3D();
var h = false;
Utility.DelayAction.Add(Game.Ping + 1000, () => h = Next(target, oldPos, spell,collisionable));
return h;
}
}
return false;
}
示例4: SpellPrediction
public static bool SpellPrediction(Spell spell, Obj_AI_Hero target,bool collisionable)
{
//
var dist = ObjectManager.Player.Distance(target.Position);
var pos1 = LeagueSharp.Common.Prediction.GetPrediction(target, dist / spell.Speed).UnitPosition-40;
var dister = target.Position.Extend(target.GetWaypoints()[1].To3D(), target.GetWaypoints()[1].To3D().Distance(target.Position) + 50);
// var pos1 = LeagueSharp.Common.Prediction.GetPrediction(target, dist / spell.Speed).UnitPosition - 40;
var wts = Drawing.WorldToScreen(target.Position);
var wtsx = target.GetWaypoints()[1];
Drawing.DrawLine(wts[0], wts[1], wtsx[0], wtsx[1], 2f, System.Drawing.Color.Red);
var e = pos1.Distance(target.GetWaypoints()[1].To3D());
pos1.Extend(target.GetWaypoints()[1].To3D(), -e);
Render.Circle.DrawCircle(dister, 10, System.Drawing.Color.GreenYellow, 2);
Render.Circle.DrawCircle(pos1, 10, System.Drawing.Color.BlueViolet, 2);
//
var point = PointsAroundTheTarget(target.Position, target.BoundingRadius + 50).FirstOrDefault(t => t.IsWall());
if (point.X != 0 && point.Y != 0 && point.Z != 0)
{
if (MinionCollideLine(ObjectManager.Player.Position, ExtendWallpos(target, point), spell,collisionable)) return false;
Render.Circle.DrawCircle(ExtendWallpos(target, point), 10, System.Drawing.Color.Brown, 2);
spell.Cast(ExtendWallpos(target, point));
return true;
}
else
{
var range = spell.Range;
if (target.Position.Distance(ObjectManager.Player.Position) < target.GetWaypoints()[1].Distance(ObjectManager.Player.Position))
{
range -= 100;
}
if (!spell.IsInRange(target, range)) return false;
/*if (target.IsFacing(ObjectManager.Player) && target.Position.Distance(ObjectManager.Player.Position) > target.GetWaypoints()[1].Distance(ObjectManager.Player.Position))
{
if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;
{
Game.PrintChat("Casteando por inface");
spell.Cast(target.Position);
return true;
}
}*/
// code of dashes
if (target.IsDashing())
{
float timeforArrive=(target.Position.Distance(target.GetDashInfo().EndPos.To3D()))/target.GetDashInfo().Speed;
float grabtime =( ObjectManager.Player.Position.Distance(target.GetDashInfo().EndPos.To3D())
/ spell.Speed)+spell.Delay;
if (timeforArrive<grabtime)
{
spell.Cast(target.GetDashInfo().EndPos);
return true;
}
}
/* if (target.IsImmovable) // check for cc guys
{
if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;
spell.Cast(target.Position);
return true;
}*/
// if(target.IsChannelingImportantSpell())
if (target.IsWindingUp && !target.IsMelee())
{
if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;
spell.Cast(target.Position);
return true;
}
if (target.Position.Distance(ObjectManager.Player.Position) <= 300)
{
CastToDirection( target, spell,collisionable);
}
else
{
var oldPos = target.GetWaypoints()[0].To3D();
var h = false;
Utility.DelayAction.Add(Game.Ping + 1000, () => h = Next(target, oldPos, spell,collisionable));
return h;
}
}
return false;
}
示例5: SmiteCollision
public static bool SmiteCollision(Obj_AI_Hero Target, Spell Skill)
{
if (!SmiteReady()) return false;
var ListCol = Skill.GetPrediction(Target).CollisionObjects.Where(i => IsValid(i, Skill.Range) && Skill.WillHit(i.Position, Target.Position, (int)i.BoundingRadius));
if (Skill.IsInRange(Target.Position) && ListCol.Count() == 1)
{
if (ListCol.First() is Obj_AI_Minion && CastSmite(ListCol.First()))
{
Skill.Cast(Target.Position);
return true;
}
}
return false;
}
示例6: getMinionsOnRange
public Obj_AI_Base getMinionsOnRange(Spell spell)
{
return ObjectManager.Get<Obj_AI_Base>().Where(x => spell.IsInRange(x)).MinOrDefault(x => x.Distance(Game.CursorPos));
}