Files
tbd-station-14/Content.Shared/Slippery/SlipperyComponent.cs
Zachary Higgs 241d0e12e2 Fix SuperSlippery And StepTriggers persisting when UpdateSlip is called (#34525)
* Fix superSlippery and stepTrigger values persist

- made values in SpillTileReaction's public so we can query the
prototype

- made the default values for slippery component and
StepTriggerComponent based on default constants
for easier resetting

- added a calculation and check in UpdateSlips to check
if a super slip is present as well as Update
relevant steptrigger and slip values based on the contents of the
solution

* The worlds biggest change

---------

Co-authored-by: Myra <vascreeper@yahoo.com>
2025-02-17 21:53:23 +01:00

48 lines
1.8 KiB
C#

using Content.Shared.StepTrigger.Components;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
namespace Content.Shared.Slippery
{
/// <summary>
/// Causes somebody to slip when they walk over this entity.
/// </summary>
/// <remarks>
/// Requires <see cref="StepTriggerComponent"/>, see that component for some additional properties.
/// </remarks>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class SlipperyComponent : Component
{
public const float DefaultParalyzeTime = 1.5f;
public const float DefaultLaunchForwardsMultiplier = 1.5f;
/// <summary>
/// Path to the sound to be played when a mob slips.
/// </summary>
[DataField, AutoNetworkedField]
[Access(Other = AccessPermissions.ReadWriteExecute)]
public SoundSpecifier SlipSound = new SoundPathSpecifier("/Audio/Effects/slip.ogg");
/// <summary>
/// How many seconds the mob will be paralyzed for.
/// </summary>
[DataField, AutoNetworkedField]
[Access(Other = AccessPermissions.ReadWrite)]
public float ParalyzeTime = DefaultParalyzeTime;
/// <summary>
/// The entity's speed will be multiplied by this to slip it forwards.
/// </summary>
[DataField, AutoNetworkedField]
[Access(Other = AccessPermissions.ReadWrite)]
public float LaunchForwardsMultiplier = DefaultLaunchForwardsMultiplier;
/// <summary>
/// If this is true, any slipping entity loses its friction until
/// it's not colliding with any SuperSlippery entities anymore.
/// </summary>
[DataField, AutoNetworkedField]
[Access(Other = AccessPermissions.ReadWrite)]
public bool SuperSlippery;
}
}