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


C# Obj_AI_Base.Distance方法代码示例

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


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

示例1: Interrupter_OnInterruptableSpell

 public static void Interrupter_OnInterruptableSpell(Obj_AI_Base unit, Interrupter.InterruptableSpellEventArgs spell)
 {
     float getDist = EloBuddy.SDK.Extensions.Distance(_Player, unit) / 2.0f; // formula of swag
     if (Program.MiscMenu["interrupt"].Cast<CheckBox>().CurrentValue && Program.W.IsReady() && Program.Q.IsReady() && unit.IsValidTarget(Program.W.Range))
     {
         if (unit.IsValidTarget(220))
         {
             Program.W.Cast(unit);
             Program.Q.Cast();
         }
         else
         {
             Program.W.Cast(unit);
             EloBuddy.SDK.Core.DelayAction(() => { Program.Q.Cast(); }, (int)getDist);
         }
     }
     if (Program.MiscMenu["interrupt"].Cast<CheckBox>().CurrentValue && Program.Q.IsReady())
     {
         if (unit.Distance(_Player.ServerPosition, true) <= Program.Q.Range)
         {
             Program.Q.Cast(unit);
         }
     }
     if (Program.MiscMenu["interrupt"].Cast<CheckBox>().CurrentValue && Program.W.IsReady())
     {
         if (unit.Distance(_Player.ServerPosition, true) <= Program.W.Range)
         {
             Program.W.Cast(unit);
         }
     }
 }
开发者ID:Smilon,项目名称:AlistarCombo,代码行数:31,代码来源:StateHandler.cs

示例2: doCombo

        public static void doCombo(Obj_AI_Base target)
        {
            if (target == null || !target.IsValidTarget())
                return;

            if (target.Distance(Player) < 500)
            {
                sumItems.cast(SummonerItems.ItemIds.Ghostblade);
            }
            if (target.Distance(Player) < 500 && (Player.Health / Player.MaxHealth) * 100 < 85)
            {
                sumItems.cast(SummonerItems.ItemIds.BotRK, target);

            }
            if (isStealthed() && targIsKillabe(target) && enemiesNear() > 2)
            {
                Orbwalking.Attack = false;
            }
            else
            {
                useHydra(target);
                doQ(target);
                Orbwalking.Attack = true;
                doSmartW(target);
                if (target.Health < fullComboDmgOn(target) * 1.3f || isStealthed())
                    doSmartE(target, true);
                else
                    reachWithE(target);
            }
            doSmartR(target);
        }
开发者ID:Merc491,项目名称:GoodGuyJodu,代码行数:31,代码来源:Khazix.cs

示例3: GetGapcloseDamage

 public static float GetGapcloseDamage(this Obj_AI_Base target, Obj_AI_Base gapclose)
 {
     var q = SpellManager.Q.IsReady() && gapclose.Distance(target) < SpellManager.Q.Range &&
             SpellManager.Q.IsActive(true);
     var w = SpellManager.W.IsReady() && gapclose.Distance(target) < SpellManager.W.Range &&
             SpellManager.W.IsActive(true);
     var r = IsRReady() && gapclose.Distance(target) < SpellManager.R.Range && SpellManager.R.IsActive(true);
     return GetComboDamage(target, q, w, false, r, true);
 }
开发者ID:TenminsPark,项目名称:LeagueSharp,代码行数:9,代码来源:Utility.cs

示例4: CastR

        public static void CastR(Obj_AI_Base target)
        {
            if (R.IsReady())
            {
                if (Rstate == 1)
                {
                    if (target.IsValidTarget(R.Range))
                    {
                        R.Cast(target);
                    }
                }
                if (Rstate == 2)
                {
                    var t = Prediction.GetPrediction(target, 400).CastPosition;
                    float x = target.MoveSpeed;
                    float y = x * 400 / 1000;
                    var pos = target.Position;
                    if (target.Distance(t) <= y)
                    {
                        pos = t;
                    }
                    if (target.Distance(t) > y)
                    {
                        pos = target.Position.Extend(t, y - 50);
                    }
                    if (Player.Distance(pos) <= 600)
                    {
                        R.Cast(pos);
                    }
                    if (Player.Distance(pos) > 600)
                    {
                        if (target.Distance(t) > y)
                        {
                            var pos2 = target.Position.Extend(t, y);
                            if (Player.Distance(pos2) <= 600)
                            {
                                R.Cast(pos2);
                            }
                            else
                            {
                                var prediction = R.GetPrediction(target);
                                if (prediction.Hitchance >= HitChance.High)
                                {
                                    var pos3 = prediction.CastPosition;
                                    var pos4 = Player.Position.Extend(pos3, 600);
                                    R.Cast(pos4);
                                }
                            }
                        }

                    }
                }
            }
        }
开发者ID:654955321,项目名称:HY_Recommend,代码行数:54,代码来源:Program.cs

示例5: IsFleeing

        public static bool IsFleeing(this Obj_AI_Hero hero, Obj_AI_Base target)
        {
            if (hero == null || target == null)
            {
                return false;
            }

            if (hero.Path.Count()>0 && target.Distance(hero.Position) < target.Distance(hero.Path.Last()))
            {
                return true;
            }
            return false;
        }
开发者ID:CjShu,项目名称:LeagueSharp,代码行数:13,代码来源:Extensions.cs

示例6: CastBushwhack

        // Human W Logic
        internal static void CastBushwhack(Obj_AI_Base target,  string mode)
        {
            // if not harass mode ignore mana check
            if (!KL.CatForm() && KL.CanUse(KL.Spells["Bushwhack"], true, mode))
            {
                if (!target.IsValidTarget(KL.Spells["Bushwhack"].Range))
                    return;

                if (KL.Player.ManaPercent <= 75 && target.IsHunted())
                    return;

                if (mode == "ha" && KL.Player.ManaPercent < 65)
                    return;

                // try bushwhack prediction
                if (KN.Root.Item("ndhwforce").GetValue<StringList>().SelectedIndex == 0)
                {
                    if (target.IsChampion())
                        KL.Spells["Bushwhack"].CastIfHitchanceEquals(target, HitChance.VeryHigh);
                    else
                    {
                        if ((KL.CanUse(KL.Spells["Javelin"], true, "jg") ||
                             KL.SpellTimer["Javelin"] > 4f) && target.Distance(KL.Player.ServerPosition) > 165f)
                             KL.Spells["Bushwhack"].Cast(target.Position.Extend(KL.Player.ServerPosition, 305f));
                        else
                            KL.Spells["Bushwhack"].Cast(target.Position.Extend(KL.Player.ServerPosition, 100f));
                    }
                }

                // try bushwhack behind target
                if (KN.Root.Item("ndhwforce").GetValue<StringList>().SelectedIndex == 1)
                {
                    if (target.IsChampion())
                    {
                        var unitpos = KL.Spells["Bushwhack"].GetPrediction(target).UnitPosition;
                        KL.Spells["Bushwhack"].Cast(unitpos.Extend(KL.Player.ServerPosition, -75f));
                    }
                    else
                    {
                        if ((KL.CanUse(KL.Spells["Javelin"], true, "jg") ||
                             KL.SpellTimer["Javelin"] > 4f) && target.Distance(KL.Player.ServerPosition) > 265f)
                             KL.Spells["Bushwhack"].Cast(target.Position.Extend(KL.Player.ServerPosition, +305f));
                        else
                            KL.Spells["Bushwhack"].Cast(target.Position.Extend(KL.Player.ServerPosition, 100f));
                    }
                }
            }
        }
开发者ID:xKurisu,项目名称:KurisuSolutions,代码行数:49,代码来源:CastManager.cs

示例7: Obj_AI_Base_OnProcessSpellCast

        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (sender.IsEnemy && sender is Obj_AI_Hero && sender.Distance(Player.Position) < 800)
            {

                switch (args.SData.Name)
                {
                    case "akalismokebomb":
                        CastVisionWards(sender.ServerPosition);
                        break;
                    case "deceive":
                        CastVisionWards(sender.ServerPosition);
                        break;
                    case "khazixr":
                        CastVisionWards(sender.ServerPosition);
                        break;
                    case "khazixrlong":
                        CastVisionWards(sender.ServerPosition);
                        break;
                    case "talonshadowassault":
                        CastVisionWards(sender.ServerPosition);
                        break;
                    case "monkeykingdecoy":
                        CastVisionWards(sender.ServerPosition);
                        break;
                    case "RengarR":
                        CastVisionWards(sender.ServerPosition);
                        break;
                    case "TwitchHideInShadows":
                        CastVisionWards(sender.ServerPosition);
                        break;
                }
            }
        }
开发者ID:okko1221,项目名称:LeagueRepo,代码行数:34,代码来源:OKTWward.cs

示例8: doCombo

        public static void doCombo(Obj_AI_Base target)
        {
            if (target == null)
                return;
            if (target.Distance(Player) < 500)
            {
                sumItems.cast(SummonerItems.ItemIds.Ghostblade);
            }
            if (target.Distance(Player) < 500 && (Player.Health/Player.MaxHealth)*100<85)
            {
                sumItems.cast(SummonerItems.ItemIds.BotRK, target);

            }

            igniteIfKIllable(target);
            rushDownQ =  RivenSharp.Config.Item("rush").GetValue<bool>() && rushDmgBasedOnDist(target) * 0.7f > target.Health;
            rushDown = rushDmgBasedOnDist(target)*1.1f > target.Health;
            if (RivenSharp.Config.Item("useR").GetValue<bool>())
                useRSmart(target);
            if (rushDown)
                sumItems.castIgnite((Obj_AI_Hero)target);
            useESmart(target);
            useWSmart(target);
            useHydra(target);
            gapWithQ(target);
        }
开发者ID:Merc491,项目名称:GoodGuyJodu,代码行数:26,代码来源:Riven.cs

示例9: L33TSmite

 internal static void L33TSmite(Obj_AI_Base unit, float smitedmg)
 {
     foreach (var hero in Smitdata.SpellList.Where(x => x.Name == Activator.Player.ChampionName))
     {
         if (Activator.Player.GetSpellDamage(unit, hero.Slot, hero.Stage) + smitedmg >= unit.Health)
         {
             if (unit.Distance(Activator.Player.ServerPosition) <= hero.CastRange + 
                 unit.BoundingRadius + Activator.Player.BoundingRadius)
             {
                 if (hero.HeroReqs(unit))
                 {
                     switch (hero.Type)
                     {
                         case SpellDataTargetType.Location:
                             Activator.Player.Spellbook.CastSpell(hero.Slot, unit.ServerPosition);
                             break;
                         case SpellDataTargetType.Unit:
                             Activator.Player.Spellbook.CastSpell(hero.Slot, unit);
                             break;
                         case SpellDataTargetType.Self:
                             Activator.Player.Spellbook.CastSpell(hero.Slot);
                             break;
                     }
                 }
             }
         }
     }
 }
开发者ID:Deprive,项目名称:Private,代码行数:28,代码来源:smite.cs

示例10: GetClosestETarget

 public static Obj_AI_Base GetClosestETarget(Obj_AI_Base unit)
 {
     return
         GetETargets(unit.ServerPosition)
             .Where(o => o.NetworkId != unit.NetworkId && unit.Distance(o) < SpellManager.Q.Range)
             .MinOrDefault(o => o.Distance(unit));
 }
开发者ID:TenminsPark,项目名称:LeagueSharp,代码行数:7,代码来源:Utility.cs

示例11: AIHeroClient_OnProcessSpellCast

        //-------------------------------------Obj_AI_Base_OnProcessSpellCast--------------------------------------
        static void AIHeroClient_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (DodgeSpells.Any(el => el == args.SData.Name) && Menu[args.SData.Name].Cast<CheckBox>().CurrentValue)
            {
                if (args.SData.Name == "KatarinaR")
                {
                    if (Q.IsReady() && Q.IsInRange(sender)) Q.Cast();
                    else if (W.IsReady() && W.IsInRange(sender)) W.Cast(sender);
                    return;
                }

                if (args.SData.Name == "AbsoluteZero")
                {
                    if (Q.IsReady() && Q.IsInRange(sender)) Q.Cast();
                    else if (W.IsReady() && W.IsInRange(sender)) W.Cast(sender);
                    return;
                }

                if (args.SData.Name == "EzrealtrueShotBarrage")
                {
                    if (Q.IsReady() && Q.IsInRange(sender)) Q.Cast();
                    else if (W.IsReady() && W.IsInRange(sender)) W.Cast(sender);
                    return;
                }

                if (Q.IsReady() && Q.IsInRange(sender)) { Q.Cast(); return; }
                if (W.IsReady() && sender.Distance(Player) <= 300) { W.Cast(sender); return; }
            }

            return;
        }
开发者ID:tramyeu,项目名称:EloBuddy,代码行数:32,代码来源:Program.cs

示例12: ChargeOnTowerSpellCast

        public static void ChargeOnTowerSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (ObjectManager.Player.IsDead || ObjectManager.Player.InFountain())
            {
                return;
            }

            if (sender.IsEnemy && sender.Type == GameObjectType.obj_AI_Turret
                && sender.Distance(ObjectManager.Player) < 2000f)
            {

                if (args.Target.IsMe)
                {
                    if (TowerIsOuter(sender))
                    {
                        if (WarmingUpStacks < 2)
                        {
                            WarmingUpStacks++;
                            //Console.WriteLine("Warming: " + WarmingUpStacks);
                        }
                        else if (HeatedUpStacks < 2)
                        {
                            HeatedUpStacks++;
                            //Console.WriteLine("Heated: " + HeatedUpStacks);
                        }
                    }
                    if (TowerIsInhib(sender))
                    {
                        if (HeatStacks < 120)
                        {
                            HeatStacks = HeatStacks + 6;
                            //Console.WriteLine("Heat: " + HeatStacks);
                        }
                    }

                }
                else if (args.Target.IsAlly && args.Target.Type == GameObjectType.obj_AI_Hero)
                {
                    ResetTowerWarming();
                }
                else
                {
                    ResetTowerStacks();
                }

            }
            //            if (!IncomingDamage.StackResetDelay)
            //            {
            //                Utility.DelayAction.ActionList.Clear();
            //                Utility.DelayAction.Add(1500, () => IncomingDamage.StackResetDelay = true);
            //            }

            //        else if (IncomingDamage.StackResetDelay)
            //        {
            //            IncomingDamage.ResetTowerStacks();
            //            IncomingDamage.StackResetDelay = false
            //        }
            //    }
            //}
        }
开发者ID:Brewster851,项目名称:Leaguesharp,代码行数:60,代码来源:IncomingDamage.cs

示例13: castQ

 public static void castQ(Obj_AI_Base target, bool useR, double predictionHitChance)
 {
     if (Q.IsReady() && target.IsValidTarget(Q.Range))
     {
         var pred = Q.GetPrediction(target);
         //No collisions we cast it directly
         if (pred.HitChancePercent >= predictionHitChance && !pred.Collision)
         {
             if (useR)
                 castR();
             Q.Cast(pred.CastPosition);
         }
         //Collisions : Damn we need to use something called the brain ...
         else
         {
             var collision = new Obj_AI_Base();
             if (pred.CollisionObjects.Length != 0)
             {
                 collision = pred.CollisionObjects[0];
                 if (collision.IsValidTarget() && target.Distance(collision.Position) < Q.Width)
                 {
                     if (useR)
                         castR();
                     Q.Cast(pred.CastPosition);
                     return;
                 }
             }
         }
     }
 }
开发者ID:,项目名称:,代码行数:30,代码来源:

示例14: GetHealthPrediction

        public static float GetHealthPrediction(Obj_AI_Base unit, int time, int delay = 70)
        {
            var predictedDamage = 0f;

            foreach (var attack in ActiveAttacks.Values)
            {
                var attackDamage = 0f;
                if (!attack.Processed && attack.Source.IsValidTarget(float.MaxValue) &&
                    attack.Target.IsValidTarget(float.MaxValue) && attack.Target.NetworkId == unit.NetworkId)
                {
                    var landTime = attack.StartTick + attack.Delay +
                                   1000*Math.Max(0, unit.Distance(attack.Source) - attack.Source.BoundingRadius)/
                                   attack.ProjectileSpeed + delay;

                    if ( /*Utils.GameTimeTickCount < landTime - delay &&*/ landTime < Utils.GameTimeTickCount + time)
                    {
                        attackDamage = attack.Damage;
                    }
                }

                predictedDamage += attackDamage;
            }

            return unit.Health - predictedDamage;
        }
开发者ID:Xelamats,项目名称:PortAIO,代码行数:25,代码来源:HealthPrediction.cs

示例15: BlitzOnInterruptableSpell

        private static void BlitzOnInterruptableSpell(Obj_AI_Base unit, InterruptableSpell spell)
        {
            if (_menu.Item("interruptq").GetValue<bool>() && _q.IsReady())
            {
                if (unit.Distance(Me.ServerPosition, true) <= _q.RangeSqr)
                {
                    var prediction = _q.GetPrediction(unit);
                    if (prediction.Hitchance >= HitChance.Low)
                    {
                        _q.Cast(prediction.CastPosition);
                    }
                }
            }

            if (_menu.Item("interruptr").GetValue<bool>() && _r.IsReady())
            {
                if (unit.Distance(Me.ServerPosition, true) <= _r.RangeSqr)
                {
                    _r.Cast();
                }
            }

            if (_menu.Item("interrupte").GetValue<bool>() && _e.IsReady())
            {
                if (unit.Distance(Me.ServerPosition, true) <= _e.RangeSqr)
                {
                    _e.CastOnUnit(Me);
                    Me.IssueOrder(GameObjectOrder.AttackUnit, unit);
                }
            }
        }
开发者ID:xlof,项目名称:folxuSharp,代码行数:31,代码来源:Program.cs


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