本文整理汇总了C#中Vector3.CountEnemiesInRange方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.CountEnemiesInRange方法的具体用法?C# Vector3.CountEnemiesInRange怎么用?C# Vector3.CountEnemiesInRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3
的用法示例。
在下文中一共展示了Vector3.CountEnemiesInRange方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsSafeEx
/// <summary>
/// Determines whether the specified position is Safe using AA ranges logic.
/// </summary>
/// <param name="position">The position.</param>
/// <returns></returns>
public static bool IsSafeEx(Vector3 position)
{
var closeEnemies =
HeroManager.Enemies.FindAll(en => en.IsValidTarget(1500f) && !(en.Distance(ObjectManager.Player.ServerPosition) < en.AttackRange + 65f))
.OrderBy(en => en.Distance(position));
return closeEnemies.All(
enemy =>
position.CountEnemiesInRange(enemy.AttackRange) <= 1);
}
示例2: IsSafePosition
public static bool IsSafePosition(Vector3 position)
{
if (position.UnderTurret(true) && !ObjectManager.Player.UnderTurret(true))
return false;
var allies = position.CountAlliesInRange(ObjectManager.Player.AttackRange);
var enemies = position.CountEnemiesInRange(ObjectManager.Player.AttackRange);
var lhEnemies = GetLhEnemiesNearPosition(position, ObjectManager.Player.AttackRange).Count();
if (enemies == 1) //It's a 1v1, safe to assume I can E
{
return true;
}
//Adding 1 for the Player
return (allies + 1 > enemies - lhEnemies);
}
示例3: GetAvgDistance
public static float GetAvgDistance(Vector3 from)
{
var numberOfEnemies = from.CountEnemiesInRange(1000f);
if (numberOfEnemies != 0)
{
var enemies = HeroManager.Enemies.Where(en => en.LSIsValidTarget(1000f, true, from)
&&
en.Health >
ObjectManager.Player.GetAutoAttackDamage(en)*3 +
Variables.spells[SpellSlot.W].GetDamage(en) +
Variables.spells[SpellSlot.Q].GetDamage(en)).ToList();
var enemiesEx = HeroManager.Enemies.Where(en => en.LSIsValidTarget(1000f, true, from)).ToList();
var LHEnemies = enemiesEx.Count() - enemies.Count();
var totalDistance = 0f;
totalDistance = (LHEnemies > 1 && enemiesEx.Count() > 2) ?
enemiesEx.Sum(en => en.LSDistance(ObjectManager.Player.ServerPosition)) :
enemies.Sum(en => en.LSDistance(ObjectManager.Player.ServerPosition));
return totalDistance / numberOfEnemies;
}
return -1;
}
示例4: GetAvgDistance
/// <summary>
/// Gets the average distance of a specified position to the enemies.
/// </summary>
/// <param name="from">From.</param>
/// <returns></returns>
public static float GetAvgDistance(Vector3 from)
{
var numberOfEnemies = from.CountEnemiesInRange(1200f);
if (numberOfEnemies != 0)
{
var enemies = EntityManager.Heroes.Enemies.Where(en => en.IsValidTarget(1200f, true, from)
&&
en.Health >
ObjectManager.Player.GetAutoAttackDamage(en) * 3 +
ObjectManager.Player.GetSpellDamage(en, SpellSlot.W) +
ObjectManager.Player.GetSpellDamage(en, SpellSlot.Q))
;
var enemiesEx = EntityManager.Heroes.Enemies.Where(en => en.IsValidTarget(1200f, true, from));
var LHEnemies = enemiesEx.Count() - enemies.Count();
var totalDistance = (LHEnemies > 1 && enemiesEx.Count() > 2)
? enemiesEx.Sum(en => en.Distance(ObjectManager.Player.ServerPosition))
: enemies.Sum(en => en.Distance(ObjectManager.Player.ServerPosition));
return totalDistance / numberOfEnemies;
}
return -1;
}
示例5: IsGoodPosition
public bool IsGoodPosition(Vector3 dashPos)
{
if (getCheckBoxItem("WallCheck"))
{
var segment = DashSpell.Range / 5;
for (var i = 1; i <= 5; i++)
{
if (Player.Position.LSExtend(dashPos, i * segment).LSIsWall())
return false;
}
}
if (getCheckBoxItem("TurretCheck"))
{
if (dashPos.UnderTurret(true))
return false;
}
var enemyCheck = getSliderItem("EnemyCheck");
var enemyCountDashPos = dashPos.CountEnemiesInRange(600);
if (enemyCheck > enemyCountDashPos)
return true;
var enemyCountPlayer = Player.CountEnemiesInRange(400);
if (enemyCountDashPos <= enemyCountPlayer)
return true;
return false;
}
示例6: InAARange
public bool InAARange(Vector3 point)
{
if (!getCheckBoxItem("AAcheck"))
return true;
if (Orbwalker.LastTarget != null && Orbwalker.LastTarget.Type == GameObjectType.AIHeroClient)
{
return point.LSDistance(Orbwalker.LastTarget.Position) < Player.AttackRange;
}
return point.CountEnemiesInRange(Player.AttackRange) > 0;
}
示例7: IsSafeEx
public static bool IsSafeEx(Vector3 position)
{
var closeEnemies =
HeroManager.Enemies.FindAll(en => en.LSIsValidTarget(1500f) && !(en.LSDistance(ObjectManager.Player.ServerPosition) < en.AttackRange + 65f))
.OrderBy(en => en.LSDistance(position));
return closeEnemies.All(
enemy =>
position.CountEnemiesInRange(
MenuGenerator.miscMenu["dz191.vhr.misc.tumble.dynamicqsafety"].Cast<CheckBox>().CurrentValue
? enemy.AttackRange
: 405f) <= 1);
}
示例8: IsSafePosition
public static bool IsSafePosition(Vector3 position)
{
var enemies = position.CountEnemiesInRange(800);
var allies = CountAlliesInRange(position);
var turrets = EntityManager.Turrets.Allies.Count(x => Player.Distance(x) < 800 && x.IsValid && !x.IsDead);
var lowEnemies = GetLowaiAiHeroClients(position, 800).Count();
if (UnderEnemyTurret(position)) return false;
if (enemies == 1)
{
return true;
}
return allies + turrets > enemies - lowEnemies;
}
示例9: IsSafeEx
public static bool IsSafeEx(Vector3 position)
{
var closeEnemies =
HeroManager.Enemies.FindAll(en => en.IsValidTarget(1500f) && !(en.Distance(ObjectManager.Player.ServerPosition) < en.AttackRange + 65f))
.OrderBy(en => en.Distance(position));
return closeEnemies.All(
enemy =>
position.CountEnemiesInRange(
MenuExtensions.GetItemValue<bool>("dz191.vhr.misc.tumble.dynamicqsafety")
? enemy.AttackRange
: 405f) <= 1);
}