本文整理汇总了C#中Obj_AI_Hero.IsValid方法的典型用法代码示例。如果您正苦于以下问题:C# Obj_AI_Hero.IsValid方法的具体用法?C# Obj_AI_Hero.IsValid怎么用?C# Obj_AI_Hero.IsValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj_AI_Hero
的用法示例。
在下文中一共展示了Obj_AI_Hero.IsValid方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryFlashInitiate
private static void TryFlashInitiate(Obj_AI_Hero target)
{
// use r at appropriate distance
// on spell cast takes over
if (menulist("multib") == 2)
return;
if (!menu.Item("shycombo").GetValue<KeyBind>().Active ||
!target.IsValid<Obj_AI_Hero>() || uo || !menubool("user"))
return;
if (riventarget() == null || !canburst(true) || uo)
return;
if (!flash.IsReady())
return;
if (e.IsReady() && target.Distance(player.ServerPosition) <= e.Range + 50 + 300)
{
if (target.Distance(player.ServerPosition) > e.Range + truerange)
{
e.Cast(target.ServerPosition);
r.Cast();
}
}
if (!e.IsReady() && target.Distance(player.ServerPosition) <= 50 + 300)
{
if (target.Distance(player.ServerPosition) > truerange + 35)
{
r.Cast();
}
}
}
示例2: Interrupter2_OnInterruptableTarget
static void Interrupter2_OnInterruptableTarget(Obj_AI_Hero sender, Interrupter2.InterruptableTargetEventArgs args)
{
if (!sender.IsEnemy || !sender.IsValid<Obj_AI_Hero>())
return;
if (_menu.Item("interruptq").GetValue<bool>() && _q.IsReady())
{
if (sender.Distance(Me.ServerPosition, true) <= _q.RangeSqr)
_q.SPredictionCast(sender, HitChance.High);
}
if (_menu.Item("interruptr").GetValue<bool>() && _r.IsReady())
{
if (sender.Distance(Me.ServerPosition, true) <= _r.RangeSqr)
_r.Cast();
}
if (_menu.Item("interrupte").GetValue<bool>() && _e.IsReady())
{
if (sender.Distance(Me.ServerPosition, true) <= _e.RangeSqr)
_e.CastOnUnit(Me);
}
}
示例3: SomeDash
private static void SomeDash(Obj_AI_Hero target)
{
if (!menu.Item("shycombo").GetValue<KeyBind>().Active ||
!target.IsValid<Obj_AI_Hero>() || uo)
return;
if (riventarget() == null || uo || !r.IsReady())
return;
if (flash.IsReady() && canburst(true) && menulist("multib") != 2)
{
if (e.IsReady() && target.Distance(player.ServerPosition) <= e.Range + 50 + 300)
{
if (target.Distance(player.ServerPosition) > e.Range + truerange)
{
e.Cast(target.ServerPosition);
r.Cast();
}
}
if (!e.IsReady() && target.Distance(player.ServerPosition) <= 50 + 300)
{
if (target.Distance(player.ServerPosition) > truerange + 35)
{
r.Cast();
}
}
}
else
{
if (e.IsReady() && target.Distance(player.ServerPosition) <= e.Range + w.Range)
{
e.Cast(target.ServerPosition);
r.Cast();
}
}
}
示例4: Custom
private void Custom(bool conserve, Obj_AI_Hero selected)
{
if (R.IsReady())
{
Obj_AI_Hero target;
if (myOrbwalker.ActiveMode == myOrbwalker.OrbwalkingMode.Combo && conserve && R.Instance.ManaCost > (40 * config.Item("UseRComboValue").GetValue<Slider>().Value)) return;
if (myOrbwalker.ActiveMode == myOrbwalker.OrbwalkingMode.Custom && config.Item("UseRConserve").GetValue<bool>() && R.Instance.ManaCost > 40) return;
var EnemyList = HeroManager.Enemies.Where(x => x.IsValidTarget() && !x.IsDead && !x.IsZombie && !x.IsInvulnerable && !myUtility.ImmuneToMagic(x) && !myUtility.ImmuneToPhysical(x));
if (selected != null && selected.IsValid<Obj_AI_Hero>()) target = selected;
else
{
target = TargetSelector.GetSelectedTarget() != null && TargetSelector.GetSelectedTarget().IsValidTarget() ?
TargetSelector.GetSelectedTarget() :
EnemyList.Where(x => !x.InFountain() && Vector3.Distance(Player.ServerPosition, x.ServerPosition) <= RRange).OrderByDescending(z => myRePriority.ResortDB(z.ChampionName)).ThenBy(i => i.Health).FirstOrDefault();
}
if (target == null) return;
PredictionOutput pred = R.GetPrediction(target);
Vector3 pos;
if (Vector3.Distance(Player.ServerPosition, target.ServerPosition) <= RRange)
{
var test1 = Prediction.GetPrediction(target, 1.2f).CastPosition;
float movement = target.MoveSpeed * 100 / 1000;
if (target.Distance(test1) > movement)
{
if (myUtility.IsFacing(target, Player.ServerPosition))
{
pos = target.ServerPosition.Extend(Player.ServerPosition.Extend(test1, target.MoveSpeed), 100);
R.Cast(pos);
}
if (!myUtility.IsFacing(target, Player.ServerPosition))
{
pos = target.ServerPosition.Extend(Player.ServerPosition.Extend(test1, target.MoveSpeed), -100);
R.Cast(pos);
}
}
else
{
if (pred.Hitchance >= KHitChance)
{
pos = myUtility.RandomPos(1, 10, 10, pred.CastPosition);
R.Cast(pos);
}
}
}
}
}
示例5: Interrupter2_OnInterruptableTarget
private static void Interrupter2_OnInterruptableTarget(Obj_AI_Hero sender, Interrupter2.InterruptableTargetEventArgs args)
{
if (!sender.IsEnemy || !sender.IsValid<Obj_AI_Hero>())
return;
if (MainMenu._MainMenu.Item("InterQ").GetValue<bool>() && _Q.IsReady() && sender.ServerPosition.Distance(Player.ServerPosition) < 850 && !_Q.IsCharging)
{
_Q.Cast(sender.ServerPosition, true);
QSpell = true;
SpellTime = TickCount(1000);
}
if (MainMenu._MainMenu.Item("InterR").GetValue<bool>() && _R.IsReady() && sender.ServerPosition.Distance(Player.ServerPosition) < 875 && SpellTime < Environment.TickCount && !Player.IsRecalling())
{
_R.Cast(true);
RTime = TickCount(1000);
}
}
示例6: Interrupter2_OnInterruptableTarget
private static void Interrupter2_OnInterruptableTarget(Obj_AI_Hero sender, Interrupter2.InterruptableTargetEventArgs args)
{
try
{
if (sender.IsEnemy && sender.IsValid<Obj_AI_Hero>())
{
if (_MainMenu.Item("Poppy_inter_E").GetValue<bool>() && _E.IsReady() && Player.Distance(sender) < 525)
{
_E.Cast(sender, true);
}
if (_MainMenu.Item("Poppy_inter_R").GetValue<bool>() && _R.IsReady() && Player.Distance(sender) < 1200)
{
if (_R.IsCharging)
{
_R.Cast(sender, true);
}
else
{
_R.StartCharging();
}
}
}
}
catch (Exception)
{
if (NowTime() > ErrorTime)
{
Game.PrintChat(ChampName + " in FreshBooster isn't Load. Error Code 09");
ErrorTime = TickCount(10000);
}
}
}
示例7: GetInterruptableTargetData
public static InterruptableTargetEventArgs GetInterruptableTargetData(Obj_AI_Hero target)
{
if (target.IsValid<Obj_AI_Hero>())
{
if (CastingInterruptableSpell.ContainsKey(target.NetworkId))
{
// Return the args with spell end time
return new InterruptableTargetEventArgs(
CastingInterruptableSpell[target.NetworkId].DangerLevel, target.Spellbook.CastEndTime, CastingInterruptableSpell[target.NetworkId].MovementInterrupts);
}
}
return null;
}
示例8: Interrupter2_OnInterruptableTarget
private static void Interrupter2_OnInterruptableTarget(Obj_AI_Hero sender, Interrupter2.InterruptableTargetEventArgs args)
{
try
{
if (Player.IsDead)
return;
if (!sender.IsEnemy || !sender.IsValid<Obj_AI_Hero>())
return;
if (_MainMenu.Item("Blitzcrank_InterQ").GetValue<bool>() && _Q.IsReady())
{
if (sender.Distance(Player.ServerPosition, true) <= _Q.RangeSqr)
_Q.Cast(sender);
}
if (_MainMenu.Item("Blitzcrank_InterR").GetValue<bool>() && _R.IsReady())
{
if (sender.Distance(Player.ServerPosition, true) <= _R.RangeSqr)
_R.Cast();
}
if (_MainMenu.Item("Blitzcrank_InterR").GetValue<bool>() && _E.IsReady())
{
if (sender.Distance(Player.ServerPosition, true) <= _E.RangeSqr)
_E.CastOnUnit(Player);
}
}
catch (Exception)
{
if (NowTime() > ErrorTime)
{
Game.PrintChat(ChampName + " in FreshBooster isn't Load. Error Code 09");
ErrorTime = TickCount(10000);
}
}
}
示例9: Interrupter2_OnInterruptableTarget
private static void Interrupter2_OnInterruptableTarget(Obj_AI_Hero sender, Interrupter2.InterruptableTargetEventArgs args)
{
try
{
if (!sender.IsEnemy || !sender.IsValid<Obj_AI_Hero>())
return;
if (_MainMenu.Item("Thresh_InterE").GetValue<bool>() && _E.IsReady())
{
if (sender.IsEnemy && sender.Distance(Player) < 480)
{
_E.Cast(sender.ServerPosition, true);
}
}
if (_MainMenu.Item("Thresh_InterQ").GetValue<bool>() && _Q.IsReady())
{
if (sender.IsEnemy && sender.Distance(Player) < 1100 && Player.Spellbook.GetSpell(SpellSlot.Q).Name == "ThreshQ")
{
_Q.CastIfHitchanceEquals(sender, Hitchance("Thresh_CUseQ_Hit"), true);
}
}
}
catch (Exception)
{
if (NowTime() > ErrorTime)
{
Game.PrintChat(ChampName + " in FreshBooster isn't Load. Error Code 09");
ErrorTime = TickCount(10000);
}
}
}
示例10: Interrupter2_OnInterruptableTarget
private static void Interrupter2_OnInterruptableTarget(Obj_AI_Hero sender, Interrupter2.InterruptableTargetEventArgs args)
{
try
{
if (!sender.IsEnemy || !sender.IsValid<Obj_AI_Hero>())
return;
if (_MainMenu.Item("Janna_InterQ").GetValue<bool>() && _Q.IsReady() && sender.ServerPosition.Distance(Player.ServerPosition) < 850 && !_Q.IsCharging)
{
_Q.Cast(sender.ServerPosition, true);
QSpell = true;
SpellTime = TickCount(1000);
}
if (_MainMenu.Item("Janna_InterR").GetValue<bool>() && _R.IsReady() && sender.ServerPosition.Distance(Player.ServerPosition) < 875 && SpellTime < Environment.TickCount && !Player.IsRecalling())
{
_R.Cast(true);
RTime = TickCount(2000);
}
}
catch (Exception)
{
if (NowTime() > ErrorTime)
{
Game.PrintChat(ChampName + " in FreshBooster isn't Load. Error Code 09");
ErrorTime = TickCount(10000);
}
}
}
示例11: Interrupter2_OnInterruptableTarget
private static void Interrupter2_OnInterruptableTarget(Obj_AI_Hero sender, Interrupter2.InterruptableTargetEventArgs args)
{
if (!sender.IsEnemy || !sender.IsValid<Obj_AI_Hero>())
return;
if (MainMenu._MainMenu.Item("InterQ").GetValue<bool>() && _Q.IsReady())
{
if (sender.Distance(Player.ServerPosition, true) <= _Q.RangeSqr)
_Q.Cast(sender);
}
if (MainMenu._MainMenu.Item("InterR").GetValue<bool>() && _R.IsReady())
{
if (sender.Distance(Player.ServerPosition, true) <= _R.RangeSqr)
_R.Cast();
}
if (MainMenu._MainMenu.Item("InterR").GetValue<bool>() && _E.IsReady())
{
if (sender.Distance(Player.ServerPosition, true) <= _E.RangeSqr)
_E.CastOnUnit(Player);
}
}