Improved Slippery prediction, moves Slippery entirely to Shared (#3677)
* Fixes SlipperyComponent mispredict * a * Holy shit
This commit is contained in:
committed by
GitHub
parent
666fb9e2af
commit
0c35b78401
@@ -1,36 +0,0 @@
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.GameObjects.Components.Movement;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Movement
|
||||
{
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(SharedSlipperyComponent))]
|
||||
public class SlipperyComponent : SharedSlipperyComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// Path to the sound to be played when a mob slips.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[DataField("slipSound")]
|
||||
public string SlipSound { get; set; } = "/Audio/Effects/slip.ogg";
|
||||
|
||||
protected override void OnSlip()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(SlipSound))
|
||||
{
|
||||
EntitySystem.Get<AudioSystem>()
|
||||
.PlayFromEntity(SlipSound, Owner, AudioHelpers.WithVariation(0.2f));
|
||||
}
|
||||
}
|
||||
|
||||
public override ComponentState GetComponentState(ICommonSession player)
|
||||
{
|
||||
return new SlipperyComponentState(ParalyzeTime, IntersectPercentage, RequiredSlipSpeed, LaunchForwardsMultiplier, Slippery);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user