Merge remote-tracking branch 'upstream/stable' into ed-27-05-2025-upstream-sync

# Conflicts:
#	.github/CODEOWNERS
#	Content.Client/Guidebook/Controls/GuideReagentReaction.xaml.cs
#	Content.IntegrationTests/Tests/Chemistry/TryAllReactionsTest.cs
#	Content.Server/Procedural/DungeonJob/DungeonJob.OreDunGen.cs
#	Resources/Prototypes/Entities/Effects/chemistry_effects.yml
#	Resources/Prototypes/Entities/Mobs/Customization/Markings/human_hair.yml
#	Resources/Prototypes/GameRules/meteorswarms.yml
#	Resources/Prototypes/Procedural/dungeon_configs.yml
This commit is contained in:
Ed
2025-05-27 12:21:14 +03:00
1165 changed files with 76878 additions and 44718 deletions

View File

@@ -1,14 +1,21 @@
using Content.Server.Administration.Logs;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Body.Systems;
using Content.Server.Buckle.Systems;
using Content.Server.Doors.Systems;
using Content.Server.Parallax;
using Content.Server.Procedural;
using Content.Server.Shuttles.Components;
using Content.Server.Shuttles.Events;
using Content.Server.Station.Systems;
using Content.Server.Stunnable;
using Content.Shared.Buckle.Components;
using Content.Shared.Damage;
using Content.Shared.GameTicking;
using Content.Shared.Light.Components;
using Content.Shared.Inventory;
using Content.Shared.Mobs.Systems;
using Content.Shared.Movement.Events;
using Content.Shared.Salvage;
using Content.Shared.Shuttles.Systems;
using Content.Shared.Throwing;
@@ -34,21 +41,22 @@ namespace Content.Server.Shuttles.Systems;
public sealed partial class ShuttleSystem : SharedShuttleSystem
{
[Dependency] private readonly IAdminLogManager _logger = default!;
[Dependency] private readonly IComponentFactory _factory = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly MapSystem _mapSystem = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPrototypeManager _protoManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly ITileDefinitionManager _tileDefManager = default!;
[Dependency] private readonly BiomeSystem _biomes = default!;
[Dependency] private readonly BodySystem _bobby = default!;
[Dependency] private readonly BuckleSystem _buckle = default!;
[Dependency] private readonly DamageableSystem _damageSys = default!;
[Dependency] private readonly DockingSystem _dockSystem = default!;
[Dependency] private readonly DungeonSystem _dungeon = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly FixtureSystem _fixtures = default!;
[Dependency] private readonly MapLoaderSystem _loader = default!;
[Dependency] private readonly MapSystem _mapSystem = default!;
[Dependency] private readonly MetaDataSystem _metadata = default!;
[Dependency] private readonly PvsOverrideSystem _pvs = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
@@ -63,15 +71,21 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
[Dependency] private readonly AtmosphereSystem _atmos = default!; //CP14 FTL atmos
private EntityQuery<BuckleComponent> _buckleQuery;
private EntityQuery<MapGridComponent> _gridQuery;
private EntityQuery<PhysicsComponent> _physicsQuery;
private EntityQuery<TransformComponent> _xformQuery;
public const float TileMassMultiplier = 0.5f;
public const float TileDensityMultiplier = 0.5f;
public override void Initialize()
{
base.Initialize();
_buckleQuery = GetEntityQuery<BuckleComponent>();
_gridQuery = GetEntityQuery<MapGridComponent>();
_physicsQuery = GetEntityQuery<PhysicsComponent>();
_xformQuery = GetEntityQuery<TransformComponent>();
InitializeFTL();
InitializeGridFills();
@@ -80,6 +94,9 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
SubscribeLocalEvent<ShuttleComponent, ComponentStartup>(OnShuttleStartup);
SubscribeLocalEvent<ShuttleComponent, ComponentShutdown>(OnShuttleShutdown);
SubscribeLocalEvent<ShuttleComponent, TileFrictionEvent>(OnTileFriction);
SubscribeLocalEvent<ShuttleComponent, FTLStartedEvent>(OnFTLStarted);
SubscribeLocalEvent<ShuttleComponent, FTLCompletedEvent>(OnFTLCompleted);
SubscribeLocalEvent<GridInitializeEvent>(OnGridInit);
SubscribeLocalEvent<FixturesComponent, GridFixtureChangeEvent>(OnGridFixtureChange);
@@ -95,7 +112,7 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
{
foreach (var fixture in args.NewFixtures)
{
_physics.SetDensity(uid, fixture.Key, fixture.Value, TileMassMultiplier, false, manager);
_physics.SetDensity(uid, fixture.Key, fixture.Value, TileDensityMultiplier, false, manager);
_fixtures.SetRestitution(uid, fixture.Key, fixture.Value, 0.1f, false, manager);
}
}
@@ -105,7 +122,8 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
if (HasComp<MapComponent>(ev.EntityUid))
return;
EntityManager.EnsureComponent<ShuttleComponent>(ev.EntityUid);
EnsureComp<ShuttleComponent>(ev.EntityUid);
EnsureComp<ImplicitRoofComponent>(ev.EntityUid);
}
private void OnShuttleStartup(EntityUid uid, ShuttleComponent component, ComponentStartup args)
@@ -124,6 +142,8 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
{
Enable(uid, component: physicsComponent, shuttle: component);
}
component.DampingModifier = component.BodyModifier;
}
public void Toggle(EntityUid uid, ShuttleComponent component)
@@ -151,8 +171,6 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
_physics.SetBodyType(uid, BodyType.Dynamic, manager: manager, body: component);
_physics.SetBodyStatus(uid, component, BodyStatus.InAir);
_physics.SetFixedRotation(uid, false, manager: manager, body: component);
_physics.SetLinearDamping(uid, component, shuttle.LinearDamping);
_physics.SetAngularDamping(uid, component, shuttle.AngularDamping);
}
public void Disable(EntityUid uid, FixturesComponent? manager = null, PhysicsComponent? component = null)
@@ -173,4 +191,19 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
Disable(uid);
}
private void OnTileFriction(Entity<ShuttleComponent> ent, ref TileFrictionEvent args)
{
args.Modifier *= ent.Comp.DampingModifier;
}
private void OnFTLStarted(Entity<ShuttleComponent> ent, ref FTLStartedEvent args)
{
ent.Comp.DampingModifier = 0f;
}
private void OnFTLCompleted(Entity<ShuttleComponent> ent, ref FTLCompletedEvent args)
{
ent.Comp.DampingModifier = ent.Comp.BodyModifier;
}
}