當前位置: 首頁>>代碼示例>>C#>>正文


C# AttackableUnitDamageEventArgs類代碼示例

本文整理匯總了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();
            }
        }
開發者ID:FireBuddy,項目名稱:karthus,代碼行數:34,代碼來源:OnDamage.cs

示例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;
            }
        }
開發者ID:q51251,項目名稱:Shy-Riven,代碼行數:32,代碼來源:Animation.cs

示例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);
        }
開發者ID:HeheheM,項目名稱:EB,代碼行數:26,代碼來源:Program.cs

示例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);
        }
開發者ID:addctionbr,項目名稱:EloBuddy,代碼行數:29,代碼來源:CastManager.cs

示例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());
     }
 }
開發者ID:Hyunabstar,項目名稱:Experimental,代碼行數:8,代碼來源:Program.cs

示例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();

        }
開發者ID:coman3,項目名稱:EloBuddy.Addons,代碼行數:10,代碼來源:AutoMoveOnDamage.cs

示例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);
            }
        }
開發者ID:DanThePman,項目名稱:HumanziedBaseUlt,代碼行數:11,代碼來源:Debug.cs

示例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();
            }
        }
開發者ID:Wesley67,項目名稱:EloBuddy-Addons,代碼行數:12,代碼來源:Program.cs

示例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++;
         }
     }
 }
開發者ID:CONANLXF,項目名稱:AIO,代碼行數:18,代碼來源:Drawings.cs

示例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;
             }
         }
     }
 }
開發者ID:alvothefirst,項目名稱:EloBuddy,代碼行數:14,代碼來源:Autoplay.cs

示例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);
         }
     }
 }
開發者ID:nongnoobjung,項目名稱:Experimental,代碼行數:14,代碼來源:HAManager.cs

示例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>());
         }
     }
 }
開發者ID:JelloBeans,項目名稱:LeagueSharp-1,代碼行數:15,代碼來源:Shen.cs

示例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++;
             }
         }
     }
 }
開發者ID:ShineSharp,項目名稱:LeagueSharp,代碼行數:15,代碼來源:Program.cs

示例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));
         }
     }
 }
開發者ID:giaanthunder,項目名稱:EloBuddy,代碼行數:18,代碼來源:JungleStealer.cs

示例15: OnDamage

 private static void OnDamage(AttackableUnit sender, AttackableUnitDamageEventArgs args)
 {
     if (args.TargetNetworkId == Player.NetworkId)
     {
         lastTimeAttacked = Game.Time + (2*Game.Ping / 1000f);
     }
 }
開發者ID:Aferii,項目名稱:LeagueSharp,代碼行數:7,代碼來源:Program.cs


注:本文中的AttackableUnitDamageEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。