Exemple #1
0
        public override void Render()
        {
            if (!GameController.InGame)
            {
                return;
            }
            var actor           = GameController.Player.GetComponent <Actor>();
            var deployedObjects = actor.DeployedObjects.Where(x => x.Entity != null && x.Entity.Path.Contains("Metadata/MiscellaneousObjects/RemoteMine")).ToList();

            var realRange = Settings.DetonateDist.Value;
            var mineSkill = actor.ActorSkills.Find(x => x.Name.ToLower().Contains("mine"));

            if (mineSkill != null)
            {
                if (mineSkill.Stats.TryGetValue(GameStat.TotalSkillAreaOfEffectPctIncludingFinal, out var areaPct))
                {
                    realRange += realRange * areaPct / 100f;
                    Settings.CurrentAreaPct.Value = realRange;
                }
                else
                {
                    Settings.CurrentAreaPct.Value = 100;
                }
            }
            else
            {
                Settings.CurrentAreaPct.Value = 0;
            }


            if (deployedObjects.Count == 0)
            {
                return;
            }

            var playerPos = GameController.Player.GridPos;

            var nearMonsters = GameController.Entities.Where(
                x => x != null &&
                x.HasComponent <Monster>() &&
                x.IsHostile &&
                x.IsAlive &&
                !x.Path.StartsWith("Metadata/Monsters/LeagueBetrayal/BetrayalTaserNet") &&
                !x.Path.StartsWith("Metadata/Monsters/LeagueBetrayal/BetrayalUpgrades/UnholyRelic") &&
                !x.Path.StartsWith("Metadata/Monsters/LeagueBetrayal/BetrayalUpgrades/BetrayalDaemonSummonUnholyRelic") &&
                x.GetComponent <Life>() != null &&
                !x.GetComponent <Life>().HasBuff("hidden_monster") &&
                !x.GetComponent <Life>().HasBuff("avarius_statue_buff") &&
                !x.GetComponent <Life>().HasBuff("hidden_monster_disable_minions") &&
                x.GetComponent <Actor>() != null &&
                FilterNullAction(x.GetComponent <Actor>()) &&
                x.GetComponent <Actor>().CurrentAction?.Skill?.Name != "AtziriSummonDemons" &&
                x.GetComponent <Actor>().CurrentAction?.Skill?.Id != 728 &&
                Vector2.Distance(playerPos, x.GridPos) < realRange).ToList();

            if (nearMonsters.Count == 0)
            {
                return;
            }

            Settings.TriggerReason = "Path: " + nearMonsters[0].Path;

            if (Settings.Debug.Value)
            {
                LogMessage($"Ents: {nearMonsters.Count}. Last: {nearMonsters[0].Path}", 2);
            }

            if ((DateTime.Now - LastDetonTime).TotalMilliseconds > Settings.DetonateDelay.Value)
            {
                if (deployedObjects.Any(x => x.Entity != null && x.Entity.IsValid /*&& x.Entity.GetComponent<Stats>().StatDictionary[GameStat.CannotDie] == 0*/))
                {
                    if (!(Keyboard.IsKeyDown(Keyboard.VK_RBUTTON) && Settings.CheckMouseKey.Value))
                    {
                        LastDetonTime = DateTime.Now;
                        Keyboard.KeyPress(Settings.DetonateKey.Value);
                    }
                }
            }
        }