protected override void Init(MyObjectBuilder_DefinitionBase builder) { base.Init(builder); var ob = builder as MyObjectBuilder_ProjectileAmmoDefinition; MyDebug.AssertDebug(ob != null); this.AmmoType = MyAmmoType.HighSpeed; MyObjectBuilder_ProjectileAmmoDefinition.AmmoProjectileProperties projectileProperties = ob.ProjectileProperties; MyDebug.AssertDebug(projectileProperties != null); this.ProjectileHealthDamage = projectileProperties.ProjectileHealthDamage; this.ProjectileHitImpulse = projectileProperties.ProjectileHitImpulse; this.ProjectileMassDamage = projectileProperties.ProjectileMassDamage; this.ProjectileOnHitMaterialParticles = MyParticleEffects.GetCustomHitMaterialMethodById((int)projectileProperties.ProjectileOnHitMaterialParticlesType); this.ProjectileOnHitParticles = MyParticleEffects.GetCustomHitParticlesMethodById((int)projectileProperties.ProjectileOnHitParticlesType); this.ProjectileTrailColor = projectileProperties.ProjectileTrailColor; this.ProjectileTrailMaterial = projectileProperties.ProjectileTrailMaterial; this.ProjectileTrailProbability = projectileProperties.ProjectileTrailProbability; this.ProjectileTrailScale = projectileProperties.ProjectileTrailScale; this.HeadShot = projectileProperties.HeadShot; this.ProjectileHeadShotDamage = projectileProperties.ProjectileHeadShotDamage; this.ProjectileType = projectileProperties.ProjectileType; }
public readonly MyCustomHitMaterialMethod OnHitMaterialSpecificParticles; // Delegate to method to create material specific particles public MyAmmoProperties(float InitialSpeed, float DesiredSpeed, float SpeedVar, float MaxTrajectory, float HealthDamage, float ShipDamage, float EMPDamage, float ExplosionRadius, float DeviateAngle, Vector3 TrailColor, MySoundCuesEnum ShotSound, bool IsExplosive, bool AllowAimCorrection, float DecalEmissivity, int ProjectileGroupSize, MyDamageType DamageType, MyAmmoType AmmoType, MyCustomHitParticlesMethod OnHitParticles, MyCustomHitMaterialMethod OnHitMaterialSpecificParticles) { this.InitialSpeed = InitialSpeed; this.DesiredSpeed = DesiredSpeed; this.SpeedVar = SpeedVar; this.MaxTrajectory = MaxTrajectory; this.HealthDamage = HealthDamage; this.ShipDamage = ShipDamage; this.EMPDamage = EMPDamage; this.ExplosionRadius = ExplosionRadius; this.DeviateAngle = DeviateAngle; this.TrailColor = TrailColor; this.ShotSound = ShotSound; this.IsExplosive = IsExplosive; this.AllowAimCorrection = AllowAimCorrection; this.DecalEmissivity = DecalEmissivity; this.ProjectileGroupSize = ProjectileGroupSize; this.DamageType = DamageType; this.AmmoType = AmmoType; this.OnHitParticles = OnHitParticles; this.OnHitMaterialSpecificParticles = OnHitMaterialSpecificParticles; }