本文整理汇总了C#中Hero.CanGoInvis方法的典型用法代码示例。如果您正苦于以下问题:C# Hero.CanGoInvis方法的具体用法?C# Hero.CanGoInvis怎么用?C# Hero.CanGoInvis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hero
的用法示例。
在下文中一共展示了Hero.CanGoInvis方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Invisible
public static bool Invisible(Hero target)
{
return target.CanGoInvis() || target.IsInvisible();
}
示例2: ItemUsage
//.........这里部分代码省略.........
if (pike!=null && pike.IsValid)
{
if (target.IsMelee)
{
if (target.Distance2D(me) <= pike.GetCastRange())
{
var angle = (float)Math.Max(
Math.Abs(target.RotationRad -
Utils.DegreeToRadian(target.FindAngleBetween(me.Position))) - 0.20, 0);
if (!Prediction.IsTurning(target) && angle == 0)
{
pike.UseAbility(target);
Utils.Sleep(500, pike.Name + me.Handle);
}
}
else
{
}
}
}
// purge enemies if menu setting enabled
var purgeAll = Menu.Item("Diffusal.PurgEnemy").GetValue<StringList>().SelectedIndex == (int)PurgeSelection.AllEnemies;
// if ItemUsage is called by combo1
if (byIllusion)
{
var targets = ObjectManager.GetEntities<Hero>()
.Where(
x =>
x.IsValid && x.IsAlive && x.IsVisible && x.Team!=me.Team && x.Distance2D(me) <= 750 &&
(purgeAll || Equals(target, x)) &&
!x.IsStunned() && !x.IsHexed())
.ToList();
foreach (var hero in targets)
{
var mod =
hero.HasModifier("modifier_item_diffusal_blade_slow");
var repel = hero.FindModifier("modifier_omniknight_repel")!=null;
var guard = hero.FindModifier("modifier_omninight_guardian_angel")!=null;
var dust = inventory.Find(x => Utils.SleepCheck(x.Name + me.Handle) && x.Name == "item_dust");
if (dust != null && (!Menu.Item("Dust.Check").GetValue<bool>() || target.CanGoInvis() || target.IsInvisible()))
{
dust.UseAbility();
Utils.Sleep(250, dust.StoredName() + me.Handle);
}
if (mod && !repel && !guard)
{
continue;
}
var items2 =
inventory.Where(
x =>
Utils.SleepCheck(x.Name + me.Handle) && CloneOnlyComboItems.Contains(x.Name) &&
(me.Distance2D(hero) <= 650)).ToList();
foreach (var item in items2)
{
item.UseAbility(hero);
Utils.Sleep(500, item.Name + me.Handle);
}
}
}
// code for diffusal blade dispelling
var both = Menu.Item("Diffusal.Dispel").GetValue<StringList>().SelectedIndex == (int)DispelSelection.Both;
var main = Menu.Item("Diffusal.Dispel").GetValue<StringList>().SelectedIndex == (int)DispelSelection.Me;
var tempest = Menu.Item("Diffusal.Dispel").GetValue<StringList>().SelectedIndex == (int)DispelSelection.Tempest;
if (byIllusion && (both || main || tempest))
{
var dif = inventory.Where(
x =>
Utils.SleepCheck(x.Name + me.Handle) && CloneOnlyComboItems.Contains(x.Name)).ToList();
if (dif.Any())
TryToDispell(me, dif, both, main, tempest);
}
// code for using bkb
if (useBkb && distance<900)
{
var bkb = inventory.FirstOrDefault(x => Utils.SleepCheck(x.Name + me.Handle) && x.Name == "item_black_king_bar");
if (bkb != null && bkb.CanBeCasted() && Utils.SleepCheck(bkb.Name + me.Handle))
{
bkb.UseAbility();
Utils.Sleep(500, bkb.Name + me.Handle);
}
}
// Uses ultimate if all items expect of refresher was casted
var refreshItems = inventory.Where(
x =>
Items.Keys.Contains(x.StoredName()));
if (refreshItems.Any()) return !items.Any();
var r = me.Spellbook.SpellR;
if (r == null || r.CanBeCasted()) return !items.Any();
var refresher = inventory.FirstOrDefault(x => Utils.SleepCheck(x.Name + me.Handle) && x.Name == "item_refresher");
refresher?.UseAbility();
Utils.Sleep(500, refresher?.Name + me.Handle);
return !items.Any();
}