public static void PlayShotHitSound(Projectile shot) { ContentHandler.PlaySFX(shot.HitSound); }
public static bool IsHit(GameObject obj, out Projectile shotHit, FoF_Ident alignment = FoF_Ident.Neutral) { foreach (Projectile shot in Projectiles) //loop through each shot to check if hit { if (shot.Identification != alignment && shot.IsDummyProjectile == false) //check if friendly & not a dummy { if (obj.IsCircleColliding(shot)) //check if colliding { HitEffects.Add(new ParticleEmitter( //add a hit effect EFFECT_MAX_PARTICLES, obj.WorldCenter.Center(shot.WorldCenter), ContentHandler.Textures["particle"].ToTextureList(), EFFECT_COLORS.ToList<Color>(), EFFECT_FRAMES_TO_LIVE, true, true, EFFECT_TIME_TO_EMIT, EFFECT_MAX_PARTICLES / DETONATE_TIME_TO_EMIT, EFFECT_EJECTION_SPEED, EFFECT_RANDOMIZATION, shot.RotationDegrees + 180, EFFECT_SPRAY_WIDTH)); shotHit = shot; //set the out param shot.Active = false; if (shot.DetonateEffect) addDetonateEffect(shot.WorldCenter); return true; //return true } } } shotHit = null; //set the shot to null return false; //and return false }