Better weightless yeeting and movement (#3573)

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2021-03-08 12:10:56 +11:00
committed by GitHub
parent fcb3498bba
commit 6f3860201c
5 changed files with 26 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.Components.Stack;
using Content.Server.GameObjects.EntitySystems.Click;
using Content.Server.Interfaces.GameObjects.Components.Items;
using Content.Shared.GameObjects.Components.Movement;
using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Input;
using Content.Shared.Interfaces;
@@ -180,8 +181,17 @@ namespace Content.Server.GameObjects.EntitySystems
if (direction == Vector2.Zero) return true;
direction = direction.Normalized * MathF.Min(direction.Length, 8.0f);
var yeet = direction * ThrowForce * 15;
throwEnt.TryThrow(direction * ThrowForce * 15, playerEnt);
// Softer yeet in weightlessness
if (playerEnt.IsWeightless())
{
throwEnt.TryThrow(yeet / 4, playerEnt, 10.0f);
}
else
{
throwEnt.TryThrow(yeet, playerEnt);
}
return true;
}