Files
tbd-station-14/Content.Shared/Slippery/SlipperyComponent.cs
Princess Cheeseballs 251cfbd8be Puddle Code Slipping Cleanup (#35845)
* Init Commit

* windows yelling at me to update commit

* working commit, need prediciton and more dehardcoding

* Project 0 warnings

* Working Commit (Near Final)

* ryder got confused commit

* I love Merge Conflicts :)

* Working commit, no prediction

* Forgot the yaml changes

* Comments and typos

* Apparently while the reduced launch mult of lube was initialized it was never used so I revered back to default

* Fixed an incorrect divisor

* bit of cleanup

* Prediciton fixed, and puddles now affect all entities

* FORGOT TO RENAME A VERY IMPORTANT VARIABLE OOPS

* Really big I forgor moment

* Even bigger I forgor moment

* four more merge conflicts to fix four more oopsies

* fixed actual divide by zero moment and also im very dumb

* Even bigger I forgor moment

* four more merge conflicts to fix four more oopsies

* fixed actual divide by zero moment and also im very dumb

* Fix all test fails

* code cleanup

* Webedit whitespace

* Code cleaup

* whitespace webedit

* whitespace webedit

* whitespace webedit

* whitespace removal

* Comments and cleanup

* Re-Added 20 warnings as per Ork's request

* Cleanups

* Spacing fix

* bugfixes and cleanup

* Small bugfix

* Actually dirty the slipComp for real

* Added Friction field to Reagent Prototype per design discussion

* Sliding system is kill
2025-04-20 17:27:12 -04:00

69 lines
2.3 KiB
C#

using Content.Shared.StepTrigger.Components;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
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
{
/// <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>
/// Loads the data needed to determine how slippery something is.
/// </summary>
[DataField, AutoNetworkedField]
public SlipperyEffectEntry SlipData = new();
}
/// <summary>
/// Stores the data for slipperiness that way reagents and this component can use it.
/// </summary>
[DataDefinition, Serializable, NetSerializable]
public sealed partial class SlipperyEffectEntry
{
/// <summary>
/// How many seconds the mob will be paralyzed for.
/// </summary>
[DataField]
public TimeSpan ParalyzeTime = TimeSpan.FromSeconds(1.5);
/// <summary>
/// The entity's speed will be multiplied by this to slip it forwards.
/// </summary>
[DataField]
public float LaunchForwardsMultiplier = 1.5f;
/// <summary>
/// Minimum speed entity must be moving to slip.
/// </summary>
[DataField]
public float RequiredSlipSpeed = 3.5f;
/// <summary>
/// If this is true, any slipping entity loses its friction until
/// it's not colliding with any SuperSlippery entities anymore.
/// They also will fail any attempts to stand up unless they have no-slips.
/// </summary>
[DataField]
public bool SuperSlippery;
/// <summary>
/// This is used to store the friction modifier that is used on a sliding entity.
/// </summary>
[DataField]
public float SlipFriction;
}
}