本文整理汇总了C#中AIHeroClient.AvgPathLenght方法的典型用法代码示例。如果您正苦于以下问题:C# AIHeroClient.AvgPathLenght方法的具体用法?C# AIHeroClient.AvgPathLenght怎么用?C# AIHeroClient.AvgPathLenght使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AIHeroClient
的用法示例。
在下文中一共展示了AIHeroClient.AvgPathLenght方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPrediction
/// <summary>
/// Gets Prediction result
/// </summary>
/// <param name="target">Target for spell</param>
/// <param name="radius">Spell radius</param>
/// <param name="ringRadius">Ring radius</param>
/// <param name="delay">Spell delay</param>
/// <param name="missileSpeed">Spell missile speed</param>
/// <param name="range">Spell range</param>
/// <param name="collisionable">Spell collisionable</param>
/// <returns>Prediction result as <see cref="Prediction.Result" /></returns>
public static Prediction.Result GetPrediction(AIHeroClient target, float radius, float ringRadius, float delay,
float missileSpeed, float range, bool collisionable)
{
return GetPrediction(target, radius, ringRadius, delay, missileSpeed, range, collisionable,
target.GetWaypoints(), target.AvgMovChangeTime(), target.LastMovChangeTime(), target.AvgPathLenght(),
ObjectManager.Player.ServerPosition.LSTo2D(), ObjectManager.Player.ServerPosition.LSTo2D());
}
示例2: SPredictionCastVector
/// <summary>
/// Spell extension for cast vector spell with SPrediction
/// </summary>
/// <param name="s">Spell to cast</param>
/// <param name="t">Target for spell</param>
/// <param name="vectorLenght">Vector lenght</param>
/// <param name="hc">Minimum HitChance to cast</param>
/// <param name="reactionIgnoreDelay">Delay to ignore target's reaction time</param>
/// <param name="minHit">Minimum Hit Count to cast</param>
/// <param name="rangeCheckFrom">Position where spell will be casted from</param>
/// <param name="filterHPPercent">Minimum HP Percent to cast (for target)</param>
/// <returns>true if spell has casted</returns>
public static bool SPredictionCastVector(this Spell s, AIHeroClient t, float vectorLenght, HitChance hc,
int reactionIgnoreDelay = 0, byte minHit = 1, Vector3? rangeCheckFrom = null, float filterHPPercent = 100)
{
if (ConfigMenu.SelectedPrediction == 1)
throw new NotSupportedException("Vector Prediction not supported in Common prediction");
if (minHit > 1)
return SPredictionCastAoeVector(s, vectorLenght, minHit);
if (t.HealthPercent > filterHPPercent)
return false;
if (rangeCheckFrom == null)
rangeCheckFrom = ObjectManager.Player.ServerPosition;
var avgt = t.AvgMovChangeTime() + reactionIgnoreDelay;
float movt = t.LastMovChangeTime();
var avgp = t.AvgPathLenght();
var result = VectorPrediction.GetPrediction(t, s.Width, s.Delay, s.Speed, s.Range, vectorLenght,
t.GetWaypoints(), avgt, movt, avgp, s.RangeCheckFrom.LSTo2D());
if (result.HitChance >= hc)
{
s.Cast(result.CastSourcePosition, result.CastTargetPosition);
return true;
}
return false;
}
示例3: GetPrediction
/// <summary>
/// Gets Prediction result
/// </summary>
/// <param name="target">Target for spell</param>
/// <param name="width">Vector width</param>
/// <param name="delay">Spell delay</param>
/// <param name="vectorSpeed">Vector speed</param>
/// <param name="range">Spell range</param>
/// <param name="vectorLenght">Vector lenght</param>
/// <returns>Prediction result as <see cref="Prediction.Vector.Result" /></returns>
public static Result GetPrediction(AIHeroClient target, float width, float delay, float vectorSpeed, float range,
float vectorLenght)
{
return GetPrediction(target, width, delay, vectorSpeed, range, vectorSpeed, target.GetWaypoints(),
target.AvgMovChangeTime(), target.LastMovChangeTime(), target.AvgPathLenght(),
ObjectManager.Player.ServerPosition.LSTo2D());
}
示例4: SPredictionCast
/// <summary>
/// Spell extension for cast spell with SPrediction
/// </summary>
/// <param name="s">Spell to cast</param>
/// <param name="t">Target for spell</param>
/// <param name="hc">Minimum HitChance to cast</param>
/// <param name="reactionIgnoreDelay">Delay to ignore target's reaction time</param>
/// <param name="minHit">Minimum Hit Count to cast</param>
/// <param name="rangeCheckFrom">Position where spell will be casted from</param>
/// <param name="filterHPPercent">Minimum HP Percent to cast (for target)</param>
/// <returns>true if spell has casted</returns>
public static bool SPredictionCast(this Spell s, AIHeroClient t, HitChance hc, int reactionIgnoreDelay = 0,
byte minHit = 1, Vector3? rangeCheckFrom = null, float filterHPPercent = 100)
{
if (rangeCheckFrom == null)
rangeCheckFrom = ObjectManager.Player.ServerPosition;
if (t == null)
return s.Cast();
if (!s.IsSkillshot)
return s.Cast(t) == Spell.CastStates.SuccessfullyCasted;
#region if common prediction selected
if (ConfigMenu.SelectedPrediction == 1)
{
var pout = s.GetPrediction(t, minHit > 1);
if (minHit > 1)
if (pout.AoeTargetsHitCount >= minHit)
return s.Cast(pout.CastPosition);
else return false;
if (pout.Hitchance >= hc)
return s.Cast(pout.CastPosition);
return false;
}
#endregion
if (minHit > 1)
return SPredictionCastAoe(s, minHit);
if (t.HealthPercent > filterHPPercent)
return false;
var avgt = t.AvgMovChangeTime() + reactionIgnoreDelay;
float movt = t.LastMovChangeTime();
var avgp = t.AvgPathLenght();
var waypoints = t.GetWaypoints();
Prediction.Result result;
switch (s.Type)
{
case SkillshotType.SkillshotLine:
result = LinePrediction.GetPrediction(t, s.Width, s.Delay, s.Speed, s.Range, s.Collision, waypoints,avgt, movt, avgp, t.LastAngleDiff(), s.From.LSTo2D(), s.RangeCheckFrom.LSTo2D());
break;
case SkillshotType.SkillshotCircle:
result = CirclePrediction.GetPrediction(t, s.Width, s.Delay, s.Speed, s.Range, s.Collision, waypoints, avgt, movt, avgp, t.LastAngleDiff(), s.From.LSTo2D(), s.RangeCheckFrom.LSTo2D());
break;
case SkillshotType.SkillshotCone:
result = ConePrediction.GetPrediction(t, s.Width, s.Delay, s.Speed, s.Range, s.Collision, waypoints, avgt, movt, avgp, t.LastAngleDiff(), s.From.LSTo2D(), s.RangeCheckFrom.LSTo2D());
break;
default:
throw new InvalidOperationException("Unknown spell type");
}
Drawings.s_DrawTick = Utils.TickCount;
Drawings.s_DrawPos = result.CastPosition;
Drawings.s_DrawHitChance = result.HitChance.ToString();
Drawings.s_DrawDirection = (result.CastPosition - s.From.LSTo2D()).LSNormalized().LSPerpendicular();
Drawings.s_DrawWidth = (int) s.Width;
if (result.HitChance >= hc)
{
s.Cast(result.CastPosition);
return true;
}
return false;
}
示例5: SPredictionCastRing
/// <summary>
/// Spell extension for cast vector spell with SPrediction
/// </summary>
/// <param name="s">Spell to cast</param>
/// <param name="t">Target for spell</param>
/// <param name="ringRadius">Ring Radius</param>
/// <param name="hc">Minimum HitChance to cast</param>
/// <param name="reactionIgnoreDelay">Delay to ignore target's reaction time</param>
/// <param name="minHit">Minimum Hit Count to cast</param>
/// <param name="rangeCheckFrom">Position where spell will be casted from</param>
/// <param name="filterHPPercent">Minimum HP Percent to cast (for target)</param>
/// <returns>true if spell has casted</returns>
public static bool SPredictionCastRing(this Spell s, AIHeroClient t, float ringRadius, HitChance hc,
bool onlyEdge = true, int reactionIgnoreDelay = 0, byte minHit = 1, Vector3? rangeCheckFrom = null,
float filterHPPercent = 100)
{
if (ConfigMenu.SelectedPrediction == 1)
throw new NotSupportedException("Vector Prediction not supported in Common prediction");
if (minHit > 1)
throw new NotSupportedException("Ring aoe prediction not supported yet");
if (t.HealthPercent > filterHPPercent)
return false;
if (rangeCheckFrom == null)
rangeCheckFrom = ObjectManager.Player.ServerPosition;
var avgt = t.AvgMovChangeTime() + reactionIgnoreDelay;
float movt = t.LastMovChangeTime();
var avgp = t.AvgPathLenght();
Prediction.Result result;
if (onlyEdge)
result = RingPrediction.GetPrediction(t, s.Width, ringRadius, s.Delay, s.Speed, s.Range, s.Collision, t.GetWaypoints(), avgt, movt, avgp, s.From.LSTo2D(), rangeCheckFrom.Value.LSTo2D());
else
result = CirclePrediction.GetPrediction(t, s.Width, s.Delay, s.Speed, s.Range + ringRadius, s.Collision, t.GetWaypoints(), avgt, movt, avgp, 360, s.From.LSTo2D(), rangeCheckFrom.Value.LSTo2D());
Drawings.s_DrawTick = Utils.TickCount;
Drawings.s_DrawPos = result.CastPosition;
Drawings.s_DrawHitChance = result.HitChance.ToString();
Drawings.s_DrawDirection = (result.CastPosition - s.From.LSTo2D()).LSNormalized().LSPerpendicular();
Drawings.s_DrawWidth = (int) ringRadius;
if (result.HitChance >= hc)
{
s.Cast(result.CastPosition);
return true;
}
return false;
}
示例6: GetVectorSPrediction
/// <summary>
/// Gets Prediction result
/// </summary>
/// <param name="target">Target</param>
/// <param name="vectorLenght">Vector Lenght</param>
/// <returns>Prediction result as <see cref="Prediction.Vector.Result" /></returns>
public static VectorPrediction.Result GetVectorSPrediction(this Spell s, AIHeroClient target, float vectorLenght)
{
return VectorPrediction.GetPrediction(target, s.Width, s.Delay, s.Speed, s.Range, vectorLenght,
target.GetWaypoints(), target.AvgMovChangeTime(), target.LastMovChangeTime(), target.AvgPathLenght(),
s.RangeCheckFrom.LSTo2D());
}
示例7: GetSPrediction
/// <summary>
/// Gets Prediction result
/// </summary>
/// <param name="target">Target</param>
/// <returns>Prediction result as <see cref="Prediction.Result" /></returns>
public static Prediction.Result GetSPrediction(this Spell s, AIHeroClient target)
{
#region if common prediction selected
if (ConfigMenu.SelectedPrediction == 1)
{
var pred = s.GetPrediction(target);
var result = new Prediction.Result(new Prediction.Input(target, s), target, pred.CastPosition.LSTo2D(),
pred.UnitPosition.LSTo2D(), pred.Hitchance, default(Collision.Result));
result.Lock(false);
return result;
}
#endregion
switch (s.Type)
{
case SkillshotType.SkillshotLine:
return LinePrediction.GetPrediction(target, s.Width, s.Delay, s.Speed, s.Range, s.Collision,
target.GetWaypoints(), target.AvgMovChangeTime(), target.LastMovChangeTime(),
target.AvgPathLenght(), target.LastAngleDiff(), s.From.LSTo2D(), s.RangeCheckFrom.LSTo2D());
case SkillshotType.SkillshotCircle:
return CirclePrediction.GetPrediction(target, s.Width, s.Delay, s.Speed, s.Range, s.Collision,
target.GetWaypoints(), target.AvgMovChangeTime(), target.LastMovChangeTime(),
target.AvgPathLenght(), target.LastAngleDiff(), s.From.LSTo2D(), s.RangeCheckFrom.LSTo2D());
case SkillshotType.SkillshotCone:
return ConePrediction.GetPrediction(target, s.Width, s.Delay, s.Speed, s.Range, s.Collision,
target.GetWaypoints(), target.AvgMovChangeTime(), target.LastMovChangeTime(),
target.AvgPathLenght(), target.LastAngleDiff(), s.From.LSTo2D(), s.RangeCheckFrom.LSTo2D());
}
throw new NotSupportedException("Unknown skill shot type");
}
示例8: GetArcSPrediction
/// <summary>
/// Gets Prediction result
/// </summary>
/// <param name="target">Target</param>
/// <returns>Prediction result as <see cref="Prediction.Result" /></returns>
public static Prediction.Result GetArcSPrediction(this Spell s, AIHeroClient target)
{
return ArcPrediction.GetPrediction(target, s.Width, s.Delay, s.Speed, s.Range, s.Collision,
target.GetWaypoints(), target.AvgMovChangeTime(), target.LastMovChangeTime(), target.AvgPathLenght(),
target.LastAngleDiff(), s.From.LSTo2D(), s.RangeCheckFrom.LSTo2D());
}
示例9: SPredictionCastArc
/// <summary>
/// Spell extension for cast arc spell with SPrediction
/// </summary>
/// <param name="s">Spell to cast</param>
/// <param name="t">Target for spell</param>
/// <param name="hc">Minimum HitChance to cast</param>
/// <param name="reactionIgnoreDelay">Delay to ignore target's reaction time</param>
/// <param name="minHit">Minimum Hit Count to cast</param>
/// <param name="rangeCheckFrom">Position where spell will be casted from</param>
/// <param name="filterHPPercent">Minimum HP Percent to cast (for target)</param>
/// <returns>true if spell has casted</returns>
public static bool SPredictionCastArc(this Spell s, AIHeroClient t, EloBuddy.SDK.Enumerations.HitChance hc, bool arconly = true,
int reactionIgnoreDelay = 0, byte minHit = 1, Vector3? rangeCheckFrom = null, float filterHPPercent = 100)
{
if (ConfigMenu.SelectedPrediction == 1)
throw new NotSupportedException("Arc Prediction not supported in Common prediction");
if (minHit > 1)
return SPredictionCastAoeArc(s, minHit);
if (t.HealthPercent > filterHPPercent)
return false;
if (rangeCheckFrom == null)
rangeCheckFrom = ObjectManager.Player.ServerPosition;
var avgt = t.AvgMovChangeTime() + reactionIgnoreDelay;
float movt = t.LastMovChangeTime();
var avgp = t.AvgPathLenght();
var result = ArcPrediction.GetPrediction(t, s.Width, s.Delay, s.Speed, s.Range, s.Collision,
t.GetWaypoints(), avgt, movt, avgp, t.LastAngleDiff(), s.From.LSTo2D(), s.RangeCheckFrom.LSTo2D(), arconly);
if (result.HitChance >= hc)
{
s.Cast(result.CastPosition);
return true;
}
return false;
}
示例10: GetPrediction
/// <summary>
/// Gets Prediction result
/// </summary>
/// <param name="target">Target for spell</param>
/// <param name="width">Spell width</param>
/// <param name="delay">Spell delay</param>
/// <param name="missileSpeed">Spell missile speed</param>
/// <param name="range">Spell range</param>
/// <param name="collisionable">Spell collisionable</param>
/// <param name="type">Spell skillshot type</param>
/// <param name="from">Spell casted position</param>
/// <returns>Prediction result as <see cref="Prediction.Result" /></returns>
internal static Result GetPrediction(AIHeroClient target, float width, float delay, float missileSpeed,
float range, bool collisionable, SkillshotType type)
{
return GetPrediction(target, width, delay, missileSpeed, range, collisionable, type, target.GetWaypoints(), target.AvgMovChangeTime(), target.LastMovChangeTime(), target.AvgPathLenght(), target.LastAngleDiff(), ObjectManager.Player.ServerPosition.LSTo2D(), ObjectManager.Player.ServerPosition.LSTo2D());
}