本文整理汇总了C#中AttackableUnit.IsValid方法的典型用法代码示例。如果您正苦于以下问题:C# AttackableUnit.IsValid方法的具体用法?C# AttackableUnit.IsValid怎么用?C# AttackableUnit.IsValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AttackableUnit
的用法示例。
在下文中一共展示了AttackableUnit.IsValid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnAfterAttack
protected override void OnAfterAttack(AttackableUnit unit, AttackableUnit target)
{
if (!unit.IsMe) return;
if (unit.IsMe )
{
if (target is Obj_AI_Hero && target.IsValid<Obj_AI_Hero>() && target.IsValidTarget())
{
if (myOrbwalker.ActiveMode == myOrbwalker.OrbwalkingMode.Combo)
{
if (config.Item("UseItemCombo").GetValue<bool>() && !Player.IsWindingUp)
{
myUtility.UseItems(2, null);
}
if (config.Item("UseQCombo").GetValue<bool>() && !Player.IsWindingUp && Orbwalking.InAutoAttackRange(target) && Q.IsReady())
{
Q.Cast();
}
}
}
if (myOrbwalker.ActiveMode == myOrbwalker.OrbwalkingMode.LaneClear)
{
if (target is Obj_AI_Turret && target.Team != Player.Team &&
config.Item("UseQMisc").GetValue<bool>() &&
!Player.IsWindingUp && Orbwalking.InAutoAttackRange(target) && Q.IsReady())
{
Q.Cast();
}
}
}
}
示例2: AfterAttack
private void AfterAttack(AttackableUnit unit, AttackableUnit target)
{
if (!unit.IsMe || !unit.IsValid<Obj_AI_Base>())
{
return;
}
if (Variables.Spells[SpellSlot.Q].IsEnabledAndReady(ModesMenuExtensions.Mode.Combo)
|| (Variables.Spells[SpellSlot.Q].IsEnabledAndReady(ModesMenuExtensions.Mode.Harrass)
&& ObjectManager.Player.ManaPercent >= Variables.AssemblyMenu.GetItemValue<Slider>("dzaio.champion.extra.mixed.mana").Value))
{
if (target.IsValid<Obj_AI_Hero>() && target.IsValidTarget())
{
Variables.Spells[SpellSlot.Q].CastIfHitchanceEquals(target as Obj_AI_Hero, HitChance.High);
}
}
if (Variables.Spells[SpellSlot.W].IsEnabledAndReady(ModesMenuExtensions.Mode.Combo)
|| (Variables.Spells[SpellSlot.W].IsEnabledAndReady(ModesMenuExtensions.Mode.Harrass)
&& ObjectManager.Player.ManaPercent >= Variables.AssemblyMenu.GetItemValue<Slider>("dzaio.champion.extra.mixed.mana").Value))
{
if (target.IsValid<Obj_AI_Hero>() && target.IsValidTarget())
{
Variables.Spells[SpellSlot.W].CastIfHitchanceEquals(target as Obj_AI_Hero, HitChance.High);
}
}
}
示例3: AfterAttack
internal static void AfterAttack(AttackableUnit unit, AttackableUnit target)
{
if (target.IsValidTarget() && unit.IsValid<Obj_AI_Hero>() && unit.IsMe)
{
LastTarget = target;
}
}
示例4: AttackableUnit_OnEnterVisiblityClient
private static void AttackableUnit_OnEnterVisiblityClient(AttackableUnit sender, EventArgs args)
{
if (sender != null && sender.IsValid<Obj_AI_Hero>() && sender.IsEnemy && sender.DistanceToPlayer() < 1000)
{
UpdatePassiveList();
}
}
示例5: AfterAttack
public static void AfterAttack(AttackableUnit sender, AttackableUnit target)
{
if (sender.IsMe && target.IsValid<Obj_AI_Hero>())
{
var tg = target as Obj_AI_Hero;
if (tg == null) return;
var mode = Program.ComboMenu.Item("QMode").GetValue<StringList>().SelectedValue;
var tumblePosition = Game.CursorPos;
switch (mode)
{
case "PRADA":
tumblePosition = tg.GetTumblePos();
break;
default:
tumblePosition = Game.CursorPos;
break;
}
Tumble.Cast(tumblePosition);
}
if (sender.IsMe && target.IsValid<Obj_AI_Minion>())
{
if (Program.Orbwalker.ActiveMode == MyOrbwalker.OrbwalkingMode.LaneClear)
{
var meleeMinion = ObjectManager.Get<Obj_AI_Minion>().FirstOrDefault(m => m.IsMelee);
if (Program.LaneClearMenu.Item("QWaveClear").GetValue<bool>() && ObjectManager.Player.ManaPercent >= Program.LaneClearMenu.Item("QWaveClearMana").GetValue<Slider>().Value && meleeMinion.IsValidTarget())
{
if (ObjectManager.Player.Level == 1)
{
Tumble.Cast(meleeMinion.GetTumblePos());
}
if (ObjectManager.Player.CountEnemiesInRange(1600) == 0)
{
Tumble.Cast(meleeMinion.GetTumblePos());
}
}
if (target.Name.Contains("SRU_"))
{
Tumble.Cast(((Obj_AI_Base)target).GetTumblePos());
}
}
}
}
示例6: OnAttack
/// <summary>
/// Called on-attack request.
/// </summary>
/// <param name="unit">The sender.</param>
/// <param name="target">The target.</param>
public static void OnAttack(AttackableUnit unit, AttackableUnit target)
{
if (unit.IsMe &&
target.IsValid<Obj_AI_Hero>() &&
!((Obj_AI_Hero)target).IsInvulnerable &&
!Bools.IsSpellShielded((Obj_AI_Hero)target) &&
Variables.Orbwalker.ActiveMode != Orbwalking.OrbwalkingMode.None &&
Variables.Menu.Item($"{Variables.MainMenuName}.misc.resets").IsActive())
{
Logics.ExecuteBetaModes(unit, target);
}
}
示例7: AfterAttack
public static void AfterAttack(AttackableUnit sender, AttackableUnit target)
{
if (!Q.IsReady())
{
_tumbleToKillSecondMinion = false;
return;
}
if (!target.IsValid<Obj_AI_Hero>() || !ComboMenu.Item("QCombo").GetValue<bool>() || !sender.IsMe) return;
if (!Flash.IsReady() && Environment.TickCount - FlashTime < 500) return;
var tg = target as Obj_AI_Hero;
if (tg == null) return;
var mode = ComboMenu.Item("QMode").GetValue<StringList>().SelectedValue;
switch (mode)
{
case "PRADA":
TumbleOrder = tg.GetTumblePos();
break;
case "TUMBLEANDCONDEMN":
TumbleOrder = tg.ServerPosition.GetCondemnPosition();
break;
default:
TumbleOrder = Game.CursorPos;
break;
}
if (Orbwalker.ActiveMode == MyOrbwalker.OrbwalkingMode.Combo)
{
Q.Cast(TumbleOrder);
return;
}
if (_tumbleToKillSecondMinion && LaneClearMenu.Item("QLastHit").GetValue<bool>() && (Orbwalker.ActiveMode == MyOrbwalker.OrbwalkingMode.LaneClear || Orbwalker.ActiveMode == MyOrbwalker.OrbwalkingMode.LastHit) && Player.ManaPercent > LaneClearMenu.Item("QLastHitMana").GetValue<Slider>().Value)
{
TumbleOrder = Game.CursorPos;
Q.Cast(TumbleOrder);
_tumbleToKillSecondMinion = false;
}
if (Orbwalker.ActiveMode == MyOrbwalker.OrbwalkingMode.LaneClear &&
LaneClearMenu.Item("QWaveClear").GetValue<bool>() && Player.ManaPercent >
LaneClearMenu.Item("QWaveClearMana").GetValue<Slider>().Value &&
!Orbwalker.ShouldWait())
{
TumbleOrder = Game.CursorPos;
Q.Cast(TumbleOrder);
}
}
示例8: AfterAttack
public static void AfterAttack(AttackableUnit sender, AttackableUnit target)
{
if (target.IsValid<Obj_AI_Hero>())
{
var tg = target as Obj_AI_Hero;
if (tg.IsValidTarget())
{
if (Program.ComboMenu.Item("ChaseW").GetValue<bool>() && Program.Orbwalker.ActiveMode == MyOrbwalker.OrbwalkingMode.Combo
&& ObjectManager.Player.IsFacing(tg) && !tg.IsFacing(ObjectManager.Player))
{
Program.W.Cast();
}
}
}
if (target is Obj_AI_Turret)
{
if (Program.LaneClearMenu.Item("WTowers").GetValue<bool>())
{
Program.W.Cast();
}
}
}
示例9: AfterAttack
public static void AfterAttack(AttackableUnit sender, AttackableUnit target)
{
if (sender.IsMe && target.IsValid<Obj_AI_Hero>())
{
var tg = target as Obj_AI_Hero;
if (tg == null) return;
var mode = Program.ComboMenu.Item("QMode").GetValue<StringList>().SelectedValue;
var tumblePosition = Game.CursorPos;
switch (mode)
{
case "PRADA":
tumblePosition = tg.GetTumblePos();
break;
default:
tumblePosition = Game.CursorPos;
break;
}
if (Program.Orbwalker.ActiveMode == MyOrbwalker.OrbwalkingMode.Combo)
{
Tumble.Cast(tumblePosition);
return;
}
}
}
示例10: OnAfterAttack
public override void OnAfterAttack(AttackableUnit unit, AttackableUnit target)
{
if (!unit.IsMe)
{
return;
}
if (!target.IsValid<Obj_AI_Hero>() && !target.Name.ToLower().Contains("ward"))
{
return;
}
if (!E.IsReady())
{
return;
}
if (E.Cast())
{
Orbwalking.ResetAutoAttackTimer();
Player.IssueOrder(GameObjectOrder.AttackUnit, target);
}
}
示例11: OnAfterAttack
private static void OnAfterAttack(AttackableUnit target, EventArgs args)
{
if (!target.IsMe || !target.IsValid) return;
if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
{
if (getCheckBoxItem(comboMenu, "com.isivir.combo.useW") && target.IsValid<AIHeroClient>())
{
if (ObjectManager.Player.LSGetAutoAttackDamage((AIHeroClient)target, true)
* getSliderItem(miscMenu, "com.isivir.miscc.noW") > target.Health) return;
Spells[SpellSlot.W].Cast();
}
if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Harass))
{
if (getCheckBoxItem(harassMenu, "com.isivir.harass.useW") && target.IsValid<AIHeroClient>()
&& ObjectManager.Player.ManaPercent
>= getSliderItem(harassMenu, "com.isivir.harass.mana"))
{
Spells[SpellSlot.W].Cast();
}
if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear))
{
if (getCheckBoxItem(laneMenu, "com.isivir.laneclear.useW") && target.IsValid<Obj_AI_Minion>()
&& ObjectManager.Player.ManaPercent
>= getSliderItem(laneMenu, "com.isivir.laneclear.mana"))
{
Spells[SpellSlot.W].Cast();
}
}
}
}
}
示例12: Orbwalking_AfterAttack
static void Orbwalking_AfterAttack(AttackableUnit unit, AttackableUnit target)
{
if (!unit.IsValid || !unit.IsMe)
{
return;
}
if (Config.Item("usecombo").GetValue<KeyBind>().Active && Player.ManaPercent >
Config.Item("combomana").GetValue<Slider>().Value)
{
if (Config.Item("usecombow").GetValue<bool>() &&
target.IsValid<Obj_AI_Hero>())
{
W.Cast();
}
}
if (Config.Item("useharass").GetValue<KeyBind>().Active && Player.ManaPercent >
Config.Item("harassmana").GetValue<Slider>().Value)
{
if (Config.Item("useharassw").GetValue<bool>() &&
target.IsValid<Obj_AI_Hero>() && IsWhiteListed((Obj_AI_Hero)target))
{
W.Cast();
}
}
if (Config.Item("useclear").GetValue<KeyBind>().Active && Player.ManaPercent >
Config.Item("clearmana").GetValue<Slider>().Value)
{
if (Config.Item("useclearw").GetValue<bool>() &&
target.IsValid<Obj_AI_Minion>())
{
W.Cast();
}
}
}
示例13: Orbwalk
public static void Orbwalk(AttackableUnit target)
{
if (target.IsValidTarget() && CanAttack && IsAllowedToAttack)
{
disableNextAttack = false;
FireBeforeAttack(target);
if (!disableNextAttack
&& (CurrentMode != Mode.Harass || !target.IsValid<Obj_AI_Minion>()
|| config.Item("OW_Harass_LastHit").IsActive()))
{
lastAttack = Utils.GameTimeTickCount + Game.Ping + 100 - (int)(Player.AttackCastDelay * 1000);
missileLaunched = false;
if (Player.Distance(target, true) > Math.Pow(GetAutoAttackRange(target) - 65, 2) && !Player.IsMelee)
{
lastAttack = Utils.GameTimeTickCount + Game.Ping + 400 - (int)(Player.AttackCastDelay * 1000);
}
if (!Player.IssueOrder(GameObjectOrder.AttackUnit, target))
{
//ResetAutoAttack();
}
lastTarget = target;
return;
}
}
if (!CanMove || !IsAllowedToMove)
{
return;
}
if (config.Item("OW_Combo_MeleeMagnet").IsActive() && CurrentMode == Mode.Combo && Player.IsMelee
&& Player.AttackRange < 200 && InAutoAttackRange(target) && target.IsValid<Obj_AI_Hero>()
&& ((Obj_AI_Hero)target).Distance(Game.CursorPos) < 300)
{
MovePrediction.Delay = Player.BasicAttack.SpellCastTime;
MovePrediction.Speed = Player.BasicAttack.MissileSpeed;
MoveTo(MovePrediction.GetPrediction((Obj_AI_Hero)target).UnitPosition);
}
else
{
MoveTo(Game.CursorPos);
}
}
示例14: OrbwalkingOnAfterAttack
private static void OrbwalkingOnAfterAttack(AttackableUnit unit, AttackableUnit target)
{
if (!unit.IsValid || !unit.IsMe)
{
return;
}
if (!target.IsValid<Obj_AI_Hero>())
{
return;
}
var targetAsHero = (Obj_AI_Hero) target;
if (ProSeries.Player.GetSpellDamage(targetAsHero, SpellSlot.W) / W.Delay >
ProSeries.Player.GetAutoAttackDamage(targetAsHero, true) * (1 / ProSeries.Player.AttackDelay))
{
W.Cast(targetAsHero);
}
}
示例15: Orbwalking_OnAfterAttack
private static void Orbwalking_OnAfterAttack(AttackableUnit unit, AttackableUnit target)
{
if (!unit.IsValid || !unit.IsMe)
{
return;
}
if (ProSeries.CanCombo())
{
if (ProSeries.Config.Item("usecombow", true).GetValue<bool>() &&
target.IsValid<Obj_AI_Hero>())
{
W.Cast();
}
}
if (ProSeries.CanHarass())
{
if (ProSeries.Config.Item("useharassw", true).GetValue<bool>() &&
target.IsValid<Obj_AI_Hero>() && ProSeries.IsWhiteListed((Obj_AI_Hero) target))
{
W.Cast();
}
}
if (ProSeries.CanClear())
{
if (ProSeries.Config.Item("useclearw", true).GetValue<bool>() &&
target.IsValid<Obj_AI_Minion>())
{
W.Cast();
}
}
}