Esempio n. 1
0
    public void SelectTargetingStyle()
    {
        switch (targetingType)
        {
        case AI_TargetingType.StraightAhead:
            targeting = shootStraight;
            break;

        case AI_TargetingType.AimAtPlayer:
            targeting = shootAtPlayer;
            break;

        case AI_TargetingType.Peaceful:
            targeting = peacefulOne;
            break;

        case AI_TargetingType.PlayerInSight:
            targeting = playerInSight;
            break;

        case AI_TargetingType.JumpAttack:
            targeting = jumpAttack;
            break;
        }

        targeting.Initialize(mainTransform, weaponTransform, animator);
    }
        public DetectorPart(int detectionWidth, int detectionHeight, Type type, ITargeting parent, IDs id = IDs.DEFAULT) : base(id)
        {
            RotRectangle temp = BoundBox;

            BoundBox        = new RotRectangle(new Rectangle((int)Position.X, (int)Position.Y, detectionWidth, detectionHeight), angle);
            BoundBox.Origin = temp.Origin;
            this.parent     = parent;
            this.type       = type;
        }
Esempio n. 3
0
 public void Init(Avatar owner)
 {
     this.owner = owner;
     if (photonView.isMine)
     {
         GameObject targetingGO = Instantiate(Resources.Load <GameObject>(ResourcePaths.WeaponTargeting));
         targetingGO.transform.SetParent(transform, false);
         targeting = targetingGO.GetComponent <CurvedTargeting>();
     }
     else
     {
         targeting = new NoTargeting();
     }
 }
Esempio n. 4
0
        public void TargetingTestInitialize()
        {
            _logging = new Mock <ILogging>();
            _meCache = new Mock <IMeCache>();
            _maxRuntimeConfiguration = new Mock <IMaxRuntimeConfiguration>();
            _ship            = new Mock <IShip>();
            _drones          = new Mock <IDrones>();
            _alerts          = new Mock <IAlerts>();
            _targetQueue     = new Mock <ITargetQueue>();
            _entityPopulator = new Mock <IEntityProvider>();
            _moduleManager   = new Mock <IModuleManager>();
            _movement        = new Mock <IMovement>();

            _targeting = new Targeting(_logging.Object, _maxRuntimeConfiguration.Object, _meCache.Object, _ship.Object, _drones.Object, _alerts.Object,
                                       _moduleManager.Object, _targetQueue.Object, _entityPopulator.Object, _movement.Object);
        }
Esempio n. 5
0
        public NonOffensive(IMeCache meCache, IMiningConfiguration miningConfiguration, IDefensiveConfiguration defensiveConfiguration, IEntityProvider entityProvider,
                            ITargetQueue targetQueue, IShip ship, IDrones drones, ITargeting targeting, IMovement movement)
        {
            _meCache                = meCache;
            _miningConfiguration    = miningConfiguration;
            _defensiveConfiguration = defensiveConfiguration;
            _entityProvider         = entityProvider;
            _targetQueue            = targetQueue;
            _ship      = ship;
            _drones    = drones;
            _targeting = targeting;
            _movement  = movement;

            ModuleManager.ModulesToPulse.Add(this);
            PulseFrequency = 1;
            ModuleName     = "NonOffensive";

            _randomWait.AddWait(new KeyValuePair <int, int>(16, 30), 1);
            _randomWait.AddWait(new KeyValuePair <int, int>(6, 15), 3);
            _randomWait.AddWait(new KeyValuePair <int, int>(3, 5), 6);
            _randomWait.AddWait(new KeyValuePair <int, int>(1, 2), 10);
        }
Esempio n. 6
0
        public override bool Initialize()
        {
            IsCleanedUpOutOfFrame = false;

            _isxeveProvider    = new IsxeveProvider();
            _eveWindowProvider = new EveWindowProvider();

            #region Core object construction
            //Background stuff
            Logging     = new Logging();
            LogCallback = LogIsxeveMessage;
            Tracing.AddCallback(LogCallback);

            _mathUtility        = new MathUtility();
            Statistics          = new Statistics();
            EventCommunications = new EventCommunications(Logging);
            FileManager         = new FileManager();

            //moduleManager and BehaviorManager
            ModuleManager = new ModuleManager(_isxeveProvider, _eveWindowProvider);

            //Me cache. Contains the other caches.
            MeCache = new MeCache(_isxeveProvider, _eveWindowProvider);

            //ConfigurationManager
            Config = new Configuration();
            ConfigurationManager = new ConfigurationManager(Config, MeCache);

            Ship = new Ship(_isxeveProvider, _eveWindowProvider, MeCache, MeCache.Ship, Config.CargoConfig, Statistics, Config.MovementConfig);

            //Entity Populator object
            EntityProvider = new EntityProvider(_isxeveProvider);

            //Other Cache and Data classes
            MissionCache = new MissionCache(_isxeveProvider, _eveWindowProvider);
            AgentCache   = new AgentCache(FileManager, MeCache, Config, _eveWindowProvider);

            BookMarkCache  = new BookMarkCache(MeCache, EntityProvider, Logging, _isxeveProvider);
            NpcBountyCache = new NpcBountyCache();
            //EVEDB modules
            PilotCache       = new PilotCache();
            AllianceCache    = new AllianceCache(FileManager);
            CorporationCache = new CorporationCache();
            MissionDatabase  = new MissionDatabase();
            PossibleEwarNpcs = new PossibleEwarNpcs();

            //Core Functionality Providers, not necessarily caches
            TargetQueue          = new TargetQueue(MeCache, EntityProvider, Config.MiningConfig, Config.MainConfig);
            JetCan               = new JettisonContainer(_eveWindowProvider);
            Social               = new Social(_isxeveProvider);
            Station              = new Station(_isxeveProvider, _eveWindowProvider);
            AsteroidBelts        = new AsteroidBelts(Config, MeCache, EntityProvider, BookMarkCache, Ship);
            Bookmarks            = new Bookmarks(MeCache, Station, Config, BookMarkCache, AsteroidBelts, _isxeveProvider);
            Drones               = new Drones(_isxeveProvider);
            Fleet                = new Fleet();
            Alerts               = new Alerts(Config, MeCache, Logging);
            _anomalyProvider     = new AnomalyProvider(MeCache.Ship);
            _anomalyClaimTracker = new AnomalyClaimTracker(Logging, EventCommunications, MeCache);
            _safespots           = new Safespots(MeCache, BookMarkCache, Config.MovementConfig, MeCache.ToEntity, EntityProvider, _isxeveProvider, Ship, Social, _mathUtility, Logging);

            Attackers = new Attackers(MeCache, Config, Ship, Drones, EntityProvider, Alerts, AsteroidBelts, PossibleEwarNpcs, TargetQueue, ModuleManager);
            #endregion

            #region ActionModule construction
            //Action classes
            Movement     = new Movement(_isxeveProvider, EntityProvider, MeCache, _anomalyProvider, TargetQueue, Ship, Drones);
            Targeting    = new Targeting(Logging, Config.MaxRuntimeConfig, MeCache, Ship, Drones, Alerts, ModuleManager, TargetQueue, EntityProvider, Movement);
            Offensive    = new Offensive(Logging, TargetQueue, EntityProvider);
            NonOffensive = new NonOffensive(MeCache, Config.MiningConfig, Config.DefenseConfig, EntityProvider, TargetQueue, Ship, Drones, Targeting, Movement);
            Defense      = new Defense(_isxeveProvider, EntityProvider, Ship, MeCache, Config.DefenseConfig, Social, Drones, Alerts, _safespots, Movement);
            #endregion

            #region Processor construction
            MissionProcessor = new MissionProcessor(_eveWindowProvider, Movement);
            #endregion

            #region BehaviorModule construction
            _moveToDropOffLocationPartialBehavior = new MoveToDropOffLocationPartialBehavior(Movement, EntityProvider, Config.CargoConfig, BookMarkCache, Bookmarks,
                                                                                             Config.MovementConfig, MeCache, _mathUtility, _isxeveProvider);
            _dropOffCargoPartialBehavior = new DropOffCargoPartialBehavior(_eveWindowProvider, Config.CargoConfig, Config.MainConfig, Config.MiningConfig,
                                                                           MeCache, Ship, Station, JetCan, EntityProvider, EventCommunications);

            //Behavior classes
            BehaviorManager = new BehaviorManager();
            Mining          = new Mining(Config.CargoConfig, Config.MainConfig, MeCache, Ship, EntityProvider,
                                         _safespots, Movement, Social, Config.MovementConfig, AsteroidBelts, _moveToDropOffLocationPartialBehavior, _dropOffCargoPartialBehavior, Config.MiningConfig,
                                         _isxeveProvider, BookMarkCache, TargetQueue);
            Hauler = new Hauler(_eveWindowProvider, Config.CargoConfig, Config.MainConfig, Config.MiningConfig, MeCache, Ship, Station, JetCan, EntityProvider, EventCommunications,
                                _safespots, Movement, BookMarkCache, _moveToDropOffLocationPartialBehavior);
            BoostCanOrca = new BoostCanOrca();
            BoostOrca    = new BoostOrca(BookMarkCache, Config.MiningConfig, Bookmarks, _safespots, Movement, Config.MainConfig, Ship, MeCache);
            Freighter    = new Freighter(_eveWindowProvider, Config.CargoConfig, Config.MainConfig,
                                         Config.MiningConfig, MeCache, Ship, Station, JetCan, EntityProvider, EventCommunications, _moveToDropOffLocationPartialBehavior, _dropOffCargoPartialBehavior, Movement);
            MissionRunner     = new MissionRunner(Config, MissionCache, AgentCache, _eveWindowProvider);
            JumpStabilityTest = new JumpStabilityTest();
            Ratting           = new Ratting(Social, MeCache, Bookmarks, Config.SalvageConfig, Config.RattingConfig, _anomalyProvider, EntityProvider, _anomalyClaimTracker, _safespots,
                                            Movement, Ship, AsteroidBelts, Config.MovementConfig, Alerts, TargetQueue, Attackers);
            #endregion

            //StealthBotUI Interop construction
            //SbUiCommunication = new SbUiCommunication();

#if DEBUG
            LavishScript.ExecuteCommand("ISXEVE:Debug_SetHighPerfLogging[1]");
#endif

            return(true);
        }