本文整理汇总了C#中WoWUnit.MeleeDistance方法的典型用法代码示例。如果您正苦于以下问题:C# WoWUnit.MeleeDistance方法的具体用法?C# WoWUnit.MeleeDistance怎么用?C# WoWUnit.MeleeDistance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WoWUnit
的用法示例。
在下文中一共展示了WoWUnit.MeleeDistance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsDisengageNeeded
public static bool IsDisengageNeeded()
{
if (SingularRoutine.CurrentWoWContext == WoWContext.Instances)
return false;
if (!Me.IsAlive || Me.IsFalling || Me.IsCasting)
return false;
if (Me.Stunned || Me.Rooted || Me.IsStunned() || Me.IsRooted())
return false;
if (NextDisengageAllowed > DateTime.Now)
return false;
useRocketJump = false;
if (!Spell.CanCastHack("Disengage", Me))
{
if (!SingularSettings.Instance.UseRacials || Me.Race != WoWRace.Goblin || !Spell.CanCastHack("Rocket Jump", Me))
return false;
useRocketJump = true;
}
mobToGetAwayFrom = SafeArea.NearestEnemyMobAttackingMe;
if (mobToGetAwayFrom == null)
return false;
if (SingularRoutine.CurrentWoWContext == WoWContext.Normal )
{
List<WoWUnit> attackers = SafeArea.AllEnemyMobsAttackingMe.ToList();
if ((attackers.Sum( a => a.MaxHealth ) / 4) < Me.MaxHealth && Me.HealthPercent > 40)
return false;
}
else if (SingularRoutine.CurrentWoWContext == WoWContext.Battlegrounds)
{
switch (mobToGetAwayFrom.Class)
{
default:
return false;
case WoWClass.DeathKnight:
case WoWClass.Druid:
case WoWClass.Monk:
case WoWClass.Paladin:
case WoWClass.Rogue:
case WoWClass.Shaman:
break;
}
}
if (mobToGetAwayFrom.Distance > mobToGetAwayFrom.MeleeDistance() + 3f)
return false;
SafeArea sa = new SafeArea();
sa.MinScanDistance = TalentManager.HasGlyph("Disengage") ? 21 : 16; // average disengage distance on flat ground
sa.MaxScanDistance = sa.MinScanDistance;
sa.RaysToCheck = 36;
sa.LineOfSightMob = Target;
sa.MobToRunFrom = mobToGetAwayFrom;
sa.CheckLineOfSightToSafeLocation = true;
sa.CheckSpellLineOfSightToMob = false;
safeSpot = sa.FindLocation();
if (safeSpot == WoWPoint.Empty)
{
Logger.WriteDebug(Color.Cyan, "DIS: no safe landing spots found for {0}", useRocketJump ? "Rocket Jump" : "Disengage");
return false;
}
Logger.WriteDebug(Color.Cyan, "DIS: Attempt safe {0} due to {1} @ {2:F1} yds",
useRocketJump ? "Rocket Jump" : "Disengage",
mobToGetAwayFrom.SafeName(),
mobToGetAwayFrom.Distance);
return true;
}
示例2: CanWeDisengage
public static bool CanWeDisengage(string spell, Direction dir, int distance)
{
if (!SpellManager.HasSpell(spell))
return false;
if (DateTime.UtcNow < NextDisengageAllowed)
return false;
if (!Me.IsAlive || Me.IsFalling || Me.IsCasting || Me.IsSwimming)
return false;
if (Me.Stunned || Me.Rooted || Me.IsStunned() || Me.IsRooted())
return false;
if (!Spell.CanCastHack(spell, Me))
return false;
mobToGetAwayFrom = SafeArea.NearestEnemyMobAttackingMe;
if (mobToGetAwayFrom == null)
return false;
if (mobToGetAwayFrom.SpellDistance() > mobToGetAwayFrom.MeleeDistance() + 3f)
return false;
SafeArea sa = new SafeArea();
sa.MinScanDistance = distance; // average distance on flat ground
sa.MaxScanDistance = sa.MinScanDistance;
sa.RaysToCheck = 36;
sa.LineOfSightMob = Target;
sa.MobToRunFrom = mobToGetAwayFrom;
sa.CheckLineOfSightToSafeLocation = true;
sa.CheckSpellLineOfSightToMob = false;
sa.DirectPathOnly = true;
safeSpot = sa.FindLocation();
if (safeSpot == WoWPoint.Empty)
{
Logger.WriteDebug(Color.Cyan, "DIS: no safe landing spots found for {0}", spell);
return false;
}
Logger.WriteDebug(Color.Cyan, "DIS: Attempt safe {0} due to {1} @ {2:F1} yds",
spell,
mobToGetAwayFrom.SafeName(),
mobToGetAwayFrom.Distance);
return true;
}
示例3: IsDisengageNeeded
public static bool IsDisengageNeeded()
{
if (!Me.IsAlive || Me.IsFalling || Me.IsCasting)
return false;
if (Me.Stunned || Me.Rooted || Me.IsStunned() || Me.IsRooted())
return false;
if (NextDisengageAllowed > DateTime.Now)
return false;
useRocketJump = false;
if (!SpellManager.CanCast("Disengage", Me, false, false))
{
if (!SingularSettings.Instance.UseRacials || Me.Race != WoWRace.Goblin || !SpellManager.CanCast("Rocket Jump", Me, false, false))
return false;
useRocketJump = true;
}
mobToGetAwayFrom = SafeArea.NearestEnemyMobAttackingMe;
if (mobToGetAwayFrom == null)
return false;
if (mobToGetAwayFrom.Distance > mobToGetAwayFrom.MeleeDistance() + 3f)
return false;
if (Me.Level > (mobToGetAwayFrom.Level + (mobToGetAwayFrom.Elite ? 10 : 5)) && Me.HealthPercent > 20)
return false;
SafeArea sa = new SafeArea();
sa.MinScanDistance = 16; // average disengage distance on flat ground
sa.MaxScanDistance = sa.MinScanDistance;
sa.RaysToCheck = 36;
sa.LineOfSightMob = Me.CurrentTarget;
sa.MobToRunFrom = mobToGetAwayFrom;
sa.CheckLineOfSightToSafeLocation = true;
sa.CheckSpellLineOfSightToMob = false;
safeSpot = sa.FindLocation();
if (safeSpot == WoWPoint.Empty)
{
Logger.Write(Color.Cyan, "DIS: no safe landing spots found for {0}", useRocketJump ? "Rocket Jump" : "Disengage");
return false;
}
Logger.Write(Color.Cyan, "DIS: Attempt safe {0} due to {1} @ {2:F1} yds",
useRocketJump ? "Rocket Jump" : "Disengage",
mobToGetAwayFrom.Name,
mobToGetAwayFrom.Distance);
return true;
}
示例4: CanWeDisengage
public static bool CanWeDisengage(string spell, Direction dir, int distance)
{
if (!SpellManager.HasSpell(spell))
return false;
if (DateTime.Now < NextDisengageAllowed)
return false;
if (!Me.IsAlive || Me.IsFalling || Me.IsCasting || Me.IsSwimming)
return false;
if (Me.Stunned || Me.Rooted || Me.IsStunned() || Me.IsRooted())
return false;
if (!Spell.CanCastHack(spell, Me))
return false;
mobToGetAwayFrom = SafeArea.NearestEnemyMobAttackingMe;
if (mobToGetAwayFrom == null)
return false;
if (SingularRoutine.CurrentWoWContext == WoWContext.Normal)
{
List<WoWUnit> attackers = SafeArea.AllEnemyMobsAttackingMe.ToList();
if ((attackers.Sum(a => a.MaxHealth) / 3) < Me.MaxHealth && Me.HealthPercent > 40)
{
return false;
}
}
else if (SingularRoutine.CurrentWoWContext == WoWContext.Battlegrounds)
{
switch (mobToGetAwayFrom.Class)
{
default:
return false;
case WoWClass.DeathKnight:
case WoWClass.Druid:
case WoWClass.Monk:
case WoWClass.Paladin:
case WoWClass.Rogue:
case WoWClass.Shaman:
break;
}
}
if (mobToGetAwayFrom.Distance > mobToGetAwayFrom.MeleeDistance() + 3f)
return false;
SafeArea sa = new SafeArea();
sa.MinScanDistance = distance; // average distance on flat ground
sa.MaxScanDistance = sa.MinScanDistance;
sa.RaysToCheck = 36;
sa.LineOfSightMob = Target;
sa.MobToRunFrom = mobToGetAwayFrom;
sa.CheckLineOfSightToSafeLocation = true;
sa.CheckSpellLineOfSightToMob = false;
safeSpot = sa.FindLocation();
if (safeSpot == WoWPoint.Empty)
{
Logger.WriteDebug(Color.Cyan, "DIS: no safe landing spots found for {0}", spell);
return false;
}
Logger.WriteDebug(Color.Cyan, "DIS: Attempt safe {0} due to {1} @ {2:F1} yds",
spell,
mobToGetAwayFrom.SafeName(),
mobToGetAwayFrom.Distance);
return true;
}