本文整理汇总了C#中Obj_AI_Hero.Distance方法的典型用法代码示例。如果您正苦于以下问题:C# Obj_AI_Hero.Distance方法的具体用法?C# Obj_AI_Hero.Distance怎么用?C# Obj_AI_Hero.Distance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj_AI_Hero
的用法示例。
在下文中一共展示了Obj_AI_Hero.Distance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnInterruptableTarget
private void OnInterruptableTarget(Obj_AI_Hero target, Interrupter2.InterruptableTargetEventArgs args)
{
if (E.CanCast(target) && config.Item("useEint", true).GetValue<bool>())
{
if (E.CastIfHitchanceEquals(target, HitChance.High, config.Item("packets").GetValue<bool>()))
{
return;
}
}
if (R.CanCast(target) && config.Item("useRint", true).GetValue<bool>())
{
if (savedQ != null && !SimpleQ && !target.IsMoving && target.Distance(qPos) > QExplosionRange &&
target.Distance(player) < R.Range - 100 &&
target.Position.Distance(savedQ.position) < 550 + QExplosionRange / 2 &&
!target.HasBuffOfType(BuffType.Knockback))
{
var cast = Prediction.GetPrediction(target, 1000f).UnitPosition.Extend(savedQ.position, -100);
R.Cast(cast);
}
else if (target.Distance(player) < R.Range - 100)
{
if (player.CountEnemiesInRange(2000) <= player.CountAlliesInRange(2000))
{
var cast = target.Position.Extend(player.Position, -100);
R.Cast(cast);
}
else
{
var cast = target.Position.Extend(player.Position, 100);
R.Cast(cast);
}
}
}
}
示例2: Execute
public override void Execute(Obj_AI_Hero target)
{
if (target == null)
target = TargetSelector.GetTarget(1200, TargetSelector.DamageType.Magical);
if (target == null) return;
var dmgPerBounce = ObjectManager.Player.GetSpellDamage(target, Slot) + BrandCombo.GetPassiveDamage(target);
if (dmgPerBounce > target.Health && target.Distance(ObjectManager.Player) > 750)
{
TryBridgeUlt(target);
// Console.WriteLine("ayy lmao bridge bois");
}
if (dmgPerBounce > target.Health && !Provider.ShouldBeDead(target) && ObjectManager.Player.GetAutoAttackDamage(target, true) < target.Health && ((_otherSkills.All(skill => skill.Instance.State != SpellState.Ready && skill.Instance.State != SpellState.Surpressed /*&& !skill.IsSafeCasting(1)*/) /*|| target.Distance(ObjectManager.Player) > 650*/) || ObjectManager.Player.GetSpellDamage(target, SpellSlot.Q) + dmgPerBounce + ObjectManager.Player.GetAutoAttackDamage(target) > target.Health && !target.HasBuff("brandablaze") && target.Distance(ObjectManager.Player) < 750))
{
if (ObjectManager.Player.HealthPercent - target.HealthPercent < OverkillPercent || !AntiOverkill || IgnoreAntiOverkillOnFlee && target.Distance(ObjectManager.Player) > ObjectManager.Player.AttackRange)
{
Cast(target);
}
else if (ObjectManager.Player.HealthPercent < target.HealthPercent && IgniteManager.CanBeUsed() && IgniteManager.GetDamage() + dmgPerBounce > target.Health)
{
if (target.Distance(ObjectManager.Player) < 600)
IgniteManager.UseIgnite(target);
Cast(target);
}
}
// if (target.Distance(ObjectManager.Player) > 750) return;
var inBounce = new bool[HeroManager.Enemies.Count];
var canBounce = BounceCheck(target, inBounce);
if (canBounce)
{
var inBounceEnemies = HeroManager.Enemies.Where(enemy => inBounce[HeroManager.Enemies.IndexOf(enemy)]).ToArray();
var distance = target.Distance(ObjectManager.Player);
var bounceCount = inBounce.Count(item => item);
if (bounceCount <= 1) return;
//Console.WriteLine("bounce r " + bounceCount);
if ((inBounceEnemies.Any(enemy => (dmgPerBounce > enemy.Health && MaxDamage > enemy.Health)) && (bounceCount == 2 || RiskyUlt)))
{
TryUlt(target, inBounceEnemies, distance);
}
else if (bounceCount == 2 && dmgPerBounce * 3 > target.Health && MaxDamage > target.Health && distance < 750 && RiskyUlt)
{
Cast(target);
}
else if (dmgPerBounce * 2 > target.Health && MaxDamage > target.Health)
{
TryUlt(target, inBounceEnemies, distance);
}
else if (UltNonKillable && MinBounceTargets <= bounceCount)
{
TryUlt(target, inBounceEnemies, distance, false);
}
}
}
示例3: ChampionInfo
public ChampionInfo(Obj_AI_Hero hero, bool ally)
{
index++;
int textoffset = index * 50;
_hero = hero;
Render.Text text = new Render.Text(
new Vector2(), _hero.ChampionName, 20,
ally
? new Color { R = 205, G = 255, B = 205, A = 255 }
: new Color { R = 255, G = 205, B = 205, A = 255 })
{
PositionUpdate =
() =>
Drawing.WorldToScreen(
ObjectManager.Player.Position.Extend(_hero.Position, 300 + textoffset)),
VisibleCondition = delegate
{
float dist = _hero.Distance(ObjectManager.Player.Position);
return Program.Instance().ShowChampionNames && !_hero.IsDead &&
Game.ClockTime - _lineStart < Program.Instance().LineDuration &&
(!_hero.IsVisible || !Render.OnScreen(Drawing.WorldToScreen(_hero.Position))) &&
dist < Program.Instance().Radius && dist > 300 + textoffset;
},
Centered = true,
OutLined = true,
};
text.Add(1);
_line = new Render.Line(
new Vector2(), new Vector2(), 5,
ally ? new Color { R = 0, G = 255, B = 0, A = 125 } : new Color { R = 255, G = 0, B = 0, A = 125 })
{
StartPositionUpdate = () => Drawing.WorldToScreen(ObjectManager.Player.Position),
EndPositionUpdate = () => Drawing.WorldToScreen(_hero.Position),
VisibleCondition =
delegate
{
return !_hero.IsDead && Game.ClockTime - _lineStart < Program.Instance().LineDuration &&
_hero.Distance(ObjectManager.Player.Position) < (Program.Instance().Radius + 1000);
}
};
_line.Add(0);
Render.Line minimapLine = new Render.Line(
new Vector2(), new Vector2(), 2,
ally ? new Color { R = 0, G = 255, B = 0, A = 255 } : new Color { R = 255, G = 0, B = 0, A = 255 })
{
StartPositionUpdate = () => Drawing.WorldToMinimap(ObjectManager.Player.Position),
EndPositionUpdate = () => Drawing.WorldToMinimap(_hero.Position),
VisibleCondition =
delegate
{
return Program.Instance().DrawMinimapLines && !_hero.IsDead && Game.ClockTime - _lineStart < Program.Instance().LineDuration;
}
};
minimapLine.Add(0);
Game.OnUpdate += Game_OnGameUpdate;
OnEnterRange += ChampionInfo_OnEnterRange;
}
示例4: Cast
public override void Cast(Obj_AI_Hero target, bool force = false, HitChance minChance = HitChance.Low)
{
if (target == null) return;
if (ObjectManager.Player.HasBuff("ekkoattackbuff") && target.Distance(ObjectManager.Player) < 500)
{
ObjectManager.Player.IssueOrder(GameObjectOrder.AutoAttack, target);
}
if (HasBeenSafeCast() || target.Distance(ObjectManager.Player) < ObjectManager.Player.AttackRange + ObjectManager.Player.BoundingRadius + target.BoundingRadius) return;
SafeCast(() => Spell.Cast(target.Position));
}
示例5: GetComboDamage
public float GetComboDamage(Obj_AI_Hero target)
{
if (target == null) return 0;
float comboDmg = 0;
var aaDmg = (float)ObjectManager.Player.GetAutoAttackDamage(target, true);
if (qSpell.Spell.IsReady())
{
comboDmg += qSpell.GetDamage(target) + aaDmg;
}
if (wSpell.Spell.IsReady())
{
comboDmg += wSpell.Spell.GetDamage(target) + aaDmg;
}
if (eSpell.Spell.IsReady())
{
comboDmg += aaDmg;
}
if (target.Distance(ObjectManager.Player) >= 900 && rSpell.Spell.IsReady())
{
comboDmg += rSpell.GetDamage(target);
}
return comboDmg;
}
示例6: doCombo
public static void doCombo(Obj_AI_Hero target)
{
igniteIfKIllable(target);
if (!target.IsValidTarget())
return;
if (!W.IsReady() && !E.IsReady() && R.IsReady() && Rdata.Name == "TalonShadowAssault" && (target.Health > getAAdmg(target) || targetInRange(target, 125f))
&& target.Health<(getRdmg(target)*2 + getTargetBleedDmg(target)))
{
PredictionOutput po = R.GetPrediction(target);
if (po.Hitchance >= HitChance.Medium)
{
R.Cast();
posRCast = Player.ServerPosition;
}
}
if (Rdata.Name == "TalonShadowAssault")
{
if (target.Health<= getRdmg(target) && target.Distance(posRCast) < R.Range)
R.Cast();
}
if (E.IsReady() && targetInRange(target, E.Range))
{
E.Cast(target);
}
if (W.IsReady() && !E.IsReady() && targetInRange(target, W.Range) && !targetInRange(target, 100) && !Player.IsChanneling
&& (!targetInRange(target,250) || targetHasCut(target)))
{
W.Cast(target);
}
castItemsFull(target);
}
示例7: CastE
void CastE(Obj_AI_Hero target)
{
if (target != null)
{
if (SpellSlot.E.IsReady() && isHealthy)
{
if (DashCount >= 1 && GetDashPos(target).IsCloser(target) && target.IsDashable() &&
(GetBool("Combo.ETower") || GetKeyBind("Misc.TowerDive") || !GetDashPos(target).PointUnderEnemyTurret()))
{
Spells[E].CastOnUnit(target);
return;
}
if (DashCount == 0)
{
var dist = Yasuo.Distance(target);
var bestminion =
ObjectManager.Get<Obj_AI_Base>()
.Where(
x =>
x.IsDashable()
&& target.Distance(GetDashPos(x)) < dist &&
(GetBool("Combo.ETower") || GetKeyBind("Misc.TowerDive") || !GetDashPos(x).PointUnderEnemyTurret()))
.OrderBy(x => Vector2.Distance(GetDashPos(x), target.ServerPosition.To2D()))
.FirstOrDefault();
if (bestminion != null)
{
Spells[E].CastOnUnit(bestminion);
}
else
{
var minion =
ObjectManager.Get<Obj_AI_Base>()
.Where(x => x.IsDashable() && (GetBool("Combo.ETower") || GetKeyBind("Misc.TowerDive") || !GetDashPos(x).PointUnderEnemyTurret()))
.OrderBy(x => GetDashPos(x).Distance(target)).FirstOrDefault();
if (minion != null && GetDashPos(minion).IsCloser(target))
{
Spells[E].CastOnUnit(minion);
}
}
}
else
{
var minion =
ObjectManager.Get<Obj_AI_Base>()
.Where(x => x.IsDashable() && (GetBool("Combo.ETower") || GetKeyBind("Misc.TowerDive") || !GetDashPos(x).PointUnderEnemyTurret()))
.OrderBy(x => GetDashPos(x).Distance(target)).FirstOrDefault();
if (minion != null && GetDashPos(minion).IsCloser(target))
{
Spells[E].CastOnUnit(minion);
}
}
}
}
}
示例8: Update
public void Update(Obj_AI_Hero target)
{
if ((target.HealthPercent >= _minEnemyHealth || ObjectManager.Player.HealthPercent < 20) && ObjectManager.Player.HealthPercent <= _maxPlayerHealth && target.Distance(ObjectManager.Player) < 550)
{
Use(target);
}
}
示例9: QMinion
public static Obj_AI_Base QMinion(Obj_AI_Hero t)
{
var m = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, Q.Range, MinionTypes.All,
MinionTeam.NotAlly, MinionOrderTypes.None);
return (from vM
in m.Where(vM => vM.IsValidTarget(Q.Range))
let endPoint = vM.ServerPosition.To2D().Extend(ObjectManager.Player.ServerPosition.To2D(), -Q2.Range).To3D()
where
vM.Distance(t) <= t.Distance(ObjectManager.Player) &&
Intersection(ObjectManager.Player.ServerPosition.To2D(), endPoint.To2D(), t.ServerPosition.To2D(), t.BoundingRadius + vM.BoundingRadius)
//Intersection(ObjectManager.Player.ServerPosition.To2D(), endPoint.To2D(), t.ServerPosition.To2D(), t.BoundingRadius + Q.Width/4)
select vM).FirstOrDefault();
//get
//{
// var vTarget = TargetSelector.GetTarget(Q2.Range, TargetSelector.DamageType.Physical);
// var vMinions = MinionManager.GetMinions(
// ObjectManager.Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.NotAlly,
// MinionOrderTypes.None);
// return (from vMinion in vMinions.Where(vMinion => vMinion.IsValidTarget(Q.Range))
// let endPoint =
// vMinion.ServerPosition.To2D()
// .Extend(ObjectManager.Player.ServerPosition.To2D(), -Q2.Range)
// .To3D()
// where
// vMinion.Distance(vTarget) <= vTarget.Distance(ObjectManager.Player) &&
// Intersection(ObjectManager.Player.ServerPosition.To2D(), endPoint.To2D(),
// vTarget.ServerPosition.To2D(), vTarget.BoundingRadius + vMinion.BoundingRadius)
// select vMinion).FirstOrDefault();
//}
}
示例10: WardJumpFlashInsec
public static void WardJumpFlashInsec(Obj_AI_Hero enemy)
{
if (Config.Item("insec.whitelist." + enemy.ChampionName).GetValue<bool>() && HybridCommon.Utility.GetPriority(enemy.ChampionName) > 2)
{
if (ObjectManager.Player.Distance(enemy.Position) > Spells[Q].Range &&
ObjectManager.Player.Distance(enemy.Position) < Spells[Q].Range + 600 && WardJump.WardCastable)
{
WardJump.HikiJump(Spells[W], Helper.WardJumpToEnemy(enemy, 600));
}
if (enemy.Distance(LeeSin.Position) < Spells[Q].Range && Spells[Q].GetPrediction(enemy).Hitchance > HitChance.High)
{
Spells[Q].Cast(enemy);
}
if (Helper.QTwo(Spells[Q]) && Spells[Q2].IsReady())
{
Spells[Q2].Cast();
}
if (Flashable && LeeSin.Distance(Helper.InsecPositions()) < FlashRange)
{
Utility.DelayAction.Add(Helper.SliderCheck("flash.insec.flash.delay"),
() => LeeSin.Spellbook.CastSpell(FlashSlot, Helper.InsecPositions()));
}
if (LeeSin.Spellbook.CanUseSpell(FlashSlot) == SpellState.Cooldown && !Spells[Q].IsReady() &&
LeeSin.Distance(enemy.Position) < Spells[R].Range)
{
Spells[R].Cast(enemy);
}
}
}
示例11: Interrupter2_OnInterruptableTarget
private void Interrupter2_OnInterruptableTarget(Obj_AI_Hero sender,
Interrupter2.InterruptableTargetEventArgs args)
{
if (R.IsReady() && config.Item("Interrupt", true).GetValue<bool>() && sender.Distance(player) < R.Range)
{
CastR();
}
}
示例12: Interruptable
public override void Interruptable(ComboProvider combo, Obj_AI_Hero sender, ComboProvider.InterruptableSpell interruptableSpell, float endTime)
{
var distance = sender.Distance(ObjectManager.Player);
if (sender.HasBuff("brandablaze") || Provider.IsMarked(sender) || !_brandQ.CouldHit(sender) || !InterruptW) return;
if (Cast(sender) == CastStates.SuccessfullyCasted)
Provider.SetMarked(sender); //Todo: risky, keep an eye on this. If the W misses u r fucked
}
示例13: Interruptable
public override void Interruptable(ComboProvider combo, Obj_AI_Hero sender, ComboProvider.InterruptableSpell interruptableSpell, float endTime)
{
if (endTime - Game.Time > Math.Max(sender.Distance(ObjectManager.Player) - Orbwalking.GetRealAutoAttackRange(sender), 0)/ObjectManager.Player.MoveSpeed + 0.5f)
{
SafeCast();
Orbwalking.Orbwalk(sender, sender.Position);
}
}
示例14: Insec
public static void Insec(Obj_AI_Hero target)
{
Rpos = Player.Position.To2D().Extend(target.Position.To2D(), Player.Distance(target) + 250);
if (Rpos.Distance(Player.Position) <= R.Range)
{
if (Player.Distance(Rpos.Extend(target.Position.To2D(), 700 - target.Distance(Rpos))) < E.Range && !IsWall(Rpos.To3D()) && target.IsFacing(Player))
{
R.Cast(Rpos);
}
}
}
示例15: IgniteOnTarget
private static void IgniteOnTarget(Obj_AI_Hero t)
{
var range = 550f;
var use = menu.Item("Spells.Ignite").GetValue<bool>();
if (use && Program.Player.Spellbook.CanUseSpell(IgniteSlot) == SpellState.Ready &&
t.Distance(Program.Player.Position) < range &&
Program.Player.GetSummonerSpellDamage(t, Damage.SummonerSpell.Ignite) > t.Health)
{
Program.Player.Spellbook.CastSpell(IgniteSlot, t);
}
}