Твики (#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.Level3 => 10,
_ => 0,
} * 10;
} * 3.3f;
}
if (TryComp<ParticleProjectileComponent>(emitted, out var particle))

View File

@@ -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

View File

@@ -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();
}
@@ -96,6 +100,7 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
gravWell.LastPulseTime = _timing.CurTime;
gravWell.NextPulseTime = gravWell.LastPulseTime + gravWell.TargetPulsePeriod;
if (gravWell.MaxRange < 0.0f || !Resolve(uid, ref xform))
return;
@@ -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,19 +189,27 @@ 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)
{
if (!bodyQuery.TryGetComponent(entity, out var physics)) // WD edit
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
continue;
@@ -204,13 +217,18 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
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);
}
@@ -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);
}

View File

@@ -125,10 +125,6 @@ public sealed class SingularitySystem : SharedSingularitySystem
if (!Resolve(uid, ref singularity))
return;
var oldValue = singularity.Energy;
if (oldValue == value)
return;
singularity.Energy = value;
SetLevel(uid, value switch
{
@@ -158,9 +154,10 @@ public sealed class SingularitySystem : SharedSingularitySystem
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);
}

View File

@@ -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.

View File

@@ -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:

View File

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

View File

@@ -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

View File

@@ -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

View File

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

View File

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

View File

@@ -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: