Radiation pulse ECS (#10641)
This commit is contained in:
@@ -54,6 +54,7 @@ namespace Content.Server.Sound
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<EmitSoundOnSpawnComponent, ComponentInit>(HandleEmitSpawnOnInit);
|
||||
SubscribeLocalEvent<EmitSoundOnLandComponent, LandEvent>(HandleEmitSoundOnLand);
|
||||
SubscribeLocalEvent<EmitSoundOnUseComponent, UseInHandEvent>(HandleEmitSoundOnUseInHand);
|
||||
SubscribeLocalEvent<EmitSoundOnThrowComponent, ThrownEvent>(HandleEmitSoundOnThrown);
|
||||
@@ -64,6 +65,11 @@ namespace Content.Server.Sound
|
||||
SubscribeLocalEvent<EmitSoundOnDropComponent, DroppedEvent>(HandleEmitSoundOnDrop);
|
||||
}
|
||||
|
||||
private void HandleEmitSpawnOnInit(EntityUid uid, EmitSoundOnSpawnComponent component, ComponentInit args)
|
||||
{
|
||||
TryEmitSound(component);
|
||||
}
|
||||
|
||||
private void HandleEmitSoundOnTrigger(EntityUid uid, EmitSoundOnTriggerComponent component, TriggerEvent args)
|
||||
{
|
||||
TryEmitSound(component);
|
||||
@@ -122,6 +128,8 @@ namespace Content.Server.Sound
|
||||
|
||||
private void TryEmitSound(BaseEmitSoundComponent component)
|
||||
{
|
||||
if (component.Sound == null)
|
||||
return;
|
||||
_audioSystem.PlayPvs(component.Sound, component.Owner, component.Sound.Params.AddVolume(-2f));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user