Beispiel #1
0
        //  This method realy initiates/starts the missile
        //  IMPORTANT: Direction vector must be normalized!
        public override void Start(Vector3 position, Vector3 initialVelocity, Vector3 direction, float impulseMultiplier, MyEntity owner, StringBuilder displayName)
        {
            base.Start(position, initialVelocity, direction, impulseMultiplier, owner, displayName);
            m_state = MyCurrentState.MOVING_TO_DESTINATION_POINT;
            m_collidedEntity = null;

            Faction = owner.Faction;
            Physics.LinearDamping = 0.5f;

            var ownerSmallShip = owner as MySmallShip;
            if (ownerSmallShip != null)
                Physics.GroupMask = ownerSmallShip.GroupMask;
        }
Beispiel #2
0
        //  This method realy initiates/starts the missile
        //  IMPORTANT: Direction vector must be normalized!
        public override void Start(Vector3 position, Vector3 initialVelocity, Vector3 direction, float impulseMultiplier, MyEntity owner, StringBuilder displayName)
        {
            base.Start(position, initialVelocity, direction, impulseMultiplier, owner, displayName);
            m_state          = MyCurrentState.MOVING_TO_DESTINATION_POINT;
            m_collidedEntity = null;

            Faction = owner.Faction;
            Physics.LinearDamping = 0.5f;

            var ownerSmallShip = owner as MySmallShip;

            if (ownerSmallShip != null)
            {
                Physics.GroupMask = ownerSmallShip.GroupMask;
            }
        }
Beispiel #3
0
        public override void UpdateBeforeSimulation()
        {
            if (m_isExploded)
            {
                MarkForClose();
                MyExplosion newExplosion = MyExplosions.AddExplosion();
                if (newExplosion != null)
                {
                    float radius = m_ammoProperties.ExplosionRadius;
                    newExplosion.Start(m_ammoProperties.HealthDamage, m_ammoProperties.ShipDamage, m_ammoProperties.EMPDamage, m_explosionType, new BoundingSphere(GetPosition(), radius), MyExplosionsConstants.EXPLOSION_LIFESPAN, CascadedExplosionLevel, hitEntity: m_collidedEntity, ownerEntity: OwnerEntity);
                }
                return;
            }
            base.UpdateBeforeSimulation();

            if (m_elapsedMiliseconds > MyRemoteCameraConstants.TIME_TO_ACTIVATE_GROUP_MASK && m_state == MyCurrentState.MOVING_TO_DESTINATION_POINT)
            {
                m_state           = MyCurrentState.ACTIVATED;
                Physics.GroupMask = MyGroupMask.Empty;
            }
        }
Beispiel #4
0
        public override void UpdateBeforeSimulation()
        {
            if (m_isExploded)
            {
                MarkForClose();
                MyExplosion newExplosion = MyExplosions.AddExplosion();
                if (newExplosion != null)
                {
                    float radius = m_ammoProperties.ExplosionRadius;
                    newExplosion.Start(m_ammoProperties.HealthDamage, m_ammoProperties.ShipDamage, m_ammoProperties.EMPDamage, m_explosionType, new BoundingSphere(GetPosition(), radius), MyExplosionsConstants.EXPLOSION_LIFESPAN, CascadedExplosionLevel, hitEntity:m_collidedEntity, ownerEntity: OwnerEntity);
                }
                return;
            }
            base.UpdateBeforeSimulation();

            if (m_elapsedMiliseconds > MyRemoteCameraConstants.TIME_TO_ACTIVATE_GROUP_MASK && m_state == MyCurrentState.MOVING_TO_DESTINATION_POINT)
            {
                m_state = MyCurrentState.ACTIVATED;
                Physics.GroupMask = MyGroupMask.Empty;
            }
        }