Пример #1
0
 public void AddChild(CombatAIController child)
 {
     if (!(child is SwarmerAttackerControl))
     {
         return;
     }
     foreach (Ship loadingSwarmer in this.m_LoadingSwarmers)
     {
         if (loadingSwarmer == child.GetShip())
         {
             this.m_LoadingSwarmers.Remove(loadingSwarmer);
             this.m_LaunchingShips.Add(loadingSwarmer);
             this.m_SpawnedSwarmers.Add(child as SwarmerAttackerControl);
             break;
         }
     }
     foreach (Ship loadingGuardian in this.m_LoadingGuardians)
     {
         if (loadingGuardian == child.GetShip())
         {
             this.m_LoadingGuardians.Remove(loadingGuardian);
             this.m_LaunchingShips.Add(loadingGuardian);
             this.m_SpawnedGuardians.Add(child as SwarmerAttackerControl);
             break;
         }
     }
 }
Пример #2
0
        public override void Initialize()
        {
            this.m_Target                = (IGameObject)null;
            this.m_ParentBerserker       = (VonNeumannNeoBerserkerControl)null;
            this.m_State                 = VonNeumannDiscStates.SEEK;
            this.m_PodsLaunched          = false;
            this.m_Discs                 = new List <VonNeumannDiscControl>();
            this.m_PossessorBoardingPods = new List <Ship>();
            this.m_UpdateDelay           = 0;
            if (this.m_DiscType != VonNeumannDiscTypes.POSSESSOR)
            {
                return;
            }
            Matrix rotationYpr = Matrix.CreateRotationYPR(this.m_Disc.Maneuvering.Rotation);

            rotationYpr.Position = this.m_Disc.Maneuvering.Position;
            int num = this.m_Disc.BattleRiderMounts.Count <BattleRiderMount>();

            for (int index = 0; index < num; ++index)
            {
                Ship newShip = CombatAIController.CreateNewShip(this.m_Game.Game, rotationYpr, VonNeumann.StaticShipDesigns[VonNeumann.VonNeumannShipDesigns.BoardingPod].DesignId, this.m_Disc.ObjectID, this.m_Disc.InputID, this.m_Disc.Player.ObjectID);
                if (newShip != null)
                {
                    this.m_PossessorBoardingPods.Add(newShip);
                }
            }
            this.m_State = VonNeumannDiscStates.ACTIVATEBOARDINGPODS;
        }
Пример #3
0
        private void ThinkEmitChild()
        {
            VonNeumannChildSpawnLocations childSpawnLocations = this.m_SpawnLocations.FirstOrDefault <VonNeumannChildSpawnLocations>((Func <VonNeumannChildSpawnLocations, bool>)(x => x.CanSpawnAtLocation()));

            if (childSpawnLocations == null)
            {
                return;
            }
            Matrix rotationYpr = Matrix.CreateRotationYPR(this.m_VonNeumannMom.Maneuvering.Rotation);

            rotationYpr.Position = childSpawnLocations.GetSpawnLocation();
            Ship newShip = CombatAIController.CreateNewShip(this.m_Game.Game, rotationYpr, VonNeumann.StaticShipDesigns[VonNeumann.VonNeumannShipDesigns.CollectorProbe].DesignId, 0, this.m_VonNeumannMom.InputID, this.m_VonNeumannMom.Player.ObjectID);

            newShip.Maneuvering.RetreatDestination = this.m_VonNeumannMom.Maneuvering.RetreatDestination;
            if (newShip == null)
            {
                this.m_State = VonNeumannMomStates.COLLECT;
            }
            else
            {
                childSpawnLocations.SpawnAtLocation(newShip);
                this.m_RUStore -= this.m_Game.AssetDatabase.GlobalVonNeumannData.ChildRUCost;
                this.m_State    = VonNeumannMomStates.INTEGRATECHILD;
                this.m_LoadingChilds.Add(newShip);
            }
        }
Пример #4
0
 public void AddChild(CombatAIController child)
 {
     if (child is VonNeumannChildControl)
     {
         foreach (Ship loadingChild in this.m_LoadingChilds)
         {
             if (loadingChild == child.GetShip())
             {
                 this.m_LoadingChilds.Remove(loadingChild);
                 break;
             }
         }
         this.m_SpawnedChilds.Add(child as VonNeumannChildControl);
     }
     else if (child is VonNeumannMomControl)
     {
         if (child.GetShip() == this.m_LoadingMom)
         {
             this.m_LoadingMom = (Ship)null;
         }
         this.m_SpawnedMoms.Add(child as VonNeumannMomControl);
     }
     switch (this.m_State)
     {
     case VonNeumannMomStates.INITFLEE:
     case VonNeumannMomStates.FLEE:
     case VonNeumannMomStates.VANISH:
         child.ForceFlee();
         break;
     }
 }
Пример #5
0
        private void SpawnSmallerMeteors()
        {
            if (!this.m_CanSubDivide || this.m_Meteor.InstantlyKilled)
            {
                return;
            }
            this.m_CanSubDivide = false;
            Random     random             = new Random();
            Vector3    forward            = this.m_Target != null ? this.m_Target.Parameters.Position - this.m_Meteor.Maneuvering.Position : this.m_TargetPosition - this.m_Meteor.Maneuvering.Position;
            double     num1               = (double)forward.Normalize();
            Matrix     world              = Matrix.CreateWorld(this.m_Meteor.Maneuvering.Position, forward, Vector3.UnitY);
            Sphere     shipSphere         = this.m_Meteor.ShipSphere;
            int        numBreakoffMeteors = this.m_Game.AssetDatabase.GlobalMeteorShowerData.NumBreakoffMeteors;
            float      radians            = MathHelper.DegreesToRadians(30f);
            List <int> subMeteorDesignIds = MeteorCombatAIControl.GetAvailableSubMeteorDesignIDs(this.m_Game, this.m_Size);

            if (subMeteorDesignIds.Count <= 0)
            {
                return;
            }
            for (int index = 0; index < numBreakoffMeteors; ++index)
            {
                Vector3 vector3 = new Vector3();
                vector3.X = (random.CoinToss(0.5) ? -1f : 1f) * random.NextInclusive(10f, 85f);
                vector3.Y = (random.CoinToss(0.5) ? -1f : 1f) * random.NextInclusive(10f, 85f);
                vector3.Z = (random.CoinToss(0.5) ? -1f : 1f) * random.NextInclusive(10f, 85f);
                double num2 = (double)vector3.Normalize();
                vector3 *= random.NextInclusive(shipSphere.radius * 0.1f, shipSphere.radius);
                Matrix worldMat = Matrix.PolarDeviation(random, radians);
                worldMat.Position = vector3;
                worldMat         *= world;
                int designId = subMeteorDesignIds[random.NextInclusive(0, subMeteorDesignIds.Count - 1)];
                this.m_Game.CurrentState.AddGameObject((IGameObject)CombatAIController.CreateNewShip(this.m_Game.Game, worldMat, designId, 0, this.m_Meteor.InputID, this.m_Meteor.Player.ObjectID), true);
            }
        }
Пример #6
0
        private void SpawnMaxFighters()
        {
            if (this.m_Game.Game.ScriptModules.Locust == null || this.m_MaxNumFightersTotal <= 0)
            {
                return;
            }
            int    num         = Math.Min(Math.Max(Math.Min(this.m_MaxNumFighters, this.m_MaxNumFightersTotal) - (this.m_LoadingFighters.Count + this.m_SpawnedFighters.Count), 0), Math.Max(this.m_LocustNest.BattleRiderMounts.Count <BattleRiderMount>() - this.m_LoadingFighters.Count, 0));
            Matrix rotationYpr = Matrix.CreateRotationYPR(this.m_LocustNest.Maneuvering.Rotation);

            rotationYpr.Position = this.m_LocustNest.Maneuvering.Position;
            int needleShipDesignId = this.m_Game.Game.ScriptModules.Locust.NeedleShipDesignId;

            for (int index = 0; index < num; ++index)
            {
                Ship newShip = CombatAIController.CreateNewShip(this.m_Game.Game, rotationYpr, needleShipDesignId, this.m_LocustNest.ObjectID, this.m_LocustNest.InputID, this.m_LocustNest.Player.ObjectID);
                if (newShip != null)
                {
                    this.m_LoadingFighters.Add(newShip);
                    --this.m_MaxNumFightersTotal;
                }
            }
            if (this.m_LoadingFighters.Count <= 0)
            {
                return;
            }
            this.m_State = LocustNestStates.INTEGRATEFIGHTER;
        }
Пример #7
0
        public override void Update(List <IGameObject> objs)
        {
            if (!App.m_bAI_Enabled || this.m_bIsHumanPlayerControlled)
            {
                return;
            }
            List <IGameObject> gameObjectList = new List <IGameObject>();

            foreach (IGameObject gameObject in objs)
            {
                if (gameObject is Ship)
                {
                    Ship ship = gameObject as Ship;
                    gameObjectList.Add((IGameObject)ship);
                    if (ship.Player == this.m_Player && !this.m_CombatAIControls.Any <CombatAIController>((Func <CombatAIController, bool>)(x => x.GetShip() == ship)))
                    {
                        CombatAIController combatAiController = this.CreateNewCombatAIController(ship);
                        if (combatAiController != null)
                        {
                            combatAiController.Initialize();
                            this.m_CombatAIControls.Add(combatAiController);
                        }
                    }
                }
                else if (gameObject is StellarBody)
                {
                    gameObjectList.Add(gameObject);
                }
                else if (gameObject is StarModel)
                {
                    gameObjectList.Add(gameObject);
                }
            }
            foreach (CombatAIController combatAiControl in this.m_CombatAIControls)
            {
                if (combatAiControl.NeedsAParent())
                {
                    combatAiControl.FindParent((IEnumerable <CombatAIController>) this.m_CombatAIControls);
                }
                if (combatAiControl.GetShip().Active&& Ship.IsActiveShip(combatAiControl.GetShip()) || combatAiControl is MeteorCombatAIControl)
                {
                    if (combatAiControl.RequestingNewTarget())
                    {
                        combatAiControl.FindNewTarget((IEnumerable <IGameObject>)gameObjectList);
                    }
                    if (combatAiControl.GetTarget() != null && combatAiControl.GetTarget() is StellarBody && !this.PlanetsAttackedByNPC.Contains(combatAiControl.GetTarget().ObjectID))
                    {
                        this.PlanetsAttackedByNPC.Add(combatAiControl.GetTarget().ObjectID);
                    }
                    combatAiControl.OnThink();
                }
            }
        }
Пример #8
0
 public virtual void AddChild(CombatAIController child)
 {
     if (!(child is VonNeumannDiscControl))
     {
         return;
     }
     foreach (Ship loadingDisc in this.m_LoadingDiscs)
     {
         if (loadingDisc == child.GetShip())
         {
             loadingDisc.Active = this.m_DiscsActivated;
             this.m_LoadingDiscs.Remove(loadingDisc);
             break;
         }
     }
     this.m_Discs.Add(child as VonNeumannDiscControl);
 }
Пример #9
0
 public void AddCrow(CombatAIController crow)
 {
     if (!(crow is MorrigiCrowControl))
     {
         return;
     }
     foreach (Ship loadingCrow in this.m_LoadingCrows)
     {
         if (loadingCrow == crow.GetShip())
         {
             this.m_LoadingCrows.Remove(loadingCrow);
             this.m_LaunchingCrows.Add(loadingCrow);
             break;
         }
     }
     this.m_SpawnedCrows.Add(crow as MorrigiCrowControl);
 }
Пример #10
0
 public override void AddChild(CombatAIController child)
 {
     base.AddChild(child);
     if (!(child is VonNeumannPyramidControl))
     {
         return;
     }
     foreach (Ship loadingPyramid in this.m_LoadingPyramids)
     {
         if (loadingPyramid == child.GetShip())
         {
             this.m_LoadingPyramids.Remove(loadingPyramid);
             break;
         }
     }
     this.m_Pyramids.Add(child as VonNeumannPyramidControl);
 }
Пример #11
0
        private void ThinkEmitMom()
        {
            this.m_RUStore -= this.m_Game.AssetDatabase.GlobalVonNeumannData.MomRUCost;
            Matrix rotationYpr = Matrix.CreateRotationYPR(this.m_VonNeumannMom.Maneuvering.Rotation);

            rotationYpr.Position = this.m_VonNeumannMom.Maneuvering.Position + rotationYpr.Forward * 500f;
            Ship newShip = CombatAIController.CreateNewShip(this.m_Game.Game, rotationYpr, VonNeumann.StaticShipDesigns[VonNeumann.VonNeumannShipDesigns.CollectorMothership].DesignId, 0, this.m_VonNeumannMom.InputID, this.m_VonNeumannMom.Player.ObjectID);

            if (newShip == null)
            {
                this.m_State = VonNeumannMomStates.COLLECT;
            }
            else
            {
                this.m_RUStore   -= this.m_Game.AssetDatabase.GlobalVonNeumannData.ChildRUCost;
                this.m_State      = VonNeumannMomStates.INTEGRATEMOM;
                this.m_LoadingMom = newShip;
            }
        }
Пример #12
0
 public void AddFighter(CombatAIController fighter)
 {
     if (fighter is LocustFighterControl)
     {
         foreach (Ship loadingFighter in this.m_LoadingFighters)
         {
             if (loadingFighter == fighter.GetShip())
             {
                 this.m_LoadingFighters.Remove(loadingFighter);
                 this.m_LaunchingFighters.Add(loadingFighter);
                 break;
             }
         }
         this.m_SpawnedFighters.Add(fighter as LocustFighterControl);
     }
     if (this.m_LoadingFighters.Count != 0)
     {
         return;
     }
     this.m_State = LocustNestStates.WAITFORDOCKED;
 }
Пример #13
0
        public override void Initialize()
        {
            base.Initialize();
            this.m_FormationInitialized = false;
            this.m_LoadingPyramids      = new List <Ship>();
            this.m_Pyramids             = new List <VonNeumannPyramidControl>();
            Matrix rotationYpr = Matrix.CreateRotationYPR(this.m_VonNeumannBerserker.Maneuvering.Rotation);

            rotationYpr.Position = this.m_VonNeumannBerserker.Maneuvering.Position;
            int designId = VonNeumann.StaticShipDesigns[VonNeumann.VonNeumannShipDesigns.Pyramid].DesignId;

            for (int index = 0; index < 14; ++index)
            {
                Ship newShip = CombatAIController.CreateNewShip(this.m_Game.Game, rotationYpr, designId, this.m_VonNeumannBerserker.ObjectID, this.m_VonNeumannBerserker.InputID, this.m_VonNeumannBerserker.Player.ObjectID);
                if (newShip != null)
                {
                    this.m_LoadingPyramids.Add(newShip);
                }
            }
            this.m_PyramidsLaunched = false;
            this.m_State            = VonNeumannBerserkerStates.INTEGRATECHILDS;
        }
Пример #14
0
        public override void Initialize()
        {
            this.m_LoadingDiscs   = new List <Ship>();
            this.m_Discs          = new List <VonNeumannDiscControl>();
            this.m_DiscsActivated = false;
            Matrix rotationYpr = Matrix.CreateRotationYPR(this.m_VonNeumannBerserker.Maneuvering.Rotation);

            rotationYpr.Position = this.m_VonNeumannBerserker.Maneuvering.Position;
            float radians = MathHelper.DegreesToRadians(36f);

            for (int index = 0; index < 10; ++index)
            {
                Matrix worldMat = Matrix.CreateRotationY((float)index * radians) * rotationYpr;
                worldMat.Position += worldMat.Forward * 500f;
                int  num     = 5 + index;
                Ship newShip = CombatAIController.CreateNewShip(this.m_Game.Game, worldMat, VonNeumann.StaticShipDesigns[(VonNeumann.VonNeumannShipDesigns)num].DesignId, this.m_VonNeumannBerserker.ObjectID, this.m_VonNeumannBerserker.InputID, this.m_VonNeumannBerserker.Player.ObjectID);
                if (newShip != null)
                {
                    this.m_LoadingDiscs.Add(newShip);
                }
            }
            this.m_State = VonNeumannBerserkerStates.INTEGRATECHILDS;
        }
Пример #15
0
        public override void Initialize()
        {
            this.m_VonNeumannSeekerPods = new List <Ship>();
            this.m_LoadingPods          = new List <Ship>();
            this.m_AvailableTargets     = new List <PlanetTarget>();
            this.m_CurrentTarget        = (StellarBody)null;
            this.m_State    = VonNeumannSeekerStates.SEEK;
            this.m_Vanished = false;
            Matrix rotationYpr = Matrix.CreateRotationYPR(this.m_VonNeumannSeeker.Maneuvering.Rotation);

            rotationYpr.Position = this.m_VonNeumannSeeker.Maneuvering.Position;
            int designId = VonNeumann.StaticShipDesigns[VonNeumann.VonNeumannShipDesigns.SeekerProbe].DesignId;

            for (int index = 0; index < 12; ++index)
            {
                Ship newShip = CombatAIController.CreateNewShip(this.m_Game.Game, rotationYpr, designId, this.m_VonNeumannSeeker.ObjectID, this.m_VonNeumannSeeker.InputID, this.m_VonNeumannSeeker.Player.ObjectID);
                if (newShip != null)
                {
                    this.m_LoadingPods.Add(newShip);
                    ++this.m_NumPodsRemain;
                }
            }
            this.m_State = VonNeumannSeekerStates.INTEGRATECHILD;
        }
Пример #16
0
        private void SpawnMaxSwarmerAttackers(Swarmers swarmers)
        {
            if (this.m_MaxToCreate <= 0)
            {
                return;
            }
            Matrix rotationYpr = Matrix.CreateRotationYPR(this.m_SwarmerSpawner.Maneuvering.Rotation);

            rotationYpr.Position = this.m_SwarmerSpawner.Maneuvering.Position;
            int num1 = Math.Max(this.m_SwarmerSpawner.BattleRiderMounts.Count <BattleRiderMount>() - (this.m_LoadingSwarmers.Count + this.m_LoadingGuardians.Count + this.m_LaunchingShips.Count), 0);

            if (num1 == 0)
            {
                return;
            }
            int val2_1 = Math.Max(this.m_MaxSwarmers - (this.m_LoadingSwarmers.Count + this.m_SpawnedSwarmers.Count), 0);
            int val2_2 = Math.Max(this.m_MaxGuardians - (this.m_LoadingGuardians.Count + this.m_SpawnedGuardians.Count), 0);

            if (val2_1 + val2_2 == 0)
            {
                return;
            }
            int num2 = Math.Min(num1 / 2, val2_1);
            int num3 = Math.Min(num1 - num2, val2_2);
            int num4 = Math.Min(num2 + Math.Max(num1 - (num2 + num3), 0), val2_1);
            int num5 = num4 + num3;

            for (int index = 0; index < num5; ++index)
            {
                int designId;
                if (num4 > 0 && (index % 2 == 0 || num3 == 0))
                {
                    designId = swarmers.SwarmerDesignID;
                    --num4;
                }
                else if (num3 > 0)
                {
                    designId = swarmers.GuardianDesignID;
                    --num3;
                }
                else
                {
                    break;
                }
                Ship newShip = CombatAIController.CreateNewShip(this.m_Game.Game, rotationYpr, designId, this.m_SwarmerSpawner.ObjectID, this.m_SwarmerSpawner.InputID, this.m_SwarmerSpawner.Player.ObjectID);
                if (newShip != null)
                {
                    if (designId == swarmers.GuardianDesignID)
                    {
                        this.m_LoadingGuardians.Add(newShip);
                    }
                    else
                    {
                        this.m_LoadingSwarmers.Add(newShip);
                    }
                    --this.m_MaxToCreate;
                }
                if (this.m_MaxToCreate <= 0)
                {
                    break;
                }
            }
            if (this.m_LoadingSwarmers.Count <= 0 && this.m_LoadingGuardians.Count <= 0)
            {
                return;
            }
            this.m_State = SwarmerSpawnerStates.INTEGRATESWARMER;
        }
Пример #17
0
        public override void Initialize()
        {
            this.m_LoadingMom              = (Ship)null;
            this.m_LoadingChilds           = new List <Ship>();
            this.m_SpawnedChilds           = new List <VonNeumannChildControl>();
            this.m_SpawnedMoms             = new List <VonNeumannMomControl>();
            this.m_SpawnLocations          = new List <VonNeumannChildSpawnLocations>();
            this.m_SpawnedDefensePlatforms = new List <Ship>();
            this.m_SpawnedEnemies          = new List <Ship>();
            this.m_State  = VonNeumannMomStates.COLLECT;
            this.m_Orders = VonNeumannOrders.COLLECT;
            this.m_NumChildrenToMaintain = 10;
            this.m_Vanished      = false;
            this.m_TryFindParent = true;
            this.m_VonNeumannID  = 0;
            VonNeumannInfo vonNeumannInfo = this.m_Game.GameDatabase.GetVonNeumannInfos().ToList <VonNeumannInfo>().FirstOrDefault <VonNeumannInfo>((Func <VonNeumannInfo, bool>)(x =>
            {
                int?fleetId1 = x.FleetId;
                int fleetId2 = this.m_FleetID;
                if (fleetId1.GetValueOrDefault() == fleetId2)
                {
                    return(fleetId1.HasValue);
                }
                return(false);
            }));

            if (vonNeumannInfo != null)
            {
                this.m_VonNeumannID = vonNeumannInfo.Id;
            }
            Matrix rotationYpr = Matrix.CreateRotationYPR(this.m_VonNeumannMom.Maneuvering.Rotation);

            rotationYpr.Position = this.m_VonNeumannMom.Maneuvering.Position + rotationYpr.Forward * 500f;
            Vector3 right               = rotationYpr.Right;
            int     designId            = VonNeumann.StaticShipDesigns[VonNeumann.VonNeumannShipDesigns.CollectorProbe].DesignId;
            int     childrenToMaintain1 = this.m_NumChildrenToMaintain;
            float   radians             = MathHelper.DegreesToRadians(360f / (float)childrenToMaintain1);
            float   num1 = radians * 0.5f;
            float   num2 = 1f;

            for (int index = 0; index < childrenToMaintain1; ++index)
            {
                float num3 = radians * (float)((index % childrenToMaintain1 + 1) / 2) * num2 + num1;
                this.m_SpawnLocations.Add(new VonNeumannChildSpawnLocations(this.m_VonNeumannMom, new Vector3((float)Math.Sin((double)num3), 0.0f, -(float)Math.Cos((double)num3)), 300f));
                num2 *= -1f;
            }
            int childrenToMaintain2 = this.m_Game.AssetDatabase.GlobalVonNeumannData.MinChildrenToMaintain;

            for (int index = 0; index < childrenToMaintain2; ++index)
            {
                VonNeumannChildSpawnLocations childSpawnLocations = this.m_SpawnLocations.FirstOrDefault <VonNeumannChildSpawnLocations>((Func <VonNeumannChildSpawnLocations, bool>)(x => x.CanSpawnAtLocation()));
                if (childSpawnLocations != null)
                {
                    Matrix worldMat = rotationYpr;
                    worldMat.Position = childSpawnLocations.GetSpawnLocation();
                    Ship newShip = CombatAIController.CreateNewShip(this.m_Game.Game, worldMat, designId, 0, this.m_VonNeumannMom.InputID, this.m_VonNeumannMom.Player.ObjectID);
                    if (newShip != null)
                    {
                        this.m_LoadingChilds.Add(newShip);
                        childSpawnLocations.SpawnAtLocation(newShip);
                    }
                }
            }
            if (this.m_LoadingChilds.Count <= 0)
            {
                return;
            }
            this.m_State = VonNeumannMomStates.INTEGRATECHILD;
        }
Пример #18
0
        private CombatAIController CreateNewCombatAIController(Ship ship)
        {
            CombatAIController combatAiController = (CombatAIController)null;

            switch (ship.CombatAI)
            {
            case SectionEnumerations.CombatAiType.TrapDrone:
                combatAiController = (CombatAIController) new ColonyTrapDroneControl(this.m_Game, ship, this, this.m_FleetID);
                break;

            case SectionEnumerations.CombatAiType.Swarmer:
                combatAiController = (CombatAIController) new SwarmerAttackerControl(this.m_Game, ship, SwarmerAttackerType.SWARMER);
                break;

            case SectionEnumerations.CombatAiType.SwarmerGuardian:
                combatAiController = (CombatAIController) new SwarmerAttackerControl(this.m_Game, ship, SwarmerAttackerType.GAURDIAN);
                break;

            case SectionEnumerations.CombatAiType.SwarmerHive:
                combatAiController = (CombatAIController) new SwarmerHiveControl(this.m_Game, ship, this.m_SystemID);
                break;

            case SectionEnumerations.CombatAiType.SwarmerQueenLarva:
                combatAiController = (CombatAIController) new SwarmerQueenLarvaControl(this.m_Game, ship);
                break;

            case SectionEnumerations.CombatAiType.SwarmerQueen:
                combatAiController = (CombatAIController) new SwarmerQueenControl(this.m_Game, ship, this.m_SystemID);
                break;

            case SectionEnumerations.CombatAiType.VonNeumannCollectorMotherShip:
                combatAiController = (CombatAIController) new VonNeumannMomControl(this.m_Game, ship, this.m_FleetID);
                break;

            case SectionEnumerations.CombatAiType.VonNeumannCollectorProbe:
                combatAiController = (CombatAIController) new VonNeumannChildControl(this.m_Game, ship);
                break;

            case SectionEnumerations.CombatAiType.VonNeumannSeekerMotherShip:
                combatAiController = (CombatAIController) new VonNeumannSeekerControl(this.m_Game, ship);
                break;

            case SectionEnumerations.CombatAiType.VonNeumannBerserkerMotherShip:
                combatAiController = (CombatAIController) new VonNeumannBerserkerControl(this.m_Game, ship);
                break;

            case SectionEnumerations.CombatAiType.VonNeumannNeoBerserker:
                combatAiController = (CombatAIController) new VonNeumannNeoBerserkerControl(this.m_Game, ship);
                break;

            case SectionEnumerations.CombatAiType.VonNeumannDisc:
                combatAiController = (CombatAIController) new VonNeumannDiscControl(this.m_Game, ship);
                break;

            case SectionEnumerations.CombatAiType.VonNeumannPyramid:
                combatAiController = (CombatAIController) new VonNeumannPyramidControl(this.m_Game, ship);
                break;

            case SectionEnumerations.CombatAiType.VonNeumannPlanetKiller:
                combatAiController = (CombatAIController) new VonNeumannPlanetKillerCombatAIControl(this.m_Game, ship, this.m_SystemID);
                break;

            case SectionEnumerations.CombatAiType.LocustMoon:
                combatAiController = (CombatAIController) new LocustMoonControl(this.m_Game, ship, this.m_FleetID);
                break;

            case SectionEnumerations.CombatAiType.LocustWorld:
                combatAiController = (CombatAIController) new LocustNestControl(this.m_Game, ship, this.m_FleetID);
                break;

            case SectionEnumerations.CombatAiType.LocustFighter:
                combatAiController = (CombatAIController) new LocustFighterControl(this.m_Game, ship);
                break;

            case SectionEnumerations.CombatAiType.SystemKiller:
                combatAiController = (CombatAIController) new SystemKillerCombatAIControl(this.m_Game, ship);
                break;

            case SectionEnumerations.CombatAiType.MorrigiRelic:
                combatAiController = (CombatAIController) new MorrigiRelicControl(this.m_Game, ship, this.m_FleetID);
                break;

            case SectionEnumerations.CombatAiType.MorrigiCrow:
                combatAiController = (CombatAIController) new MorrigiCrowControl(this.m_Game, ship);
                break;

            case SectionEnumerations.CombatAiType.Meteor:
                combatAiController = (CombatAIController) new MeteorCombatAIControl(this.m_Game, ship);
                break;

            case SectionEnumerations.CombatAiType.Comet:
                combatAiController = (CombatAIController) new CometCombatAIControl(this.m_Game, ship);
                break;

            case SectionEnumerations.CombatAiType.Specter:
                combatAiController = (CombatAIController) new SpecterCombatAIControl(this.m_Game, ship);
                break;

            case SectionEnumerations.CombatAiType.Gardener:
                combatAiController = (CombatAIController) new GardenerCombatAIControl(this.m_Game, ship);
                break;

            case SectionEnumerations.CombatAiType.Protean:
                combatAiController = (CombatAIController) new ProteanCombatAIControl(this.m_Game, ship);
                break;

            case SectionEnumerations.CombatAiType.CommandMonitor:
                combatAiController = (CombatAIController) new CommandMonitorCombatAIControl(this.m_Game, ship, this.m_Game.GameDatabase.GetEncounterIDAtSystem(EasterEgg.EE_ASTEROID_MONITOR, this.m_SystemID));
                break;

            case SectionEnumerations.CombatAiType.NormalMonitor:
                combatAiController = (CombatAIController) new NormalMonitorCombatAIControl(this.m_Game, ship);
                break;

            case SectionEnumerations.CombatAiType.GhostShip:
                combatAiController = (CombatAIController) new GhostShipCombatAIControl(this.m_Game, ship);
                break;
            }
            return(combatAiController);
        }