Gravity anomaly rework (#24452)

* balance

* gorilla gauntlet fix

* magboots update

* some more buff

* randomwalk speed scales with severity

* nerf

* content

* Revert "content"
This commit is contained in:
Ed
2024-01-27 15:15:05 +03:00
committed by GitHub
parent 23999b3d69
commit a923beb21b
6 changed files with 88 additions and 23 deletions

View File

@@ -1,5 +1,6 @@
using System.Numerics;
using Robust.Shared.GameStates;
using Robust.Shared.Physics.Components;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Weapons.Melee.Components;
@@ -89,6 +90,12 @@ public sealed partial class MeleeThrownComponent : Component
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoNetworkedField]
public TimeSpan MinLifetimeTime;
/// <summary>
/// the status to which the entity will return when the thrown ends
/// </summary>
[DataField]
public BodyStatus PreviousStatus;
}
/// <summary>

View File

@@ -71,6 +71,7 @@ public sealed class MeleeThrowOnHitSystem : EntitySystem
(body.BodyType & (BodyType.Dynamic | BodyType.KinematicController)) == 0x0)
return;
comp.PreviousStatus = body.BodyStatus;
comp.ThrownEndTime = _timing.CurTime + TimeSpan.FromSeconds(comp.Lifetime);
comp.MinLifetimeTime = _timing.CurTime + TimeSpan.FromSeconds(comp.MinLifetime);
_physics.SetBodyStatus(body, BodyStatus.InAir);
@@ -82,7 +83,7 @@ public sealed class MeleeThrowOnHitSystem : EntitySystem
private void OnThrownShutdown(Entity<MeleeThrownComponent> ent, ref ComponentShutdown args)
{
if (TryComp<PhysicsComponent>(ent, out var body))
_physics.SetBodyStatus(body, BodyStatus.OnGround);
_physics.SetBodyStatus(body,ent.Comp.PreviousStatus);
var ev = new MeleeThrowOnHitEndEvent();
RaiseLocalEvent(ent, ref ev);
}