本文整理汇总了C#中Hero.PredictedPosition方法的典型用法代码示例。如果您正苦于以下问题:C# Hero.PredictedPosition方法的具体用法?C# Hero.PredictedPosition怎么用?C# Hero.PredictedPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hero
的用法示例。
在下文中一共展示了Hero.PredictedPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
/// <summary>
/// The execute.
/// </summary>
/// <param name="hero">
/// The hero.
/// </param>
/// <returns>
/// The <see cref="bool" />.
/// </returns>
public bool Execute(Hero hero = null)
{
if (hero == null)
{
return false;
}
var me = Variables.Techies;
var heroPosition = hero.PredictedPosition(me.GetTurnTime(hero) * 2);
if (me.Distance2D(heroPosition) > this.blinkDagger.GetCastRange() + 150)
{
return false;
}
if (Prediction.StraightTime(hero) / 1000
< Variables.Menu.HurricanePikeMenu.Item("Techies.HurricanePikeStraightTime").GetValue<Slider>().Value)
{
return false;
}
if (hero.NetworkActivity == NetworkActivity.Move
&& Variables.Menu.HurricanePikeMenu.Item("Techies.HurricanePikeNoMove").GetValue<bool>())
{
return false;
}
var stack = GetNearestStackToPush(hero, heroPosition);
if (stack == null)
{
return false;
}
stack.AutoDetonate = true;
stack.MinEnemiesKill = 1;
var blinkPosition = stack.Position.Extend(heroPosition, stack.Position.Distance2D(hero) + 300);
this.blinkDagger.UseAbility(blinkPosition);
var sleeper = new Sleeper();
Events.OnUpdateDelegate update = args =>
{
if (sleeper.Sleeping || !this.hurricanePike.CanBeCasted())
{
return;
}
this.hurricanePike.UseAbility(hero);
sleeper.Sleep(150);
};
DelayAction.Add((float)(me.GetTurnTime(blinkPosition) * 1000), () => { Events.OnUpdate += update; });
DelayAction.Add(
(float)((me.GetTurnTime(blinkPosition) * 1000) + 50 + Game.Ping),
() => { Events.OnUpdate -= update; });
this.comboSleeper.Sleep(1000);
return true;
}
示例2: Execute
//.........这里部分代码省略.........
if (category != "buff" && target.IsMagicImmune() && ability.ImmunityType != (ImmunityType)3)
{
continue;
}
if (!CastingChecks.All(name, target, ability))
{
continue;
}
var handleString = ability.Handle.ToString();
if (etherealHitTime >= (Environment.TickCount + ability.GetHitDelay(target, name) * 1000))
{
continue;
}
if (name == "omniknight_purification")
{
if (Nukes.NukesMenuDictionary[name].Item(name + "minManaCheck").GetValue<Slider>().Value
< mana && MainMenu.Menu.Item("nukesToggler").GetValue<AbilityToggler>().IsEnabled(name)
&& Nukes.NukesMenuDictionary[name].Item(name + "herotoggler")
.GetValue<HeroToggler>()
.IsEnabled(NameManager.Name(target))
&& (etherealHitTime < (Environment.TickCount + ability.GetHitDelay(target, name) * 1000))
&& target.Health
> Nukes.NukesMenuDictionary[name].Item(NameManager.Name(ability) + "minhealthslider")
.GetValue<Slider>()
.Value)
{
var target1 =
AllyHeroes.UsableHeroes.Where(x => !x.IsMagicImmune())
.MinOrDefault(x => x.Distance2D(target));
if (target1 != null && ability.CanHit(target1, MyHeroInfo.Position, name)
&& target1.PredictedPosition().Distance2D(target.PredictedPosition())
< ability.GetRadius(name)
&& target1.PredictedPosition()
.Distance2D(
target.PredictedPosition(
ability.FindCastPoint(NameManager.Name(ability))))
< ability.GetRadius(name))
{
if (Nuke.Cast(ability, target1, name))
{
Utils.Sleep(
Math.Max(ability.GetCastDelay(me, target1, abilityName: name), 0.2) * 1000,
"GlobalCasting");
Utils.Sleep(ability.GetHitDelay(target1, name) * 1000, "calculate");
Utils.Sleep(
Math.Max(
ability.GetCastDelay(
me,
target1,
useCastPoint: false,
abilityName: name),
0.15) * 1000 + Game.Ping,
// + (Math.Max(me.Distance2D(target) - ability.GetCastRange(name) - 50, 0)
// / me.MovementSpeed) * 1000,
"casting");
Utils.Sleep(
Math.Max(ability.GetCastDelay(me, target1, abilityName: name), 0.2) * 1000,
"cancelorder");
return true;
}
}
else if (target1 != null && target1.Equals(me))