private void SelectMostPushedLane() { Obj_HQ nMyNexus = ObjectManager.Get <Obj_HQ>().First(hq => hq.IsEnemy); Obj_AI_Minion andrzej = ObjectManager.Get <Obj_AI_Minion>() .Where(min => min.Name.Contains("Minion") && min.IsAlly && min.Health > 0) .OrderBy(min => min.Distance(nMyNexus)) .First(); status = "selected most pushed lane: " + andrzej.GetLane(); Obj_AI_Base ally = ObjectManager.Get <Obj_AI_Turret>() .Where(tur => tur.IsAlly && tur.Health > 0 && tur.GetLane() == andrzej.GetLane()) .OrderBy(tur => tur.Distance(andrzej)) .FirstOrDefault(); if (ally == null) { Console.WriteLine("ally 1"); ally = ObjectManager.Get <Obj_AI_Turret>() .Where(tur => tur.Health > 0 && tur.IsAlly && tur.GetLane() == Lane.HQ) .OrderBy(tur => tur.Distance(andrzej)) .FirstOrDefault(); } if (ally == null) { Console.WriteLine("ally 2"); ally = ObjectManager.Get <Obj_AI_Turret>().FirstOrDefault(tur => tur.IsAlly && tur.GetLane() == Lane.Spawn); } Obj_AI_Base enemy = ObjectManager.Get <Obj_AI_Turret>() .Where(tur => tur.IsEnemy && tur.Health > 0 && tur.GetLane() == andrzej.GetLane()) .OrderBy(tur => tur.Distance(andrzej)) .FirstOrDefault(); if (enemy == null) { Console.WriteLine("enemy 1"); enemy = ObjectManager.Get <Obj_AI_Turret>() .Where(tur => tur.Health > 0 && tur.IsEnemy && tur.GetLane() == Lane.HQ) .OrderBy(tur => tur.Distance(andrzej)) .FirstOrDefault(); } if (enemy == null) { Console.WriteLine("enemy 2"); enemy = ObjectManager.Get <Obj_AI_Turret>().FirstOrDefault(tur => tur.IsEnemy && tur.GetLane() == Lane.Spawn); } currentLogic.pushLogic.Reset(ally, enemy, andrzej.GetLane()); }
private void Obj_AI_Minion_OnCreate(GameObject sender, EventArgs args) { if (!IsActive()) { return; } Obj_AI_Minion minion = sender as Obj_AI_Minion; if (minion != null) { if (minionPower.ContainsKey(minion.BaseSkinName)) { minions.Add(minion, new MinionStruct() { Lane = minion.GetLane(), Power = minionPower[minion.BaseSkinName] }); } } }