本文整理汇总了C#中AttackableUnitDamageEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# AttackableUnitDamageEventArgs类的具体用法?C# AttackableUnitDamageEventArgs怎么用?C# AttackableUnitDamageEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AttackableUnitDamageEventArgs类属于命名空间,在下文中一共展示了AttackableUnitDamageEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Damage
public static void Damage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
{
if (!(args.Target is AIHeroClient))
{
return;
}
var caster = sender;
var target = (AIHeroClient)args.Target;
if ((!(caster is AIHeroClient) && !(caster is Obj_AI_Turret)) || caster == null || target == null)
{
return;
}
var Rally = Menu.UltMenu.Get<CheckBox>("Rally").CurrentValue && Spells.R.IsReady();
var Rallyh = Menu.UltMenu.Get<Slider>("Rallyh").CurrentValue;
if (!target.IsAlly || !target.IsMe || !caster.IsEnemy || target.IsEnemy
|| Menu.UltMenu["DontUlt" + target.BaseSkinName].Cast<CheckBox>().CurrentValue)
{
return;
}
if (!Player.Instance.IsInRange(target, Spells.R.Range))
{
return;
}
if (Rally && target.HealthPercent <= Rallyh)
{
Spells.R.Cast();
}
}
示例2: OnDamage
public static void OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
{
if (Utils.TickCount - s_LastAATick < 300 + Game.Ping && s_CheckAA && args.SourceNetworkId == ObjectManager.Player.NetworkId)
{
var t = Target.Get(Program.Champion.Spells[0].Range + 50, true);
if (s_DoAttack && Program.Champion.Spells[0].IsReady())
{
if (t != null && (Program.Champion.OrbwalkingActiveMode == Program.Champion.OrbwalkingComboMode || Program.Champion.OrbwalkingActiveMode == Program.Champion.OrbwalkingHarassMode))
{
Program.Champion.Spells[0].Cast(t.ServerPosition, true);
ShineCommon.Orbwalking.ResetAutoAttackTimer();
Program.Champion.Orbwalker.ForceTarget(t);
}
else if (Program.Champion.OrbwalkingActiveMode == Program.Champion.OrbwalkingLaneClearMode)
{
var minion = MinionManager.GetMinions(400, MinionTypes.All, MinionTeam.NotAlly, MinionOrderTypes.MaxHealth).OrderBy(p => p.ServerPosition.Distance(ObjectManager.Player.ServerPosition)).FirstOrDefault();
if (minion != null)
{
Program.Champion.Spells[0].Cast(minion.ServerPosition, true);
ShineCommon.Orbwalking.ResetAutoAttackTimer();
Program.Champion.Orbwalker.ForceTarget(t);
}
}
}
else
SetAttack(false);
CanCastAnimation = true;
s_CheckAA = false;
}
}
示例3: Obj_AI_Base_OnDamage
private static void Obj_AI_Base_OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
{
var caster = sender as AIHeroClient;
var target = args.Target as AIHeroClient;
if (caster == null || target == null || sender.Distance(Player.Instance) > 1500) return;
HitMarkPosition = args.Target.Position.WorldToScreen();
CanDrawHitMarker = true;
HitMarkerSound.Play();
var hero = AkbarSpells.Spells.FirstOrDefault(x => x.Hero == Player.Instance.Hero && !caster.Spellbook.GetSpell(x.Slot).IsReady);
if (args.Source.IsMe && hero!= null && args.Target.IsEnemy)
{
AkbarSound.Play();
}
if (hero != null && sender.IsVisible && !caster.Spellbook.GetSpell(SpellSlot.R).IsReady)
{
if (hero.Hero == Champion.JarvanIV || hero.Hero == Champion.Darius || hero.Hero == Champion.Aatrox)
{
DunkSound.Play();
}
}
Core.DelayAction(() => CanDrawHitMarker = false, 200);
}
示例4: Volatile_OnDamage
protected override void Volatile_OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
{
if (!sender.IsMe) return;
_lastSpells.RemoveAll(p => Environment.TickCount - p.tick > 2000);
if (args.Source.NetworkId != Player.NetworkId ||
!EntityManager.Heroes.Enemies.Exists(p => p.NetworkId == args.Target.NetworkId)) return;
if (_lastSpells.Count == 0) return;
var sremove = new LastSpells("", 0, 0, "");
foreach (var spell in _lastSpells)
{
if (VolatileMenu["debug"].Cast<CheckBox>().CurrentValue)
Chat.Print(spell.name +
" & args dmg: " + args.Damage + " & preddmg: " + spell.dmg);
if (spell.target != args.Target.Name) continue;
if (!Champions.Exists(p => p.Name == spell.target)) continue;
Champions.Find(p => p.Name == spell.target)
.Differences.Add(Math.Abs(spell.dmg - args.Damage));
HitCount++;
sremove = spell;
}
if (_lastSpells.Contains(sremove))
_lastSpells.Remove(sremove);
}
示例5: OnDamage
public static void OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
{
if (sender == null) return;
if (args.TargetNetworkId == ObjectManager.Player.NetworkId && (sender is Obj_AI_Turret || sender is Obj_AI_Minion))
{
Orbwalker.ForceOrbwalkingPoint(Heroes.Player.Position.Extend(Wizard.GetFarthestMinion().Position, 500).RandomizePosition());
}
}
示例6: Player_OnDamage
private void Player_OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
{
if(sender.IsMe || !args.Target.IsMe) return;
if (args.Damage < DamageRecivedCount.CurrentValue) return;
if (OnlyMoveOnCc.CurrentValue) return;
if (args.Source is Obj_AI_Minion && IgnoreMinionDamage.CurrentValue) return;
MoveCamera();
}
示例7: AiHeroClientOnOnDamage
private static void AiHeroClientOnOnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
{
if (!(args.Target is AIHeroClient) || !sender.IsMe)
return;
var enemySpawnPos = ObjectManager.Get<Obj_SpawnPoint>().First(x => x.IsEnemy).Position;
if (args.Target.Distance(enemySpawnPos) <= 1000)
{
OnTargetHitInBase(args.Target as AIHeroClient, args.Damage);
}
}
示例8: AIHeroClient_OnDamage
protected static void AIHeroClient_OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
{
if (!sender.IsMe || !R.IsReady() || args.Damage > 45)
return;
var safeNet = spell["R_Safe_Net2"].Cast<Slider>().CurrentValue;
if (Player.HealthPercent <= safeNet)
{
R1.Cast();
}
}
示例9: AIHeroClient_OnDamage
/// <summary>
/// OnDamage event
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
private static void AIHeroClient_OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
{
LastSpells.RemoveAll(p => Environment.TickCount - p.Item2 > 2000);
if (args.Source.NetworkId == ObjectManager.Player.NetworkId &&
HeroManager.Enemies.Exists(p => p.NetworkId == args.Target.NetworkId))
{
if (LastSpells.Count != 0)
{
LastSpells.RemoveAt(0);
s_HitCount++;
}
}
}
示例10: Player_OnDamage
private static void Player_OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
{
if (sender != null)
{
if (sender.IsEnemy)
{
if (sender.Type == GameObjectType.obj_AI_Turret)
{
LeaveTowerPls = true;
tower = (Obj_AI_Turret)sender;
}
}
}
}
示例11: OnDamage
public static void OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
{
if ((sender is Obj_AI_Minion || sender is Obj_AI_Turret) && args.TargetNetworkId == Heroes.Player.NetworkId)
{
if (Heroes.Player.Position.CountNearbyAllies(1000) <
Heroes.Player.Position.CountNearbyEnemies(1000) ||
Heroes.Player.Position.CountNearbyAllies(1000) <= 1)
{
Program.Orbwalker.ActiveMode = MyOrbwalker.OrbwalkingMode.None;
Wizard.MoveBehindClosestAllyMinion();
Utility.DelayAction.Add(2500, () => Program.Orbwalker.ActiveMode = MyOrbwalker.OrbwalkingMode.Mixed);
}
}
}
示例12: Obj_AI_Base_OnDamage
private void Obj_AI_Base_OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
{
var t = ObjectManager.Get<Obj_AI_Hero>().FirstOrDefault(h => h.NetworkId == args.SourceNetworkId);
var s = ObjectManager.Get<Obj_AI_Hero>().FirstOrDefault(h => h.NetworkId == args.TargetNetworkId);
if (t != null && s != null &&
(t.IsMe &&
ObjectManager.Get<Obj_AI_Turret>()
.FirstOrDefault(tw => tw.Distance(t) < 750 && tw.Distance(s) < 750 && tw.IsAlly) != null))
{
if (config.Item("autotauntattower", true).GetValue<bool>() && E.CanCast(s))
{
E.Cast(s, config.Item("packets").GetValue<bool>());
}
}
}
示例13: Obj_AI_Hero_OnDamage
private static void Obj_AI_Hero_OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
{
lock (LastSpells)
{
LastSpells.RemoveAll(p => Environment.TickCount - p.tick > 2000);
if (args.SourceNetworkId == ObjectManager.Player.NetworkId && HeroManager.Enemies.Exists(p => p.NetworkId == sender.NetworkId))
{
if (LastSpells.Count != 0)
{
LastSpells.RemoveAt(0);
hitCount++;
}
}
}
}
示例14: AttackableUnit_OnDamage
private static void AttackableUnit_OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
{
if (args.Source.IsEnemy)
{
var minion = args.Target as Obj_AI_Minion;
if (minion != null && minion.IsMonster && minion.MaxHealth >= 3500)
{
if (!DamagesOnTime.ContainsKey(minion.NetworkId)) DamagesOnTime[minion.NetworkId] = new List<OnDamageEvent>();
DamagesOnTime[minion.NetworkId].Add(new OnDamageEvent(Core.GameTickCount, args.Damage));
}
var sourceMinion = args.Source as Obj_AI_Minion;
if (sourceMinion != null && sourceMinion.IsMonster && sourceMinion.MaxHealth >= 3500)
{
if (!DamagesOnTime.ContainsKey(sourceMinion.NetworkId)) DamagesOnTime[sourceMinion.NetworkId] = new List<OnDamageEvent>();
DamagesOnTime[sourceMinion.NetworkId].Add(new OnDamageEvent(Core.GameTickCount, 0));
}
}
}
示例15: OnDamage
private static void OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
{
if (args.TargetNetworkId == Player.NetworkId)
{
lastTimeAttacked = Game.Time + (2*Game.Ping / 1000f);
}
}