Твики (#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:
ThereDrD
2024-08-20 04:01:10 +03:00
committed by GitHub
parent 39e89210d8
commit 33d969b36d
12 changed files with 64 additions and 45 deletions

View File

@@ -51,7 +51,7 @@ public sealed partial class ParticleAcceleratorSystem
ParticleAcceleratorPowerState.Level2 => 3, ParticleAcceleratorPowerState.Level2 => 3,
ParticleAcceleratorPowerState.Level3 => 10, ParticleAcceleratorPowerState.Level3 => 10,
_ => 0, _ => 0,
} * 10; } * 3.3f;
} }
if (TryComp<ParticleProjectileComponent>(emitted, out var particle)) if (TryComp<ParticleProjectileComponent>(emitted, out var particle))

View File

@@ -1,4 +1,3 @@
using Content.Shared.Singularity.Components;
using Content.Server.Singularity.EntitySystems; using Content.Server.Singularity.EntitySystems;
namespace Content.Server.Singularity.Components; namespace Content.Server.Singularity.Components;
@@ -13,7 +12,7 @@ public sealed partial class GravityWellComponent : Component
/// <summary> /// <summary>
/// The maximum range at which the gravity well can push/pull entities. /// The maximum range at which the gravity well can push/pull entities.
/// </summary> /// </summary>
[DataField("maxRange")] [DataField]
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
public float MaxRange; 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. /// The minimum range at which the gravity well can push/pull entities.
/// This is effectively hardfloored at <see cref="GravityWellSystem.MinGravPulseRange"/>. /// This is effectively hardfloored at <see cref="GravityWellSystem.MinGravPulseRange"/>.
/// </summary> /// </summary>
[DataField("minRange")] [DataField]
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
public float MinRange = 0f; public float MinRange;
/// <summary> /// <summary>
/// The acceleration entities will experience towards the gravity well at a distance of 1m. /// The acceleration entities will experience towards the gravity well at a distance of 1m.
/// Negative values accelerate entities away from the gravity well. /// Negative values accelerate entities away from the gravity well.
/// Actual acceleration scales with the inverse of the distance to the singularity. /// Actual acceleration scales with the inverse of the distance to the singularity.
/// </summary> /// </summary>
[DataField("baseRadialAcceleration")] [DataField]
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
public float BaseRadialAcceleration = 0.0f; public float BaseRadialAcceleration;
/// <summary> /// <summary>
/// The acceleration entities will experience tangent to the gravity well at a distance of 1m. /// The acceleration entities will experience tangent to the gravity well at a distance of 1m.
/// Positive tangential acceleration is counter-clockwise. /// Positive tangential acceleration is counter-clockwise.
/// Actual acceleration scales with the inverse of the distance to the singularity. /// Actual acceleration scales with the inverse of the distance to the singularity.
/// </summary> /// </summary>
[DataField("baseTangentialAcceleration")] [DataField]
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
public float BaseTangentialAcceleration = 0.0f; public float BaseTangentialAcceleration;
#region Update Timing #region Update Timing

View File

@@ -1,7 +1,9 @@
using Content.Server._White.Other;
using Content.Server.Atmos.Components; using Content.Server.Atmos.Components;
using Content.Server.Singularity.Components; using Content.Server.Singularity.Components;
using Content.Server.Stunnable; using Content.Server.Stunnable;
using Content.Shared.Ghost; using Content.Shared.Ghost;
using Content.Shared.Singularity.Components;
using Content.Shared.Singularity.EntitySystems; using Content.Shared.Singularity.EntitySystems;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Map.Components; using Robust.Shared.Map.Components;
@@ -37,6 +39,7 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
SubscribeLocalEvent<GravityWellComponent, ComponentStartup>(OnGravityWellStartup); SubscribeLocalEvent<GravityWellComponent, ComponentStartup>(OnGravityWellStartup);
var vvHandle = _vvManager.GetTypeHandler<GravityWellComponent>(); var vvHandle = _vvManager.GetTypeHandler<GravityWellComponent>();
@@ -47,6 +50,7 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
{ {
var vvHandle = _vvManager.GetTypeHandler<GravityWellComponent>(); var vvHandle = _vvManager.GetTypeHandler<GravityWellComponent>();
vvHandle.RemovePath(nameof(GravityWellComponent.TargetPulsePeriod)); vvHandle.RemovePath(nameof(GravityWellComponent.TargetPulsePeriod));
base.Shutdown(); base.Shutdown();
} }
@@ -96,6 +100,7 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
gravWell.LastPulseTime = _timing.CurTime; gravWell.LastPulseTime = _timing.CurTime;
gravWell.NextPulseTime = gravWell.LastPulseTime + gravWell.TargetPulsePeriod; gravWell.NextPulseTime = gravWell.LastPulseTime + gravWell.TargetPulsePeriod;
if (gravWell.MaxRange < 0.0f || !Resolve(uid, ref xform)) if (gravWell.MaxRange < 0.0f || !Resolve(uid, ref xform))
return; return;
@@ -113,10 +118,10 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
private bool CanGravPulseAffect(EntityUid entity) private bool CanGravPulseAffect(EntityUid entity)
{ {
return !( return !(
EntityManager.HasComponent<GhostComponent>(entity) || HasComp<GhostComponent>(entity) ||
EntityManager.HasComponent<MapGridComponent>(entity) || HasComp<MapGridComponent>(entity) ||
EntityManager.HasComponent<MapComponent>(entity) || HasComp<MapComponent>(entity) ||
EntityManager.HasComponent<GravityWellComponent>(entity) HasComp<GravityWellComponent>(entity)
); );
} }
@@ -184,19 +189,27 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
var epicenter = mapPos.Position; 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 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 bodyQuery = GetEntityQuery<PhysicsComponent>();
var xformQuery = GetEntityQuery<TransformComponent>(); 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) if (ignore?.Contains(entity) is true)
continue; continue;
if (!bodyQuery.TryGetComponent(entity, out var physics) if (!bodyQuery.TryGetComponent(entity, out var physics)) // WD edit
|| physics.BodyType == BodyType.Static)
{
continue; continue;
}
// 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 if (TryComp<MovedByPressureComponent>(entity, out var movedPressure) && !movedPressure.Enabled) // Ignore magboots users
continue; continue;
@@ -204,13 +217,18 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
if (!CanGravPulseAffect(entity)) if (!CanGravPulseAffect(entity))
continue; continue;
if (xform.Anchored) // WD added
_transform.Unanchor(entity, xform);
var displacement = epicenter - _transform.GetWorldPosition(entity, xformQuery); var displacement = epicenter - _transform.GetWorldPosition(entity, xformQuery);
var distance2 = displacement.LengthSquared(); var distance2 = displacement.LengthSquared();
if (distance2 < minRange2) if (distance2 < minRange2)
continue; continue;
var scaling = (1f / distance2) * physics.Mass; // TODO: Variable falloff gradiants. var scaling = (1f / distance2) * physics.Mass; // TODO: Variable falloff gradiants.
_physics.ApplyLinearImpulse(entity, (displacement * baseMatrixDeltaV) * scaling, body: physics); _physics.ApplyLinearImpulse(entity, (displacement * baseMatrixDeltaV) * scaling, body: physics);
if (stunTime > 0f) if (stunTime > 0f)
_stun.TryParalyze(entity, TimeSpan.FromSeconds(stunTime), true); _stun.TryParalyze(entity, TimeSpan.FromSeconds(stunTime), true);
} }
@@ -254,6 +272,7 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
gravWell.NextPulseTime = gravWell.LastPulseTime + gravWell.TargetPulsePeriod; gravWell.NextPulseTime = gravWell.LastPulseTime + gravWell.TargetPulsePeriod;
var curTime = _timing.CurTime; var curTime = _timing.CurTime;
if (gravWell.NextPulseTime <= curTime) if (gravWell.NextPulseTime <= curTime)
Update(uid, curTime - gravWell.LastPulseTime, gravWell); Update(uid, curTime - gravWell.LastPulseTime, gravWell);
} }

View File

@@ -125,10 +125,6 @@ public sealed class SingularitySystem : SharedSingularitySystem
if (!Resolve(uid, ref singularity)) if (!Resolve(uid, ref singularity))
return; return;
var oldValue = singularity.Energy;
if (oldValue == value)
return;
singularity.Energy = value; singularity.Energy = value;
SetLevel(uid, value switch SetLevel(uid, value switch
{ {
@@ -158,9 +154,10 @@ public sealed class SingularitySystem : SharedSingularitySystem
return; return;
var newValue = singularity.Energy + delta; var newValue = singularity.Energy + delta;
if((!snapMin && newValue < min)
|| (!snapMax && newValue > max)) if ((!snapMin && newValue < min) || (!snapMax && newValue > max))
return; return;
SetEnergy(uid, MathHelper.Clamp(newValue, min, max), singularity); SetEnergy(uid, MathHelper.Clamp(newValue, min, max), singularity);
} }

View File

@@ -27,7 +27,7 @@ public sealed partial class EmbeddableProjectileComponent : Component
/// How long it takes to remove the embedded object. /// How long it takes to remove the embedded object.
/// </summary> /// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField] [ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public float? RemovalTime = 3f; public float? RemovalTime = 1f;
/// <summary> /// <summary>
/// Whether this entity will embed when thrown, or only when shot as a projectile. /// Whether this entity will embed when thrown, or only when shot as a projectile.

View File

@@ -250,7 +250,7 @@
sprintModifier: 0.8 sprintModifier: 0.8
- type: entity - type: entity
parent: ClothingShoesBaseButcherable parent: ClothingShoesBase
id: ClothingShoesSkates id: ClothingShoesSkates
name: roller skates name: roller skates
description: "Get your skates on!" description: "Get your skates on!"
@@ -266,8 +266,8 @@
- type: Item - type: Item
sprite: Clothing/Shoes/Specific/skates.rsi sprite: Clothing/Shoes/Specific/skates.rsi
- type: ClothingSpeedModifier - type: ClothingSpeedModifier
walkModifier: 1.1 walkModifier: 1.3
sprintModifier: 1.1 sprintModifier: 1.3
- type: Skates - type: Skates
- type: FootstepModifier - type: FootstepModifier
footstepSoundCollection: footstepSoundCollection:

View File

@@ -24,7 +24,7 @@
- type: NavMapBeacon - type: NavMapBeacon
defaultText: station-beacon-general defaultText: station-beacon-general
color: "#D4D4D496" color: "#D4D4D496"
- type: WarpPoint # - type: WarpPoint WD edit
- type: SpawnTeleportLocation - type: SpawnTeleportLocation
- type: GiftIgnore - type: GiftIgnore
- type: ActivatableUI - type: ActivatableUI

View File

@@ -70,9 +70,9 @@
- type: ExplodeOnTrigger - type: ExplodeOnTrigger
- type: Explosive - type: Explosive
explosionType: Default explosionType: Default
maxIntensity: 10 maxIntensity: 40
intensitySlope: 3 intensitySlope: 3
totalIntensity: 120 # about a ~4 tile radius totalIntensity: 70 # about a ~4 tile radius
canCreateVacuum: false canCreateVacuum: false
- type: entity - type: entity

View File

@@ -409,6 +409,10 @@
state: icon state: icon
- type: Item - type: Item
size: Normal size: Normal
storedRotation: -90
shape: # WD
- 0, 1, 0, 1
- 0, 0, 1, 0
- type: Clothing - type: Clothing
sprite: Objects/Tools/rcd.rsi sprite: Objects/Tools/rcd.rsi
quickEquip: false quickEquip: false

View File

@@ -16,7 +16,7 @@
- type: Wieldable - type: Wieldable
- type: GunWieldBonus - type: GunWieldBonus
minAngle: -20 minAngle: -20
maxAngle: -20 maxAngle: -35 # WD
- type: Gun - type: Gun
minAngle: 24 minAngle: 24
maxAngle: 45 maxAngle: 45

View File

@@ -46,7 +46,7 @@
- type: DamageOtherOnHit - type: DamageOtherOnHit
damage: damage:
types: types:
Piercing: 15 Piercing: 30 # WD
- type: Item - type: Item
storedRotation: 44 # It just works storedRotation: 44 # It just works
size: Huge size: Huge

View File

@@ -19,8 +19,8 @@
colliderFixtureId: EventHorizonCollider colliderFixtureId: EventHorizonCollider
consumerFixtureId: EventHorizonConsumer consumerFixtureId: EventHorizonConsumer
- type: GravityWell # To make the singularity attract things. - type: GravityWell # To make the singularity attract things.
baseRadialAcceleration: 10 baseRadialAcceleration: 20
maxRange: 4 maxRange: 10
- type: Fixtures - type: Fixtures
fixtures: fixtures:
EventHorizonCollider: EventHorizonCollider: