Update trivial components to use auto comp states (#20539)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using Content.Shared.StepTrigger.Components;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Slippery
|
||||
{
|
||||
@@ -11,14 +10,13 @@ namespace Content.Shared.Slippery
|
||||
/// <remarks>
|
||||
/// Requires <see cref="StepTriggerComponent"/>, see that component for some additional properties.
|
||||
/// </remarks>
|
||||
[RegisterComponent]
|
||||
[NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public sealed partial class SlipperyComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Path to the sound to be played when a mob slips.
|
||||
/// </summary>
|
||||
[DataField("slipSound")]
|
||||
[DataField, AutoNetworkedField]
|
||||
[Access(Other = AccessPermissions.ReadWriteExecute)]
|
||||
public SoundSpecifier SlipSound = new SoundPathSpecifier("/Audio/Effects/slip.ogg");
|
||||
|
||||
@@ -26,7 +24,7 @@ namespace Content.Shared.Slippery
|
||||
/// How many seconds the mob will be paralyzed for.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("paralyzeTime")]
|
||||
[DataField, AutoNetworkedField]
|
||||
[Access(Other = AccessPermissions.ReadWrite)]
|
||||
public float ParalyzeTime = 3f;
|
||||
|
||||
@@ -34,23 +32,8 @@ namespace Content.Shared.Slippery
|
||||
/// The entity's speed will be multiplied by this to slip it forwards.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("launchForwardsMultiplier")]
|
||||
[DataField, AutoNetworkedField]
|
||||
[Access(Other = AccessPermissions.ReadWrite)]
|
||||
public float LaunchForwardsMultiplier = 1f;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class SlipperyComponentState : ComponentState
|
||||
{
|
||||
public float ParalyzeTime { get; }
|
||||
public float LaunchForwardsMultiplier { get; }
|
||||
public string SlipSound { get; }
|
||||
|
||||
public SlipperyComponentState(float paralyzeTime, float launchForwardsMultiplier, string slipSound)
|
||||
{
|
||||
ParalyzeTime = paralyzeTime;
|
||||
LaunchForwardsMultiplier = launchForwardsMultiplier;
|
||||
SlipSound = slipSound;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user