本文整理汇总了C#中AttackableUnit类的典型用法代码示例。如果您正苦于以下问题:C# AttackableUnit类的具体用法?C# AttackableUnit怎么用?C# AttackableUnit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AttackableUnit类属于命名空间,在下文中一共展示了AttackableUnit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AfterAttack
internal static void AfterAttack(AttackableUnit unit, AttackableUnit target)
{
if (target.IsValidTarget() && unit.IsValid<Obj_AI_Hero>() && unit.IsMe)
{
LastTarget = target;
}
}
示例2: OrbwalkingAfterAttack
private static void OrbwalkingAfterAttack(AttackableUnit unit, AttackableUnit target)
{
if (!unit.IsMe) return;
if (passiveStacks > 0)
passiveStacks = passiveStacks - 1;
}
示例3: Orbwalking_AfterAttack
private void Orbwalking_AfterAttack(AttackableUnit unit, AttackableUnit target)
{
if (Player.ChampionName == "Riven")
return;
if (!Menu.Item("use" + Name).GetValue<bool>() || !IsReady())
return;
var hero = target as Obj_AI_Hero;
if (hero.IsValidTarget(Range))
{
if (!Parent.Item(Parent.Name + "useon" + hero.NetworkId).GetValue<bool>())
return;
if (hero.Health / hero.MaxHealth * 100 <= Menu.Item("enemylowhp" + Name + "pct").GetValue<Slider>().Value)
{
UseItem(Tar.Player, true);
}
if (Player.Health / Player.MaxHealth * 100 <= Menu.Item("selflowhp" + Name + "pct").GetValue<Slider>().Value)
{
UseItem(Tar.Player, true);
}
}
}
示例4: getLaneClearPred
public static float getLaneClearPred(AttackableUnit unit, int msTime, bool ignoreAlmostDead = true)
{
float predictedDamage = 0;
var damageDoneTill = now + msTime;
foreach (var damager in damagerSources.Values)
{
if(!damager.isValidDamager())
continue;
var target = damager.getTarget();
if(target == null || target.NetworkId != unit.NetworkId || (ignoreAlmostDead && almostDead(damager.source)))
continue;
if (damager.firstHitAt > damageDoneTill)
continue;
predictedDamage += damager.damage;
//Console.WriteLine(damager.damage);
//Can be optimized??
var nextAA = damager.firstHitAt + damager.cycle;
while (damageDoneTill > nextAA)
{
predictedDamage += damager.damage;
nextAA += damager.cycle;
}
}
//if (predictedDamage > 0)
// Console.WriteLine("dmg: " + predictedDamage);
return unit.Health - predictedDamage;
}
示例5: Orbwalker_OnPostAttack
private static void Orbwalker_OnPostAttack(AttackableUnit target, EventArgs args)
{
bool newtarget = false;
if (Settings.useHarrier && (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass)))
{
foreach (var e in EntityManager.Heroes.Enemies.Where(t => !t.IsDead && t.IsTargetable && !t.IsZombie && !t.IsInvulnerable && Player.Instance.IsInRange(t, 525)).OrderBy(t => t.MaxHealth))
{
if (e.HasBuff("quinnw"))
{
Orbwalker.ForcedTarget = e;
newtarget = true;
break;
}
}
}
else if (Settings.useHarrier)
{
foreach (var e in EntityManager.MinionsAndMonsters.CombinedAttackable)
{
if (e.HasBuff("quinnw"))
{
Orbwalker.ForcedTarget = e;
newtarget = true;
break;
}
}
}
if (!newtarget)
{
Orbwalker.ForcedTarget = null;
//Orbwalker.ResetAutoAttack();
}
}
示例6: Weaving
/// <summary>
/// Called on orbwalker action.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="target">The target.</param>
public static void Weaving(AttackableUnit sender, AttackableUnit target)
{
var tg = (Obj_AI_Hero)target;
if (TargetSelector.IsInvulnerable(tg, TargetSelector.DamageType.Physical))
{
return;
}
/// <summary>
/// The Q Weaving Logic.
/// </summary>
if (Variables.Q.IsReady() && Variables.QMenu.Item("combo").IsActive())
{
if (!Variables.Q.GetPrediction(tg).CollisionObjects.Any())
{
Variables.Q.Cast(Variables.Q.GetPrediction(tg).UnitPosition);
return;
}
}
/// <summary>
/// The W Weaving Logic.
/// </summary>
if (Variables.W.IsReady() && Variables.WMenu.Item("combo").IsActive())
{
Variables.W.Cast(Variables.W.GetPrediction(tg).UnitPosition);
}
}
示例7: BuildingClear
/// <summary>
/// Called on orbwalker action.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="target">The target.</param>
public static void BuildingClear(AttackableUnit sender, AttackableUnit target)
{
if (!(target is Obj_HQ) && !(target is Obj_AI_Turret) && !(target is Obj_BarracksDampener))
{
return;
}
/// <summary>
/// The E BuildingClear Logic.
/// </summary>
if (Variables.E.IsReady()
&& ObjectManager.Player.ManaPercent
> ManaManager.GetNeededMana(Variables.E.Slot, Variables.EMenu.Item("buildings"))
&& Variables.EMenu.Item("buildings").GetValue<SliderButton>().Value.Item2)
{
Variables.E.Cast(ObjectManager.Player.ServerPosition.Extend(Game.CursorPos, 25));
return;
}
/// <summary>
/// The W BuildingClear Logic.
/// </summary>
if (Variables.W.IsReady()
&& ObjectManager.Player.ManaPercent
> ManaManager.GetNeededMana(Variables.W.Slot, Variables.WMenu.Item("buildings"))
&& Variables.WMenu.Item("buildings").GetValue<SliderButton>().Value.Item2)
{
Variables.W.Cast(Game.CursorPos);
}
}
示例8: afterAttack
private void afterAttack(AttackableUnit unit, AttackableUnit target)
{
if (!unit.IsMe)
return;
var t = target as Obj_AI_Hero;
var dashPosition = Player.Position.Extend(Game.CursorPos, Q.Range);
if (Q.IsReady() && t.IsValidTarget() && GetWStacks(t) == 1 && t.Position.Distance(Game.CursorPos) < t.Position.Distance(Player.Position) && dashPosition.CountEnemiesInRange(800) < 3)
{
Q.Cast(dashPosition, true);
Program.debug("" + t.Name + GetWStacks(t));
}
else if (Q.IsReady() && Program.Farm && Config.Item("farmQ").GetValue<bool>())
{
var minions = MinionManager.GetMinions(dashPosition, Player.AttackRange, MinionTypes.All);
if (minions == null || minions.Count == 0)
return;
int countMinions = 0;
foreach (var minion in minions.Where(minion => minion.Health < Player.GetAutoAttackDamage(minion) + Q.GetDamage(minion)))
{
countMinions++;
}
if (countMinions > 1)
Q.Cast(dashPosition, true);
}
}
示例9: CustomInAutoattackRange
public int CustomInAutoattackRange(AttackableUnit target)
{
if (Orbwalking.InAutoAttackRange(target))
{
return 1;
}
if (!target.IsValidTarget())
{
return 0;
}
//Azir's soldiers can't attack structures.
if (!(target is Obj_AI_Base))
{
return 0;
}
var soldierAArange = _soldierAARange + 65 + target.BoundingRadius;
soldierAArange *= soldierAArange;
foreach (var soldier in SoldiersManager.ActiveSoldiers)
{
if (soldier.Distance(target, true) <= soldierAArange)
{
return 2;
}
}
return 0;
}
示例10: JungleClear
/// <summary>
/// Called on orbwalker action.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="target">The target.</param>
public static void JungleClear(AttackableUnit sender, AttackableUnit target)
{
var tg = (Obj_AI_Minion)target;
if (!Targets.JungleMinions.Contains(tg))
{
return;
}
/// <summary>
/// The W JungleClear Logic.
/// </summary>
if (Variables.W.IsReady() && Variables.WMenu.Item("jungleclear").IsActive())
{
Variables.W.Cast();
return;
}
/// <summary>
/// The Q JungleClear Logic.
/// </summary>
if (Variables.Q.IsReady() && Variables.QMenu.Item("jungleclear").IsActive())
{
Variables.Q.Cast();
}
}
示例11: OnAfterAttack
private static void OnAfterAttack(AttackableUnit target, EventArgs args)
{
if (Settings.UsarQ.CurrentValue)
if (Orbwalker.ActiveModesFlags.Equals(Orbwalker.ActiveModes.Combo))
{
var starget = target as AIHeroClient;
if (starget != null)
{
if (Settings.FixQ.CurrentValue)
{
if (starget.IsInRange(Player.Instance, Player.Instance.GetAutoAttackRange()))
if (Spells.Q.IsReady()) Spells.Q.Cast();
}
else if (Settings.FixQ.CurrentValue == false)
{
if (starget.IsInAutoAttackRange(Player.Instance))
if (Spells.Q.IsReady()) Spells.Q.Cast();
}
}
}
if (Settings.JusarQ.CurrentValue)
if (Orbwalker.ActiveModesFlags.Equals(Orbwalker.ActiveModes.JungleClear))
{
var monster = target as Obj_AI_Minion;
if (monster != null)
{
if (monster.IsInRange(Player.Instance, Player.Instance.GetAutoAttackRange()))
if (Spells.Q.IsReady()) Spells.Q.Cast();
}
}
}
示例12: OrbwalkerOnOnPostAttack
private void OrbwalkerOnOnPostAttack(AttackableUnit target, EventArgs args)
{
var unit = target as AIHeroClient;
if (unit == null)
{
Orbwalker.OnPostAttack -= OrbwalkerOnOnPostAttack;
return;
}
if (Settings.UseQ && Q.IsReady() && unit.GetSilverStacks() >= 0)
{
var sidePolygon = Helpers.GetSidePolygons();
var positions = new List<Vector2>();
for (var i = 0; i < 2; i++)
{
positions.Add(sidePolygon[i].Points.Where(index => index.ToVector3().ExtendPlayerVector().IsInRange(unit, Player.Instance.GetAutoAttackRange())).OrderByDescending(
index => index.Distance(unit.ServerPosition)).FirstOrDefault());
}
Q.Cast(positions.OrderByDescending(index => index.Distance(unit)).FirstOrDefault().ToVector3().ExtendPlayerVector(200));
}
if (Settings.UseE && E.IsReady() && unit.GetSilverStacks() == 1 && unit.IsECastableOnEnemy())
{
SpellManager.E.Cast(unit);
}
Orbwalker.OnPostAttack -= OrbwalkerOnOnPostAttack;
}
示例13: afterAttack
private void afterAttack(AttackableUnit unit, AttackableUnit target)
{
if (Player.Mana < RMANA + WMANA || !W.IsReady() || !unit.IsMe)
return;
var t = target as Obj_AI_Hero;
if (t.IsValidTarget())
W.Cast();
else if (Config.Item("farmW", true).GetValue<bool>())
{
var minions = MinionManager.GetMinions(Player.Position, Player.AttackRange, MinionTypes.All);
if (minions == null || minions.Count == 0)
return;
int countMinions = 0;
foreach (var minion in minions.Where(minion => minion.Health < W.GetDamage(minion)))
{
countMinions++;
}
if (countMinions > 0)
W.Cast();
}
}
示例14: UseHydraNot
public static void UseHydraNot(AttackableUnit target)
{
if (!Tiamat.IsOwned() && !Hydra.IsOwned()) return;
if (!Tiamat.IsReady() && !Hydra.IsReady()) return;
Tiamat.Cast();
Hydra.Cast();
}
示例15: OnAfterAttack
protected override void OnAfterAttack(AttackableUnit unit, AttackableUnit target)
{
if (!unit.IsMe) return;
if (unit.IsMe)
{
if (myOrbwalker.ActiveMode == myOrbwalker.OrbwalkingMode.Combo)
{
if (config.Item("UseWCombo").GetValue<bool>() &&
!Player.IsWindingUp &&
W.IsReady() &&
target.IsValidTarget() && Orbwalking.InAutoAttackRange(target)) W.Cast();
}
if (myOrbwalker.ActiveMode == myOrbwalker.OrbwalkingMode.Harass)
{
if (config.Item("UseWHarass").GetValue<bool>() &&
!Player.IsWindingUp &&
W.IsReady() &&
target.IsValidTarget() && Orbwalking.InAutoAttackRange(target)) W.Cast();
}
if (myOrbwalker.ActiveMode == myOrbwalker.OrbwalkingMode.JungleClear)
{
if (target is Obj_AI_Minion && target.Team == GameObjectTeam.Neutral && !target.Name.Contains("Mini") &&
!Player.IsWindingUp && Orbwalking.InAutoAttackRange(target))
{
if (W.IsReady() && config.Item("UseWJFarm").GetValue<bool>()) W.Cast();
}
}
}
}