private void FireBullet(RigidBody body, Transform transform, Vector2 localPos, float localAngle)
{
ShipBlueprint blueprint = this.blueprint.Res;
if (blueprint.BulletType == null) return;
Bullet bullet = blueprint.BulletType.Res.CreateBullet();
Vector2 recoilImpulse;
Vector2 worldPos = transform.GetWorldPoint(localPos);
bullet.Fire(this.owner, body.LinearVelocity, worldPos, transform.Angle + localAngle, out recoilImpulse);
body.ApplyWorldImpulse(recoilImpulse);
Scene.Current.AddObject(bullet.GameObj);
SoundInstance inst = null;
if (Player.AlivePlayers.Count() > 1)
inst = DualityApp.Sound.PlaySound3D(this.owner.WeaponSound, new Vector3(worldPos));
else
inst = DualityApp.Sound.PlaySound(this.owner.WeaponSound);
inst.Volume = MathF.Rnd.NextFloat(0.6f, 1.0f);
inst.Pitch = MathF.Rnd.NextFloat(0.9f, 1.11f);
}