Cap throwing scaling (#16923)

This commit is contained in:
metalgearsloth
2023-05-29 17:11:54 +10:00
committed by GitHub
parent 586b30cd18
commit 7aa0798644

View File

@@ -15,7 +15,7 @@ public sealed class ThrowingSystem : EntitySystem
{ {
public const float ThrowAngularImpulse = 5f; public const float ThrowAngularImpulse = 5f;
public const float PushbackDefault = 1f; public const float PushbackDefault = 2f;
/// <summary> /// <summary>
/// The minimum amount of time an entity needs to be thrown before the timer can be run. /// The minimum amount of time an entity needs to be thrown before the timer can be run.
@@ -155,9 +155,10 @@ public sealed class ThrowingSystem : EntitySystem
{ {
var msg = new ThrowPushbackAttemptEvent(); var msg = new ThrowPushbackAttemptEvent();
RaiseLocalEvent(uid, msg); RaiseLocalEvent(uid, msg);
const float MassLimit = 5f;
if (!msg.Cancelled) if (!msg.Cancelled)
_physics.ApplyLinearImpulse(user.Value, -impulseVector * pushbackRatio * physics.Mass, body: userPhysics); _physics.ApplyLinearImpulse(user.Value, -impulseVector / physics.Mass * pushbackRatio * MathF.Min(MassLimit, physics.Mass), body: userPhysics);
} }
} }
} }