* fix a lot of spaces in shuttle call reason * fix tts fatal without api url * Physics Based Air Throws (#342) I've made it so that when a room is explosively depressurized(or when a body of high pressure air flows into one of lower pressure air), that entities inside are launched by the air pressure with effects according to their mass. An entity's mass is now used as an innate resistance to forced movement by airflow, and more massive entities are both less likely to be launched, and will launch less far than others. While lighter entities are launched far more easily, and will shoot off into space quite quickly! Spacing departments has never been so exciting! This can be made extraordinarily fun if more objects are given the ability to injure people when colliding with them at high speeds. As a note, Humans are very unlikely to be sucked into space at a typical force generated from a 101kpa room venting into 0kpa, unless they happened to be standing right next to the opening to space when it was created. The same cannot be said for "Lighter-Than-Human" species such as Felinids and Harpies. I guess that's just the price to pay for being cute. :) On a plus side, because the math behind this is simplified even further than it was before, this actually runs more efficiently than the previous system. Nothing, this is basically done. I've spent a good 6 hours straight finely tuning the system until I was satisfied that it reflects something close to reality. **Before the Space Wind Rework:** https://github.com/Simple-Station/Einstein-Engines/assets/16548818/0bf56c50-58e6-4aef-97f8-027fbe62331e **With this Rework:** https://github.com/Simple-Station/Einstein-Engines/assets/16548818/6be507a9-e9de-4bb8-9d46-8b7c83ed5f1d 🆑 VMSolidus - add: Atmospheric "Throws" are now calculated using object mass, and behave accordingly. Tiny objects will shoot out of rooms quite fast! --------- Signed-off-by: VMSolidus <evilexecutive@gmail.com> Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> * fixes --------- Signed-off-by: VMSolidus <evilexecutive@gmail.com> Co-authored-by: VMSolidus <evilexecutive@gmail.com> Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com>
113 lines
4.0 KiB
C#
113 lines
4.0 KiB
C#
using Content.Server.Administration.Logs;
|
|
using Content.Server.Atmos.Components;
|
|
using Content.Server.Body.Systems;
|
|
using Content.Server.Fluids.EntitySystems;
|
|
using Content.Server.NodeContainer.EntitySystems;
|
|
using Content.Shared.Atmos.EntitySystems;
|
|
using Content.Shared.Doors.Components;
|
|
using Content.Shared.Maps;
|
|
using Content.Shared.Throwing;
|
|
using JetBrains.Annotations;
|
|
using Robust.Server.GameObjects;
|
|
using Robust.Shared.Audio.Systems;
|
|
using Robust.Shared.Containers;
|
|
using Robust.Shared.Map;
|
|
using Robust.Shared.Physics.Systems;
|
|
using Robust.Shared.Random;
|
|
|
|
namespace Content.Server.Atmos.EntitySystems;
|
|
|
|
/// <summary>
|
|
/// This is our SSAir equivalent, if you need to interact with or query atmos in any way, go through this.
|
|
/// </summary>
|
|
[UsedImplicitly]
|
|
public sealed partial class AtmosphereSystem : SharedAtmosphereSystem
|
|
{
|
|
[Dependency] private readonly IMapManager _mapManager = default!;
|
|
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
|
|
[Dependency] private readonly IRobustRandom _robustRandom = default!;
|
|
[Dependency] private readonly IAdminLogManager _adminLog = default!;
|
|
[Dependency] private readonly EntityLookupSystem _lookup = default!;
|
|
[Dependency] private readonly InternalsSystem _internals = default!;
|
|
[Dependency] private readonly SharedContainerSystem _containers = default!;
|
|
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
|
[Dependency] private readonly GasTileOverlaySystem _gasTileOverlaySystem = default!;
|
|
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
|
[Dependency] private readonly SharedMapSystem _mapSystem = default!;
|
|
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
|
|
[Dependency] private readonly TileSystem _tile = default!;
|
|
[Dependency] private readonly MapSystem _map = default!;
|
|
[Dependency] public readonly PuddleSystem Puddle = default!;
|
|
[Dependency] private readonly ThrowingSystem _throwing = default!;
|
|
|
|
private const float ExposedUpdateDelay = 1f;
|
|
private float _exposedTimer = 0f;
|
|
|
|
private EntityQuery<GridAtmosphereComponent> _atmosQuery;
|
|
private EntityQuery<MapAtmosphereComponent> _mapAtmosQuery;
|
|
private EntityQuery<AirtightComponent> _airtightQuery;
|
|
private EntityQuery<FirelockComponent> _firelockQuery;
|
|
private HashSet<EntityUid> _entSet = new();
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
UpdatesAfter.Add(typeof(NodeGroupSystem));
|
|
|
|
InitializeBreathTool();
|
|
InitializeGases();
|
|
InitializeCommands();
|
|
InitializeCVars();
|
|
InitializeGridAtmosphere();
|
|
InitializeMap();
|
|
|
|
_mapAtmosQuery = GetEntityQuery<MapAtmosphereComponent>();
|
|
_atmosQuery = GetEntityQuery<GridAtmosphereComponent>();
|
|
_airtightQuery = GetEntityQuery<AirtightComponent>();
|
|
_firelockQuery = GetEntityQuery<FirelockComponent>();
|
|
|
|
SubscribeLocalEvent<TileChangedEvent>(OnTileChanged);
|
|
|
|
}
|
|
|
|
public override void Shutdown()
|
|
{
|
|
base.Shutdown();
|
|
|
|
ShutdownCommands();
|
|
}
|
|
|
|
private void OnTileChanged(ref TileChangedEvent ev)
|
|
{
|
|
InvalidateTile(ev.NewTile.GridUid, ev.NewTile.GridIndices);
|
|
}
|
|
|
|
public override void Update(float frameTime)
|
|
{
|
|
base.Update(frameTime);
|
|
|
|
UpdateProcessing(frameTime);
|
|
UpdateHighPressure(frameTime);
|
|
|
|
_exposedTimer += frameTime;
|
|
|
|
if (_exposedTimer < ExposedUpdateDelay)
|
|
return;
|
|
|
|
var query = EntityQueryEnumerator<AtmosExposedComponent, TransformComponent>();
|
|
while (query.MoveNext(out var uid, out _, out var transform))
|
|
{
|
|
var air = GetContainingMixture((uid, transform));
|
|
|
|
if (air == null)
|
|
continue;
|
|
|
|
var updateEvent = new AtmosExposedUpdateEvent(transform.Coordinates, air, transform);
|
|
RaiseLocalEvent(uid, ref updateEvent);
|
|
}
|
|
|
|
_exposedTimer -= ExposedUpdateDelay;
|
|
}
|
|
}
|