Add slipping prediction (#1440)

This commit is contained in:
DrSmugleaf
2020-07-23 01:40:31 +02:00
committed by GitHub
parent c9057d01ae
commit b88afec350
12 changed files with 461 additions and 365 deletions

View File

@@ -1,7 +1,10 @@
#nullable enable
using Content.Shared.Audio;
using Content.Shared.GameObjects.Components.Mobs;
using Content.Shared.GameObjects.Components.Movement;
using Robust.Client.GameObjects.EntitySystems;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
namespace Content.Client.GameObjects.Components.Mobs
{
@@ -9,13 +12,11 @@ namespace Content.Client.GameObjects.Components.Mobs
[ComponentReference(typeof(SharedStunnableComponent))]
public class StunnableComponent : SharedStunnableComponent
{
private bool _stunned;
private bool _knockedDown;
private bool _slowedDown;
public override bool Stunned => _stunned;
public override bool KnockedDown => _knockedDown;
public override bool SlowedDown => _slowedDown;
protected override void OnInteractHand()
{
EntitySystem.Get<AudioSystem>()
.Play("/Audio/Effects/thudswoosh.ogg", Owner, AudioHelpers.WithVariation(0.25f));
}
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
{
@@ -26,9 +27,9 @@ namespace Content.Client.GameObjects.Components.Mobs
return;
}
_stunned = state.Stunned;
_knockedDown = state.KnockedDown;
_slowedDown = state.SlowedDown;
StunnedTimer = state.StunnedTimer;
KnockdownTimer = state.KnockdownTimer;
SlowdownTimer = state.SlowdownTimer;
WalkModifierOverride = state.WalkModifierOverride;
RunModifierOverride = state.RunModifierOverride;