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


C# Obj_AI_Base.LSDistance方法代码示例

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


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

示例1: CastR

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

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

示例2: IsFleeing

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

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

示例3: GetClosestETarget

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

示例4: FastPrediction

 public static FastPredResult FastPrediction(Vector2 from, Obj_AI_Base unit, int delay, int speed)
 {
     var tDelay = delay / 1000f + (unit.LSDistance(from) / speed);
     var d = tDelay * unit.MoveSpeed;
     var path = unit.GetWaypoints();
     if (path.LSPathLength() > d)
     {
         return new FastPredResult
                    {
                        IsMoving = true, CurrentPos = unit.ServerPosition.LSTo2D(),
                        PredictedPos = path.CutPath((int)d)[0]
                    };
     }
     return new FastPredResult
                { IsMoving = false, CurrentPos = path[path.Count - 1], PredictedPos = path[path.Count - 1] };
 }
开发者ID:yMeliodasNTD,项目名称:PortAIO,代码行数:16,代码来源:Collision.cs

示例5: Obj_AI_Base_OnProcessSpellCast

 /// <summary>
 ///     OnProcessSpellCast Event which detects targeted spells to me
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="args">The args.</param>
 private static void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
 {
     if (OnDetected != null && sender.IsChampion() && !sender.IsMe)
     {
         var spells =
             SpellDatabase.TargetedSpells.Where(p => p.ChampionName == (sender as AIHeroClient).ChampionName);
         if (spells != null && spells.Count() > 0)
         {
             var spell = spells.Where(p => p.SpellName == args.SData.Name).FirstOrDefault();
             if (spell != null)
             {
                 if ((spell.IsTargeted && args.Target != null && args.Target.IsMe) ||
                     (!spell.IsTargeted && sender.LSDistance(ObjectManager.Player.ServerPosition) <= spell.Radius))
                     OnDetected(new DetectedTargetedSpellArgs
                     {
                         Caster = sender,
                         SpellData = spell,
                         SpellCastArgs = args
                     });
             }
         }
     }
 }
开发者ID:CONANLXF,项目名称:AIO,代码行数:28,代码来源:TargetedSpellDetector.cs

示例6: slayMaderDuker

        public static void slayMaderDuker(Obj_AI_Base target)
        {
            try
            {
                if (target == null)
                    return;
                if (MasterSharp.getCheckBoxItem(MasterSharp.comboMenu, "useSmite"))
                    useSmiteOnTarget(target);

                if (target.LSDistance(player) < 500)
                {
                    sumItems.cast(SummonerItems.ItemIds.Ghostblade);
                }
                if (target.LSDistance(player) < 300)
                {
                    sumItems.cast(SummonerItems.ItemIds.Hydra);
                }
                if (target.LSDistance(player) < 300)
                {
                    sumItems.cast(SummonerItems.ItemIds.Tiamat);
                }
                if (target.LSDistance(player) < 300)
                {
                    sumItems.cast(SummonerItems.ItemIds.Cutlass, target);
                }
                if (target.LSDistance(player) < 500 && player.Health / player.MaxHealth * 100 < 85)
                {
                    sumItems.cast(SummonerItems.ItemIds.BotRK, target);
                }

                if (MasterSharp.getCheckBoxItem(MasterSharp.comboMenu, "useQ") &&
                    (Orbwalker.CanMove || Q.IsKillable(target)))
                    useQSmart(target);
                if (MasterSharp.getCheckBoxItem(MasterSharp.comboMenu, "useE"))
                    useESmart(target);
                if (MasterSharp.getCheckBoxItem(MasterSharp.comboMenu, "useR"))
                    useRSmart(target);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
开发者ID:yMeliodasNTD,项目名称:PortAIO,代码行数:43,代码来源:MasterYi.cs

示例7: Interrupter2_OnInterruptableTarget

        private static void Interrupter2_OnInterruptableTarget(Obj_AI_Base sender,
            Interrupter.InterruptableSpellEventArgs e)
        {
            try
            {
                if (Player.IsDead)
                    return;
                if (!sender.IsEnemy || !sender.IsValid<AIHeroClient>())
                    return;

                if (getCheckBoxItem(MiscMenu, "Blitzcrank_InterQ") && _Q.IsReady())
                {
                    if (sender.LSDistance(Player.ServerPosition, true) <= _Q.RangeSqr)
                        _Q.Cast(sender);
                }
                if (getCheckBoxItem(MiscMenu, "Blitzcrank_InterR") && _R.IsReady())
                {
                    if (sender.LSDistance(Player.ServerPosition, true) <= _R.RangeSqr)
                        _R.Cast();
                }
                if (getCheckBoxItem(MiscMenu, "Blitzcrank_InterE") && _E.IsReady())
                {
                    if (sender.LSDistance(Player.ServerPosition, true) <= _E.RangeSqr)
                        _E.CastOnUnit(Player);
                }
            }
            catch (Exception)
            {
                if (FreshCommon.NowTime() > ErrorTime)
                {
                    Chat.Print(ChampName + " in FreshBooster isn't Load. Error Code 09");
                    ErrorTime = FreshCommon.TickCount(10000);
                }
            }
        }
开发者ID:,项目名称:,代码行数:35,代码来源:

示例8: onDash

 private static void onDash(Obj_AI_Base sender, Dash.DashItem args)
 {
     if (PortAIO.OrbwalkerManager.LastTarget() != null && sender.NetworkId == PortAIO.OrbwalkerManager.LastTarget().NetworkId &&
         MasterYi.Q.IsReady() && PortAIO.OrbwalkerManager.isComboActive
         && sender.LSDistance(MasterYi.player) <= 600)
         MasterYi.Q.Cast(sender);
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:7,代码来源:MasterSharp.cs

示例9: Qcast

        private static void Qcast(Obj_AI_Base target)
        {
            if (target == null)
            {
                return;
            }
            if (!getCheckBoxItem(comboMenu, "UseQ")) return;
            if (!(target.LSDistance(Player) <= Q.Range)) return;
            if (Bomb == null)
            {
                Q.Cast(target, true);
            }

            if (Bomb != null && target.LSDistance(Bomb.Position) <= 300)
            {
                Q.Cast();
            }
        }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:18,代码来源:Program.cs

示例10: CastQ

        private static void CastQ(Obj_AI_Base target)
        {
            if (!_q.IsReady()) return;

            if (WShadow != null && target.LSDistance(WShadow.ServerPosition) <= 900 && target.LSDistance(_player.ServerPosition) > 450)
            {

                var shadowpred = _q.GetPrediction(target);
                _q.UpdateSourcePosition(WShadow.ServerPosition, WShadow.ServerPosition);
                if (shadowpred.Hitchance >= HitChance.Medium)
                    _q.Cast(target);

            }
            else
            {

                _q.UpdateSourcePosition(_player.ServerPosition, _player.ServerPosition);
                var normalpred = _q.GetPrediction(target);

                if (normalpred.CastPosition.LSDistance(_player.ServerPosition) < 900 && normalpred.Hitchance >= HitChance.Medium)
                {
                    _q.Cast(target);
                }

            }
        }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:26,代码来源:Program.cs

示例11: GetGapcloseDamage

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

示例12: GetPrediction

        /// <summary>
        ///     Gets Prediction result
        /// </summary>
        /// <param name="target">Target for spell</param>
        /// <param name="width">Spell width</param>
        /// <param name="delay">Spell delay</param>
        /// <param name="missileSpeed">Spell missile speed</param>
        /// <param name="range">Spell range</param>
        /// <param name="collisionable">Spell collisionable</param>
        /// <param name="type">Spell skillshot type</param>
        /// <param name="path">Waypoints of target</param>
        /// <param name="avgt">Average reaction time (in ms)</param>
        /// <param name="movt">Passed time from last movement change (in ms)</param>
        /// <param name="avgp">Average Path Lenght</param>
        /// <param name="from">Spell casted position</param>
        /// <param name="rangeCheckFrom"></param>
        /// <returns>Prediction result as <see cref="Prediction.Result" /></returns>
        public static Prediction.Result GetPrediction(Obj_AI_Base target, float width, float delay, float missileSpeed,
            float range, bool collisionable, List<Vector2> path, float avgt, float movt, float avgp, float anglediff,
            Vector2 from, Vector2 rangeCheckFrom, bool arconly = true)
        {
            Prediction.AssertInitializationMode();

            if (arconly)
            {
                if (target.LSDistance(from) < width || target.LSDistance(from) > range*0.75f)
                    return CirclePrediction.GetPrediction(target, width, delay, missileSpeed, range, collisionable, path,
                        avgt, movt, avgp, anglediff, from, rangeCheckFrom);

                var pred = LinePrediction.GetPrediction(target, 80f, delay, missileSpeed, range, collisionable, path,
                    avgt, movt, avgp, anglediff, from, rangeCheckFrom);
                if (pred.HitChance >= EloBuddy.SDK.Enumerations.HitChance.Low)
                {
                    pred.CastPosition = @from + (pred.CastPosition - @from).LSNormalized()*range
                        /*.RotateAroundPoint(from, (1 - pred.UnitPosition.LSDistance(ObjectManager.Player.ServerPosition.LSTo2D()) / 820f) * (float)Math.PI / 2f)*/;
                    var cos = (float) Math.Cos((1 - pred.UnitPosition.LSDistance(from)/820f)*Math.PI/2);
                    var sin = (float) Math.Sin((1 - pred.UnitPosition.LSDistance(from)/820f)*Math.PI/2);
                    var x = cos*(pred.CastPosition.X - from.X) - sin*(pred.CastPosition.Y - from.Y) + from.X;
                    var y = sin*(pred.CastPosition.X - from.X) + cos*(pred.CastPosition.Y - from.Y) + from.Y;
                    pred.CastPosition = new Vector2(x, y);
                }

                return pred;
            }
            var result = new Prediction.Result();

            if (path.Count <= 1) //if target is not moving, easy to hit
            {
                result.HitChance = EloBuddy.SDK.Enumerations.HitChance.Immobile;
                result.CastPosition = target.ServerPosition.LSTo2D();
                result.UnitPosition = result.CastPosition;
                return result;
            }

            if (target is AIHeroClient && ((AIHeroClient) target).IsChannelingImportantSpell())
            {
                result.HitChance = EloBuddy.SDK.Enumerations.HitChance.Immobile;
                result.CastPosition = target.ServerPosition.LSTo2D();
                result.UnitPosition = result.CastPosition;
                return result;
            }

            if (Utility.IsImmobileTarget(target))
                return Prediction.GetImmobilePrediction(target, width, delay, missileSpeed, range, collisionable,
                    SkillshotType.SkillshotCircle, @from, rangeCheckFrom);

            if (target.IsDashing())
                return Prediction.GetDashingPrediction(target, width, delay, missileSpeed, range, collisionable,
                    SkillshotType.SkillshotCircle, @from, rangeCheckFrom);

            var targetDistance = rangeCheckFrom.LSDistance(target.ServerPosition);
            var flyTime = 0f;

            if (missileSpeed != 0)
            {
                var Vt = (path[path.Count - 1] - path[0]).LSNormalized()*target.MoveSpeed;
                var Vs = (target.ServerPosition.LSTo2D() - rangeCheckFrom).LSNormalized()*missileSpeed;
                var Vr = Vs - Vt;

                flyTime = targetDistance/Vr.Length();

                if (path.Count > 5)
                    flyTime = targetDistance/missileSpeed;
            }

            var t = flyTime + delay + Game.Ping/2000f + ConfigMenu.SpellDelay/1000f;

            result.HitChance = Prediction.GetHitChance(t*1000f, avgt, movt, avgp, anglediff);

            #region arc collision test

            if (result.HitChance > EloBuddy.SDK.Enumerations.HitChance.Low)
            {
                for (var i = 1; i < path.Count; i++)
                {
                    var senderPos = rangeCheckFrom;
                    var testPos = path[i];

                    var multp = testPos.LSDistance(senderPos)/875.0f;

//.........这里部分代码省略.........
开发者ID:yMeliodasNTD,项目名称:PortAIO,代码行数:101,代码来源:ArcPrediction.cs

示例13: Orbwalk

 public static void Orbwalk(Vector3 goalPosition, Obj_AI_Base target)
 {
     if (target != null && (CanAttack() || HaveCancled()) && IsAllowedToAttack())
     {
         _disableNextAttack = false;
         FireBeforeAttack(target);
         if (!_disableNextAttack)
         {
             if (CurrentMode != Mode.Harass || !target.IsMinion || getCheckBoxItem(modeHarass, "Harass_Lasthit"))
             {
                 Player.IssueOrder(GameObjectOrder.AttackUnit, target);
                 _lastAATick = Environment.TickCount + Game.Ping / 2;
             }
         }
     }
     if (!CanMove() || !IsAllowedToMove())
         return;
     if (MyHero.IsMelee() && target != null && target.LSDistance(MyHero) < GetAutoAttackRange(MyHero, target) &&
         getCheckBoxItem(menuMelee, "orb_Melee_Prediction") && target is AIHeroClient && Game.CursorPos.LSDistance(target.Position) < 300)
     {
         _movementPrediction.Delay = MyHero.BasicAttack.SpellCastTime;
         _movementPrediction.Speed = MyHero.BasicAttack.MissileSpeed;
         MoveTo(_movementPrediction.GetPrediction(target).UnitPosition);
     }
     else
         MoveTo(goalPosition);
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:27,代码来源:Orbwalker.cs

示例14: Game_OnProcessSpell

        public void Game_OnProcessSpell(Obj_AI_Base unit, GameObjectProcessSpellCastEventArgs spell)
        {
            if (!Program.misc["EFlash"].Cast<CheckBox>().CurrentValue || unit.Team == ObjectManager.Player.Team)
            {
                return;
            }

            if (spell.SData.Name.ToLower() == "summonerflash" && unit.LSDistance(ObjectManager.Player.Position) < 2000)
            {
                E.Cast(spell.End);
            }
        }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:12,代码来源:Ashe.cs

示例15: Obj_AI_Base_OnProcessSpellCast

        private void Obj_AI_Base_OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (!sender.IsEnemy || sender.Type != GameObjectType.AIHeroClient)
                return;

            if (sender.LSDistance(Player.Position) > 1600)
                return;

            if (Zhonya.IsReady() && getCheckBoxItem("Zhonya"))
            {
                if (Sub["spellZ" + args.SData.Name] != null && getCheckBoxItem("spellZ" + args.SData.Name))
                {
                    if (args.Target != null && args.Target.NetworkId == Player.NetworkId)
                    {
                        ZhonyaTryCast();
                    }
                    else
                    {
                        var castArea = Player.LSDistance(args.End)*(args.End - Player.ServerPosition).Normalized() +
                                       Player.ServerPosition;
                        if (castArea.LSDistance(Player.ServerPosition) < Player.BoundingRadius/2)
                            ZhonyaTryCast();
                    }
                }
            }

            if (CanUse(exhaust) && getCheckBoxItem("Exhaust"))
            {
                foreach (
                    var ally in
                        Program.Allies.Where(
                            ally =>
                                ally.IsValid && !ally.IsDead && ally.HealthPercent < 51 &&
                                Player.LSDistance(ally.ServerPosition) < 700))
                {
                    double dmg = 0;
                    if (args.Target != null && args.Target.NetworkId == ally.NetworkId)
                    {
                        dmg = dmg + sender.LSGetSpellDamage(ally, args.SData.Name);
                    }
                    else
                    {
                        var castArea = ally.LSDistance(args.End)*(args.End - ally.ServerPosition).Normalized() +
                                       ally.ServerPosition;
                        if (castArea.LSDistance(ally.ServerPosition) < ally.BoundingRadius/2)
                            dmg = dmg + sender.LSGetSpellDamage(ally, args.SData.Name);
                        else
                            continue;
                    }

                    if (ally.Health - dmg < ally.CountEnemiesInRange(700)*ally.Level*40)
                        Player.Spellbook.CastSpell(exhaust, sender);
                }
            }
        }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:55,代码来源:Activator.cs


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