public void Copy(WeaponDefinition w) { Enabled = w.Enabled; SubtypeId = w.SubtypeId; DeviateShotAngle = w.DeviateShotAngle; ReloadTime = w.ReloadTime; AmmoData = w.AmmoData; ReleaseTimeAfterFire = w.ReleaseTimeAfterFire; //PhysicalMaterial = w.PhysicalMaterial; MuzzleFlashLifeSpan = w.MuzzleFlashLifeSpan; MuzzleFlashSpriteName = w.MuzzleFlashSpriteName; NoAmmoSound = w.NoAmmoSound; ReloadSound = w.ReloadSound; SecondarySound = w.SecondarySound; NoAmmoSoundPair = w.NoAmmoSoundPair; ReloadSoundPair = w.ReloadSoundPair; SecondarySoundPair = w.SecondarySoundPair; AiEnabled = w.AiEnabled; MinElevationDegrees = w.MinElevationDegrees; MaxElevationDegrees = w.MaxElevationDegrees; MinAzimuthDegrees = w.MinAzimuthDegrees; MaxAzimuthDegrees = w.MaxAzimuthDegrees; IdleRotation = w.IdleRotation; MaxRangeMeters = w.MaxRangeMeters; RotationSpeed = w.RotationSpeed; ElevationSpeed = w.ElevationSpeed; MinFov = w.MinFov; MaxFov = w.MaxFov; AmmoPullAmount = w.AmmoPullAmount; InventoryFillFactorMin = w.InventoryFillFactorMin; }
public static WeaponDefinition CreateFromKeenDefinition(MyWeaponBlockDefinition b, MyWeaponDefinition w) { if (b is MyLargeTurretBaseDefinition) { MyLargeTurretBaseDefinition lb = b as MyLargeTurretBaseDefinition; return(new WeaponDefinition { Enabled = true, SubtypeId = w.Id.SubtypeId.String, DeviateShotAngle = w.DeviateShotAngle, ReloadTime = w.ReloadTime, ReleaseTimeAfterFire = w.ReleaseTimeAfterFire, //PhysicalMaterial = w.PhysicalMaterial, MuzzleFlashLifeSpan = w.MuzzleFlashLifeSpan, MuzzleFlashSpriteName = "Muzzle_Flash_Large", NoAmmoSound = w.NoAmmoSound.SoundId.ToString(), ReloadSound = w.ReloadSound.SoundId.ToString(), SecondarySound = w.SecondarySound.SoundId.ToString(), NoAmmoSoundPair = w.NoAmmoSound, ReloadSoundPair = w.ReloadSound, SecondarySoundPair = w.SecondarySound, AmmoData = WeaponAmmoDefinition.CreateFromKeenDefinition(w.WeaponAmmoDatas[0]), AiEnabled = lb.AiEnabled, MinElevationDegrees = lb.MinElevationDegrees, MaxElevationDegrees = lb.MaxElevationDegrees, MinAzimuthDegrees = lb.MinAzimuthDegrees, MaxAzimuthDegrees = lb.MaxAzimuthDegrees, IdleRotation = lb.IdleRotation, MaxRangeMeters = lb.MaxRangeMeters, RotationSpeed = lb.RotationSpeed, ElevationSpeed = lb.ElevationSpeed, MinFov = lb.MinFov, MaxFov = lb.MaxFov, AmmoPullAmount = lb.AmmoPullAmount, InventoryFillFactorMin = lb.InventoryFillFactorMin, }); } else { return(new WeaponDefinition { Enabled = true, SubtypeId = w.Id.SubtypeId.String, DeviateShotAngle = w.DeviateShotAngle, ReloadTime = w.ReloadTime, ReleaseTimeAfterFire = w.ReleaseTimeAfterFire, //PhysicalMaterial = w.PhysicalMaterial, MuzzleFlashLifeSpan = w.MuzzleFlashLifeSpan, MuzzleFlashSpriteName = "Muzzle_Flash_Large", NoAmmoSound = w.NoAmmoSound.SoundId.ToString(), ReloadSound = w.ReloadSound.SoundId.ToString(), SecondarySound = w.SecondarySound.SoundId.ToString(), NoAmmoSoundPair = w.NoAmmoSound, ReloadSoundPair = w.ReloadSound, SecondarySoundPair = w.SecondarySound, AmmoData = WeaponAmmoDefinition.CreateFromKeenDefinition(w.WeaponAmmoDatas[0]), InventoryFillFactorMin = b.InventoryFillFactorMin, }); } }