本文整理匯總了C#中AIHeroClient.PredictedHealth方法的典型用法代碼示例。如果您正苦於以下問題:C# AIHeroClient.PredictedHealth方法的具體用法?C# AIHeroClient.PredictedHealth怎麽用?C# AIHeroClient.PredictedHealth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AIHeroClient
的用法示例。
在下文中一共展示了AIHeroClient.PredictedHealth方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ShieldItems
public static bool ShieldItems(AIHeroClient ally)
{
if (ally == null || ally.IsDead || ally.Health <= 0 || !ally.IsValid) return false;
var predHp = ally.PredictedHealth();
if (ally.IsMe && Defence.DefenceMenu["Archangels_Staff"].Cast<CheckBox>().CurrentValue && predHp + ShieldHeals[ItemId.Archangels_Staff].Invoke() > 0) // Seraphs
{
if (Archangles != null && Archangles.CanUseItem())
{
Player.CastSpell(Archangles.SpellSlot);
Defence.LastSpellCast = Environment.TickCount + 250;
return true;
}
}
if (Defence.DefenceMenu["Locket_of_the_Iron_Solari"].Cast<CheckBox>().CurrentValue && (ally.IsMe && Defence.DefenceMenu["Locket_of_the_Iron_Solari_self"].Cast<CheckBox>().CurrentValue || !ally.IsMe && Defence.DefenceMenu["Locket_of_the_Iron_Solari_ally"].Cast<CheckBox>().CurrentValue) && predHp + ShieldHeals[ItemId.Locket_of_the_Iron_Solari].Invoke() > 0 && ally.Distance(Player.Instance) < 600) // Locket
{
if (Locket != null && Locket.CanUseItem())
{
Player.CastSpell(Locket.SpellSlot);
Defence.LastSpellCast = Environment.TickCount + 250;
return true;
}
}
if (Defence.DefenceMenu["Face_of_the_Mountain"].Cast<CheckBox>().CurrentValue && (ally.IsMe && Defence.DefenceMenu["Face_of_the_Mountain_self"].Cast<CheckBox>().CurrentValue || !ally.IsMe) && predHp + ShieldHeals[ItemId.Face_of_the_Mountain].Invoke() > 0 && ally.Distance(Player.Instance) < 700) // FOM
{
if (FaceOfTheMountain != null && FaceOfTheMountain.CanUseItem())
{
Player.CastSpell(FaceOfTheMountain.SpellSlot, ally);
Defence.LastSpellCast = Environment.TickCount + 250;
return true;
}
}
if (Defence.DefenceMenu["Mikaels_Crucible_Heal"].Cast<CheckBox>().CurrentValue && Mikaels != null && Mikaels.CanUseItem() && predHp + (150 + (0.1 * ally.Health)) > 0 && ally.Distance(Player.Instance) < 750) // Mikaels
{
Player.CastSpell(Mikaels.SpellSlot, ally);
Defence.LastSpellCast = Environment.TickCount + 250;
return true;
}
return false;
}