SlipperyComponent.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using Content.Shared.StepTrigger.Components;
  2. using Robust.Shared.Audio;
  3. using Robust.Shared.GameStates;
  4. namespace Content.Shared.Slippery
  5. {
  6. /// <summary>
  7. /// Causes somebody to slip when they walk over this entity.
  8. /// </summary>
  9. /// <remarks>
  10. /// Requires <see cref="StepTriggerComponent"/>, see that component for some additional properties.
  11. /// </remarks>
  12. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  13. public sealed partial class SlipperyComponent : Component
  14. {
  15. public const float DefaultParalyzeTime = 1.5f;
  16. public const float DefaultLaunchForwardsMultiplier = 1.5f;
  17. /// <summary>
  18. /// Path to the sound to be played when a mob slips.
  19. /// </summary>
  20. [DataField, AutoNetworkedField]
  21. [Access(Other = AccessPermissions.ReadWriteExecute)]
  22. public SoundSpecifier SlipSound = new SoundPathSpecifier("/Audio/Effects/slip.ogg");
  23. /// <summary>
  24. /// How many seconds the mob will be paralyzed for.
  25. /// </summary>
  26. [DataField, AutoNetworkedField]
  27. [Access(Other = AccessPermissions.ReadWrite)]
  28. public float ParalyzeTime = DefaultParalyzeTime;
  29. /// <summary>
  30. /// The entity's speed will be multiplied by this to slip it forwards.
  31. /// </summary>
  32. [DataField, AutoNetworkedField]
  33. [Access(Other = AccessPermissions.ReadWrite)]
  34. public float LaunchForwardsMultiplier = DefaultLaunchForwardsMultiplier;
  35. /// <summary>
  36. /// If this is true, any slipping entity loses its friction until
  37. /// it's not colliding with any SuperSlippery entities anymore.
  38. /// </summary>
  39. [DataField, AutoNetworkedField]
  40. [Access(Other = AccessPermissions.ReadWrite)]
  41. public bool SuperSlippery;
  42. }
  43. }