2023-05-08 22:37:40 +10:00
|
|
|
using Robust.Shared.Audio;
|
|
|
|
|
using Robust.Shared.GameStates;
|
|
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Weapons.Ranged.Components;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Responsible for handling recharging a basic entity ammo provider over time.
|
|
|
|
|
/// </summary>
|
2024-02-26 04:36:19 +01:00
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
|
2023-05-08 22:37:40 +10:00
|
|
|
public sealed partial class RechargeBasicEntityAmmoComponent : Component
|
|
|
|
|
{
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
[DataField("rechargeCooldown")]
|
|
|
|
|
[AutoNetworkedField]
|
|
|
|
|
public float RechargeCooldown = 1.5f;
|
|
|
|
|
|
|
|
|
|
[DataField("rechargeSound")]
|
|
|
|
|
[AutoNetworkedField]
|
2024-09-11 09:52:27 -04:00
|
|
|
public SoundSpecifier? RechargeSound = new SoundPathSpecifier("/Audio/Magic/forcewall.ogg")
|
2023-05-08 22:37:40 +10:00
|
|
|
{
|
|
|
|
|
Params = AudioParams.Default.WithVolume(-5f)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite),
|
|
|
|
|
DataField("nextCharge", customTypeSerializer:typeof(TimeOffsetSerializer)),
|
|
|
|
|
AutoNetworkedField]
|
2024-02-26 04:36:19 +01:00
|
|
|
[AutoPausedField]
|
2023-05-08 22:37:40 +10:00
|
|
|
public TimeSpan? NextCharge;
|
2024-09-11 09:52:27 -04:00
|
|
|
|
|
|
|
|
[DataField, AutoNetworkedField]
|
|
|
|
|
public bool ShowExamineText = true;
|
2023-05-08 22:37:40 +10:00
|
|
|
}
|