protected void AddProjectile(MyAmmoProperties ammoProperties, Vector3 muzzlePosition)
        {
            float deviateAngle = ammoProperties.DeviateAngle;

            Vector3 projectileForwardVector = GetDeviatedVector(ammoProperties);

            Vector3 velocity = ((MyLargeShipGunBase)Parent).PrefabParent.Parent.Physics.LinearVelocity;

            MyProjectiles.Add(ammoProperties, Parent, muzzlePosition, velocity, projectileForwardVector, false, 1.0f, this, ((MyLargeShipGunBase)Parent).WeaponOwner);
        }
Exemplo n.º 2
0
        public void Explode(MyEntity collideEntity)
        {
            if (m_usedAmmo.AmmoType == MyMwcObjectBuilder_SmallShip_Ammo_TypesEnum.Cannon_Proximity_Explosive)
            { //make flying shrapnels
                int shrapnels = MyCannonShotConstants.PROXIMITY_SHRAPNELS_COUNT;
                while (shrapnels-- > 0)
                {
                    Vector3 projectileForwardVector = MyUtilRandomVector3ByDeviatingVector.GetRandom(WorldMatrix.Forward, MathHelper.TwoPi);
                    //MyProjectiles.Add(
                    //  MyAmmoConstants.GetAmmoProperties(MyAmmoPropertiesEnum.Shrapnel),
                    //Parent, GetPosition(), Vector3.Zero, projectileForwardVector, false, 3, this);

                    MyProjectiles.Add(
                        MyAmmoConstants.GetAmmoProperties(MyAmmoPropertiesEnum.Shrapnel),
                        Parent, GetPosition(), Vector3.Zero, projectileForwardVector, false, 3, this);
                }
            }

            Explode();
        }
Exemplo n.º 3
0
        protected void AddProjectile(MyAmmoProperties ammoProperties, MyEntity weapon)
        {
            Vector3 projectileForwardVector = GetDeviatedVector(ammoProperties);

            MyProjectiles.Add(ammoProperties, Parent, m_positionMuzzleInWorldSpace, Parent.Physics.LinearVelocity, projectileForwardVector, false, 1.0f, weapon);
        }