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


C# Obj_AI_Hero.IsMelee方法代码示例

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


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

示例1: SpellPrediction

        public static bool SpellPrediction(Spell spell, Obj_AI_Hero target,bool collisionable)
        {
            //
            var dist = ObjectManager.Player.Distance(target.Position);
            var pos1 = LeagueSharp.Common.Prediction.GetPrediction(target, dist / spell.Speed).UnitPosition-40;
            var dister = target.Position.Extend(target.GetWaypoints()[1].To3D(), target.GetWaypoints()[1].To3D().Distance(target.Position) + 50);
              //  var pos1 = LeagueSharp.Common.Prediction.GetPrediction(target, dist / spell.Speed).UnitPosition - 40;
            var wts = Drawing.WorldToScreen(target.Position);
            var wtsx = target.GetWaypoints()[1];
            Drawing.DrawLine(wts[0], wts[1], wtsx[0], wtsx[1], 2f, System.Drawing.Color.Red);
            var e = pos1.Distance(target.GetWaypoints()[1].To3D());

            pos1.Extend(target.GetWaypoints()[1].To3D(), -e);
            Render.Circle.DrawCircle(dister, 10, System.Drawing.Color.GreenYellow, 2);
            Render.Circle.DrawCircle(pos1, 10, System.Drawing.Color.BlueViolet, 2);
            //
            var point = PointsAroundTheTarget(target.Position, target.BoundingRadius + 50).FirstOrDefault(t => t.IsWall());
            if (point.X != 0 && point.Y != 0 && point.Z != 0)
            {
                if (MinionCollideLine(ObjectManager.Player.Position, ExtendWallpos(target, point), spell,collisionable)) return false;

                Render.Circle.DrawCircle(ExtendWallpos(target, point), 10, System.Drawing.Color.Brown, 2);
                spell.Cast(ExtendWallpos(target, point));
                return true;
            }
            else
            {
                var range = spell.Range;
                if (target.Position.Distance(ObjectManager.Player.Position) < target.GetWaypoints()[1].Distance(ObjectManager.Player.Position))
                {
                    range -= 100;
                }

                if (!spell.IsInRange(target, range)) return false;

                /*if (target.IsFacing(ObjectManager.Player) && target.Position.Distance(ObjectManager.Player.Position) > target.GetWaypoints()[1].Distance(ObjectManager.Player.Position))
                {
                  if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;

                    {
                        Game.PrintChat("Casteando por inface");
                       spell.Cast(target.Position);

                        return true;
                    }

                }*/
                // code of dashes
                if (target.IsDashing())
                {
                    float timeforArrive=(target.Position.Distance(target.GetDashInfo().EndPos.To3D()))/target.GetDashInfo().Speed;
                    float grabtime =( ObjectManager.Player.Position.Distance(target.GetDashInfo().EndPos.To3D())
                                     / spell.Speed)+spell.Delay;
                    if (timeforArrive<grabtime)
                    {
                        spell.Cast(target.GetDashInfo().EndPos);
                        return true;
                    }
                }
               /* if (target.IsImmovable) // check for cc guys
                {
                    if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;
                    spell.Cast(target.Position);
                    return true;
                }*/

              //  if(target.IsChannelingImportantSpell())
                if (target.IsWindingUp && !target.IsMelee())
                {
                    if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;
                    spell.Cast(target.Position);
                    return true;
                }

                if (target.Position.Distance(ObjectManager.Player.Position) <= 300)
                {
                    CastToDirection( target, spell,collisionable);
                }
                else
                {
                    var oldPos = target.GetWaypoints()[0].To3D();
                   var h = false;
                    Utility.DelayAction.Add(Game.Ping + 1000, () => h = Next(target, oldPos, spell,collisionable));
                    return h;
                }
            }
            return false;
        }
开发者ID:kga321,项目名称:zeroRepository,代码行数:88,代码来源:Prediction.cs

示例2: SpellPrediction

        public static bool SpellPrediction(Spell spell, Obj_AI_Hero target,bool collisionable)
        {
            //
            var dist = ObjectManager.Player.Distance(target.Position);
            var pos1 = LeagueSharp.Common.Prediction.GetPrediction(target, dist / spell.Speed).UnitPosition;
            var e = pos1.Distance(target.GetWaypoints()[1].To3D());

            pos1.Extend(target.GetWaypoints()[1].To3D(), -e);
            Render.Circle.DrawCircle(pos1, 10, System.Drawing.Color.BlueViolet, 2);
            //
            var point = PointsAroundTheTarget(target.Position, target.BoundingRadius + 50).FirstOrDefault(t => t.IsWall());
            if (point.X != 0 && point.Y != 0 && point.Z != 0)
            {
                if (MinionCollideLine(ObjectManager.Player.Position, ExtendWallpos(target, point), spell,collisionable)) return false;

                Render.Circle.DrawCircle(ExtendWallpos(target, point), 10, System.Drawing.Color.Brown, 2);
                spell.Cast(ExtendWallpos(target, point));
                return true;
            }
            else
            {
                var range = spell.Range;
                if (target.Position.Distance(ObjectManager.Player.Position) < target.GetWaypoints()[1].Distance(ObjectManager.Player.Position))
                {
                    range -= 100;
                }

                if (!spell.IsInRange(target, range)) return false;

                if (target.IsFacing(ObjectManager.Player) && target.Position.Distance(ObjectManager.Player.Position) > target.GetWaypoints()[1].Distance(ObjectManager.Player.Position))
                {
                  if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;
                        spell.Cast(target.Position);
                        return true;

                }
               // float speed =
                if (target.IsImmovable) // check for cc guys
                {
                    if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;
                    spell.Cast(target.Position);
                    return true;
                }

              //  if(target.IsChannelingImportantSpell())
                if (target.IsWindingUp && !target.IsMelee())
                {
                    if (MinionCollideLine(ObjectManager.Player.Position, target.Position, spell,collisionable)) return false;
                    spell.Cast(target.Position);
                    return true;
                }

                if (target.Position.Distance(ObjectManager.Player.Position) <= 300)
                {
                    CastToDirection( target, spell,collisionable);
                }
                else
                {
                    var oldPos = target.GetWaypoints()[0].To3D();
                   var h = false;
                    Utility.DelayAction.Add(Game.Ping + 1000, () => h = Next(target, oldPos, spell,collisionable));
                    return h;
                }
            }
            return false;
        }
开发者ID:1550441149,项目名称:zeroRepository,代码行数:66,代码来源:Prediction.cs

示例3: putWallBehind

        public static void putWallBehind(Obj_AI_Hero target)
        {
            if (!W.IsReady() || !E.IsReady() || target.IsMelee())
                return;
            Vector2 dashPos = getNextPos(target);
            PredictionOutput po = Prediction.GetPrediction(target, 0.5f);

            float dist = Player.Distance(po.UnitPosition);
            if (!target.IsMoving || Player.Distance(dashPos) <= dist + 40)
                if (dist < 330 && dist > 100 && W.IsReady())
                {
                    SmoothMouse.addMouseEvent(po.UnitPosition);
                    W.Cast(po.UnitPosition);
                }
        }
开发者ID:Merc491,项目名称:GoodGuyJodu,代码行数:15,代码来源:Yasuo.cs

示例4: eBehindWall

 public static void eBehindWall(Obj_AI_Hero target)
 {
     if (!E.IsReady() || !enemyIsJumpable(target) || target.IsMelee())
         return;
     float dist = Player.Distance(target);
     var pPos = Player.Position.To2D();
     Vector2 dashPos = target.Position.To2D();
     if (!target.IsMoving || Player.Distance(dashPos) <= dist)
     {
         foreach (Obj_AI_Base enemy in ObjectManager.Get<Obj_AI_Base>().Where(enemy => enemyIsJumpable(enemy)))
         {
             Vector2 posAfterE = pPos + (Vector2.Normalize(enemy.Position.To2D() - pPos) * E.Range);
             if ((target.Distance(posAfterE) < dist
                 || target.Distance(posAfterE) < Orbwalking.GetRealAutoAttackRange(target) + 100)
                 && goesThroughWall(target.Position, posAfterE.To3D()))
             {
                 if (useENormal(target))
                     return;
             }
         }
     }
 }
开发者ID:Merc491,项目名称:GoodGuyJodu,代码行数:22,代码来源:Yasuo.cs

示例5: Drawing_OnDraw

        static void Drawing_OnDraw(EventArgs args)
        {
            if (!Menu.Item("switch").GetValue<Boolean>())
                return;

            Target = TargetSelector.GetSelectedTarget() != null ? TargetSelector.GetSelectedTarget() : Player;

            var buffs = string.Empty;

            foreach (var buff in Target.Buffs)
            {
                buffs += "\n" + buff.Name + "[Count: " + buff.Count + "/Duration: " + (buff.EndTime - Game.ClockTime).ToString("0.00") +"],";
            }

            var Mobs = MinionManager.GetMinions(1500, MinionTypes.All, MinionTeam.NotAlly, MinionOrderTypes.MaxHealth);
            var MobsList = string.Empty;

            foreach (var Mob in Mobs)
            {
                MobsList += "\n" + Mob.Name + "[Skinname: " + Mob.SkinName + "/HP: " + Mob.Health + " / " + Mob.MaxHealth + "(" + Mob.HealthPercent.ToString("0.0") + "%)],";
            }

            Render.Circle.DrawCircle(Player.Position, 1500, Color.Red, 10);

            Text.text =
                //"Name: " + Target.Name + NewLine +
                "ChampionName: " + Target.ChampionName + NewLine +
                "SkinName: " + Target.SkinName + NewLine +
                //"Gold: " + Target.Gold + NewLine +
                //"Level: " + Target.Level + NewLine +
                "TotalAttackDamage: " + Utility.TotalAttackDamage(Target) + NewLine +
                "TotalMagicalDamage: " + Utility.TotalMagicalDamage(Target) + NewLine +
                "Armor: " + Target.Armor + NewLine +
                "Health: " + Target.Health + " / " + Target.MaxHealth + " (" + Target.HealthPercent.ToString("0.0") + "%)" + NewLine +
                "Mana: " + Target.Mana + " / " + Target.MaxMana + " (" + Target.HealthPercent.ToString("0.0") + "%)" + NewLine +
                "HPRegenRate: " + Target.HPRegenRate + NewLine +
                "PARRegenRate: " + Target.PARRegenRate + NewLine +
                "Experience: " + Target.Experience + NewLine +
                "Position: " + Target.Position + NewLine +
                "ServerPosition: " + Target.ServerPosition + NewLine +
                "Team: " + Target.Team + NewLine +
                "NetworkId: " + Target.NetworkId + NewLine +
                "MoveSpeed: " + Target.MoveSpeed + NewLine +
                "AttackRange: " + Target.AttackRange + NewLine +
                "RealAutoAttackRange: " + Orbwalking.GetRealAutoAttackRange(Target) + NewLine +
                //"DeathDuration: " + Target.DeathDuration + NewLine +
                "BoundingRadius: " + Target.BoundingRadius + NewLine +
                NewLine +
                "Buffs: " + buffs + NewLine +
                NewLine +
                "IsDead: " + Target.IsDead + NewLine +
                "IsImmovable: " + Target.IsImmovable + NewLine +
                "IsInvulnerable: " + Target.IsInvulnerable + NewLine +
                "IsMoving: " + Target.IsMoving + NewLine +
                "IsPacified: " + Target.IsPacified + NewLine +
                "IsTargetable: " + Target.IsTargetable + NewLine +
                "IsWindingUp: " + Target.IsWindingUp + NewLine +
                "IsZombie: " + Target.IsZombie + NewLine +
                "IsRecalling: " + Target.IsRecalling() + NewLine +
                "IsStunned: " + Target.IsStunned + NewLine +
                "IsRooted: " + Target.IsRooted + NewLine +
                "IsMelee: " + Target.IsMelee() + NewLine +
                "IsDashing: " + Target.IsDashing() + NewLine +
                "IsAlly: " + Target.IsAlly + NewLine +
                "IsCanMove: " + Orbwalking.CanMove(1) + NewLine +
                "UnderTurret: " + Target.UnderTurret() + NewLine +
                NewLine +
                "Mobs: " + MobsList + NewLine +
                NewLine +
                "Game_CursorPos: " + Game.CursorPos + NewLine +
                "Game_ClockTime: " + Game.ClockTime + NewLine +
                "Game_Time: " + Game.Time + NewLine +
                "Game_Type: " + Game.Type + NewLine +
                "Game_Version: " + Game.Version + NewLine +
                "Game_Region: " + Game.Region + NewLine +
                "Game_IP: " + Game.IP + NewLine +
                "Game_Port: " + Game.Port + NewLine +
                "Game_Ping: " + Game.Ping + NewLine +
                "Game_Mode: " + Game.Mode + NewLine +
                "Game_MapId: " + Game.MapId + NewLine +
                "Game_MapName: " + Utility.Map.GetMap().Name
                ;

            Text.OnEndScene();
        }
开发者ID:gn00433001,项目名称:LeagueSharp-2,代码行数:85,代码来源:Program.cs

示例6: putWallBehind

        public static void putWallBehind(Obj_AI_Hero target)
        {
            if (!W.IsReady() || !E.IsReady() || target.IsMelee())
                return;
            Vector2 dashPos = getNextPos(target);
            PredictionOutput po = Prediction.GetPrediction(target, 0.5f);

            float dist = myHero.Distance(po.UnitPosition);
            if (!target.IsMoving || myHero.Distance(dashPos) <= dist + 40)
                if (dist < 330 && dist > 100 && W.IsReady() && Config.Item(target.ChampionName).GetValue<bool>())
                {
                    W.Cast(po.UnitPosition, true);
                }
        }
开发者ID:GosuMechanics,项目名称:LeagueSharp,代码行数:14,代码来源:Program.cs

示例7: Combo

    private static void Combo(Obj_AI_Hero target)
    {
        if (Config.Item("Muramana-Enabled").GetValue<bool>() && !Player.HasBuff("Muramana") && Config.Item("Muramana-Mana").GetValue<Slider>().Value <= (Player.Mana / Player.MaxMana) * 100 && Muramana.IsOwned() && Muramana.IsReady())
            Items.UseItem(Muramana.Id);

        if (Config.Item("Combo-Use-Q").GetValue<bool>() && _q.IsReady())
        {
            var qHit = _q.GetPrediction(target);
            if (qHit.Hitchance >= ComboHitChance)
            {
                _q.Cast(target);
            }
        }

        if (Config.Item("Combo-Use-W").GetValue<bool>() && _w.IsReady() && Player.Distance(target) < _w.Range)
        {
            var wHit = _w.GetPrediction(target);
            if (wHit.Hitchance >= ComboHitChance)
            {
                _w.Cast(wHit.CastPosition);
                if (Config.Item("Combo-Use-E-W").GetValue<bool>() && _e.IsReady())
                {
                    var landingPosition = Player.Position.Extend(wHit.CastPosition, _e.Range);

                    if (!landingPosition.UnderTurret(true) && !landingPosition.IsWall() && //Check if landing position is definitely not a wall or a turret
                        ObjectManager.Get<Obj_AI_Hero>().Count(enemy => enemy.IsEnemy && enemy.IsValidTarget(600, true, target.Position)) - 1 //The number of enemies, other than the target, near the target
                        <= ObjectManager.Get<Obj_AI_Hero>().Count(ally => ally.IsAlly && !ally.IsDead && ally.Distance(target) < 600) && //The number of allies near the target
                        (!target.IsMelee() || //If target is range, then just go ahead and land
                         (target.IsMelee() && (landingPosition.Distance(target.Position) + Player.BoundingRadius + 50 > target.AttackRange + target.BoundingRadius)))) //If target is melee, make sure you don't land in its AA range
                    {
                        CheckFlag = true;
                    }
                }
            }
        }

        if (Config.Item("Combo-Use-R").GetValue<bool>() && _r.IsReady())
        {
            var rHit = _r.GetPrediction(target);
            if (rHit.Hitchance >= ComboHitChance)
            {
                _r.Cast(target);
            }
        }

        CastOffensiveItems(target);
    }
开发者ID:zjian1013,项目名称:LeagueSharpFlapperDoodlez,代码行数:47,代码来源:Program.cs


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