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:
Arendian
2024-02-01 11:39:10 +01:00
committed by GitHub
parent c4f275bc53
commit 4f3b8d740c
7 changed files with 112 additions and 9 deletions

View File

@@ -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);