本文整理汇总了C#中LeagueSharp.Common.Spell.GetCollision方法的典型用法代码示例。如果您正苦于以下问题:C# Spell.GetCollision方法的具体用法?C# Spell.GetCollision怎么用?C# Spell.GetCollision使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LeagueSharp.Common.Spell
的用法示例。
在下文中一共展示了Spell.GetCollision方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Cast
/// <summary>
/// Casts aoe spell
/// </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="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 Cast(Spell s, Obj_AI_Hero t, HitChance hc, int reactionIgnoreDelay = 0, byte minHit = 2, Vector3? rangeCheckFrom = null, float filterHPPercent = 0)
{
if (!blInitialized)
throw new Exception("Prediction is not initalized");
if (rangeCheckFrom == null)
rangeCheckFrom = ObjectManager.Player.ServerPosition;
if (Monitor.TryEnter(EnemyInfo[t.NetworkId].m_lock))
{
try
{
HitChance predictedhc = HitChance.Impossible;
float avgt = t.AvgMovChangeTime() + reactionIgnoreDelay;
float movt = t.LastMovChangeTime();
Vector2 pos = ObjectManager.Player.ServerPosition.To2D();
switch (s.Type)
{
case SkillshotType.SkillshotLine: pos = Line.GetPrediction(t, s, t.GetWaypoints(), avgt, movt, filterHPPercent, minHit, out predictedhc, rangeCheckFrom.Value);
break;
case SkillshotType.SkillshotCircle: pos = Circle.GetPrediction(t, s, t.GetWaypoints(), avgt, movt, filterHPPercent, minHit, out predictedhc, rangeCheckFrom.Value);
break;
case SkillshotType.SkillshotCone: pos = Cone.GetPrediction(t, s, t.GetWaypoints(), avgt, movt, filterHPPercent, minHit, out predictedhc, rangeCheckFrom.Value);
break;
}
//pos = pos + pos.Perpendicular() * s.Width / 2; //need moar test (for lineaar skillshots)
if (s.Collision && s.GetCollision(rangeCheckFrom.Value.To2D(), new List<Vector2> { pos }).Exists(q => q.IsEnemy)) //needs update
{
Monitor.Pulse(EnemyInfo[t.NetworkId].m_lock);
return false;
}
if (predictedhc >= hc)
{
s.Cast(pos);
return true;
}
Monitor.Pulse(EnemyInfo[t.NetworkId].m_lock);
return false;
}
finally
{
Monitor.Exit(EnemyInfo[t.NetworkId].m_lock);
}
}
return false;
}