本文整理汇总了C#中AIHeroClient.IsValid方法的典型用法代码示例。如果您正苦于以下问题:C# AIHeroClient.IsValid方法的具体用法?C# AIHeroClient.IsValid怎么用?C# AIHeroClient.IsValid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AIHeroClient
的用法示例。
在下文中一共展示了AIHeroClient.IsValid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGapCloser
public static void OnGapCloser(AIHeroClient sender, Gapcloser.GapcloserEventArgs e)
{
var playerPosition = ObjectManager.Player.Position.To2D();
var direction1 = (ObjectManager.Player.ServerPosition - sender.ServerPosition).To2D().Normalized();
const int distance = 475;
const int stepSize = 20;
if (!Spells.E.IsReady() ||
!(Init.MiscMenu["gapcloser"].Cast<CheckBox>().CurrentValue &&
e.Type == Gapcloser.GapcloserType.Skillshot) ||
!(Init.MiscMenu["gapcloserT"].Cast<CheckBox>().CurrentValue &&
e.Type == Gapcloser.GapcloserType.Targeted) ||
sender.IsAlly || !sender.IsValid())
return;
{
for (var step = 0f; step < 360; step += stepSize)
{
var currentAngel = step * (float)Math.PI / 90;
var currentCheckPoint = playerPosition +
distance * direction1.Rotated(currentAngel);
if (!Helpers.IsSafePosition((Vector3)currentCheckPoint) ||
NavMesh.GetCollisionFlags(currentCheckPoint).HasFlag(CollisionFlags.Wall) ||
NavMesh.GetCollisionFlags(currentCheckPoint).HasFlag(CollisionFlags.Building))
continue;
{
Spells.E.Cast((Vector3)currentCheckPoint);
}
}
}
}
示例2: GetInterruptableTargetData
public static InterruptableTargetEventArgs GetInterruptableTargetData(AIHeroClient target)
{
if (target.IsValid<AIHeroClient>())
{
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;
}
示例3: 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();
}
}
}
示例4: Interrupter2_OnInterruptableTarget
private static void Interrupter2_OnInterruptableTarget(AIHeroClient sender, Interrupter2.InterruptableTargetEventArgs args)
{
try
{
if (!sender.IsEnemy || !sender.IsValid<AIHeroClient>())
return;
if (getCheckBoxItem(miscMenu, "Janna_InterQ") && _Q.IsReady() && sender.ServerPosition.LSDistance(Player.ServerPosition) < 850 && !_Q.IsCharging)
{
_Q.Cast(sender.ServerPosition, true);
QSpell = true;
SpellTime = TickCount(1000);
}
if (getCheckBoxItem(miscMenu, "Janna_InterR") && _R.IsReady() && sender.ServerPosition.LSDistance(Player.ServerPosition) < 875 && SpellTime < Environment.TickCount && !Player.IsRecalling())
{
_R.Cast(true);
RTime = TickCount(2000);
}
}
catch (Exception)
{
if (NowTime() > ErrorTime)
{
Chat.Print(ChampName + " in FreshBooster isn't Load. Error Code 09");
ErrorTime = TickCount(10000);
}
}
}
示例5: OnGapCloser
public static void OnGapCloser(AIHeroClient sender, Gapcloser.GapcloserEventArgs e)
{
if (!sender.IsValid() || sender.IsAlly) return;
var tentaclesNearGapcloser = TentacleList.Count(x => x.Distance(e.End) < Spells.Q.Range);
if (Init.MiscMenu["gapcloserQ"].Cast<CheckBox>().CurrentValue &&
e.End.Distance(Player.ServerPosition) <= Spells.Q.Range && Spells.Q.IsReady())
{
Spells.Q.Cast(e.End);
}
if (!Init.MiscMenu["gapcloserW"].Cast<CheckBox>().CurrentValue || !Spells.W.IsReady()) return;
{
if (tentaclesNearGapcloser > 0)
{
Spells.W.Cast();
}
}
}