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:
@@ -1,4 +1,5 @@
|
|||||||
using Content.Server.Singularity.Components;
|
using Content.Server.Physics.Components;
|
||||||
|
using Content.Server.Singularity.Components;
|
||||||
using Content.Shared.Anomaly.Components;
|
using Content.Shared.Anomaly.Components;
|
||||||
using Content.Shared.Anomaly.Effects;
|
using Content.Shared.Anomaly.Effects;
|
||||||
using Content.Shared.Anomaly.Effects.Components;
|
using Content.Shared.Anomaly.Effects.Components;
|
||||||
@@ -19,21 +20,31 @@ public sealed class GravityAnomalySystem : SharedGravityAnomalySystem
|
|||||||
SubscribeLocalEvent<GravityAnomalyComponent, AnomalyStabilityChangedEvent>(OnStabilityChanged);
|
SubscribeLocalEvent<GravityAnomalyComponent, AnomalyStabilityChangedEvent>(OnStabilityChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnSeverityChanged(EntityUid uid, GravityAnomalyComponent component, ref AnomalySeverityChangedEvent args)
|
private void OnSeverityChanged(Entity<GravityAnomalyComponent> anomaly, ref AnomalySeverityChangedEvent args)
|
||||||
{
|
{
|
||||||
if (TryComp<RadiationSourceComponent>(uid, out var radSource))
|
if (TryComp<RadiationSourceComponent>(anomaly, out var radSource))
|
||||||
radSource.Intensity = component.MaxRadiationIntensity * args.Severity;
|
radSource.Intensity = anomaly.Comp.MaxRadiationIntensity * args.Severity;
|
||||||
|
|
||||||
if (!TryComp<GravityWellComponent>(uid, out var gravityWell))
|
if (TryComp<GravityWellComponent>(anomaly, out var gravityWell))
|
||||||
return;
|
{
|
||||||
var accel = (component.MaxAccel - component.MinAccel) * args.Severity + component.MinAccel;
|
var accel = MathHelper.Lerp(anomaly.Comp.MinAccel, anomaly.Comp.MaxAccel, args.Severity);
|
||||||
gravityWell.BaseRadialAcceleration = accel;
|
gravityWell.BaseRadialAcceleration = accel;
|
||||||
gravityWell.BaseTangentialAcceleration = accel * 0.2f;
|
|
||||||
|
var radialAccel = MathHelper.Lerp(anomaly.Comp.MinRadialAccel, anomaly.Comp.MaxRadialAccel, args.Severity);
|
||||||
|
gravityWell.BaseTangentialAcceleration = radialAccel;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TryComp<RandomWalkComponent>(anomaly, out var randomWalk))
|
||||||
|
{
|
||||||
|
var speed = MathHelper.Lerp(anomaly.Comp.MinSpeed, anomaly.Comp.MaxSpeed, args.Severity);
|
||||||
|
randomWalk.MinSpeed = speed - anomaly.Comp.SpeedVariation;
|
||||||
|
randomWalk.MaxSpeed = speed + anomaly.Comp.SpeedVariation;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnStabilityChanged(EntityUid uid, GravityAnomalyComponent component, ref AnomalyStabilityChangedEvent args)
|
private void OnStabilityChanged(Entity<GravityAnomalyComponent> anomaly, ref AnomalyStabilityChangedEvent args)
|
||||||
{
|
{
|
||||||
if (TryComp<GravityWellComponent>(uid, out var gravityWell))
|
if (TryComp<GravityWellComponent>(anomaly, out var gravityWell))
|
||||||
gravityWell.MaxRange = component.MaxGravityWellRange * args.Stability;
|
gravityWell.MaxRange = anomaly.Comp.MaxGravityWellRange * args.Stability;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Content.Server.Atmos.Components;
|
||||||
using Content.Server.Singularity.Components;
|
using Content.Server.Singularity.Components;
|
||||||
using Content.Shared.Ghost;
|
using Content.Shared.Ghost;
|
||||||
using Content.Shared.Singularity.EntitySystems;
|
using Content.Shared.Singularity.EntitySystems;
|
||||||
@@ -192,6 +193,9 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (TryComp<MovedByPressureComponent>(entity, out var movedPressure) && !movedPressure.Enabled) //Ignore magboots users
|
||||||
|
continue;
|
||||||
|
|
||||||
if(!CanGravPulseAffect(entity))
|
if(!CanGravPulseAffect(entity))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
|
|
||||||
namespace Content.Shared.Anomaly.Effects.Components;
|
namespace Content.Shared.Anomaly.Effects.Components;
|
||||||
|
|
||||||
@@ -9,47 +9,81 @@ public sealed partial class GravityAnomalyComponent : Component
|
|||||||
/// The maximumum size the GravityWellComponent MaxRange can be.
|
/// The maximumum size the GravityWellComponent MaxRange can be.
|
||||||
/// Is scaled linearly with stability.
|
/// Is scaled linearly with stability.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("maxGravityWellRange"), ViewVariables(VVAccess.ReadWrite)]
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
public float MaxGravityWellRange = 8f;
|
public float MaxGravityWellRange = 10f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maximum distance from which the anomaly
|
/// The maximum distance from which the anomaly
|
||||||
/// can throw you via a pulse.
|
/// can throw you via a pulse.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("maxThrowRange"), ViewVariables(VVAccess.ReadWrite)]
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
public float MaxThrowRange = 5f;
|
public float MaxThrowRange = 5f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maximum strength the anomaly
|
/// The maximum strength the anomaly
|
||||||
/// can throw you via a pulse
|
/// can throw you via a pulse
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("maxThrowStrength"), ViewVariables(VVAccess.ReadWrite)]
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
public float MaxThrowStrength = 10;
|
public float MaxThrowStrength = 10;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maximum Intensity of the RadiationSourceComponent.
|
/// The maximum Intensity of the RadiationSourceComponent.
|
||||||
/// Is scaled linearly with stability.
|
/// Is scaled linearly with stability.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("maxRadiationIntensity"), ViewVariables(VVAccess.ReadWrite)]
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
public float MaxRadiationIntensity = 3f;
|
public float MaxRadiationIntensity = 3f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The minimum acceleration value for GravityWellComponent
|
/// The minimum acceleration value for GravityWellComponent
|
||||||
/// Is scaled linearly with stability.
|
/// Is scaled linearly with stability.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("minAccel"), ViewVariables(VVAccess.ReadWrite)]
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
public float MinAccel = 1f;
|
public float MinAccel = 0f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maximum acceleration value for GravityWellComponent
|
/// The maximum acceleration value for GravityWellComponent
|
||||||
/// Is scaled linearly with stability.
|
/// Is scaled linearly with stability.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("maxAccel"), ViewVariables(VVAccess.ReadWrite)]
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
public float MaxAccel = 5f;
|
public float MaxAccel = 5f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The minimum acceleration value for GravityWellComponent
|
||||||
|
/// Is scaled linearly with stability.
|
||||||
|
/// </summary>
|
||||||
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public float MinRadialAccel = 0f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The maximum acceleration value for GravityWellComponent
|
||||||
|
/// Is scaled linearly with stability.
|
||||||
|
/// </summary>
|
||||||
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public float MaxRadialAccel = 5f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The maximum speed for RandomWalkComponent
|
||||||
|
/// Is scaled linearly with severity.
|
||||||
|
/// </summary>
|
||||||
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public float MinSpeed = 0.1f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The maximum speed for RandomWalkComponent
|
||||||
|
/// Is scaled linearly with severity.
|
||||||
|
/// </summary>
|
||||||
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public float MaxSpeed = 1.0f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Random +- speed modifier
|
||||||
|
/// </summary>
|
||||||
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
public float SpeedVariation = 0.1f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The range around the anomaly that will be spaced on supercritical.
|
/// The range around the anomaly that will be spaced on supercritical.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("spaceRange"), ViewVariables(VVAccess.ReadWrite)]
|
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||||
public float SpaceRange = 3f;
|
public float SpaceRange = 3f;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
|
using Robust.Shared.Physics.Components;
|
||||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||||
|
|
||||||
namespace Content.Shared.Weapons.Melee.Components;
|
namespace Content.Shared.Weapons.Melee.Components;
|
||||||
@@ -89,6 +90,12 @@ public sealed partial class MeleeThrownComponent : Component
|
|||||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||||
[AutoNetworkedField]
|
[AutoNetworkedField]
|
||||||
public TimeSpan MinLifetimeTime;
|
public TimeSpan MinLifetimeTime;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// the status to which the entity will return when the thrown ends
|
||||||
|
/// </summary>
|
||||||
|
[DataField]
|
||||||
|
public BodyStatus PreviousStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ public sealed class MeleeThrowOnHitSystem : EntitySystem
|
|||||||
(body.BodyType & (BodyType.Dynamic | BodyType.KinematicController)) == 0x0)
|
(body.BodyType & (BodyType.Dynamic | BodyType.KinematicController)) == 0x0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
comp.PreviousStatus = body.BodyStatus;
|
||||||
comp.ThrownEndTime = _timing.CurTime + TimeSpan.FromSeconds(comp.Lifetime);
|
comp.ThrownEndTime = _timing.CurTime + TimeSpan.FromSeconds(comp.Lifetime);
|
||||||
comp.MinLifetimeTime = _timing.CurTime + TimeSpan.FromSeconds(comp.MinLifetime);
|
comp.MinLifetimeTime = _timing.CurTime + TimeSpan.FromSeconds(comp.MinLifetime);
|
||||||
_physics.SetBodyStatus(body, BodyStatus.InAir);
|
_physics.SetBodyStatus(body, BodyStatus.InAir);
|
||||||
@@ -82,7 +83,7 @@ public sealed class MeleeThrowOnHitSystem : EntitySystem
|
|||||||
private void OnThrownShutdown(Entity<MeleeThrownComponent> ent, ref ComponentShutdown args)
|
private void OnThrownShutdown(Entity<MeleeThrownComponent> ent, ref ComponentShutdown args)
|
||||||
{
|
{
|
||||||
if (TryComp<PhysicsComponent>(ent, out var body))
|
if (TryComp<PhysicsComponent>(ent, out var body))
|
||||||
_physics.SetBodyStatus(body, BodyStatus.OnGround);
|
_physics.SetBodyStatus(body,ent.Comp.PreviousStatus);
|
||||||
var ev = new MeleeThrowOnHitEndEvent();
|
var ev = new MeleeThrowOnHitEndEvent();
|
||||||
RaiseLocalEvent(ent, ref ev);
|
RaiseLocalEvent(ent, ref ev);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,6 +102,14 @@
|
|||||||
- type: GravityAnomaly
|
- type: GravityAnomaly
|
||||||
- type: GravityWell
|
- type: GravityWell
|
||||||
- type: RadiationSource
|
- type: RadiationSource
|
||||||
|
- type: Physics
|
||||||
|
bodyType: Dynamic
|
||||||
|
bodyStatus: InAir
|
||||||
|
- type: CanMoveInAir
|
||||||
|
- type: RandomWalk
|
||||||
|
- type: SingularityDistortion
|
||||||
|
intensity: 1000
|
||||||
|
falloffPower: 2.7
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: AnomalyElectricity
|
id: AnomalyElectricity
|
||||||
|
|||||||
Reference in New Issue
Block a user