本文整理汇总了C#中Obj_AI_Hero.HealthPercent方法的典型用法代码示例。如果您正苦于以下问题:C# Obj_AI_Hero.HealthPercent方法的具体用法?C# Obj_AI_Hero.HealthPercent怎么用?C# Obj_AI_Hero.HealthPercent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj_AI_Hero
的用法示例。
在下文中一共展示了Obj_AI_Hero.HealthPercent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProtectorOnTargetedProtection
private void ProtectorOnTargetedProtection(Obj_AI_Base caster, Obj_AI_Hero target, SpellData spell)
{
try
{
if (!ConfigValue<bool>("Misc.Shield.Target"))
return;
if (Orbwalking.IsAutoAttack(spell.Name) &&
target.HealthPercent() > ConfigValue<Slider>("Misc.Shield.Health").Value)
return;
if (spell.MissileSpeed > 2000 || spell.MissileSpeed == 0)
return;
// TODO: blacklist FiddleQ, FioraQ/R, LeonaE, VladQ, ZileanQ
if (target.IsMe && E.IsReady())
{
CastShield(caster.Position);
}
if (!target.IsMe && W.IsReady() && W.IsInRange(target) && (IsShieldActive || E.IsReady()))
{
var jumpTime = (Player.Distance(target)*1000/W.Instance.SData.MissileSpeed) +
(W.Instance.SData.SpellCastTime*1000);
var missileTime = caster.Distance(target)*1000/spell.MissileSpeed;
if (jumpTime > missileTime)
{
Console.WriteLine("Abort Jump - Missile too Fast: {0} {1}", jumpTime, missileTime);
return;
}
W.CastOnUnit(target, UsePackets);
Utility.DelayAction.Add((int) jumpTime, () => CastShield(caster.Position));
}
}
catch (Exception e)
{
Console.WriteLine(e);
}
}