Твики (#575)
* faster skates * better rotation for RCD * remove WarpPoint component from station beacon * cleanup * add robust singulo * buff land mines * better l6 * wd edit * removing embed projectiles faster now * da ebanniy rot ya vse pereputal
This commit is contained in:
@@ -51,7 +51,7 @@ public sealed partial class ParticleAcceleratorSystem
|
||||
ParticleAcceleratorPowerState.Level2 => 3,
|
||||
ParticleAcceleratorPowerState.Level3 => 10,
|
||||
_ => 0,
|
||||
} * 10;
|
||||
} * 3.3f;
|
||||
}
|
||||
|
||||
if (TryComp<ParticleProjectileComponent>(emitted, out var particle))
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Content.Shared.Singularity.Components;
|
||||
using Content.Server.Singularity.EntitySystems;
|
||||
|
||||
namespace Content.Server.Singularity.Components;
|
||||
@@ -13,7 +12,7 @@ public sealed partial class GravityWellComponent : Component
|
||||
/// <summary>
|
||||
/// The maximum range at which the gravity well can push/pull entities.
|
||||
/// </summary>
|
||||
[DataField("maxRange")]
|
||||
[DataField]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float MaxRange;
|
||||
|
||||
@@ -21,27 +20,27 @@ public sealed partial class GravityWellComponent : Component
|
||||
/// The minimum range at which the gravity well can push/pull entities.
|
||||
/// This is effectively hardfloored at <see cref="GravityWellSystem.MinGravPulseRange"/>.
|
||||
/// </summary>
|
||||
[DataField("minRange")]
|
||||
[DataField]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float MinRange = 0f;
|
||||
public float MinRange;
|
||||
|
||||
/// <summary>
|
||||
/// The acceleration entities will experience towards the gravity well at a distance of 1m.
|
||||
/// Negative values accelerate entities away from the gravity well.
|
||||
/// Actual acceleration scales with the inverse of the distance to the singularity.
|
||||
/// </summary>
|
||||
[DataField("baseRadialAcceleration")]
|
||||
[DataField]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float BaseRadialAcceleration = 0.0f;
|
||||
public float BaseRadialAcceleration;
|
||||
|
||||
/// <summary>
|
||||
/// The acceleration entities will experience tangent to the gravity well at a distance of 1m.
|
||||
/// Positive tangential acceleration is counter-clockwise.
|
||||
/// Actual acceleration scales with the inverse of the distance to the singularity.
|
||||
/// </summary>
|
||||
[DataField("baseTangentialAcceleration")]
|
||||
[DataField]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public float BaseTangentialAcceleration = 0.0f;
|
||||
public float BaseTangentialAcceleration;
|
||||
|
||||
#region Update Timing
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using Content.Server._White.Other;
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Server.Singularity.Components;
|
||||
using Content.Server.Stunnable;
|
||||
using Content.Shared.Ghost;
|
||||
using Content.Shared.Singularity.Components;
|
||||
using Content.Shared.Singularity.EntitySystems;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
@@ -37,6 +39,7 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<GravityWellComponent, ComponentStartup>(OnGravityWellStartup);
|
||||
|
||||
var vvHandle = _vvManager.GetTypeHandler<GravityWellComponent>();
|
||||
@@ -47,6 +50,7 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
|
||||
{
|
||||
var vvHandle = _vvManager.GetTypeHandler<GravityWellComponent>();
|
||||
vvHandle.RemovePath(nameof(GravityWellComponent.TargetPulsePeriod));
|
||||
|
||||
base.Shutdown();
|
||||
}
|
||||
|
||||
@@ -57,7 +61,7 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
|
||||
/// <param name="frameTime">The time elapsed since the last set of updates.</param>
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
if(!_timing.IsFirstTimePredicted)
|
||||
if (!_timing.IsFirstTimePredicted)
|
||||
return;
|
||||
|
||||
var query = EntityQueryEnumerator<GravityWellComponent, TransformComponent>();
|
||||
@@ -91,15 +95,16 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
|
||||
/// <param name="xform">The transform of the gravity well to make pulse.</param>
|
||||
private void Update(EntityUid uid, TimeSpan frameTime, GravityWellComponent? gravWell = null, TransformComponent? xform = null)
|
||||
{
|
||||
if(!Resolve(uid, ref gravWell))
|
||||
if (!Resolve(uid, ref gravWell))
|
||||
return;
|
||||
|
||||
gravWell.LastPulseTime = _timing.CurTime;
|
||||
gravWell.NextPulseTime = gravWell.LastPulseTime + gravWell.TargetPulsePeriod;
|
||||
|
||||
if (gravWell.MaxRange < 0.0f || !Resolve(uid, ref xform))
|
||||
return;
|
||||
|
||||
var scale = (float)frameTime.TotalSeconds;
|
||||
var scale = (float) frameTime.TotalSeconds;
|
||||
GravPulse(uid, gravWell.MaxRange, gravWell.MinRange, gravWell.BaseRadialAcceleration * scale, gravWell.BaseTangentialAcceleration * scale, xform);
|
||||
}
|
||||
|
||||
@@ -113,10 +118,10 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
|
||||
private bool CanGravPulseAffect(EntityUid entity)
|
||||
{
|
||||
return !(
|
||||
EntityManager.HasComponent<GhostComponent>(entity) ||
|
||||
EntityManager.HasComponent<MapGridComponent>(entity) ||
|
||||
EntityManager.HasComponent<MapComponent>(entity) ||
|
||||
EntityManager.HasComponent<GravityWellComponent>(entity)
|
||||
HasComp<GhostComponent>(entity) ||
|
||||
HasComp<MapGridComponent>(entity) ||
|
||||
HasComp<MapComponent>(entity) ||
|
||||
HasComp<GravityWellComponent>(entity)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -184,33 +189,46 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
|
||||
|
||||
var epicenter = mapPos.Position;
|
||||
var minRange2 = MathF.Max(minRange * minRange, MinGravPulseRange); // Cache square value for speed. Also apply a sane minimum value to the minimum value so that div/0s don't happen.
|
||||
|
||||
var bodyQuery = GetEntityQuery<PhysicsComponent>();
|
||||
var xformQuery = GetEntityQuery<TransformComponent>();
|
||||
|
||||
foreach(var entity in _lookup.GetEntitiesInRange(mapPos.MapId, epicenter, maxRange, flags: LookupFlags.Dynamic | LookupFlags.Sundries))
|
||||
foreach(var entity in _lookup.GetEntitiesInRange(mapPos.MapId, epicenter, maxRange, flags: LookupFlags.Dynamic | LookupFlags.Static | LookupFlags.Sundries))
|
||||
{
|
||||
if (ignore?.Contains(entity) is true)
|
||||
continue;
|
||||
|
||||
if (!bodyQuery.TryGetComponent(entity, out var physics)
|
||||
|| physics.BodyType == BodyType.Static)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (TryComp<MovedByPressureComponent>(entity, out var movedPressure) && !movedPressure.Enabled) //Ignore magboots users
|
||||
if (!bodyQuery.TryGetComponent(entity, out var physics)) // WD edit
|
||||
continue;
|
||||
|
||||
if(!CanGravPulseAffect(entity))
|
||||
// WD added start
|
||||
var xform = Transform(entity);
|
||||
|
||||
if (HasComp<ContainmentFieldGeneratorComponent>(entity))
|
||||
continue;
|
||||
|
||||
if (xform.Anchored && HasComp<RadiationCollectorComponent>(entity))
|
||||
continue;
|
||||
// WD added end
|
||||
|
||||
if (TryComp<MovedByPressureComponent>(entity, out var movedPressure) && !movedPressure.Enabled) // Ignore magboots users
|
||||
continue;
|
||||
|
||||
if (!CanGravPulseAffect(entity))
|
||||
continue;
|
||||
|
||||
if (xform.Anchored) // WD added
|
||||
_transform.Unanchor(entity, xform);
|
||||
|
||||
var displacement = epicenter - _transform.GetWorldPosition(entity, xformQuery);
|
||||
var distance2 = displacement.LengthSquared();
|
||||
|
||||
if (distance2 < minRange2)
|
||||
continue;
|
||||
|
||||
var scaling = (1f / distance2) * physics.Mass; // TODO: Variable falloff gradiants.
|
||||
_physics.ApplyLinearImpulse(entity, (displacement * baseMatrixDeltaV) * scaling, body: physics);
|
||||
|
||||
if (stunTime > 0f)
|
||||
_stun.TryParalyze(entity, TimeSpan.FromSeconds(stunTime), true);
|
||||
}
|
||||
@@ -244,7 +262,7 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
|
||||
/// <param name="gravWell">The state of the gravity well to set the pulse period for.</param>
|
||||
public void SetPulsePeriod(EntityUid uid, TimeSpan value, GravityWellComponent? gravWell = null)
|
||||
{
|
||||
if(!Resolve(uid, ref gravWell))
|
||||
if (!Resolve(uid, ref gravWell))
|
||||
return;
|
||||
|
||||
if (MathHelper.CloseTo(gravWell.TargetPulsePeriod.TotalSeconds, value.TotalSeconds))
|
||||
@@ -254,6 +272,7 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
|
||||
gravWell.NextPulseTime = gravWell.LastPulseTime + gravWell.TargetPulsePeriod;
|
||||
|
||||
var curTime = _timing.CurTime;
|
||||
|
||||
if (gravWell.NextPulseTime <= curTime)
|
||||
Update(uid, curTime - gravWell.LastPulseTime, gravWell);
|
||||
}
|
||||
|
||||
@@ -122,11 +122,7 @@ public sealed class SingularitySystem : SharedSingularitySystem
|
||||
/// <param name="singularity">The state of the singularity to set the energy of.</param>
|
||||
public void SetEnergy(EntityUid uid, float value, SingularityComponent? singularity = null)
|
||||
{
|
||||
if(!Resolve(uid, ref singularity))
|
||||
return;
|
||||
|
||||
var oldValue = singularity.Energy;
|
||||
if (oldValue == value)
|
||||
if (!Resolve(uid, ref singularity))
|
||||
return;
|
||||
|
||||
singularity.Energy = value;
|
||||
@@ -154,13 +150,14 @@ public sealed class SingularitySystem : SharedSingularitySystem
|
||||
/// <param name="singularity">The state of the singularity to adjust the energy of.</param>
|
||||
public void AdjustEnergy(EntityUid uid, float delta, float min = float.MinValue, float max = float.MaxValue, bool snapMin = true, bool snapMax = true, SingularityComponent? singularity = null)
|
||||
{
|
||||
if(!Resolve(uid, ref singularity))
|
||||
if (!Resolve(uid, ref singularity))
|
||||
return;
|
||||
|
||||
var newValue = singularity.Energy + delta;
|
||||
if((!snapMin && newValue < min)
|
||||
|| (!snapMax && newValue > max))
|
||||
|
||||
if ((!snapMin && newValue < min) || (!snapMax && newValue > max))
|
||||
return;
|
||||
|
||||
SetEnergy(uid, MathHelper.Clamp(newValue, min, max), singularity);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public sealed partial class EmbeddableProjectileComponent : Component
|
||||
/// How long it takes to remove the embedded object.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
|
||||
public float? RemovalTime = 3f;
|
||||
public float? RemovalTime = 1f;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this entity will embed when thrown, or only when shot as a projectile.
|
||||
|
||||
@@ -250,7 +250,7 @@
|
||||
sprintModifier: 0.8
|
||||
|
||||
- type: entity
|
||||
parent: ClothingShoesBaseButcherable
|
||||
parent: ClothingShoesBase
|
||||
id: ClothingShoesSkates
|
||||
name: roller skates
|
||||
description: "Get your skates on!"
|
||||
@@ -266,8 +266,8 @@
|
||||
- type: Item
|
||||
sprite: Clothing/Shoes/Specific/skates.rsi
|
||||
- type: ClothingSpeedModifier
|
||||
walkModifier: 1.1
|
||||
sprintModifier: 1.1
|
||||
walkModifier: 1.3
|
||||
sprintModifier: 1.3
|
||||
- type: Skates
|
||||
- type: FootstepModifier
|
||||
footstepSoundCollection:
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
- type: NavMapBeacon
|
||||
defaultText: station-beacon-general
|
||||
color: "#D4D4D496"
|
||||
- type: WarpPoint
|
||||
# - type: WarpPoint WD edit
|
||||
- type: SpawnTeleportLocation
|
||||
- type: GiftIgnore
|
||||
- type: ActivatableUI
|
||||
|
||||
@@ -70,9 +70,9 @@
|
||||
- type: ExplodeOnTrigger
|
||||
- type: Explosive
|
||||
explosionType: Default
|
||||
maxIntensity: 10
|
||||
maxIntensity: 40
|
||||
intensitySlope: 3
|
||||
totalIntensity: 120 # about a ~4 tile radius
|
||||
totalIntensity: 70 # about a ~4 tile radius
|
||||
canCreateVacuum: false
|
||||
|
||||
- type: entity
|
||||
|
||||
@@ -409,6 +409,10 @@
|
||||
state: icon
|
||||
- type: Item
|
||||
size: Normal
|
||||
storedRotation: -90
|
||||
shape: # WD
|
||||
- 0, 1, 0, 1
|
||||
- 0, 0, 1, 0
|
||||
- type: Clothing
|
||||
sprite: Objects/Tools/rcd.rsi
|
||||
quickEquip: false
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
- type: Wieldable
|
||||
- type: GunWieldBonus
|
||||
minAngle: -20
|
||||
maxAngle: -20
|
||||
maxAngle: -35 # WD
|
||||
- type: Gun
|
||||
minAngle: 24
|
||||
maxAngle: 45
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
- type: DamageOtherOnHit
|
||||
damage:
|
||||
types:
|
||||
Piercing: 15
|
||||
Piercing: 30 # WD
|
||||
- type: Item
|
||||
storedRotation: 44 # It just works
|
||||
size: Huge
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
colliderFixtureId: EventHorizonCollider
|
||||
consumerFixtureId: EventHorizonConsumer
|
||||
- type: GravityWell # To make the singularity attract things.
|
||||
baseRadialAcceleration: 10
|
||||
maxRange: 4
|
||||
baseRadialAcceleration: 20
|
||||
maxRange: 10
|
||||
- type: Fixtures
|
||||
fixtures:
|
||||
EventHorizonCollider:
|
||||
|
||||
Reference in New Issue
Block a user