private void HandleCollide(EntityUid uid, DamageOnHighSpeedImpactComponent component, StartCollideEvent args) { if (!EntityManager.HasComponent <DamageableComponent>(uid)) { return; } var otherBody = args.OtherFixture.Body.Owner; var speed = args.OurFixture.Body.LinearVelocity.Length; if (speed < component.MinimumSpeed) { return; } SoundSystem.Play(Filter.Pvs(otherBody), component.SoundHit.GetSound(), otherBody, AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f)); if ((_gameTiming.CurTime - component.LastHit).TotalSeconds < component.DamageCooldown) { return; } component.LastHit = _gameTiming.CurTime; if (_robustRandom.Prob(component.StunChance)) { _stunSystem.TryStun(uid, TimeSpan.FromSeconds(component.StunSeconds), true); } var damageScale = (speed / component.MinimumSpeed) * component.Factor; _damageableSystem.TryChangeDamage(uid, component.Damage * damageScale); }