Spacelube slide (#24801)
* Space lube now makes you slide * review * oh lord he slippin --------- Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -5,7 +5,6 @@ using Content.Shared.StatusEffect;
|
||||
using Content.Shared.StepTrigger.Systems;
|
||||
using Content.Shared.Stunnable;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Physics.Components;
|
||||
@@ -60,7 +59,7 @@ public sealed class SlipperySystem : EntitySystem
|
||||
|
||||
private void TrySlip(EntityUid uid, SlipperyComponent component, EntityUid other)
|
||||
{
|
||||
if (HasComp<KnockedDownComponent>(other))
|
||||
if (HasComp<KnockedDownComponent>(other) && !component.SuperSlippery)
|
||||
return;
|
||||
|
||||
var attemptEv = new SlipAttemptEvent();
|
||||
@@ -71,9 +70,14 @@ public sealed class SlipperySystem : EntitySystem
|
||||
var ev = new SlipEvent(other);
|
||||
RaiseLocalEvent(uid, ref ev);
|
||||
|
||||
if (TryComp(other, out PhysicsComponent? physics))
|
||||
if (TryComp(other, out PhysicsComponent? physics) && !HasComp<SlidingComponent>(other))
|
||||
{
|
||||
_physics.SetLinearVelocity(other, physics.LinearVelocity * component.LaunchForwardsMultiplier, body: physics);
|
||||
|
||||
if (component.SuperSlippery)
|
||||
EnsureComp<SlidingComponent>(other);
|
||||
}
|
||||
|
||||
var playSound = !_statusEffects.HasStatusEffect(other, "KnockedDown");
|
||||
|
||||
_stun.TryParalyze(other, TimeSpan.FromSeconds(component.ParalyzeTime), true);
|
||||
|
||||
Reference in New Issue
Block a user