using Content.Shared.StepTrigger.Components;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Slippery
{
///
/// Causes somebody to slip when they walk over this entity.
///
///
/// Requires , see that component for some additional properties.
///
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class SlipperyComponent : Component
{
///
/// Path to the sound to be played when a mob slips.
///
[DataField, AutoNetworkedField]
[Access(Other = AccessPermissions.ReadWriteExecute)]
public SoundSpecifier SlipSound = new SoundPathSpecifier("/Audio/Effects/slip.ogg");
///
/// Should this component's friction factor into sliding friction?
///
[DataField, AutoNetworkedField]
public bool AffectsSliding;
///
/// How long should this component apply the FrictionStatusComponent?
/// Note: This does stack with SlidingComponent since they are two separate Components
///
[DataField, AutoNetworkedField]
public TimeSpan FrictionStatusTime = TimeSpan.FromSeconds(0.5f);
///
/// How much stamina damage should this component do on slip?
///
[DataField, AutoNetworkedField]
public float StaminaDamage = 25f;
///
/// Loads the data needed to determine how slippery something is.
///
[DataField, AutoNetworkedField]
public SlipperyEffectEntry SlipData = new();
}
///
/// Stores the data for slipperiness that way reagents and this component can use it.
///
[DataDefinition, Serializable, NetSerializable]
public sealed partial class SlipperyEffectEntry
{
///
/// How many seconds the mob will be stunned for.
///
[DataField]
public TimeSpan StunTime = TimeSpan.FromSeconds(0.5);
///
/// How many seconds the mob will be knocked down for.
///
[DataField]
public TimeSpan KnockdownTime = TimeSpan.FromSeconds(1.5);
///
/// Should the slipped entity try to stand up when Knockdown ends?
///
[DataField]
public bool AutoStand = true;
///
/// The entity's speed will be multiplied by this to slip it forwards.
///
[DataField]
public float LaunchForwardsMultiplier = 1.5f;
///
/// Minimum speed entity must be moving to slip.
///
[DataField]
public float RequiredSlipSpeed = 3.5f;
///
/// 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.
///
[DataField]
public bool SuperSlippery;
///
/// This is used to store the friction modifier that is used on a sliding entity.
///
[DataField]
public float SlipFriction = 0.5f;
}
}