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;
        }
        private void ThinkActivateBoardingPods()
        {
            bool flag = true;

            foreach (GameObject possessorBoardingPod in this.m_PossessorBoardingPods)
            {
                if (possessorBoardingPod.ObjectStatus != GameObjectStatus.Ready)
                {
                    flag = false;
                }
            }
            if (!flag)
            {
                return;
            }
            foreach (Ship possessorBoardingPod in this.m_PossessorBoardingPods)
            {
                BattleRiderSquad squad = this.m_Disc.AssignRiderToSquad(possessorBoardingPod as BattleRiderShip, possessorBoardingPod.RiderIndex);
                if (squad != null)
                {
                    possessorBoardingPod.ParentID = this.m_Disc.ObjectID;
                    possessorBoardingPod.PostSetBattleRiderParent(squad.ObjectID);
                    possessorBoardingPod.Player = this.m_Disc.Player;
                }
                possessorBoardingPod.Active = true;
                this.m_Game.CurrentState.AddGameObject((IGameObject)possessorBoardingPod, false);
            }
            this.m_State = VonNeumannDiscStates.SEEK;
        }
 private void ThinkTrack()
 {
     if (this.m_Target == null)
     {
         this.m_State = VonNeumannDiscStates.SEEK;
         if (this.m_Disc.CombatStance != CombatStance.NO_STANCE)
         {
             this.m_Disc.SetCombatStance(CombatStance.NO_STANCE);
         }
         this.m_Disc.Maneuvering.PostSetProp("SetStanceTarget", (object)0, (object)0.0f);
     }
     else
     {
         if (this.m_DiscType != VonNeumannDiscTypes.POSSESSOR || !(this.m_Target is Ship))
         {
             return;
         }
         Ship target = this.m_Target as Ship;
         if (this.m_PodsLaunched || (double)(this.m_Disc.Position - target.Position).LengthSquared >= 2250000.0)
         {
             return;
         }
         this.m_State = VonNeumannDiscStates.LAUNCHPODS;
     }
 }
        private void ThinkSeek()
        {
            if (this.m_Target == null)
            {
                return;
            }
            float num = VonNeumannDiscControl.DiscTypeIsAttacker(this.m_DiscType) ? Math.Max(100f, CombatAI.GetMinPointBlankWeaponRange(this.m_Disc, false)) : 400f;

            if (this.m_Disc.CombatStance != CombatStance.PURSUE)
            {
                this.m_Disc.SetCombatStance(CombatStance.PURSUE);
            }
            this.m_Disc.Maneuvering.PostSetProp("SetStanceTarget", (object)this.m_Target.ObjectID, (object)num);
            this.m_State = VonNeumannDiscStates.TRACK;
        }
        private void ThinkWaitForLaunch()
        {
            bool flag = true;

            foreach (Ship possessorBoardingPod in this.m_PossessorBoardingPods)
            {
                if (possessorBoardingPod.DockedWithParent)
                {
                    flag = false;
                }
            }
            if (!flag)
            {
                return;
            }
            this.m_PodsLaunched = true;
            this.m_State        = VonNeumannDiscStates.SEEK;
        }
        private void ThinkLaunchPods()
        {
            bool flag = true;

            foreach (Ship possessorBoardingPod in this.m_PossessorBoardingPods)
            {
                if (!possessorBoardingPod.DockedWithParent)
                {
                    flag = false;
                }
            }
            if (!flag)
            {
                return;
            }
            this.m_Disc.PostSetProp("LaunchBattleriders");
            this.m_State = VonNeumannDiscStates.WAITFORLAUNCH;
        }