本文整理汇总了C#中Obj_AI_Base.CountAlliesInRange方法的典型用法代码示例。如果您正苦于以下问题:C# Obj_AI_Base.CountAlliesInRange方法的具体用法?C# Obj_AI_Base.CountAlliesInRange怎么用?C# Obj_AI_Base.CountAlliesInRange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj_AI_Base
的用法示例。
在下文中一共展示了Obj_AI_Base.CountAlliesInRange方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleObjective
/// <summary>
/// Handles the objective.
/// </summary>
/// <param name="unit">The unit.</param>
/// <param name="type">The type.</param>
private void HandleObjective(Obj_AI_Base unit, ObjectiveType type)
{
if ((Config.Instance.objectiveMenu["SmartObjectiveSteal"].Cast<CheckBox>().CurrentValue
&& !Config.Instance.objectiveMenu["StealObjectiveKeyBind"].Cast<CheckBox>().CurrentValue && unit.CountAlliesInRange(500) != 0)
|| !Config.Instance.objectiveMenu["StealObjectiveKeyBind"].Cast<CheckBox>().CurrentValue)
{
return;
}
if (!Config.Instance.objectiveMenu["Steal" + type].Cast<CheckBox>().CurrentValue)
{
return;
}
this.StealObject(unit, StealType.ObjectiveSteal);
}
示例2: CheckRKillable
internal static void CheckRKillable(Obj_AI_Base target)
{
KillSteal.RDamageOnEnemies[target.NetworkId] = SpellSlot.R.GetSpellDamage(target);
if (target.TotalShieldHealth() + target.HPRegenRate * 2 <= KillSteal.RDamageOnEnemies[target.NetworkId])
{
var distance = Vector3.Distance(Util.MyHero.Position, target.Position);
R.Speed = (int)InitialSpeed;
if (distance >= ChangerSpeedDistance)
{
var travelTime = ChangerSpeedDistance / InitialSpeed + (distance - ChangerSpeedDistance) / FinalSpeed;
R.Speed = (int)(distance / travelTime);
}
var pred = R.GetPrediction(target);
var hitchance = predi.GetHitChance(SpellSlot.R, 20000, SkillShotType.Linear, 600, 1700, 140,Player.Instance.ServerPosition,target);
var firstHit =
pred.GetCollisionObjects<AIHeroClient>()
.OrderBy(h => Util.MyHero.Distance(h, true))
.FirstOrDefault() ?? target;
KillSteal.RDamageOnEnemies[target.NetworkId] = SpellSlot.R.GetSpellDamage(target,
firstHit.IdEquals(target) ? 1 : 2);
if (target.TotalShieldHealth() + target.HPRegenRate * 2 <= KillSteal.RDamageOnEnemies[target.NetworkId] && Util.MyHero.Distance(target, true) <= RRangeSqr)
{
KillSteal.RKillableBases.Add(target);
if (pred.HitChance >= HitChance.Low && hitchance >= MenuManager.PredR() &&
firstHit.Distance(target, true) <= (225 + target.BoundingRadius).Pow())
{
if ((KillSteal.Menu.CheckBox("R") /*&& target.WillBeHittedByR()*/ &&
!MyTargetSelector.PowPowTarget.IdEquals(target) && target.CountAlliesInRange(500) == 0) || MenuManager.TapKeyPressed)
{
KillSteal.RHittableBases.Add(pred.CastPosition);
}
}
}
}
}
示例3: HandleBuff
/// <summary>
/// Handles the buff.
/// </summary>
/// <param name="unit">The unit.</param>
/// <param name="type">The type.</param>
private void HandleBuff(Obj_AI_Base unit, ObjectiveType type)
{
if (!Config.Instance.buffMenu["Steal" + type + "Buff"].Cast<CheckBox>().CurrentValue)
{
return;
}
var alliesinRange = unit.CountAlliesInRange(1000);
if (!Config.Instance.buffMenu["StealAllyBuffs"].Cast<CheckBox>().CurrentValue && alliesinRange > 0)
{
return;
}
this.StealObject(unit, StealType.BuffSteal);
}
示例4: steal
private void steal(Obj_AI_Base monster)
{
if (monster == null || monster.CountEnemiesInRange(600) == 0 || monster.CountAlliesInRange(500) > 0)
return;
float distance = Player.Instance.Position.Distance(monster.Position);
int travelTime = 0;
if (distance > 1500)
{
travelTime = 1000;
distance -= 1500;
}
else
{
travelTime = (int)distance / 1500 * 1000;
distance = 0;
}
travelTime += (int)(distance / 2500) * 1000;
float health = Prediction.Health.GetPrediction(monster, travelTime);
if (health - 300 > 0 && health < SpellManager.getRDamage(monster) * 0.8)
{
R.Cast(monster);
}
}