当前位置: 首页>>代码示例>>C#>>正文


C# Obj_AI_Base.IsMelee方法代码示例

本文整理汇总了C#中Obj_AI_Base.IsMelee方法的典型用法代码示例。如果您正苦于以下问题:C# Obj_AI_Base.IsMelee方法的具体用法?C# Obj_AI_Base.IsMelee怎么用?C# Obj_AI_Base.IsMelee使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Obj_AI_Base的用法示例。


在下文中一共展示了Obj_AI_Base.IsMelee方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: onMeleeStartAutoAttack

        private static void onMeleeStartAutoAttack(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {


            if (sender is Obj_AI_Turret)
            {
                activeTowerTargets.Remove(sender.NetworkId);
                var dMake = new DamageMaker(sender,
                    (Obj_AI_Base)args.Target,
                    null,
                    args.SData,
                    true);

                activeTowerTargets.Add(sender.NetworkId, dMake);


            }

            if (!args.SData.IsAutoAttack())
                return;
            if (args.Target != null && args.Target is Obj_AI_Base && !sender.IsMe)
            {

                var tar = (Obj_AI_Base) args.Target;
                if (damagerSources.ContainsKey(sender.NetworkId))
                {
                    damagerSources[sender.NetworkId].setTarget(tar);
                }
                else
                {
                    damagerSources.Add(sender.NetworkId, new Damager(sender, tar));
                }
            }


            if(!sender.IsMelee())
                return;

            if (args.Target is Obj_AI_Base)
            {
                activeDamageMakers.Remove(sender.NetworkId);
                var dMake = new DamageMaker(sender,
                    (Obj_AI_Base)args.Target,
                    null,
                    args.SData,
                    true);

                activeDamageMakers.Add(sender.NetworkId, dMake);
            }

            if (sender is Obj_AI_Hero)
            {
                DeathWalker.lastDmg = now;
            }
        }
开发者ID:Sthephanfelix,项目名称:LeagueSharp-4,代码行数:55,代码来源:HealthDeath.cs

示例2: enemIsOnMe

        public static bool enemIsOnMe(Obj_AI_Base target)
        {
            if (!target.IsMelee() || target.IsAlly || target.IsDead)
                return false;

            var distTo = target.Distance(Properties.PlayerHero, true);
            var targetReack = target.AttackRange + target.BoundingRadius + Properties.PlayerHero.BoundingRadius + 100;
            if (distTo > targetReack * targetReack)
                return false;

            var per = target.Direction.To2D().Perpendicular();
            var dir = new Vector3(per, 0);
            var enemDir = target.Position + dir * 40;
            return !(distTo < enemDir.Distance(Properties.PlayerHero.Position, true));
        }
开发者ID:jayblah,项目名称:KallenSharp,代码行数:15,代码来源:OrdWalkermanager.cs

示例3: ObjAiBaseOnOnProcessSpellCast

        private static void ObjAiBaseOnOnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsValidTarget(3000, false) || sender.Team != ObjectManager.Player.Team || sender is Obj_AI_Hero ||
                !Orbwalking.IsAutoAttack(args.SData.Name) || !(args.Target is Obj_AI_Base))
            {
                return;
            }

            var target = (Obj_AI_Base) args.Target;
            ActiveAttacks.Remove(sender.NetworkId);

            var attackData = new PredictedDamage(
                sender, target, Utils.TickCount - Game.Ping / 2, sender.AttackCastDelay * 1000,
                sender.AttackDelay * 1000 - (sender is Obj_AI_Turret ? 70 : 0),
                sender.IsMelee() ? int.MaxValue : (int) args.SData.MissileSpeed,
                (float) sender.GetAutoAttackDamage(target, true));
            ActiveAttacks.Add(sender.NetworkId, attackData);
        }
开发者ID:qktlfflzk,项目名称:Backup5.4,代码行数:18,代码来源:HealthPrediction.cs

示例4: OnProcessSpell

        private static void OnProcessSpell(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs Spell)
        {
            try
            {
                var spellName = Spell.SData.Name;

                if (IsAutoAttackReset(spellName) && unit.IsMe)
                {
                    Utility.DelayAction.Add(250, ResetAutoAttackTimer);
                }

                if (!IsAutoAttack(spellName))
                {
                    return;
                }

                if (unit.IsMe &&
                    (Spell.Target is Obj_AI_Base || Spell.Target is Obj_BarracksDampener || Spell.Target is Obj_HQ))
                {
                    LastAATick = Utils.TickCount - Game.Ping / 2;

                    if (Spell.Target is Obj_AI_Base)
                    {
                        var target = (Obj_AI_Base)Spell.Target;
                        if (target.IsValid)
                        {
                            FireOnTargetSwitch(target);
                            _lastTarget = target;
                        }

                        if (unit.IsMelee())
                        {
                            Utility.DelayAction.Add(
                                (int)(unit.AttackCastDelay * 1000 + 40 - Game.Ping/2), () => FireAfterAttack(unit, _lastTarget));
                        }
                    }
                }

                FireOnAttack(unit, _lastTarget);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
开发者ID:AlrikSharp,项目名称:LeagueSharp-2,代码行数:45,代码来源:Orb.cs

示例5: Obj_AI_Base_OnProcessSpellCast

 public static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs args)
 {
     if (args.Target != null && Config.Item("autoE").GetValue<bool>() && args.Target.IsMe && unit.IsValid<Obj_AI_Hero>() && unit.IsMelee() && Q.IsReady() &&  args.SData.IsAutoAttack()
             && ObjectManager.Player.Position.Extend(Game.CursorPos, Q.Range).CountEnemiesInRange(500) < 3)
     {
         Q.Cast(Game.CursorPos, true);
     }
 }
开发者ID:654955321,项目名称:HY_Recommend,代码行数:8,代码来源:Program.cs

示例6: OnProcessSpell

        private static void OnProcessSpell(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs spell)
        {
            if (IsAutoAttackReset(spell.SData.Name) && unit.IsMe)
            {
                Console.WriteLine("Reset");
                Utility.DelayAction.Add(250, ResetAutoAttackTimer);
            }

            if (!IsAutoAttack(spell.SData.Name))
                return;
            if (unit.IsMe)
            {
                _lastAATick = Environment.TickCount;
                // ReSharper disable once CanBeReplacedWithTryCastAndCheckForNull
                if (spell.Target is Obj_AI_Base)
                {
                    FireOnTargetSwitch((Obj_AI_Base)spell.Target);
                    _lastTarget = (Obj_AI_Base)spell.Target;
                }
                if (unit.IsMelee())
                    Utility.DelayAction.Add(
                        (int)(unit.AttackCastDelay * 1000 + Game.Ping * 0.5) + 50, () => FireAfterAttack(unit, _lastTarget));
            }
            FireOnAttack(unit, _lastTarget);
        }
开发者ID:kywooo,项目名称:ElRengar,代码行数:25,代码来源:LXOrbwalker.cs

示例7: OnProcessSpell

        private static void OnProcessSpell(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs spell)
        {
            var spellName = spell.SData.Name;

            if (unit.IsMe && IsAutoAttackReset(spellName) && spell.SData.SpellCastTime == 0)
            {
                ResetAutoAttackTimer();
            }

            if (!IsAutoAttack(spellName))
            {
                return;
            }

            if (IsAutoAttackReset(spell.SData.Name) && unit.IsMe)
                LeagueSharp.Common.Utility.DelayAction.Add(100, ResetAutoAttackTimer);

            if (unit.IsMe)
            {
                _lastAATick = Environment.TickCount - Game.Ping / 2; // need test todo
                                                                     // ReSharper disable once CanBeReplacedWithTryCastAndCheckForNull
                if (spell.Target is Obj_AI_Base)
                {
                    FireOnTargetSwitch((Obj_AI_Base)spell.Target);
                    _lastTarget = (Obj_AI_Base)spell.Target;
                }

                if (unit.IsMelee())
                    LeagueSharp.Common.Utility.DelayAction.Add((int)(unit.AttackCastDelay * 1000 + Game.Ping * 0.5) + 50, () => FireAfterAttack(unit, _lastTarget));

                FireOnAttack(unit, _lastTarget);
            }
            else
            {
                FireOnAttack(unit, (Obj_AI_Base)spell.Target);
            }
        }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:37,代码来源:Orbwalker.cs

示例8: OnProcessSpell

        private static void OnProcessSpell(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs spell)
        {
            SpellSlot castedSlot = MyHero.GetSpellSlot(spell.SData.Name);

            if (castedSlot == SpellSlot.R && MyHero.ChampionName == "Katarina")
            {
                R.LastCastAttemptT = Environment.TickCount;
            }

            if (IsAutoAttackReset(spell.SData.Name) && unit.IsMe)
                Utility.DelayAction.Add(100, ResetAutoAttackTimer);

            if (!IsAutoAttack(spell.SData.Name))
                return;
            if (unit.IsMe)
            {
                _lastAATick = Environment.TickCount - Game.Ping / 2; // need test todo
                // ReSharper disable once CanBeReplacedWithTryCastAndCheckForNull
                if (spell.Target is Obj_AI_Base)
                {
                    FireOnTargetSwitch((Obj_AI_Base)spell.Target);
                    _lastTarget = (Obj_AI_Base)spell.Target;
                }
                if (unit.IsMelee())
                    Utility.DelayAction.Add(
                        (int)(unit.AttackCastDelay * 1000 + Game.Ping * 0.5) + 50, () => FireAfterAttack(unit, _lastTarget));

                FireOnAttack(unit, _lastTarget);
            }
            else
            {
                if (spell.Target is Obj_AI_Base)
                {
                    FireOnAttack(unit, (Obj_AI_Base)spell.Target);
                }
            }
        }
开发者ID:qktlfflzk,项目名称:Backup5.4,代码行数:37,代码来源:Orbwalker.cs

示例9: OnProcessSpell

        private static void OnProcessSpell(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs spell)
        {
            if (IsAutoAttackReset(spell.SData.Name) && unit.IsMe)
            {
                Console.WriteLine("reset AA");
              //  if (spell.SData.Name == "LucianQ")
               //    Utility.DelayAction.Add(400, ResetAutoAttackTimer);
                //else
                    Utility.DelayAction.Add(250, ResetAutoAttackTimer);
            }

            if (!IsAutoAttack(spell.SData.Name))
                return;
            if (unit.IsMe)
            {
                _lastAATick = Environment.TickCount;
                if (spell.Target is Obj_AI_Base)
                {
                    FireOnTargetSwitch((Obj_AI_Base)spell.Target);
                    _lastTarget = (Obj_AI_Base)spell.Target;
                }
                if (unit.IsMelee())
                    Utility.DelayAction.Add(
                        (int)(unit.AttackCastDelay * 1000 + Game.Ping * 0.5) + 50, () => FireAfterAttack(unit, _lastTarget));
            }
            FireOnAttack(unit, _lastTarget);
        }
开发者ID:Merc491,项目名称:GoodGuyJodu,代码行数:27,代码来源:LXOrbwalkerLucian.cs

示例10: OnProcessSpellCast

        protected override void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            #region ward brush after condemn
            if (sender.IsMe && args.SData.Name.ToLower().Contains("condemn"))
            {
                if (NavMesh.IsWallOfGrass(_condemnEndPos, 150))
                {
                    var blueTrinket = ItemId.Scrying_Orb_Trinket;
                    if (Items.HasItem((int)ItemId.Farsight_Orb_Trinket, Player)) blueTrinket = ItemId.Farsight_Orb_Trinket;

                    var yellowTrinket = ItemId.Warding_Totem_Trinket;
                    if (Items.HasItem((int)ItemId.Greater_Stealth_Totem_Trinket, Player)) yellowTrinket = ItemId.Greater_Stealth_Totem_Trinket;

                    if (Items.CanUseItem((int)blueTrinket))
                        Items.UseItem((int)blueTrinket, _condemnEndPos.Randomize(0, 150));
                    if (Items.CanUseItem((int)yellowTrinket))
                        Items.UseItem((int)yellowTrinket, _condemnEndPos.Randomize(0, 150));
                }
            }
            #endregion

            if (ShouldSaveCondemn()) return;
            if (sender.Distance(Player) > 700 || !sender.IsMelee() || !args.Target.IsMe || sender.Distance(Player) > 700 ||
                !sender.IsValid<Obj_AI_Hero>() || !sender.IsEnemy || args.SData == null)
                return;
            //how to milk alistar/thresh/everytoplaner
            var spellData = SpellDb.GetByName(args.SData.Name);
            if (spellData != null)
            {
                if (spellData.CcType == CcType.Knockup || spellData.CcType == CcType.Stun)
                {
                    if (E.CanCast(sender))
                    {
                        E.Cast(sender);
                    }
                }
            }

            if (args.SData.Name.ToLower().Contains("talonshadow"))
            {
                if (Items.HasItem((int)ItemId.Oracles_Lens_Trinket))
                {
                    Items.UseItem((int)ItemId.Oracles_Lens_Trinket, Player.Position);
                }
                else if (Items.HasItem((int)ItemId.Vision_Ward, Player))
                {
                    Items.UseItem((int)ItemId.Vision_Ward, Player.Position.Randomize(0, 125));
                }
            }
        }
开发者ID:fanmars1988,项目名称:LeagueSharp,代码行数:50,代码来源:Vayne.cs

示例11: OnProcessSpell

        private static void OnProcessSpell(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs Spell)
        {
            if (IsAutoAttackReset(Spell.SData.Name) && unit.IsMe)
            {
                Utility.DelayAction.Add(250, ResetAutoAttackTimer);
            }

            if (IsAutoAttack(Spell.SData.Name))
            {
                if (unit.IsMe)
                {
                    LastAATick = Environment.TickCount - Game.Ping / 2;
                    if (Spell.Target is Obj_AI_Base)
                    {
                        FireOnTargetSwitch((Obj_AI_Base) Spell.Target);
                        _lastTarget = (Obj_AI_Base) Spell.Target;
                    }

                    if (unit.IsMelee())
                    {
                        Utility.DelayAction.Add(
                            (int) (unit.AttackCastDelay * 1000 + 40), () => FireAfterAttack(unit, _lastTarget));
                    }
                }

                FireOnAttack(unit, _lastTarget);
            }
        }
开发者ID:Jokiblack,项目名称:LeagueSharpCommon,代码行数:28,代码来源:Orbwalking.cs

示例12: Obj_AI_Base_OnProcessSpellCast

        private static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsValidTarget(3000, false) || sender.Team != ObjectManager.Player.Team || sender is Obj_AI_Hero || !Orbwalking.Utility.IsAutoAttack(args.SData.Name) || !(args.Target is Obj_AI_Base) || sender.Type == GameObjectType.obj_AI_Turret)
                return;

            var target = (Obj_AI_Base)args.Target;
            if(ActiveAttacks.ContainsKey(sender.NetworkId))
                ActiveAttacks.Remove(sender.NetworkId);

            var attackData = new PredictedDamage(
                sender,
                target,
                Utils.TickCount,
                sender.AttackCastDelay * 1000f,
                sender.AttackDelay * 1000f,
                sender.IsMelee() ? float.MaxValue : args.SData.MissileSpeed,
                (float)sender.GetAutoAttackDamage(target) - 1);
            ActiveAttacks.Add(sender.NetworkId, attackData);
        }
开发者ID:JelloBeans,项目名称:SAC,代码行数:19,代码来源:Prediction.cs

示例13: OnProcessSpell

 private static void OnProcessSpell(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs spell)
 {
     if (IsAutoAttackReset(spell.SData.Name) && unit.IsMe)
     {
         Utility.DelayAction.Add(GetResetDelay(), ResetAutoAttackTimer);
     }
     if (!IsAutoAttack(spell.SData.Name))
     {
         if (unit.IsMe)
         {
             var ct = (unit.Spellbook.CastTime - Game.Time) * 1000;
             if (ct > 0)
             {
                 LastCastTime = myUtility.TickCount + (int)ct;
             }
         }
         return;
     }
     if (unit.IsMe && spell.Target is Obj_AI_Base)
     {
         LastAATick = myUtility.TickCount;
         MissileLaunched = false;
         var target = (Obj_AI_Base)spell.Target;
         if (target.IsValid)
         {
             FireOnTargetSwitch(target);
             ProcessSpellLastTarget = target;
         }
         if (unit.IsMelee())
         {
             Utility.DelayAction.Add((int)(unit.AttackCastDelay * 1000 + 50), () => FireAfterAttack(unit, ProcessSpellLastTarget));
         }
     }
     FireOnAttack(unit, ProcessSpellLastTarget);
 }
开发者ID:Shpaamyi,项目名称:LeagueSharp,代码行数:35,代码来源:myOrbwalker.cs

示例14: ObjAiBaseOnOnProcessSpellCast

        private static void ObjAiBaseOnOnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (sender.IsValidTarget(3000, false) && sender.Team == ObjectManager.Player.Team &&
                !(sender is Obj_AI_Hero))
            {
                if (Orbwalking.IsAutoAttack(args.SData.Name))
                {
                    if (args.Target is Obj_AI_Base)
                    {
                        var target = (Obj_AI_Base) args.Target;
                        ActiveAttacks.Remove(sender.NetworkId);

                        var attackData = new PredictedDamage(
                            sender, target, Environment.TickCount - Game.Ping / 2, sender.AttackCastDelay * 1000,
                            sender.AttackDelay * 1000 - (sender is Obj_AI_Turret ? 70 : 0), sender.IsMelee() ? int.MaxValue : (int) args.SData.MissileSpeed,
                            (float) CalcMinionToMinionDmg(sender, target));
                        ActiveAttacks.Add(sender.NetworkId, attackData);
                    }
                }
            }
        }
开发者ID:Jokiblack,项目名称:LeagueSharpCommon,代码行数:21,代码来源:HealthPrediction.cs

示例15: PassiveFlatMod

        private static double PassiveFlatMod(Obj_AI_Base source, Obj_AI_Base target)
        {
            double d = 0;

            //Offensive masteries:

            //Butcher
            //  Basic attacks and single target abilities do 2 bonus damage to minions and monsters.
            var hero = source as Obj_AI_Hero;
            if (hero != null && target is Obj_AI_Minion)
            {
                if (hero.Masteries.Any(m => m.Page == MasteryPage.Offense && m.Id == 65 && m.Points == 1))
                {
                    d = d + 2;
                }
            }

            //Defensive masteries:

            //Block
            //Reduces incoming damage from champion basic attacks by 1 / 2
            if (source is Obj_AI_Hero && target is Obj_AI_Hero)
            {
                var mastery =
                    ((Obj_AI_Hero) target).Masteries.FirstOrDefault(m => m.Page == MasteryPage.Defense && m.Id == 65);
                if (mastery != null && mastery.Points >= 1)
                {
                    d = d - 1 * mastery.Points;
                }
            }

            //Tough Skin
            //Reduces damage taken from neutral monsters by 1 / 2
            if (source is Obj_AI_Minion && target is Obj_AI_Hero && source.Team == GameObjectTeam.Neutral)
            {
                var mastery =
                    ((Obj_AI_Hero) target).Masteries.FirstOrDefault(m => m.Page == MasteryPage.Defense && m.Id == 68);
                if (mastery != null && mastery.Points >= 1)
                {
                    d = d - 1 * mastery.Points;
                }
            }

            //Unyielding
            //Melee - Reduces all incoming damage from champions by 2
            //Ranged - Reduces all incoming damage from champions by 1
            if (source is Obj_AI_Hero && target is Obj_AI_Hero)
            {
                var mastery =
                    ((Obj_AI_Hero) target).Masteries.FirstOrDefault(m => m.Page == MasteryPage.Defense && m.Id == 81);
                if (mastery != null && mastery.Points == 1)
                {
                    if (source.IsMelee())
                    {
                        d = d - 2;
                    }
                    else
                    {
                        d = d - 1;
                    }
                }
            }

            return d;
        }
开发者ID:xQxCPMxQx,项目名称:LeagueSharp-5,代码行数:65,代码来源:Damage.cs


注:本文中的Obj_AI_Base.IsMelee方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。