本文整理汇总了C#中AIHeroClient.IsDashing方法的典型用法代码示例。如果您正苦于以下问题:C# AIHeroClient.IsDashing方法的具体用法?C# AIHeroClient.IsDashing怎么用?C# AIHeroClient.IsDashing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AIHeroClient
的用法示例。
在下文中一共展示了AIHeroClient.IsDashing方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleQ
private static void HandleQ(AIHeroClient comboTarget)
{
var QPrediction = spells[SpellSlot.Q].GetPrediction(comboTarget);
if (QPrediction.Hitchance >= HitChance.High)
{
if (spells[SpellSlot.Q].GetDamage(comboTarget) > comboTarget.Health + 15 &&
getCheckBoxItem(comboMenu, "dz191.bard.combo.qks"))
{
spells[SpellSlot.Q].Cast(QPrediction.CastPosition);
return;
}
var QPushDistance = getSliderItem(miscMenu, "dz191.bard.misc.distance");
var QAccuracy = getSliderItem(miscMenu, "dz191.bard.misc.accuracy");
var PlayerPosition = ObjectManager.Player.ServerPosition;
var BeamStartPositions = new List<Vector3>
{
QPrediction.CastPosition,
QPrediction.UnitPosition,
comboTarget.ServerPosition,
comboTarget.Position
};
if (comboTarget.IsDashing())
{
BeamStartPositions.Add(comboTarget.GetDashInfo().EndPos);
}
var PositionsList = new List<Vector3>();
var CollisionPositions = new List<Vector3>();
foreach (var position in BeamStartPositions)
{
var collisionableObjects = spells[SpellSlot.Q].GetCollision(position.LSTo2D(),
new List<Vector2> { position.LSExtend(PlayerPosition, -QPushDistance).LSTo2D() });
if (collisionableObjects.Any())
{
if (collisionableObjects.Any(h => h is AIHeroClient) &&
collisionableObjects.All(h => h.LSIsValidTarget()))
{
spells[SpellSlot.Q].Cast(QPrediction.CastPosition);
break;
}
for (var i = 0; i < QPushDistance; i += (int)comboTarget.BoundingRadius)
{
CollisionPositions.Add(position.LSExtend(PlayerPosition, -i));
}
}
for (var i = 0; i < QPushDistance; i += (int)comboTarget.BoundingRadius)
{
PositionsList.Add(position.LSExtend(PlayerPosition, -i));
}
}
if (PositionsList.Any())
{
//We don't want to divide by 0 Kappa
var WallNumber = PositionsList.Count(p => p.LSIsWall()) * 1.3f;
var CollisionPositionCount = CollisionPositions.Count;
var Percent = (WallNumber + CollisionPositionCount) / PositionsList.Count;
var AccuracyEx = QAccuracy / 100f;
if (Percent >= AccuracyEx)
{
spells[SpellSlot.Q].Cast(QPrediction.CastPosition);
}
}
}
else if (QPrediction.Hitchance == HitChance.Collision)
{
var QCollision = QPrediction.CollisionObjects;
if (QCollision.Count == 1)
{
spells[SpellSlot.Q].Cast(QPrediction.CastPosition);
}
}
}
示例2: IsCondemnable
public static bool IsCondemnable(AIHeroClient hero)
{
if (!hero.IsValidTarget(550f) || hero.HasBuffOfType(BuffType.SpellShield) ||
hero.HasBuffOfType(BuffType.SpellImmunity) || hero.IsDashing())
return false;
//values for pred calc pP = player position; p = enemy position; pD = push distance
var pP = ObjectManager.Player.ServerPosition;
var p = hero.ServerPosition;
var pD = MenuGenerator.EMenu["EPushDist"].Cast<Slider>().CurrentValue;
var mode = MenuGenerator.EMenu["EMode"].Cast<Slider>().CurrentValue;
if (mode == 0 && (IsCollisionable(p.ExtendVector3(pP, -pD)) || IsCollisionable(p.ExtendVector3(pP, -pD / 2f)) ||
IsCollisionable(p.ExtendVector3(pP, -pD / 3f))))
{
if (!hero.CanMove ||
(hero.Spellbook.IsAutoAttacking))
return true;
var enemiesCount = ObjectManager.Player.CountEnemiesInRange(1200);
if (enemiesCount > 1 && enemiesCount <= 3)
{
Spell.Skillshot E = new Spell.Skillshot(SpellSlot.E, 550, SkillShotType.Linear, (int) 0.25f, (int?) 2200f);
var prediction = E.GetPrediction(hero);
for (var i = 15; i < pD; i += 75)
{
var posFlags = NavMesh.GetCollisionFlags(
prediction.UnitPosition.To2D()
.Extend(
pP.To2D(),
-i)
.To3D());
if (posFlags.HasFlag(CollisionFlags.Wall) || posFlags.HasFlag(CollisionFlags.Building))
{
return true;
}
}
return false;
}
else
{
var hitchance = MenuGenerator.EMenu["EHitchance"].Cast<Slider>().CurrentValue;
var angle = 0.20 * hitchance;
const float travelDistance = 0.5f;
var alpha = new Vector2((float)(p.X + travelDistance * Math.Cos(Math.PI / 180 * angle)),
(float)(p.X + travelDistance * Math.Sin(Math.PI / 180 * angle)));
var beta = new Vector2((float)(p.X - travelDistance * Math.Cos(Math.PI / 180 * angle)),
(float)(p.X - travelDistance * Math.Sin(Math.PI / 180 * angle)));
for (var i = 15; i < pD; i += 100)
{
if (IsCollisionable(pP.To2D().Extend(alpha,
i)
.To3D()) && IsCollisionable(pP.To2D().Extend(beta, i).To3D()))
return true;
}
return false;
}
}
if (mode == 1 &&
(IsCollisionable(p.ExtendVector3(pP, -pD)) || IsCollisionable(p.ExtendVector3(pP, -pD / 2f)) ||
IsCollisionable(p.ExtendVector3(pP, -pD / 3f))))
{
if (!hero.CanMove ||
(hero.Spellbook.IsAutoAttacking))
return true;
var hitchance = MenuGenerator.EMenu["EHitchance"].Cast<Slider>().CurrentValue;
var angle = 0.20 * hitchance;
const float travelDistance = 0.5f;
var alpha = new Vector2((float)(p.X + travelDistance * Math.Cos(Math.PI / 180 * angle)),
(float)(p.X + travelDistance * Math.Sin(Math.PI / 180 * angle)));
var beta = new Vector2((float)(p.X - travelDistance * Math.Cos(Math.PI / 180 * angle)),
(float)(p.X - travelDistance * Math.Sin(Math.PI / 180 * angle)));
for (var i = 15; i < pD; i += 100)
{
if (IsCollisionable(pP.To2D().Extend(alpha,
i)
.To3D()) && IsCollisionable(pP.To2D().Extend(beta, i).To3D()))
return true;
}
return false;
}
if (mode == 8)
{
if (!hero.CanMove ||
(hero.Spellbook.IsAutoAttacking))
return true;
var hitchance = MenuGenerator.EMenu["EHitchance"].Cast<Slider>().CurrentValue;
var angle = 0.20 * hitchance;
const float travelDistance = 0.5f;
var alpha = new Vector2((float)(p.X + travelDistance * Math.Cos(Math.PI / 180 * angle)),
(float)(p.X + travelDistance * Math.Sin(Math.PI / 180 * angle)));
var beta = new Vector2((float)(p.X - travelDistance * Math.Cos(Math.PI / 180 * angle)),
(float)(p.X - travelDistance * Math.Sin(Math.PI / 180 * angle)));
//.........这里部分代码省略.........
示例3: QLogic
//------------------------------------|| Methods ||--------------------------------------
//--------------------------------------QLogic()-----------------------------------------
void QLogic(AIHeroClient Target)
{
if (combo.IsActive("w.beforeq") && W.IsReady())
{
if (Target.IsDashing()) { W.Cast(); Core.DelayAction(() => Q.Cast(Target), Game.Ping + W.CastDelay); }
if (Player.Distance(Target) >= Player.GetAutoAttackRange(Target)) { W.Cast(); Core.DelayAction(() => Q.Cast(Target), Game.Ping + W.CastDelay); }
if (Target.HealthPercent <= 30) { W.Cast(); Core.DelayAction(() => Q.Cast(Target), Game.Ping + W.CastDelay); }
if (Player.HealthPercent <= 30) { W.Cast(); Core.DelayAction(() => Q.Cast(Target), Game.Ping + W.CastDelay); }
if (damageManager.SpellDamage(Target, SpellSlot.Q) >= Target.Health) { W.Cast(); Core.DelayAction(() => Q.Cast(Target), Game.Ping + W.CastDelay); }
}
else
{
if (Target.IsDashing()) Q.Cast(Target);
if (Player.Distance(Target) >= Player.GetAutoAttackRange(Target)) Q.Cast(Target);
if (Target.HealthPercent <= 30) Q.Cast(Target);
if (Player.HealthPercent <= 30) Q.Cast(Target);
if (damageManager.SpellDamage(Target, SpellSlot.Q) >= Target.Health) Q.Cast(Target);
}
}
示例4: CanICastE
/// <summary>
/// Returns true if all 3 condemn vectors have wall collision flags
/// </summary>
/// <param name="unit">Target</param>
/// <param name="range">Push distance</param>
/// <returns>Returns true if vectors have wall collision flags</returns>
public static bool CanICastE(AIHeroClient unit, float range)
{
if (unit == null || !unit.IsECastableOnEnemy() || unit.IsDashing())
return false;
var accuracy = Config.CondemnMenu.EMethod;
var position = Prediction.PredictUnitPosition(unit, 200);
if (!unit.CanMove)
{
for (var i = 25; i < range + 50; i += 50)
{
var vec = unit.ServerPosition.Extend(Player.Instance.ServerPosition, -Math.Min(i, range));
if (vec.IsWall())
{
return true;
}
}
}
else
{
switch (accuracy)
{
case 0:
{
for (var i = Config.CondemnMenu.PushDistance; i >= 100; i -= 100)
{
var vec = position.Extend(Player.Instance.ServerPosition, -i);
var left = new Vector2[5];
var right = new Vector2[5];
var var = 18*i/100;
for (var x = 0; x < 5; x++)
{
left[x] =
position.Extend(
vec + (position - vec).Normalized().Rotated((float) ToRadian(Math.Max(0, var)))*
Math.Abs(i < 200 ? 50 : 45*x), i);
right[x] =
position.Extend(
vec +
(position - vec).Normalized().Rotated((float) ToRadian(-Math.Max(0, var)))*
Math.Abs(i < 200 ? 50 : 45*x), i);
}
if (left[0].IsWall() && right[0].IsWall() && left[1].IsWall() && right[1].IsWall() &&
left[2].IsWall() && right[2].IsWall() && left[3].IsWall() && right[3].IsWall() &&
left[4].IsWall() && right[4].IsWall() && vec.IsWall())
{
return true;
}
}
break;
}
case 1:
{
for (var i = 25; i < range + 50; i += 50)
{
var vec = position.Extend(Player.Instance.ServerPosition, -Math.Min(i, range));
if (vec.IsWall())
{
return true;
}
}
break;
}
default:
{
return false;
}
}
}
return false;
}