本文整理汇总了C#中AttackableUnit.CountEnemiesInRange方法的典型用法代码示例。如果您正苦于以下问题:C# AttackableUnit.CountEnemiesInRange方法的具体用法?C# AttackableUnit.CountEnemiesInRange怎么用?C# AttackableUnit.CountEnemiesInRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AttackableUnit
的用法示例。
在下文中一共展示了AttackableUnit.CountEnemiesInRange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Orbwalker_OnPreAttack
/*private static void Client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
{
Chat.Print("Failed Downloading: " + e.Error);
AllahAkbar = new SoundPlayer
{
SoundLocation =
SandboxConfig.DataDirectory + @"\JinXXX\" + "Allahu_Akbar_Sound_Effect_Download_Link.wav"
};
AllahAkbar.Load();
}*/
/// <summary>
/// Called Before Attack
/// </summary>
/// <param name="target">The Target</param>
/// <param name="args">The Args</param>
private static void Orbwalker_OnPreAttack(AttackableUnit target, Orbwalker.PreAttackArgs args)
{
#region Combo
if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
{
var useQ = Config.ComboMenu["useQ"].Cast<CheckBox>().CurrentValue;
// If the player has the rocket
if (useQ && Program.Q.IsReady() && Essentials.FishBones())
{
//var target = TargetSelector.GetTarget(Essentials.FishBonesRange(), DamageType.Physical);
if (target != null && target.IsValidTarget())
{
if (Player.Instance.Distance(target) <= Essentials.MinigunRange &&
target.CountEnemiesInRange(100) <
Config.ComboMenu["qCountC"].Cast<Slider>().CurrentValue)
{
Program.Q.Cast();
Orbwalker.ForcedTarget = target;
}
}
}
}
#endregion
#region LastHit
if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LastHit))
{
var useQ = Config.LastHitMenu["useQ"].Cast<CheckBox>().CurrentValue;
var manaQ = Config.LastHitMenu["manaQ"].Cast<Slider>().CurrentValue;
var qCountM = Config.LastHitMenu["qCountM"].Cast<Slider>().CurrentValue;
// Force Minigun if there is a lasthittable minion in minigun range and there is no targets more than the setting amount.
var kM = Orbwalker.LastHitMinionsList.Where(
t => t.IsEnemy &&
t.Health <= (Player.Instance.GetAutoAttackDamage(t) * 0.9) && t.IsValidTarget() &&
t.Distance(Player.Instance) <= Essentials.MinigunRange);
if (useQ && Essentials.FishBones() && kM.Count() < qCountM)
{
Program.Q.Cast();
}
}
#endregion
#region Lane Clear
if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear))
{
var minion = EntityManager.MinionsAndMonsters.GetLaneMinions(
EntityManager.UnitTeam.Enemy,
Player.Instance.ServerPosition,
Essentials.FishBonesRange()).OrderByDescending(t => t.Health);
if (Essentials.FishBones())
{
foreach (var m in minion)
{
var minionsAoe =
EntityManager.MinionsAndMonsters.EnemyMinions.Count(
t => t.IsValidTarget() && t.Distance(m) <= 100);
if (m.Distance(Player.Instance) <= Essentials.MinigunRange && m.IsValidTarget() &&
(minionsAoe < Config.LaneClearMenu["qCountM"].Cast<Slider>().CurrentValue ||
m.Health > (Player.Instance.GetAutoAttackDamage(m))))
{
Q.Cast();
Orbwalker.ForcedTarget = m;
}
else if (m.Distance(Player.Instance) <= Essentials.MinigunRange &&
!Orbwalker.LastHitMinionsList.Contains(m))
{
Q.Cast();
Orbwalker.ForcedTarget = m;
}
else
{
foreach (
var kM in
Orbwalker.LastHitMinionsList.Where(
kM =>
//.........这里部分代码省略.........