本文整理汇总了C#中AttackableUnit.LSIsValidTarget方法的典型用法代码示例。如果您正苦于以下问题:C# AttackableUnit.LSIsValidTarget方法的具体用法?C# AttackableUnit.LSIsValidTarget怎么用?C# AttackableUnit.LSIsValidTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AttackableUnit
的用法示例。
在下文中一共展示了AttackableUnit.LSIsValidTarget方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetRealAutoAttackRange
/// <summary>
/// Returns the auto-attack range of local player with respect to the target.
/// </summary>
/// <param name="target">The target.</param>
/// <returns>System.Single.</returns>
public static float GetRealAutoAttackRange(AttackableUnit target)
{
var result = ObjectManager.Player.GetAutoAttackRange(target);
if (target.LSIsValidTarget())
{
return result;
}
return result;
}
示例2: GetRealAutoAttackRange
public static float GetRealAutoAttackRange(AIHeroClient attacker, AttackableUnit target)
{
var result = attacker.AttackRange + attacker.BoundingRadius;
if (target.LSIsValidTarget())
{
return result + target.BoundingRadius;
}
return result;
}
示例3: InAutoAttackRange
/// <summary>
/// Returns true if the target is in auto-attack range.
/// </summary>
/// <param name="target">The target.</param>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
public static bool InAutoAttackRange(AttackableUnit target)
{
if (!target.LSIsValidTarget())
{
return false;
}
var myRange = GetRealAutoAttackRange(target);
return
Vector2.DistanceSquared(
target is Obj_AI_Base ? ((Obj_AI_Base)target).ServerPosition.To2D() : target.Position.To2D(),
Player.ServerPosition.To2D()) <= myRange * myRange;
}
示例4: Orbwalker_OnPostAttack
private void Orbwalker_OnPostAttack(AttackableUnit target, EventArgs args)
{
Orbwalker.ForcedTarget = null;
var t = target as Obj_AI_Base;
if (Q.IsReady() && target.LSIsValidTarget() && !t.IsMinion)
{
this.QLogic(target);
if (UseQStackTransferBool)
{
this.QLogic(target);
}
}
}
示例5: GetRealAutoAttackRange
public static float GetRealAutoAttackRange(AttackableUnit target)
{
var result = ObjectManager.Player.AttackRange + ObjectManager.Player.BoundingRadius;
if (target.LSIsValidTarget())
{
var aiBase = target as Obj_AI_Base;
if (aiBase != null && ObjectManager.Player.ChampionName == "Caitlyn")
{
if (aiBase.HasBuff("caitlynyordletrapinternal"))
{
result += 650;
}
}
return result + target.BoundingRadius;
}
return result;
}
示例6: CanOrbwalkTarget
/// <summary>
/// Checks if player can orbwalk given target in custom range
/// </summary>
/// <param name="target">Target</param>
/// <param name="range">Custom range</param>
/// <returns>true if can orbwalk target</returns>
public bool CanOrbwalkTarget(AttackableUnit target, float range)
{
if (target.LSIsValidTarget())
{
if (target.Type == GameObjectType.AIHeroClient)
{
AIHeroClient hero = target as AIHeroClient;
return ObjectManager.Player.LSDistance(hero.ServerPosition) - hero.BoundingRadius - hero.GetScalingRange() + 10 < range + ObjectManager.Player.BoundingRadius + ObjectManager.Player.GetScalingRange();
}
else
return ObjectManager.Player.LSDistance(target.Position) - target.BoundingRadius + 20 < range + ObjectManager.Player.BoundingRadius + ObjectManager.Player.GetScalingRange();
}
return false;
}
示例7: Magnet
/// <summary>
/// Magnets the hero to given target
/// </summary>
/// <param name="target">The target.</param>
private void Magnet(AttackableUnit target)
{
if (!m_attackInProgress && !CanOrbwalkTarget(target))
{
if (ObjectManager.Player.AttackRange <= m_Configuration.StickRange)
{
if (target.LSIsValidTarget(m_Configuration.StickRange))
{
/*expermential*/
OrbwalkingPoint = target.Position.LSExtend(ObjectManager.Player.ServerPosition, -(m_rnd.NextFloat(0.6f, 1.01f) + 0.2f) * 400);
/*expermential*/
}
else
OrbwalkingPoint = Vector3.Zero;
}
else
OrbwalkingPoint = Vector3.Zero;
}
else
OrbwalkingPoint = Vector3.Zero;
}
示例8: FireAfterAttack
/// <summary>
/// Fires the after attack event.
/// </summary>
/// <param name="unit">The unit.</param>
/// <param name="target">The target.</param>
private static void FireAfterAttack(AttackableUnit unit, AttackableUnit target)
{
if (AfterAttack != null && target.LSIsValidTarget())
{
AfterAttack(unit, target);
}
}
示例9: OrbwalkingOnAfterAttack
private static void OrbwalkingOnAfterAttack(AttackableUnit target, EventArgs args)
{
if (!(target is AIHeroClient))
{
return;
}
if (!target.LSIsValidTarget())
{
return;
}
if (Hydra.IsReady())
{
Hydra.Cast();
}
else if (Tiamat.IsReady())
{
Tiamat.Cast();
}
}
示例10: CanUse
private static bool CanUse(Spell spell, AttackableUnit target)
{
return spell.IsReady() && Player.Mana >= spell.ManaCost && target.LSIsValidTarget(spell.Range);
}
示例11: IsValidUnit
/// <summary>
/// Determines whether the unit is valid.
/// </summary>
/// <param name="unit">
/// The unit.
/// </param>
/// <param name="range">
/// The range.
/// </param>
/// <returns>
/// The <see cref="bool" />.
/// </returns>
private static bool IsValidUnit(AttackableUnit unit, float range = 0f)
{
return unit.LSIsValidTarget(range > 0 ? range : unit.GetRealAutoAttackRange());
}
示例12: InAARange
/// <summary>
/// Checks if target is in unit's auto attack range
/// </summary>
/// <param name="target">Target</param>
/// <param name="_unit">Unit to check range</param>
/// <returns>true if in auto attack range</returns>
public static bool InAARange(AttackableUnit target, Obj_AI_Base _unit = null)
{
if (!target.LSIsValidTarget())
return false;
Obj_AI_Base unit = CorrectUnit(_unit);
float range = GetRealAARange(target, _unit);
return Vector2.DistanceSquared(target.Position.LSTo2D(), unit.ServerPosition.LSTo2D()) <= range * range;
}
示例13: InWRange
public static bool InWRange(AttackableUnit t) => t != null && t.LSIsValidTarget(WRange);
示例14: AfterAttack
private static void AfterAttack(AttackableUnit target, EventArgs args)
{
if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
{
if (getCheckBoxItem(comboMenu, "useE") && e.IsReady() && target is AIHeroClient && target.LSIsValidTarget(e.Range))
{
e.Cast();
}
}
if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear))
{
if (getCheckBoxItem(clearMenu, "useEj") && e.IsReady() && target is Obj_AI_Minion && target.LSIsValidTarget(e.Range))
{
e.Cast();
}
}
if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) ||
Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
{
if ((getCheckBoxItem(miscMenu, "titanicC") || getCheckBoxItem(miscMenu, "ravenousC") ||
getCheckBoxItem(miscMenu, "tiamatC")) && !e.IsReady() && target is AIHeroClient &&
target.LSIsValidTarget(e.Range) && CommonUtilities.CheckItem())
{
CommonUtilities.UseItem();
}
}
if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear))
{
if ((getCheckBoxItem(miscMenu, "titanicF") || getCheckBoxItem(miscMenu, "ravenousF") ||
getCheckBoxItem(miscMenu, "tiamatF")) && !e.IsReady() && target is Obj_AI_Minion &&
target.LSIsValidTarget(e.Range) && CommonUtilities.CheckItem())
{
CommonUtilities.UseItem();
}
}
}
示例15: ExecuteCastItems
private static void ExecuteCastItems(AttackableUnit t)
{
foreach (var item in Common.CommonItems.ItemDb)
{
if (item.Value.ItemType == Common.CommonItems.EnumItemType.AoE
&& item.Value.TargetingType == Common.CommonItems.EnumItemTargettingType.EnemyHero)
{
if (t is AIHeroClient && t.LSIsValidTarget(item.Value.Item.Range) && item.Value.Item.IsReady())
item.Value.Item.Cast();
}
if (item.Value.ItemType == Common.CommonItems.EnumItemType.Targeted
&& item.Value.TargetingType == Common.CommonItems.EnumItemTargettingType.EnemyHero)
{
if (t.LSIsValidTarget(item.Value.Item.Range) && item.Value.Item.IsReady())
item.Value.Item.Cast((AIHeroClient)t);
}
}
}