Пример #1
0
 public virtual void Init(MyWeaponPropertiesWrapper weaponProperties)
 {
     m_missileAmmoDefinition = weaponProperties.GetCurrentAmmoDefinitionAs <MyMissileAmmoDefinition>();
     Init(weaponProperties, m_missileAmmoDefinition.MissileModelName, false, true, true);
     m_canByAffectedByExplosionForce = false;
     UseDamageSystem = true;
 }
Пример #2
0
        private void AddProjectile(MyWeaponPropertiesWrapper weaponProperties, Vector3D initialPosition, Vector3D initialVelocity, Vector3D direction)
        {
            Vector3 projectileForwardVector = direction;

            if (weaponProperties.IsDeviated)
            {
                projectileForwardVector = GetDeviatedVector(weaponProperties.WeaponDefinition.DeviateShotAngle, direction);
            }

            MyProjectiles.Add(weaponProperties.GetCurrentAmmoDefinitionAs <MyProjectileAmmoDefinition>(), initialPosition, initialVelocity, projectileForwardVector, m_user);
        }
Пример #3
0
        private void AddProjectile(MyWeaponPropertiesWrapper weaponProperties, Vector3D initialPosition, Vector3D initialVelocity, Vector3D direction, MyEntity owner)
        {
            Vector3 projectileForwardVector = direction;

            if (weaponProperties.IsDeviated)
            {
                projectileForwardVector = GetDeviatedVector(m_shotProjectiles + direction.GetHashCode(), weaponProperties.WeaponDefinition.DeviateShotAngle, direction);
                projectileForwardVector.Normalize();
            }

            m_shotProjectiles++;

            MyProjectiles.Add(weaponProperties.GetCurrentAmmoDefinitionAs <MyProjectileAmmoDefinition>(), initialPosition, initialVelocity, projectileForwardVector, m_user, owner);
        }
Пример #4
0
        private void AddMissile(MyWeaponPropertiesWrapper weaponProperties, Vector3D initialPosition, Vector3D initialVelocity, Vector3D direction)
        {
            MyMissileAmmoDefinition missileAmmoDefinition = weaponProperties.GetCurrentAmmoDefinitionAs <MyMissileAmmoDefinition>();

            Vector3 missileDeviatedVector = direction;

            if (weaponProperties.IsDeviated)
            {
                missileDeviatedVector = GetDeviatedVector(weaponProperties.WeaponDefinition.DeviateShotAngle, direction);
                missileDeviatedVector.Normalize();
            }

            initialVelocity += missileDeviatedVector * missileAmmoDefinition.MissileInitialSpeed;

            if (m_user.Launcher != null)
            {
                MyMissiles.Add(weaponProperties, initialPosition, initialVelocity, missileDeviatedVector, m_user.OwnerId);
            }
            else
            {
                MyMissiles.AddUnsynced(weaponProperties, initialPosition + 2 * missileDeviatedVector, initialVelocity, missileDeviatedVector, m_user.OwnerId);//start missile 2 beters in front of launcher - prevents hit of own turret
            }
        }