Ejemplo n.º 1
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="GateCamping" /> class.
        /// </summary>
        public GateCamping()
        {
            EngageRules = new EngageRules(100000, true, true, false);

              Entities = new ObservableCollection<EntityViewModel>();
              GateCampingBotBusinessLogic = new GateCampingBotBusinessLogic(BotState.Idle, EngageRules);

              InitRefreshEntitiesTimer();
        }
        /// <summary>
        ///   Initializes a new instance of the <see cref="GateCampingBotBusinessLogic" /> class.
        /// </summary>
        /// <param name="state">The state.</param>
        /// <param name="engageRules"></param>
        public GateCampingBotBusinessLogic(BotState state, EngageRules engageRules)
        {
            CurrentBotState = state;
              EngageRules = engageRules;
              FrameActionScheduler = new FrameActionsScheduler(15);

              Entities = new ObservableCollection<EntityViewModel>();

              OneTimeSetup();
              AttachOnFrame();
        }
Ejemplo n.º 3
0
        /// <summary>
        ///   Does the tackle and returns the current valid engageable targets
        /// </summary>
        /// <param name="myMe">My me.</param>
        /// <param name="myEve">My eve.</param>
        /// <param name="entities">The entities.</param>
        /// <param name="engageRules">The engage rules.</param>
        public static void Engage(Character myMe, EVE.ISXEVE.EVE myEve,
                                  IEnumerable <EntityViewModel> entities, EngageRules engageRules)
        {
            IEnumerable <EntityViewModel> targettedNeuts = TargetNeuts(entities).ToList();

            //Tackle closest targetted neut
            EntityViewModel closestTargetedNeut = null;

            if (targettedNeuts.Any())
            {
                closestTargetedNeut = EntityHelper.FindClosestEntity(targettedNeuts);
            }

            if (closestTargetedNeut != null)
            {
                if (engageRules.GoBrawl ?? DefaultGoBrawl)
                {
                    closestTargetedNeut.Entity.MakeActiveTarget();
                    closestTargetedNeut.Entity.Orbit(500);
                }


                ActivateModules(myMe, myEve, engageRules);
            }
            else
            {
                var closestNeutNotTargetted = EntityHelper.FindClosestEntity(entities);

                if (closestNeutNotTargetted != null)
                {
                    ActivateModules(myMe, myEve, engageRules);

                    if (engageRules.GoBrawl ?? DefaultGoBrawl)
                    {
                        closestNeutNotTargetted.Entity.Approach();
                        myEve.Execute(ExecuteCommand.CmdAccelerate);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        ///   Activates the tackle modules.
        /// </summary>
        /// <param name="myMe">My me.</param>
        /// <param name="myEve">My eve.</param>
        /// <param name="engageRules"></param>
        public static void ActivateModules(Character myMe, EVE.ISXEVE.EVE myEve, EngageRules engageRules)
        {
            var modules = myMe.Ship.GetModules();

            foreach (var module in modules)
            {
                var mItem = module.ToItem;

                var name = mItem.Name.ToLower();

                if (name.Contains("sensor booster"))
                {
                    module.Activate();
                }
                else if (name.Contains("probe"))
                {
                    //skip
                }
                else if (name.Contains("booster"))
                {
                    if (engageRules.UseRepairer != null && engageRules.UseRepairer.Value)
                    {
                        module.Activate();
                    }
                }
                else if (name.Contains("repairer"))
                {
                    if (engageRules.UseRepairer != null && engageRules.UseRepairer.Value)
                    {
                        module.Activate();
                    }
                }
                else if (name.Contains("cloak"))
                {
                    module.Deactivate();
                }
                else if (name.Contains("cyno"))
                {
                    //skip
                }
                else if (name.Contains("bomb"))
                {
                    //skip
                }
                else if (name.Contains("microwarp"))
                {
                    if (engageRules.UsePropulsion ?? DefaultActivatePropulsion)
                    {
                        module.Activate();
                    }
                }
                else if (name.Contains("afterburner"))
                {
                    if (engageRules.UsePropulsion ?? DefaultActivatePropulsion)
                    {
                        module.Activate();
                    }
                }
                else
                {
                    module.Activate();
                }
            }

            //engage drones last because modules might improve their effectiveness
            var myDrones = myMe.GetActiveDrones().Select(x => x.ID).ToList();

            myEve.DronesEngageMyTarget(myDrones);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///   Finds the engageable targets.
        /// </summary>
        /// <param name="myMe">My me.</param>
        /// <param name="myEVE">My eve.</param>
        /// <param name="entities">The entities.</param>
        /// <param name="engageRules">The engage rules.</param>
        /// <returns></returns>
        public static IEnumerable <EntityViewModel> FindEngageableTargets(Character myMe,
                                                                          EVE.ISXEVE.EVE myEVE, IEnumerable <EntityViewModel> entities, EngageRules engageRules)
        {
            var allNeutrals = entities.Where(
                x =>
                x.Entity.IsValid &&
                x.EntityStandings <= 0 &&
                x.EntityDistanceTo <= (engageRules.MaxRange ?? DefaultEngageRange)
                );

            if (!allNeutrals.Any())
            {
                return(new List <EntityViewModel>());
            }

            //sort by capsule
            allNeutrals = allNeutrals.OrderBy(x => x.EntityGroup);

            var limitedTargets = allNeutrals.Take((int)myMe.MaxLockedTargets);

            return(limitedTargets);
        }
Ejemplo n.º 6
0
        /// <summary>
        ///   Activates the tackle modules.
        /// </summary>
        /// <param name="myMe">My me.</param>
        /// <param name="myEve">My eve.</param>
        /// <param name="engageRules"></param>
        public static void ActivateModules(Character myMe, EVE.ISXEVE.EVE myEve, EngageRules engageRules)
        {
            var modules = myMe.Ship.GetModules();

              foreach (var module in modules)
              {
            var mItem = module.ToItem;

            var name = mItem.Name.ToLower();

            if (name.Contains("sensor booster"))
            {
              module.Activate();
            }
            else if (name.Contains("probe"))
            {
              //skip
            }
            else if (name.Contains("booster"))
            {
              if (engageRules.UseRepairer != null && engageRules.UseRepairer.Value)
              {
            module.Activate();
              }
            }
            else if (name.Contains("repairer"))
            {
              if (engageRules.UseRepairer != null && engageRules.UseRepairer.Value)
              {
            module.Activate();
              }
            }
            else if (name.Contains("cloak"))
            {
              module.Deactivate();
            }
            else if (name.Contains("cyno"))
            {
              //skip
            }
            else if (name.Contains("bomb"))
            {
              //skip
            }
            else if (name.Contains("microwarp"))
            {
              if (engageRules.UsePropulsion ?? DefaultActivatePropulsion)
              {
            module.Activate();
              }
            }
            else if (name.Contains("afterburner"))
            {
              if (engageRules.UsePropulsion ?? DefaultActivatePropulsion)
              {
            module.Activate();
              }
            }
            else
            {
              module.Activate();
            }
              }

              //engage drones last because modules might improve their effectiveness
              var myDrones = myMe.GetActiveDrones().Select(x => x.ID).ToList();

              myEve.DronesEngageMyTarget(myDrones);
        }
Ejemplo n.º 7
0
        /// <summary>
        ///   Finds the engageable targets.
        /// </summary>
        /// <param name="myMe">My me.</param>
        /// <param name="myEVE">My eve.</param>
        /// <param name="entities">The entities.</param>
        /// <param name="engageRules">The engage rules.</param>
        /// <returns></returns>
        public static IEnumerable<EntityViewModel> FindEngageableTargets(Character myMe,
      EVE.ISXEVE.EVE myEVE, IEnumerable<EntityViewModel> entities, EngageRules engageRules)
        {
            var allNeutrals = entities.Where(
            x =>
              x.Entity.IsValid &&
              x.EntityStandings <= 0 &&
              x.EntityDistanceTo <= (engageRules.MaxRange ?? DefaultEngageRange)
            );

              if (!allNeutrals.Any())
              {
            return new List<EntityViewModel>();
              }

              //sort by capsule
              allNeutrals = allNeutrals.OrderBy(x => x.EntityGroup);

              var limitedTargets = allNeutrals.Take((int) myMe.MaxLockedTargets);

              return limitedTargets;
        }
Ejemplo n.º 8
0
        /// <summary>
        ///   Does the tackle and returns the current valid engageable targets
        /// </summary>
        /// <param name="myMe">My me.</param>
        /// <param name="myEve">My eve.</param>
        /// <param name="entities">The entities.</param>
        /// <param name="engageRules">The engage rules.</param>
        public static void Engage(Character myMe, EVE.ISXEVE.EVE myEve,
      IEnumerable<EntityViewModel> entities, EngageRules engageRules)
        {
            IEnumerable<EntityViewModel> targettedNeuts = TargetNeuts(entities).ToList();

              //Tackle closest targetted neut
              EntityViewModel closestTargetedNeut = null;
              if (targettedNeuts.Any())
              {
            closestTargetedNeut = EntityHelper.FindClosestEntity(targettedNeuts);
              }

              if (closestTargetedNeut != null)
              {
            if (engageRules.GoBrawl ?? DefaultGoBrawl)
            {
              closestTargetedNeut.Entity.MakeActiveTarget();
              closestTargetedNeut.Entity.Orbit(500);
            }

            ActivateModules(myMe, myEve, engageRules);
              }
              else
              {
            var closestNeutNotTargetted = EntityHelper.FindClosestEntity(entities);

            if (closestNeutNotTargetted != null)
            {
              ActivateModules(myMe, myEve, engageRules);

              if (engageRules.GoBrawl ?? DefaultGoBrawl)
              {
            closestNeutNotTargetted.Entity.Approach();
            myEve.Execute(ExecuteCommand.CmdAccelerate);
              }
            }
              }
        }