Exemple #1
0
 private void EnlargeHologram()
 {
     m_scale.X += MyHologramConstants.APPEAR_SPEED;
     if (m_scale.X >= 1)
     {
         m_scale         = Vector3.One;
         m_hologramState = HologramState.Activated;
     }
 }
Exemple #2
0
 private void ShrinkHologram()
 {
     m_scale.X -= MyHologramConstants.APPEAR_SPEED;
     if (m_scale.X <= MyMwcMathConstants.EPSILON_SQUARED)
     {
         m_scale         = Vector3.Zero;
         m_hologramState = HologramState.Deactivated;
         MarkForClose();
     }
 }
Exemple #3
0
        /// <summary>
        /// Prepares the hologram ship for display.
        /// </summary>
        private void ActivateHologram()
        {
            //this.Physics.Enabled = false;
            //this.Physics.LinearVelocity = Vector3.Zero;

            MyEntity owner = OwnerEntity;

            if (owner != null)
            {
                var ownerShipBuilder = (owner.GetObjectBuilder(false) as MyMwcObjectBuilder_SmallShip);
                Debug.Assert(ownerShipBuilder != null, "ownerShipBuilder != null");

                m_hologramBuilder.ShipType                = ownerShipBuilder.ShipType;
                m_hologramBuilder.ShipMaxHealth           = ownerShipBuilder.ShipMaxHealth;
                m_hologramBuilder.ShipHealthRatio         = ownerShipBuilder.ShipHealthRatio;
                m_hologramBuilder.ArmorHealth             = ownerShipBuilder.ArmorHealth;
                m_hologramBuilder.Oxygen                  = ownerShipBuilder.Oxygen;
                m_hologramBuilder.Fuel                    = ownerShipBuilder.Fuel;
                m_hologramBuilder.ReflectorLight          = ownerShipBuilder.ReflectorLight;
                m_hologramBuilder.ReflectorLongRange      = ownerShipBuilder.ReflectorLongRange;
                m_hologramBuilder.ReflectorShadowDistance = ownerShipBuilder.ReflectorShadowDistance;
                m_hologramBuilder.PositionAndOrientation  = ownerShipBuilder.PositionAndOrientation;
                m_hologramBuilder.Faction                 = ownerShipBuilder.Faction;

                string displayName = ownerShipBuilder.DisplayName;
                if (MyFactions.GetFactionsRelation(m_hologramBuilder.Faction, MySession.Static.Player.Faction) == MyFactionRelationEnum.Friend || MySession.PlayerShip == owner)
                {
                    displayName = "Hologram";
                }

                m_hologramShip            = MyHologramShips.Add(displayName, m_hologramBuilder);
                m_hologramShip.AIPriority = 1;
                m_hologramShip.IsHologram = true;
                if (m_hologramShip != null)
                {
                    m_hologramBaseMatrix = this.WorldMatrix;

                    m_scale         = new Vector3(0, 1, 1);
                    m_hologramState = HologramState.Activating;

                    foreach (var bot in m_awareBots)
                    {
                        bot.SpoilHologram(m_hologramShip);
                    }
                }
            }
        }
Exemple #4
0
        public void Start(Vector3 position, Vector3 initialVelocity, Vector3 direction, float impulseMultiplier, MyEntity owner)
        {
            base.Start(position, initialVelocity, direction, impulseMultiplier, owner);

            m_hologramState = HologramState.Deactivated;

            if (!TimeToActivate.HasValue)
            {
                TimeToActivate = MyHologramConstants.TIME_TO_ACTIVATE;
            }

            foreach (var bot in MyBotCoordinator.GetBots())
            {
                if (bot.CanSeeTarget(owner))
                {
                    m_awareBots.Add(bot);
                }
            }
        }
Exemple #5
0
        public void Start(Vector3 position, Vector3 initialVelocity, Vector3 direction, float impulseMultiplier, MyEntity owner)
        {
            base.Start(position, initialVelocity, direction, impulseMultiplier, owner);

            m_hologramState = HologramState.Deactivated;

            if (!TimeToActivate.HasValue)
            {
                TimeToActivate = MyHologramConstants.TIME_TO_ACTIVATE;
            }

            foreach (var bot in MyBotCoordinator.GetBots())
            {
                if (bot.CanSeeTarget(owner))
                {
                    m_awareBots.Add(bot);
                }
            }
        }
        /// <summary>
        /// Function to set the stat the hologram and update its UI to reflect the updated state
        /// </summary>
        /// <param name="value">Current state of the hologram</param>
        public void SetHologramState(HologramState value)
        {
            switch (value)
            {
            case HologramState.Inactive:
                SetHologramStateFlagsForInactive();
                break;

            case HologramState.Focused:
                SetHologramStateFlagsForFocused();
                break;

            case HologramState.Active:
                SetHologramStateFlagsForActive();
                break;
            }

            isPivotEnabled = (m_ManipulationSettings != null) && m_ManipulationSettings.EnablePivotDrawing;
            isBaseEnabled &= (m_ManipulationSettings != null) && m_ManipulationSettings.EnableBaseDrawing;

            SetControllersState();

            m_HologramState = value;
        }
Exemple #7
0
 /// <summary>
 /// Starts shrinking the hologram.
 /// </summary>
 private void DeactivateHologram()
 {
     m_hologramState = HologramState.Deactivating;
 }
Exemple #8
0
 private void ShrinkHologram()
 {
     m_scale.X -= MyHologramConstants.APPEAR_SPEED;
     if (m_scale.X <= MyMwcMathConstants.EPSILON_SQUARED)
     {
         m_scale = Vector3.Zero;
         m_hologramState = HologramState.Deactivated;
         MarkForClose();
     }
 }
Exemple #9
0
 private void EnlargeHologram()
 {
     m_scale.X += MyHologramConstants.APPEAR_SPEED;
     if (m_scale.X >= 1)
     {
         m_scale = Vector3.One;
         m_hologramState = HologramState.Activated;
     }
 }
Exemple #10
0
 /// <summary>
 /// Starts shrinking the hologram.
 /// </summary>
 private void DeactivateHologram()
 {
     m_hologramState = HologramState.Deactivating;
 }
Exemple #11
0
        /// <summary>
        /// Prepares the hologram ship for display.
        /// </summary>
        private void ActivateHologram()
        {
            //this.Physics.Enabled = false;
            //this.Physics.LinearVelocity = Vector3.Zero;

            MyEntity owner = OwnerEntity;

            if (owner != null)
            {
                var ownerShipBuilder = (owner.GetObjectBuilder(false) as MyMwcObjectBuilder_SmallShip);
                Debug.Assert(ownerShipBuilder != null, "ownerShipBuilder != null");

                m_hologramBuilder.ShipType = ownerShipBuilder.ShipType;
                m_hologramBuilder.ShipMaxHealth = ownerShipBuilder.ShipMaxHealth;
                m_hologramBuilder.ShipHealthRatio = ownerShipBuilder.ShipHealthRatio;
                m_hologramBuilder.ArmorHealth = ownerShipBuilder.ArmorHealth;
                m_hologramBuilder.Oxygen = ownerShipBuilder.Oxygen;
                m_hologramBuilder.Fuel = ownerShipBuilder.Fuel;
                m_hologramBuilder.ReflectorLight = ownerShipBuilder.ReflectorLight;
                m_hologramBuilder.ReflectorLongRange = ownerShipBuilder.ReflectorLongRange;
                m_hologramBuilder.ReflectorShadowDistance = ownerShipBuilder.ReflectorShadowDistance;
                m_hologramBuilder.PositionAndOrientation = ownerShipBuilder.PositionAndOrientation;
                m_hologramBuilder.Faction = ownerShipBuilder.Faction;

                string displayName = ownerShipBuilder.DisplayName;
                if (MyFactions.GetFactionsRelation(m_hologramBuilder.Faction, MySession.Static.Player.Faction) == MyFactionRelationEnum.Friend || MySession.PlayerShip == owner)
                {
                    displayName = "Hologram";
                }

                m_hologramShip = MyHologramShips.Add(displayName, m_hologramBuilder);
                m_hologramShip.AIPriority = 1;
                m_hologramShip.IsHologram = true;
                if (m_hologramShip != null)
                {
                    m_hologramBaseMatrix = this.WorldMatrix;

                    m_scale = new Vector3(0, 1, 1);
                    m_hologramState = HologramState.Activating;

                    foreach (var bot in m_awareBots)
                    {
                        bot.SpoilHologram(m_hologramShip);
                    }
                }            
            }
        }