本文整理汇总了C#中Spell.CanHeroEvade方法的典型用法代码示例。如果您正苦于以下问题:C# Spell.CanHeroEvade方法的具体用法?C# Spell.CanHeroEvade怎么用?C# Spell.CanHeroEvade使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spell
的用法示例。
在下文中一共展示了Spell.CanHeroEvade方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ActivateEvadeSpell
public static bool ActivateEvadeSpell(Spell spell, bool checkSpell = false)
{
var sortedEvadeSpells = evadeSpells.OrderBy(s => s.dangerlevel);
var extraDelayBuffer = ObjectCache.menuCache.cache["ExtraPingBuffer"].Cast<Slider>().CurrentValue;
float spellActivationTime = ObjectCache.menuCache.cache["SpellActivationTime"].Cast<Slider>().CurrentValue + ObjectCache.gamePing + extraDelayBuffer;
if (ObjectCache.menuCache.cache["CalculateWindupDelay"].Cast<CheckBox>().CurrentValue)
{
var extraWindupDelay = Evade.lastWindupTime - EvadeUtils.TickCount;
if (extraWindupDelay > 0)
{
return false;
}
}
foreach (var evadeSpell in sortedEvadeSpells)
{
var processSpell = true;
if (ObjectCache.menuCache.cache[evadeSpell.name + "UseEvadeSpell"].Cast<CheckBox>().CurrentValue == false
|| GetSpellDangerLevel(evadeSpell) > spell.GetSpellDangerLevel()
|| (evadeSpell.isItem == false && myHero.Spellbook.CanUseSpell(evadeSpell.spellKey) != SpellState.Ready)
|| (evadeSpell.isItem && !Items.CanUseItem((int)evadeSpell.itemID))
|| (evadeSpell.checkSpellName && myHero.Spellbook.GetSpell(evadeSpell.spellKey).Name != evadeSpell.spellName))
{
continue; //can't use spell right now
}
float evadeTime, spellHitTime;
spell.CanHeroEvade(myHero, out evadeTime, out spellHitTime);
float finalEvadeTime = (spellHitTime - evadeTime);
if (checkSpell)
{
var mode = ObjectCache.menuCache.cache[evadeSpell.name + "EvadeSpellMode"]
.Cast<ComboBox>().CurrentValue;
if (mode == 0)
{
continue;
}
else if (mode == 1)
{
if (spellActivationTime < finalEvadeTime)
{
continue;
}
}
}
else
{
//if (ObjectCache.menuCache.cache[evadeSpell.name + "LastResort"].Cast<CheckBox>().CurrentValue)
if (evadeSpell.spellDelay <= 50 && evadeSpell.evadeType != EvadeType.Dash)
{
var path = myHero.Path;
if (path.Length > 0)
{
var movePos = path[path.Length - 1].To2D();
var posInfo = EvadeHelper.CanHeroWalkToPos(movePos, ObjectCache.myHeroCache.moveSpeed, 0, 0);
if (GetSpellDangerLevel(evadeSpell) > posInfo.posDangerLevel)
{
continue;
}
}
}
}
if (evadeSpell.evadeType != EvadeType.Dash && spellHitTime > evadeSpell.spellDelay + 100 + Game.Ping +
ObjectCache.menuCache.cache["ExtraPingBuffer"].Cast<Slider>().CurrentValue)
{
processSpell = false;
if (checkSpell == false)
{
continue;
}
}
if (evadeSpell.isSpecial)
{
if (evadeSpell.useSpellFunc != null)
{
if (evadeSpell.useSpellFunc(evadeSpell, processSpell))
{
return true;
}
}
continue;
}
else if (evadeSpell.evadeType == EvadeType.Blink)
{
if (evadeSpell.castType == CastType.Position)
{
var posInfo = EvadeHelper.GetBestPositionBlink();
if (posInfo != null)
{
//.........这里部分代码省略.........