Ejemplo n.º 1
0
 private void ThinkSeek()
 {
     if (this.m_CurrentTarget == null)
     {
         return;
     }
     if (this.m_CurrentTarget is Ship)
     {
         this.m_GhostShip.SetShipTarget(this.m_CurrentTarget.ObjectID, (this.m_CurrentTarget as Ship).ShipSphere.center, true, 0);
     }
     else if (this.m_CurrentTarget is StellarBody)
     {
         this.m_GhostShip.SetShipTarget(this.m_CurrentTarget.ObjectID, Vector3.Zero, true, 0);
     }
     this.m_State = GhostShipAIStates.TRACK;
 }
Ejemplo n.º 2
0
        private void ThinkTrack()
        {
            bool flag = false;

            if (this.m_CurrentTarget == null)
            {
                this.m_State = GhostShipAIStates.SEEK;
            }
            else if (this.m_CurrentTarget is Ship)
            {
                Ship    currentTarget = this.m_CurrentTarget as Ship;
                float   num1          = (float)((double)currentTarget.ShipSphere.radius + (double)this.m_GhostShip.ShipSphere.radius + 500.0);
                Vector3 look          = currentTarget.Position - this.m_GhostShip.Position;
                double  num2          = (double)look.Normalize();
                this.m_GhostShip.Maneuvering.PostAddGoal(currentTarget.Position - look * num1, look);
                if (currentTarget.IsDestroyed)
                {
                    flag = true;
                }
            }
            else if (this.m_CurrentTarget is StellarBody)
            {
                StellarBody currentTarget = this.m_CurrentTarget as StellarBody;
                float       num1          = (float)((double)currentTarget.Parameters.Radius + (double)this.m_GhostShip.ShipSphere.radius + 750.0);
                Vector3     look          = currentTarget.Parameters.Position - this.m_GhostShip.Position;
                double      num2          = (double)look.Normalize();
                this.m_GhostShip.Maneuvering.PostAddGoal(currentTarget.Parameters.Position - look * num1, look);
                if ((this.m_CurrentTarget as StellarBody).Population <= 0.0)
                {
                    flag = true;
                }
            }
            if (!flag)
            {
                return;
            }
            this.m_CurrentTarget = (IGameObject)null;
            this.m_State         = GhostShipAIStates.FLEE;
        }
Ejemplo n.º 3
0
 public override void Initialize()
 {
     this.m_CurrentTarget = (IGameObject)null;
     this.m_State         = GhostShipAIStates.SEEK;
 }