コード例 #1
0
ファイル: Evader.cs プロジェクト: wade1990/PortAIO
        public void OnSpellHitDetected(Vector2 direction, Obj_AI_Base target)
        {
            EvadeData edata;

            Vector2 evade_direction = direction.Perpendicular();
            Vector2 evade_pos       = ObjectManager.Player.ServerPosition.To2D() + direction.Perpendicular() * EvadeSpell.Range;

            bool position_needed = !(SpecialMethod.HasFlag(EvadeMethods.MorganaE) || SpecialMethod.HasFlag(EvadeMethods.LissandraR) || SpecialMethod.HasFlag(EvadeMethods.KayleR) || SpecialMethod.HasFlag(EvadeMethods.SivirE) || SpecialMethod.HasFlag(EvadeMethods.NocturneW) || SpecialMethod.HasFlag(EvadeMethods.VladimirW));

            if (position_needed)
            {
                switch (evade.Item("EVADEMETHOD").GetValue <StringList>().SelectedIndex)
                {
                case 0:     //near turret
                    CorrectNearTurret(ref evade_pos, evade_direction.Perpendicular());
                    break;

                case 1:     //less enemies
                    CorrectLessEnemies(ref evade_pos, evade_direction.Perpendicular());
                    break;

                case 2:     //both
                    if (!CorrectLessEnemies(ref evade_pos, evade_direction.Perpendicular()))
                    {
                        CorrectNearTurret(ref evade_pos, evade_direction.Perpendicular());
                    }
                    break;
                }
            }

            edata = new EvadeData
                        (evade_pos,
                        SpecialMethod.HasFlag(EvadeMethods.MorganaE) || SpecialMethod.HasFlag(EvadeMethods.LissandraR) || SpecialMethod.HasFlag(EvadeMethods.KayleR),
                        SpecialMethod.HasFlag(EvadeMethods.SivirE) || SpecialMethod.HasFlag(EvadeMethods.NocturneW) || SpecialMethod.HasFlag(EvadeMethods.VladimirW),
                        target);

            m_evade_queue.Enqueue(edata);
        }
コード例 #2
0
ファイル: Evader.cs プロジェクト: Sthephanfelix/LeagueSharp-4
        public void OnSpellHitDetected(Vector2 direction, Obj_AI_Base target)
        {
            EvadeData edata;

            Vector2 evade_direction = direction.Perpendicular();
            Vector2 evade_pos = ObjectManager.Player.ServerPosition.To2D() + direction.Perpendicular() * EvadeSpell.Range;

            bool position_needed = !(SpecialMethod.HasFlag(EvadeMethods.MorganaE) || SpecialMethod.HasFlag(EvadeMethods.LissandraR) || SpecialMethod.HasFlag(EvadeMethods.KayleR) || SpecialMethod.HasFlag(EvadeMethods.SivirE) || SpecialMethod.HasFlag(EvadeMethods.NocturneW) || SpecialMethod.HasFlag(EvadeMethods.VladimirW));

            if (position_needed)
            {
                switch (evade.Item("EVADEMETHOD").GetValue<StringList>().SelectedIndex)
                {
                    case 0: //near turret
                        CorrectNearTurret(ref evade_pos, evade_direction.Perpendicular());
                        break;

                    case 1: //less enemies
                        CorrectLessEnemies(ref evade_pos, evade_direction.Perpendicular());
                        break;

                    case 2: //both
                        if (!CorrectLessEnemies(ref evade_pos, evade_direction.Perpendicular()))
                            CorrectNearTurret(ref evade_pos, evade_direction.Perpendicular());
                        break;
                }
            }

            edata = new EvadeData
                (evade_pos, 
                SpecialMethod.HasFlag(EvadeMethods.MorganaE) || SpecialMethod.HasFlag(EvadeMethods.LissandraR) || SpecialMethod.HasFlag(EvadeMethods.KayleR), 
                SpecialMethod.HasFlag(EvadeMethods.SivirE) || SpecialMethod.HasFlag(EvadeMethods.NocturneW) || SpecialMethod.HasFlag(EvadeMethods.VladimirW), 
                target);

            m_evade_queue.Enqueue(edata);
        }