Merge branch 'master' into replace-sounds-with-sound-specifier

# Conflicts:
#	Content.Server/Actions/Actions/DisarmAction.cs
#	Content.Server/Actions/Actions/ScreamAction.cs
#	Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs
#	Content.Server/Damage/Components/DamageOnHighSpeedImpactComponent.cs
#	Content.Server/Explosion/Components/FlashExplosiveComponent.cs
#	Content.Server/Physics/Controllers/MoverController.cs
#	Content.Server/Portal/Components/PortalComponent.cs
#	Content.Server/Portal/Components/TeleporterComponent.cs
#	Content.Server/Projectiles/Components/ProjectileComponent.cs
#	Content.Server/Singularity/Components/EmitterComponent.cs
#	Content.Server/Sound/EmitSoundSystem.cs
#	Content.Server/Stunnable/Components/StunbatonComponent.cs
#	Content.Server/Tools/Components/MultitoolComponent.cs
#	Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs
#	Content.Shared/Gravity/GravityComponent.cs
#	Content.Shared/Light/Component/SharedExpendableLightComponent.cs
#	Content.Shared/Maps/ContentTileDefinition.cs
#	Content.Shared/Slippery/SlipperyComponent.cs
#	Content.Shared/Standing/StandingStateComponent.cs
#	Resources/Prototypes/Entities/Objects/Fun/bike_horn.yml
This commit is contained in:
Galactic Chimp
2021-07-25 14:12:00 +02:00
4171 changed files with 15603 additions and 14404 deletions

View File

@@ -1,10 +1,9 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
using Content.Server.Atmos;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Disposal.Tube.Components;
using Content.Server.Interfaces;
using Content.Server.Items;
using Content.Shared.Atmos;
using Content.Shared.Body.Components;
@@ -136,10 +135,11 @@ namespace Content.Server.Disposal.Unit.Components
}
}
if (Owner.Transform.Coordinates.TryGetTileAtmosphere(out var tileAtmos) &&
tileAtmos.Air != null)
var atmosphereSystem = EntitySystem.Get<AtmosphereSystem>();
if (atmosphereSystem.GetTileMixture(Owner.Transform.Coordinates, true) is {} environment)
{
tileAtmos.AssumeAir(Air);
atmosphereSystem.Merge(environment, Air);
Air.Clear();
}

View File

@@ -1,4 +1,3 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
@@ -10,10 +9,10 @@ using Content.Server.Construction.Components;
using Content.Server.Disposal.Tube.Components;
using Content.Server.DoAfter;
using Content.Server.Hands.Components;
using Content.Server.Interfaces;
using Content.Server.Power.Components;
using Content.Server.UserInterface;
using Content.Shared.ActionBlocker;
using Content.Shared.Acts;
using Content.Shared.Atmos;
using Content.Shared.Disposal.Components;
using Content.Shared.DragDrop;
@@ -43,7 +42,7 @@ namespace Content.Server.Disposal.Unit.Components
[ComponentReference(typeof(SharedDisposalUnitComponent))]
[ComponentReference(typeof(IActivate))]
[ComponentReference(typeof(IInteractUsing))]
public class DisposalUnitComponent : SharedDisposalUnitComponent, IInteractHand, IActivate, IInteractUsing, IThrowCollide, IGasMixtureHolder
public class DisposalUnitComponent : SharedDisposalUnitComponent, IInteractHand, IActivate, IInteractUsing, IThrowCollide, IGasMixtureHolder, IDestroyAct
{
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
@@ -277,19 +276,13 @@ namespace Content.Server.Disposal.Unit.Components
var entryComponent = Owner.EntityManager.ComponentManager.GetComponent<DisposalEntryComponent>(entry);
if (Owner.Transform.Coordinates.TryGetTileAtmosphere(out var tileAtmos) &&
tileAtmos.Air != null &&
tileAtmos.Air.Temperature > 0)
var atmosphereSystem = EntitySystem.Get<AtmosphereSystem>();
if (atmosphereSystem.GetTileMixture(Owner.Transform.Coordinates, true) is {Temperature: > 0} environment)
{
var tileAir = tileAtmos.Air;
var transferMoles = 0.1f * (0.05f * Atmospherics.OneAtmosphere * 1.01f - Air.Pressure) * Air.Volume / (tileAir.Temperature * Atmospherics.R);
var transferMoles = 0.1f * (0.05f * Atmospherics.OneAtmosphere * 1.01f - Air.Pressure) * Air.Volume / (environment.Temperature * Atmospherics.R);
Air = tileAir.Remove(transferMoles);
var atmosSystem = EntitySystem.Get<AtmosphereSystem>();
atmosSystem
.GetGridAtmosphere(Owner.Transform.Coordinates)?
.Invalidate(tileAtmos.GridIndices);
Air = environment.Remove(transferMoles);
}
entryComponent.TryInsert(this);
@@ -307,7 +300,7 @@ namespace Content.Server.Disposal.Unit.Components
return true;
}
private void TryEjectContents()
public void TryEjectContents()
{
foreach (var entity in _container.ContainedEntities.ToArray())
{
@@ -694,5 +687,10 @@ namespace Content.Server.Disposal.Unit.Components
component.TryFlush();
}
}
void IDestroyAct.OnDestroy(DestructionEventArgs eventArgs)
{
TryEjectContents();
}
}
}

View File

@@ -1,4 +1,5 @@
using Content.Server.Disposal.Unit.Components;
using Content.Server.Disposal.Unit.Components;
using Content.Server.Construction.Components;
using Robust.Shared.GameObjects;
namespace Content.Server.Disposal.Unit.EntitySystems
@@ -9,15 +10,19 @@ namespace Content.Server.Disposal.Unit.EntitySystems
{
base.Initialize();
SubscribeLocalEvent<DisposalUnitComponent, PhysicsBodyTypeChangedEvent>(BodyTypeChanged);
SubscribeLocalEvent<DisposalUnitComponent, AnchoredEvent>(OnAnchored);
SubscribeLocalEvent<DisposalUnitComponent, UnanchoredEvent>(OnUnanchored);
}
private static void BodyTypeChanged(
EntityUid uid,
DisposalUnitComponent component,
PhysicsBodyTypeChangedEvent args)
private static void OnAnchored(EntityUid uid, DisposalUnitComponent component, AnchoredEvent args)
{
component.UpdateVisualState();
}
private static void OnUnanchored(EntityUid uid, DisposalUnitComponent component, UnanchoredEvent args)
{
component.UpdateVisualState();
component.TryEjectContents();
}
}
}