Atmos optimizations (#1944)
* Adds IFireAct, ITemperatureExpose * Use AtmosDirection instead of Direction for Atmos * Refactor atmos to heavily rely on arrays and bitflags. Adds F A S T M O S and reduces atmos tech debt heavily. * Optimize and fix more stuff * Kinda improve superconduction * Pipenet is a word * T U R B O M O S * Address reviews * Small optimization * Superconduct is also a word * Remove check * Cleanup tile atmosphere * Correct a comment
This commit is contained in:
committed by
GitHub
parent
3758eb1b60
commit
fb0ac3d70e
@@ -1,6 +1,7 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using Content.Server.GameObjects.Components.Atmos;
|
||||
using Content.Shared.Atmos;
|
||||
using Robust.Shared.GameObjects.Components;
|
||||
using Robust.Shared.Interfaces.Physics;
|
||||
using Robust.Shared.Interfaces.Random;
|
||||
@@ -24,7 +25,7 @@ namespace Content.Server.Atmos
|
||||
private const float ProbabilityBasePercent = 10f;
|
||||
private const float ThrowForce = 100f;
|
||||
|
||||
public void ExperiencePressureDifference(int cycle, float pressureDifference, Direction direction,
|
||||
public void ExperiencePressureDifference(int cycle, float pressureDifference, AtmosDirection direction,
|
||||
float pressureResistanceProbDelta, GridCoordinates throwTarget)
|
||||
{
|
||||
if (ControlledComponent == null)
|
||||
@@ -54,14 +55,14 @@ namespace Content.Server.Atmos
|
||||
if (throwTarget != GridCoordinates.InvalidGrid)
|
||||
{
|
||||
var moveForce = maxForce * MathHelper.Clamp(moveProb, 0, 100) / 150f;
|
||||
var pos = ((throwTarget.Position - transform.GridPosition.Position).Normalized + direction.ToVec()).Normalized;
|
||||
var pos = ((throwTarget.Position - transform.GridPosition.Position).Normalized + direction.ToDirection().ToVec()).Normalized;
|
||||
LinearVelocity = pos * moveForce;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
var moveForce = MathF.Min(maxForce * MathHelper.Clamp(moveProb, 0, 100) / 2500f, 20f);
|
||||
LinearVelocity = direction.ToVec() * moveForce;
|
||||
LinearVelocity = direction.ToDirection().ToVec() * moveForce;
|
||||
}
|
||||
|
||||
pressureComponent.LastHighPressureMovementAirCycle = cycle;
|
||||
|
||||
Reference in New Issue
Block a user