Пример #1
0
 public static bool SafeCheck(Vector3 pos)
 {
     return SafeCheckTwo(pos)
            && SafeCheckThree(pos)
            && EntityManager.Heroes.Enemies.All(e => e.Distance(pos) > 350f)
            && (!pos.IsUnderTurret() && (!Variables.JinxTrap(pos) || !Variables.CaitTrap(pos))) || Player.Instance.IsUnderTurret() && pos.IsUnderTurret() && Player.Instance.HealthPercent > 10 && (!Variables.JinxTrap(pos) || !Variables.CaitTrap(pos));
 }
Пример #2
0
 public static bool SafeCheckTwo(Vector3 pos)
 {
     return (!pos.IsUnderTurret() && (!Variables.JinxTrap(pos) || !Variables.CaitTrap(pos)) || Player.Instance.IsUnderTurret()) && (!Variables.JinxTrap(pos) || !Variables.CaitTrap(pos)) &&
            Variables.CloseAllies(1000).Count(a => a.HealthPercent > 10) +
            EntityManager.Turrets.Allies.Count(t => t.Distance(Player.Instance) < 1000) * 2 >=
            Variables.CloseEnemies(1000).Count(e => e.HealthPercent > 10) +
            (Player.Instance.IsUnderTurret()
                ? EntityManager.Turrets.Enemies.Count(t => t.Distance(Player.Instance) < 1000) * 2
                : 0);
 }
Пример #3
0
        /// <summary>
        ///     OKTR turkey magic :x
        /// </summary>
        /// <param name="pos">Pretty self-explainatory tbh</param>
        /// <returns></returns>
        internal static float GetSafeScoreTM(Vector3 pos)
        {
            var score = 0f;
            foreach (var enemy in Variables.CloseEnemies(Player.Instance.GetAutoAttackRange(), pos))
            {
                var enemySafeScore = 0f;

                for (var i = 0; i < 4; i++)
                {
                    var spell = SpellSlot.Unknown;
                    var spellSafeScore = 0f;
                    switch (i)
                    {
                        case 0:
                            spell = SpellSlot.Q;
                            break;
                        case 1:
                            spell = SpellSlot.W;
                            break;
                        case 2:
                            spell = SpellSlot.E;
                            break;
                        case 3:
                            spell = SpellSlot.R;
                            break;
                    }

                    if (enemy.Spellbook.GetSpell(spell).IsReady)
                    {
                        if (
                            TargetSpellDatabase.Spells.Any(
                                s => s.ChampionName == enemy.ChampionName && s.Spellslot == spell) &&
                            (TargetSpellDatabase.Spells.First(
                                s => s.ChampionName == enemy.ChampionName && s.Spellslot == spell).Type ==
                             SpellType.Skillshot
                             ||
                             TargetSpellDatabase.Spells.First(
                                 s => s.ChampionName == enemy.ChampionName && s.Spellslot == spell).Type ==
                             SpellType.Targeted))
                        {
                            var spellDmg = enemy.GetSpellDamage(Player.Instance, spell);
                            var isCC = CCDataBase.IsCC(enemy.Spellbook.GetSpell(spell).Name);
                            if ((spellDmg > Player.Instance.MaxHealth * 0.05 || isCC)
                                && enemy.Distance(pos) < enemy.Spellbook.GetSpell(spell).SData.CastRange)
                            {
                                if (spellDmg > Player.Instance.MaxHealth * 0.05)
                                {
                                    spellSafeScore += (Player.Instance.MaxHealth - spellDmg) / Player.Instance.MaxHealth *
                                                      100;
                                }
                                if (isCC)
                                {
                                    spellSafeScore += Variables.CloseEnemies(1000, pos).Count * 20;
                                }
                            }
                        }
                    }
                    enemySafeScore += spellSafeScore;
                }

                if (!enemy.IsMelee)
                {
                    if (pos.Distance(enemy) < enemy.GetAutoAttackRange())
                        enemySafeScore += 80;
                    enemySafeScore += enemy.Distance(Player.Instance) / 20;
                }
                if (enemy.IsMelee)
                {
                    if (pos.Distance(enemy) < enemy.GetAutoAttackRange())
                        enemySafeScore += 1000;
                    enemySafeScore += enemy.Distance(Player.Instance) / 5;
                }
                if (enemy.TotalShieldMaxHealth() < Player.Instance.GetAutoAttackDamage(enemy, true))
                {
                    enemySafeScore = 0;
                }
                score += enemySafeScore;
            }
            if (pos.IsUnderTurret()) score += 200;
            return score;
        }