CatStation/Content.Shared/Delivery/DeliverySpawnerComponent.cs
Stanislav b22d38f9c0
Yaml audio params are often ignored (#36259)
* Replace WithVolume() with AddVolume(),
Remove AudioHelpers.WithVariation(),
Use specifier options for audio params

* Undo switching to AudioParams.AddVariation()

* Replace AudioHelpers.WithVariation with AudioParams.AddVariation()

* Test AudioParams.AddVariation() and change input parameters to sound like previous AudioHelpers.WithVariation()

* Fix build error

* Fix build error v2

* Remove DoAfter

* fixes

---------

Co-authored-by: AJCM-git <ajcm_mail@disroot.org>
2026-07-25 16:16:23 +00:00

43 lines
1.5 KiB
C#

using Content.Shared.EntityTable.EntitySelectors;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
namespace Content.Shared.Delivery;
/// <summary>
/// Used to mark entities that are valid for spawning deliveries on.
/// If this requires power, it needs to be powered to count as a valid spawner.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class DeliverySpawnerComponent : Component
{
/// <summary>
/// The entity table to select deliveries from.
/// </summary>
[DataField(required: true)]
public EntityTableSelector Table = default!;
/// <summary>
/// The max amount of deliveries this spawner can hold at a time.
/// </summary>
[DataField]
public int MaxContainedDeliveryAmount = 20;
/// <summary>
/// The currently held amount of deliveries.
/// They are stored as an int and only spawned on use, as to not create additional entities without the need to.
/// </summary>
[DataField, AutoNetworkedField]
public int ContainedDeliveryAmount;
/// <summary>
/// The sound to play when the spawner spawns a delivery.
/// </summary>
[DataField]
public SoundSpecifier? SpawnSound = new SoundCollectionSpecifier("DeliverySpawnSounds", AudioParams.Default.AddVolume(-7));
/// <summary>
/// The sound to play when a spawner is opened, and spills all the deliveries out.
/// </summary>
[DataField]
public SoundSpecifier? OpenSound = new SoundCollectionSpecifier("storageRustle");
}