本文整理汇总了C#中AIHeroClient.LSDistance方法的典型用法代码示例。如果您正苦于以下问题:C# AIHeroClient.LSDistance方法的具体用法?C# AIHeroClient.LSDistance怎么用?C# AIHeroClient.LSDistance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AIHeroClient
的用法示例。
在下文中一共展示了AIHeroClient.LSDistance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChampionInfo
public ChampionInfo(AIHeroClient 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.LSExtend(_hero.Position, 300 + textoffset)),
VisibleCondition = delegate
{
float dist = _hero.LSDistance(ObjectManager.Player.Position);
return Program.Instance().ShowChampionNames && !_hero.IsDead &&
Game.Time - _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.Time - _lineStart < Program.Instance().LineDuration &&
_hero.LSDistance(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.Time - _lineStart < Program.Instance().LineDuration;
}
};
minimapLine.Add(0);
Game.OnUpdate += Game_OnGameUpdate;
OnEnterRange += ChampionInfo_OnEnterRange;
}
示例2: GetDamage
public override float GetDamage(AIHeroClient enemy)
{
var baseDamage = base.GetDamage(enemy);
return enemy.HasBuff("brandablaze") || _brandE.CanBeCast() && enemy.LSDistance(ObjectManager.Player) < 650
? baseDamage*1.25f
: baseDamage;
}
示例3: CastQ
private static void CastQ(AIHeroClient target)
{
var ext = 0;
if (player.LSDistance(target.ServerPosition) > 400)
{
ext = 100;
}
var pred = Q.GetPrediction(target, true);
var pos = player.Position.LSExtend(pred.CastPosition, player.LSDistance(pred.CastPosition) + ext);
if (pred.CastPosition.IsValid() && target.LSDistance(pos) < player.LSDistance(target) &&
pred.Hitchance >= HitChance.Medium)
{
//Console.WriteLine(2 + " - " + " - " + pred.Hitchance);
Q.Cast(pos);
}
}
示例4: Execute
public override void Execute(AIHeroClient target)
{
var distance = target.LSDistance(ObjectManager.Player);
//Todo: make him use fireminions even in range, just for showoff and potential AOE. Check if hes on fire too though
if (distance < 950 && distance > 650 && Program.getMiscMenuCB("eMinion"))
{
var fireMinion =
MinionManager.GetMinions(650, MinionTypes.All, MinionTeam.NotAlly, MinionOrderTypes.None)
.Where(minion => minion.HasBuff("brandablaze") && minion.LSDistance(target) < 300)
.MinOrDefault(minion => minion.LSDistance(target));
if (fireMinion != null)
{
if (Cast(fireMinion) == CastStates.SuccessfullyCasted && !target.HasSpellShield())
Provider.SetMarked(target);
}
}
if (distance < 650)
{
if (Cast(target) == CastStates.SuccessfullyCasted && !target.HasSpellShield())
Provider.SetMarked(target);
}
}
示例5: castQ
public void castQ(AzirMain azir, AIHeroClient target, bool useQ, int nSoldiersToQ)
{
//revisar entero
if (target.LSDistance(HeroManager.Player) <= azir.Spells.Q.Range)
{
if (target.isRunningOfYou())
{
var predpos = Prediction.GetPrediction(target, 500f);
if (azir.Hero.LSDistance(predpos.CastPosition) <= azir.Spells.Q.Range)
{
azir.Spells.Q.Cast((predpos.CastPosition));
}
}
else
{
var predq = Q.GetPrediction(target);
if (predq.Hitchance >= HitChance.High)
{
Q.Cast(predq.CastPosition);
}
}
}
}
示例6: Combo
private static void Combo(AIHeroClient target)
{
if (target != null && target.IsVisible && target.IsHPBarRendered)
{
var overkill = _player.LSGetSpellDamage(target, SpellSlot.Q) + _player.LSGetSpellDamage(target, SpellSlot.E) + _player.LSGetAutoAttackDamage(target, true) * 2;
var doubleu = _player.Spellbook.GetSpell(SpellSlot.W);
if (getCheckBoxItem(comboMenu, "UseUlt") && UltStage == UltCastStage.First && (overkill < target.Health || (!_w.IsReady() && doubleu.Cooldown > 2f && _player.LSGetSpellDamage(target, SpellSlot.Q) < target.Health && target.LSDistance(_player.Position) > 400)))
{
if ((target.LSDistance(_player.Position) > 700 && target.MoveSpeed > _player.MoveSpeed) || target.LSDistance(_player.Position) > 800)
{
CastW(target);
_w.Cast();
}
_r.Cast(target);
}
else
{
if (target != null && getCheckBoxItem(comboMenu, "UseIgnitecombo") && _igniteSlot != SpellSlot.Unknown &&
_player.Spellbook.CanUseSpell(_igniteSlot) == SpellState.Ready)
{
if (ComboDamage(target) > target.Health || target.HasBuff("zedulttargetmark"))
{
_player.Spellbook.CastSpell(_igniteSlot, target);
}
}
if (target != null && ShadowStage == ShadowCastStage.First && getCheckBoxItem(comboMenu, "UseWC") &&
target.LSDistance(_player.Position) > 400 && target.LSDistance(_player.Position) < 1300)
{
CastW(target);
}
if (target != null && ShadowStage == ShadowCastStage.Second && getCheckBoxItem(comboMenu, "UseWC") && target.LSDistance(WShadow.ServerPosition) < target.LSDistance(_player.Position))
{
_w.Cast();
}
CastE();
CastQ(target);
}
}
}
示例7: OnInterrupt
private static void OnInterrupt(AIHeroClient sender, Interrupter2.InterruptableTargetEventArgs args)
{
if (!getCheckBoxItem(MenuConfig.misc, "autoeint")) return;
if (sender.IsMe || sender.IsAlly) return;
if (sender.LSDistance(Player) <= Em.Range)
{
if (!Ismelee())
{
R.Cast();
}
if (Ismelee())
{
Em.Cast(sender);
}
}
}
示例8: useQSmart
public static void useQSmart(AIHeroClient target, bool onlyEmp = false)
{
if (!Q.IsReady() || target == null)
return;
if (isQEmpovered())
{
if (canCastFarQ())
{
PredictionOutput po = QEmp.GetPrediction(target); //QEmp.GetPrediction(target, true);
if (po.Hitchance >= LeagueSharp.Common.HitChance.Medium)
{
QEmp.Cast(po.CastPosition);
return;
}
}
else//dashing
{
Vector3 endPos = getDashEndPos();
if (Player.LSDistance(endPos) < 40 && target.LSDistance(endPos) < QCir.Range)
{
QCir.Cast(target.Position);
return;
}
}
}
else if (!onlyEmp)
{
if (canCastFarQ())
{
PredictionOutput po = Q.GetPrediction(target);
if (po.Hitchance >= LeagueSharp.Common.HitChance.Medium)
{
Q.Cast(po.CastPosition);
}
return;
}
else//dashing
{
float trueRange = QCir.Range - 10;
Vector3 endPos = getDashEndPos();
if (Player.LSDistance(endPos) < 40 && target.LSDistance(endPos) < QCir.Range)
{
QCir.Cast(target.Position);
return;
}
}
}
}
示例9: Interrupter2_OnInterruptableTarget
private static void Interrupter2_OnInterruptableTarget(
AIHeroClient sender,
Interrupter2.InterruptableTargetEventArgs args)
{
if (!getCheckBoxItem(miscMenu, "ElTristana.Interrupter"))
{
return;
}
if (sender.LSDistance(Player) <= spells[Spells.R].Range)
{
spells[Spells.R].Cast(sender);
}
}
示例10: Interrupter2_OnInterruptableTarget
/// <summary>
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
private static void Interrupter2_OnInterruptableTarget(
AIHeroClient sender,
Interrupter2.InterruptableTargetEventArgs args)
{
if (!getCheckBoxItem(miscMenu, "inter"))
{
return;
}
if (args.DangerLevel != Interrupter2.DangerLevel.High
|| sender.LSDistance(Player) > Q.Range)
{
return;
}
if (sender.LSIsValidTarget(Q.Range) && args.DangerLevel == Interrupter2.DangerLevel.High
&& Q.IsReady())
{
var prediction = Q.GetPrediction(sender);
if (prediction.Hitchance >= HitChance.High)
{
Q.Cast(sender);
}
}
}
示例11: Interrupter2_OnInterruptableTarget
private static void Interrupter2_OnInterruptableTarget(
AIHeroClient sender,
Interrupter2.InterruptableTargetEventArgs args)
{
var useInterrupter = getCheckBoxItem(ElViMenu.miscMenu, "ElVi.misc.Interrupter");
if (!useInterrupter)
{
return;
}
if (args.DangerLevel != Interrupter2.DangerLevel.High
|| sender.LSDistance(Player) > Spells[ElVi.Spells.Q].Range)
{
return;
}
if (Spells[ElVi.Spells.Q].IsReady())
{
if (!Spells[ElVi.Spells.Q].IsCharging)
{
Spells[ElVi.Spells.Q].StartCharging();
}
else
{
Spells[ElVi.Spells.Q].Cast(sender);
}
}
if (Spells[ElVi.Spells.R].CanCast(sender) && args.DangerLevel >= Interrupter2.DangerLevel.High)
{
Spells[ElVi.Spells.R].Cast(sender);
}
}
示例12: Interrupter2_OnInterruptableTarget
private static void Interrupter2_OnInterruptableTarget(AIHeroClient sender,
Interrupter2.InterruptableTargetEventArgs args)
{
if (!getCheckBoxItem(rMenu, "OPTI"))
return;
if (R.IsReady() && sender.LSDistance(BallPos) < R.Range)
{
R.Cast();
Program.debug("interupt");
}
else if (Q.IsReady() && Player.Mana > RMANA + QMANA && sender.LSIsValidTarget(Q.Range))
Q.Cast(sender.ServerPosition);
}
示例13: SomeDash
private static void SomeDash(AIHeroClient target)
{
if (!Getkeybindvalue(keybindsMenu, "shycombo") || !target.IsValid<AIHeroClient>() || uo)
return;
if (riventarget() == null || !r.IsReady())
return;
if (flash.IsReady() && w.IsReady() && (canburst() || shy()) && getBoxItem(r1Menu, "multib") != 2)
{
if (e.IsReady() && target.LSDistance(player.ServerPosition) <= e.Range + w.Range + 275)
{
if (target.LSDistance(player.ServerPosition) > e.Range + truerange + 50)
{
e.Cast(target.ServerPosition);
if (!uo)
r.Cast();
}
}
if (!e.IsReady() && target.LSDistance(player.ServerPosition) <= w.Range + 275)
{
if (target.LSDistance(player.ServerPosition) > truerange + 50)
{
if (!uo)
r.Cast();
}
}
}
else
{
if (e.IsReady() && target.LSDistance(player.ServerPosition) <= e.Range + w.Range - 25)
{
if (target.LSDistance(player.ServerPosition) > truerange + 50)
{
e.Cast(target.ServerPosition);
if (!uo)
r.Cast();
}
}
if (!e.IsReady() && target.LSDistance(player.ServerPosition) <= w.Range - 10)
{
if (!uo)
r.Cast();
}
}
}
示例14: SpellUseE
public static void SpellUseE(AIHeroClient target)
{
if (!target.CanMove && !target.IsMoving)
{
var EPosition = target.ServerPosition.LSExtend(Player.Position, 400);
_E.Cast(EPosition, true);
return;
}
if (target.LSDistance(Player) > 750)
{
var EPosition = target.ServerPosition.LSExtend(Player.Position, 200);
_E.Cast(EPosition, true);
return;
}
else
{
var EPosition = target.ServerPosition;
_E.Cast(EPosition, true);
return;
}
}
示例15: ELogic
private static void ELogic(AIHeroClient target)
{
if (!E.CanCast(target) || target.HasBuffOfType(BuffType.SpellShield)) return;
var tower = target.GetMostCloseTower();
if (tower != null && tower.IsAlly && E.CanCast(target) && target.LSDistance(tower)<tower.AttackRange + E.Range)
{
if (target.LSDistance(tower) < Player.LSDistance(tower))
{
E.Cast(target);
// Chat.Print("E1");
}
else
{
E.CastToReverse(target);
// Chat.Print("E2");
}
}
var adc = GetAdc();
if (adc!=null)
{
if (target.IsFleeing(Player))
{
E.Cast(target);
// Chat.Print("E3");
}
else if (target.IsHunting(Player))
{
E.CastToReverse(target);
// Chat.Print("E4");
}
}
if (target.LSDistance(Player)>E.Range/2 || Player.HealthPercent<50)
{
E.CastToReverse(target);
// Chat.Print("E5");
}
}