Merge branch 'space-wizards:master' into master

This commit is contained in:
Ed
2024-03-29 21:50:13 +03:00
committed by GitHub
111 changed files with 572 additions and 531 deletions

View File

@@ -4,7 +4,6 @@ using JetBrains.Annotations;
using Robust.Client.Player;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
namespace Content.Client.Alerts;
@@ -13,7 +12,6 @@ public sealed class ClientAlertsSystem : AlertsSystem
{
public AlertOrderPrototype? AlertOrder { get; set; }
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;

View File

@@ -50,7 +50,6 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
private static AudioParams _params = AudioParams.Default
.WithVariation(0.01f)
.WithLoop(true)
.WithAttenuation(Attenuation.LinearDistance)
.WithMaxDistance(7f);
/// <summary>

View File

@@ -23,8 +23,8 @@ public sealed partial class ContentAudioSystem
[Dependency] private readonly IStateManager _stateManager = default!;
[Dependency] private readonly IResourceCache _resourceCache = default!;
private readonly AudioParams _lobbySoundtrackParams = new(-5f, 1, "Master", 0, 0, 0, false, 0f);
private readonly AudioParams _roundEndSoundEffectParams = new(-5f, 1, "Master", 0, 0, 0, false, 0f);
private readonly AudioParams _lobbySoundtrackParams = new(-5f, 1, 0, 0, 0, false, 0f);
private readonly AudioParams _roundEndSoundEffectParams = new(-5f, 1, 0, 0, 0, false, 0f);
/// <summary>
/// EntityUid of lobby restart sound component.

View File

@@ -133,7 +133,7 @@ public sealed class ClientClothingSystem : ClothingSystem
else if (TryComp(uid, out SpriteComponent? sprite))
rsi = sprite.BaseRSI;
if (rsi == null || rsi.Path == null)
if (rsi == null)
return false;
var correctedSlot = slot;

View File

@@ -4,14 +4,12 @@ using Robust.Client.Animations;
using Robust.Client.GameObjects;
using Robust.Client.ResourceManagement;
using Robust.Shared.Serialization.TypeSerializers.Implementations;
using Robust.Shared.Timing;
namespace Content.Client.Doors;
public sealed class DoorSystem : SharedDoorSystem
{
[Dependency] private readonly AnimationPlayerSystem _animationSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IResourceCache _resourceCache = default!;
public override void Initialize()

View File

@@ -1,7 +1,9 @@
using Content.Client.IconSmoothing;
using Content.Shared.Chemistry.Components;
using Content.Shared.Fluids;
using Content.Shared.Fluids.Components;
using Robust.Client.GameObjects;
using Robust.Shared.Map;
namespace Content.Client.Fluids;
@@ -21,7 +23,7 @@ public sealed class PuddleSystem : SharedPuddleSystem
if (args.Sprite == null)
return;
float volume = 1f;
var volume = 1f;
if (args.AppearanceData.TryGetValue(PuddleVisuals.CurrentVolume, out var volumeObj))
{
@@ -64,4 +66,38 @@ public sealed class PuddleSystem : SharedPuddleSystem
args.Sprite.Color *= baseColor;
}
}
#region Spill
// Maybe someday we'll have clientside prediction for entity spawning, but not today.
// Until then, these methods do nothing on the client.
/// <inheritdoc/>
public override bool TrySplashSpillAt(EntityUid uid, EntityCoordinates coordinates, Solution solution, out EntityUid puddleUid, bool sound = true, EntityUid? user = null)
{
puddleUid = EntityUid.Invalid;
return false;
}
/// <inheritdoc/>
public override bool TrySpillAt(EntityCoordinates coordinates, Solution solution, out EntityUid puddleUid, bool sound = true)
{
puddleUid = EntityUid.Invalid;
return false;
}
/// <inheritdoc/>
public override bool TrySpillAt(EntityUid uid, Solution solution, out EntityUid puddleUid, bool sound = true, TransformComponent? transformComponent = null)
{
puddleUid = EntityUid.Invalid;
return false;
}
/// <inheritdoc/>
public override bool TrySpillAt(TileRef tileRef, Solution solution, out EntityUid puddleUid, bool sound = true, bool tileReact = true)
{
puddleUid = EntityUid.Invalid;
return false;
}
#endregion Spill
}

View File

@@ -16,8 +16,6 @@ namespace Content.Client.IconSmoothing
[UsedImplicitly]
public sealed partial class IconSmoothSystem : EntitySystem
{
[Dependency] private readonly IMapManager _mapManager = default!;
private readonly Queue<EntityUid> _dirtyEntities = new();
private readonly Queue<EntityUid> _anchorChangedEntities = new();

View File

@@ -93,7 +93,7 @@ public sealed class ItemSystem : SharedItemSystem
else if (TryComp(uid, out SpriteComponent? sprite))
rsi = sprite.BaseRSI;
if (rsi == null || rsi.Path == null)
if (rsi == null)
return false;
var state = (item.HeldPrefix == null)

View File

@@ -3,10 +3,12 @@
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc grinder-menu-title}" MinSize="768 256">
<BoxContainer Orientation="Horizontal">
<BoxContainer Orientation="Vertical" VerticalAlignment="Top" Margin="8">
<Button Name="GrindButton" Text="{Loc grinder-menu-grind-button}" TextAlign="Center" MinSize="64 48"/>
<Control MinSize="0 16"/>
<Button Name="JuiceButton" Text="{Loc grinder-menu-juice-button}" TextAlign="Center" MinSize="64 48"/>
<BoxContainer Orientation="Vertical" VerticalAlignment="Top" Margin="8" MinWidth="100">
<Label Text="{Loc grinder-menu-auto-label}" HorizontalAlignment="Center"/>
<Button Name="AutoModeButton" Text="{Loc grinder-menu-auto-button}" TextAlign="Center" MinSize="64 48" Margin="0 0 0 16" />
<Label Text="{Loc grinder-menu-manual-label}" HorizontalAlignment="Center"/>
<Button Name="GrindButton" Text="{Loc grinder-menu-grind-button}" TextAlign="Center" MinSize="64 48" Margin="0 0 0 16" />
<Button Name="JuiceButton" Text="{Loc grinder-menu-juice-button}" TextAlign="Center" MinSize="64 48" />
</BoxContainer>
<ui:LabelledContentBox Name="ChamberContentBox" LabelText="{Loc grinder-menu-chamber-content-box-label}" ButtonText="{Loc grinder-menu-chamber-content-box-button}" VerticalExpand="True" HorizontalExpand="True" Margin="8" SizeFlagsStretchRatio="2"/>

View File

@@ -24,6 +24,7 @@ namespace Content.Client.Kitchen.UI
_entityManager = entityManager;
_prototypeManager = prototypeManager;
_owner = owner;
AutoModeButton.OnPressed += owner.ToggleAutoMode;
GrindButton.OnPressed += owner.StartGrinding;
JuiceButton.OnPressed += owner.StartJuicing;
ChamberContentBox.EjectButton.OnPressed += owner.EjectAll;
@@ -56,6 +57,19 @@ namespace Content.Client.Kitchen.UI
GrindButton.Disabled = !state.CanGrind || !state.Powered;
JuiceButton.Disabled = !state.CanJuice || !state.Powered;
switch (state.AutoMode)
{
case GrinderAutoMode.Grind:
AutoModeButton.Text = Loc.GetString("grinder-menu-grind-button");
break;
case GrinderAutoMode.Juice:
AutoModeButton.Text = Loc.GetString("grinder-menu-juice-button");
break;
default:
AutoModeButton.Text = Loc.GetString("grinder-menu-auto-button-off");
break;
}
// TODO move this to a component state and ensure the net ids.
RefreshContentsDisplay(state.ReagentQuantities, _entityManager.GetEntityArray(state.ChamberContents), state.HasBeakerIn);
}

View File

@@ -52,6 +52,11 @@ namespace Content.Client.Kitchen.UI
_menu?.HandleMessage(message);
}
public void ToggleAutoMode(BaseButton.ButtonEventArgs args)
{
SendMessage(new ReagentGrinderToggleAutoModeMessage());
}
public void StartGrinding(BaseButton.ButtonEventArgs? _ = null)
{
SendMessage(new ReagentGrinderStartMessage(GrinderProgram.Grind));

View File

@@ -309,7 +309,7 @@ namespace Content.Client.LateJoin
if (matchingJobButton.Amount != updatedJobValue)
{
matchingJobButton.RefreshLabel(updatedJobValue);
matchingJobButton.Disabled = matchingJobButton.Amount == 0;
matchingJobButton.Disabled |= matchingJobButton.Amount == 0;
}
}
}

View File

@@ -289,7 +289,6 @@ namespace Content.Client.NPC
var invGridMatrix = gridXform.InvWorldMatrix;
DebugPathPoly? nearest = null;
var nearestDistance = float.MaxValue;
foreach (var poly in tile)
{

View File

@@ -88,7 +88,6 @@ public partial class BaseShuttleControl : MapGridControl
var cornerDistance = MathF.Sqrt(WorldRange * WorldRange + WorldRange * WorldRange);
var origin = ScalePosition(-new Vector2(Offset.X, -Offset.Y));
var distOffset = -24f;
for (var radius = minDistance; radius <= maxDistance; radius *= EquatorialMultiplier)
{

View File

@@ -306,11 +306,6 @@ public static partial class PoolManager
Pairs[fallback!] = true;
}
if (fallback == null && _pairId > 8)
{
var x = 2;
}
return fallback;
}
}

View File

@@ -181,9 +181,8 @@ namespace Content.IntegrationTests.Tests.Buckle
#pragma warning restore NUnit2045
// Move away from the chair
var xformQuery = entityManager.GetEntityQuery<TransformComponent>();
var oldWorldPosition = xformSystem.GetWorldPosition(chair, xformQuery);
xformSystem.SetWorldPosition(human, oldWorldPosition + new Vector2(1000, 1000), xformQuery);
var oldWorldPosition = xformSystem.GetWorldPosition(chair);
xformSystem.SetWorldPosition(human, oldWorldPosition + new Vector2(1000, 1000));
// Out of range
#pragma warning disable NUnit2045 // Interdependent asserts.
@@ -193,8 +192,8 @@ namespace Content.IntegrationTests.Tests.Buckle
#pragma warning restore NUnit2045
// Move near the chair
oldWorldPosition = xformSystem.GetWorldPosition(chair, xformQuery);
xformSystem.SetWorldPosition(human, oldWorldPosition + new Vector2(0.5f, 0), xformQuery);
oldWorldPosition = xformSystem.GetWorldPosition(chair);
xformSystem.SetWorldPosition(human, oldWorldPosition + new Vector2(0.5f, 0));
// In range
#pragma warning disable NUnit2045 // Interdependent asserts.
@@ -220,8 +219,8 @@ namespace Content.IntegrationTests.Tests.Buckle
Assert.That(buckleSystem.TryBuckle(human, human, chair, buckleComp: buckle));
// Move away from the chair
oldWorldPosition = xformSystem.GetWorldPosition(chair, xformQuery);
xformSystem.SetWorldPosition(human, oldWorldPosition + new Vector2(1, 0), xformQuery);
oldWorldPosition = xformSystem.GetWorldPosition(chair);
xformSystem.SetWorldPosition(human, oldWorldPosition + new Vector2(1, 0));
});
await server.WaitRunTicks(1);
@@ -371,9 +370,8 @@ namespace Content.IntegrationTests.Tests.Buckle
});
// Move the buckled entity away
var xformQuery = entityManager.GetEntityQuery<TransformComponent>();
var oldWorldPosition = xformSystem.GetWorldPosition(chair, xformQuery);
xformSystem.SetWorldPosition(human, oldWorldPosition + new Vector2(100, 0), xformQuery);
var oldWorldPosition = xformSystem.GetWorldPosition(chair);
xformSystem.SetWorldPosition(human, oldWorldPosition + new Vector2(100, 0));
});
await PoolManager.WaitUntil(server, () => !buckle.Buckled, 10);
@@ -383,9 +381,8 @@ namespace Content.IntegrationTests.Tests.Buckle
await server.WaitAssertion(() =>
{
// Move the now unbuckled entity back onto the chair
var xformQuery = entityManager.GetEntityQuery<TransformComponent>();
var oldWorldPosition = xformSystem.GetWorldPosition(chair, xformQuery);
xformSystem.SetWorldPosition(human, oldWorldPosition, xformQuery);
var oldWorldPosition = xformSystem.GetWorldPosition(chair);
xformSystem.SetWorldPosition(human, oldWorldPosition);
// Buckle
Assert.That(buckleSystem.TryBuckle(human, human, chair, buckleComp: buckle));

View File

@@ -163,7 +163,6 @@ namespace Content.IntegrationTests.Tests.Disposal
var entityManager = server.ResolveDependency<IEntityManager>();
var xformSystem = entityManager.System<SharedTransformSystem>();
var disposalSystem = entityManager.System<DisposalUnitSystem>();
await server.WaitAssertion(() =>
{
// Spawn the entities
@@ -171,8 +170,7 @@ namespace Content.IntegrationTests.Tests.Disposal
human = entityManager.SpawnEntity("HumanDisposalDummy", coordinates);
wrench = entityManager.SpawnEntity("WrenchDummy", coordinates);
disposalUnit = entityManager.SpawnEntity("DisposalUnitDummy", coordinates);
disposalTrunk = entityManager.SpawnEntity("DisposalTrunkDummy",
entityManager.GetComponent<TransformComponent>(disposalUnit).MapPosition);
disposalTrunk = entityManager.SpawnEntity("DisposalTrunkDummy", coordinates);
// Test for components existing
unitUid = disposalUnit;
@@ -204,10 +202,10 @@ namespace Content.IntegrationTests.Tests.Disposal
await server.WaitAssertion(() =>
{
// Move the disposal trunk away
var xform = entityManager.GetComponent<TransformComponent>(disposalTrunk);
var worldPos = xformSystem.GetWorldPosition(disposalTrunk);
xformSystem.SetWorldPosition(xform, worldPos + new Vector2(1, 0));
// Move the disposal trunk away
xformSystem.SetWorldPosition(disposalTrunk, worldPos + new Vector2(1, 0));
// Fail to flush with a mob and an item
Flush(disposalUnit, unitComponent, false, disposalSystem, human, wrench);
@@ -215,10 +213,12 @@ namespace Content.IntegrationTests.Tests.Disposal
await server.WaitAssertion(() =>
{
// Move the disposal trunk back
var xform = entityManager.GetComponent<TransformComponent>(disposalTrunk);
var worldPos = xformSystem.GetWorldPosition(disposalTrunk);
xformSystem.SetWorldPosition(xform, worldPos - new Vector2(1, 0));
var worldPos = xformSystem.GetWorldPosition(disposalUnit);
// Move the disposal trunk back
xformSystem.SetWorldPosition(disposalTrunk, worldPos);
xformSystem.AnchorEntity((disposalTrunk, xform));
// Fail to flush with a mob and an item, no power
Flush(disposalUnit, unitComponent, false, disposalSystem, human, wrench);
@@ -240,6 +240,7 @@ namespace Content.IntegrationTests.Tests.Disposal
// Re-pressurizing
Flush(disposalUnit, unitComponent, false, disposalSystem);
});
await pair.CleanReturnAsync();
}
}

View File

@@ -67,7 +67,7 @@ namespace Content.IntegrationTests.Tests.Fluids
await server.WaitAssertion(() =>
{
var coordinates = grid.ToCoordinates();
var coordinates = grid.Owner.ToCoordinates();
var solution = new Solution("Water", FixedPoint2.New(20));
Assert.That(spillSystem.TrySpillAt(coordinates, solution, out _), Is.False);

View File

@@ -58,7 +58,6 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.ActionBlocking
var cuffableSys = entityManager.System<CuffableSystem>();
var xformSys = entityManager.System<SharedTransformSystem>();
var xformQuery = entityManager.GetEntityQuery<TransformComponent>();
// Spawn the entities
human = entityManager.SpawnEntity("HumanHandcuffDummy", coordinates);
@@ -66,8 +65,8 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.ActionBlocking
cuffs = entityManager.SpawnEntity("HandcuffsDummy", coordinates);
secondCuffs = entityManager.SpawnEntity("HandcuffsDummy", coordinates);
var coords = xformSys.GetWorldPosition(otherHuman, xformQuery);
xformSys.SetWorldPosition(human, coords, xformQuery);
var coords = xformSys.GetWorldPosition(otherHuman);
xformSys.SetWorldPosition(human, coords);
// Test for components existing
Assert.Multiple(() =>

View File

@@ -176,16 +176,18 @@ namespace Content.IntegrationTests.Tests.Power
var map = mapManager.CreateMap();
var grid = mapManager.CreateGrid(map);
var gridOwner = grid.Owner;
// Power only works when anchored
for (var i = 0; i < 3; i++)
{
grid.SetTile(new Vector2i(0, i), new Tile(1));
entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, i));
entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, i));
}
var generatorEnt = entityManager.SpawnEntity("GeneratorDummy", grid.ToCoordinates());
var consumerEnt1 = entityManager.SpawnEntity("ConsumerDummy", grid.ToCoordinates(0, 1));
var consumerEnt2 = entityManager.SpawnEntity("ConsumerDummy", grid.ToCoordinates(0, 2));
var generatorEnt = entityManager.SpawnEntity("GeneratorDummy", gridOwner.ToCoordinates());
var consumerEnt1 = entityManager.SpawnEntity("ConsumerDummy", gridOwner.ToCoordinates(0, 1));
var consumerEnt2 = entityManager.SpawnEntity("ConsumerDummy", gridOwner.ToCoordinates(0, 2));
supplier = entityManager.GetComponent<PowerSupplierComponent>(generatorEnt);
consumer1 = entityManager.GetComponent<PowerConsumerComponent>(consumerEnt1);
@@ -237,16 +239,18 @@ namespace Content.IntegrationTests.Tests.Power
var map = mapManager.CreateMap();
var grid = mapManager.CreateGrid(map);
var gridOwner = grid.Owner;
// Power only works when anchored
for (var i = 0; i < 3; i++)
{
grid.SetTile(new Vector2i(0, i), new Tile(1));
entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, i));
entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, i));
}
var generatorEnt = entityManager.SpawnEntity("GeneratorDummy", grid.ToCoordinates());
var consumerEnt1 = entityManager.SpawnEntity("ConsumerDummy", grid.ToCoordinates(0, 1));
var consumerEnt2 = entityManager.SpawnEntity("ConsumerDummy", grid.ToCoordinates(0, 2));
var generatorEnt = entityManager.SpawnEntity("GeneratorDummy", gridOwner.ToCoordinates());
var consumerEnt1 = entityManager.SpawnEntity("ConsumerDummy", gridOwner.ToCoordinates(0, 1));
var consumerEnt2 = entityManager.SpawnEntity("ConsumerDummy", gridOwner.ToCoordinates(0, 2));
supplier = entityManager.GetComponent<PowerSupplierComponent>(generatorEnt);
consumer1 = entityManager.GetComponent<PowerConsumerComponent>(consumerEnt1);
@@ -292,16 +296,17 @@ namespace Content.IntegrationTests.Tests.Power
{
var map = mapManager.CreateMap();
var grid = mapManager.CreateGrid(map);
var gridOwner = grid.Owner;
// Power only works when anchored
for (var i = 0; i < 3; i++)
{
grid.SetTile(new Vector2i(0, i), new Tile(1));
entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, i));
entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, i));
}
var generatorEnt = entityManager.SpawnEntity("GeneratorDummy", grid.ToCoordinates());
var consumerEnt = entityManager.SpawnEntity("ConsumerDummy", grid.ToCoordinates(0, 2));
var generatorEnt = entityManager.SpawnEntity("GeneratorDummy", gridOwner.ToCoordinates());
var consumerEnt = entityManager.SpawnEntity("ConsumerDummy", gridOwner.ToCoordinates(0, 2));
supplier = entityManager.GetComponent<PowerSupplierComponent>(generatorEnt);
consumer = entityManager.GetComponent<PowerConsumerComponent>(consumerEnt);
@@ -383,16 +388,17 @@ namespace Content.IntegrationTests.Tests.Power
{
var map = mapManager.CreateMap();
var grid = mapManager.CreateGrid(map);
var gridOwner = grid.Owner;
// Power only works when anchored
for (var i = 0; i < 3; i++)
{
grid.SetTile(new Vector2i(0, i), new Tile(1));
entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, i));
entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, i));
}
var generatorEnt = entityManager.SpawnEntity("DischargingBatteryDummy", grid.ToCoordinates());
var consumerEnt = entityManager.SpawnEntity("ConsumerDummy", grid.ToCoordinates(0, 2));
var generatorEnt = entityManager.SpawnEntity("DischargingBatteryDummy", gridOwner.ToCoordinates());
var consumerEnt = entityManager.SpawnEntity("ConsumerDummy", gridOwner.ToCoordinates(0, 2));
netBattery = entityManager.GetComponent<PowerNetworkBatteryComponent>(generatorEnt);
battery = entityManager.GetComponent<BatteryComponent>(generatorEnt);
@@ -486,17 +492,18 @@ namespace Content.IntegrationTests.Tests.Power
{
var map = mapManager.CreateMap();
var grid = mapManager.CreateGrid(map);
var gridOwner = grid.Owner;
// Power only works when anchored
for (var i = 0; i < 3; i++)
{
grid.SetTile(new Vector2i(0, i), new Tile(1));
entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, i));
entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, i));
}
var generatorEnt = entityManager.SpawnEntity("GeneratorDummy", grid.ToCoordinates());
var consumerEnt = entityManager.SpawnEntity("ConsumerDummy", grid.ToCoordinates(0, 1));
var batteryEnt = entityManager.SpawnEntity("DischargingBatteryDummy", grid.ToCoordinates(0, 2));
var generatorEnt = entityManager.SpawnEntity("GeneratorDummy", gridOwner.ToCoordinates());
var consumerEnt = entityManager.SpawnEntity("ConsumerDummy", gridOwner.ToCoordinates(0, 1));
var batteryEnt = entityManager.SpawnEntity("DischargingBatteryDummy", gridOwner.ToCoordinates(0, 2));
netBattery = entityManager.GetComponent<PowerNetworkBatteryComponent>(batteryEnt);
battery = entityManager.GetComponent<BatteryComponent>(batteryEnt);
supplier = entityManager.GetComponent<PowerSupplierComponent>(generatorEnt);
@@ -577,16 +584,17 @@ namespace Content.IntegrationTests.Tests.Power
{
var map = mapManager.CreateMap();
var grid = mapManager.CreateGrid(map);
var gridOwner = grid.Owner;
// Power only works when anchored
for (var i = 0; i < 3; i++)
{
grid.SetTile(new Vector2i(0, i), new Tile(1));
entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, i));
entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, i));
}
var generatorEnt = entityManager.SpawnEntity("GeneratorDummy", grid.ToCoordinates());
var batteryEnt = entityManager.SpawnEntity("ChargingBatteryDummy", grid.ToCoordinates(0, 2));
var generatorEnt = entityManager.SpawnEntity("GeneratorDummy", gridOwner.ToCoordinates());
var batteryEnt = entityManager.SpawnEntity("ChargingBatteryDummy", gridOwner.ToCoordinates(0, 2));
supplier = entityManager.GetComponent<PowerSupplierComponent>(generatorEnt);
var netBattery = entityManager.GetComponent<PowerNetworkBatteryComponent>(batteryEnt);
@@ -635,20 +643,21 @@ namespace Content.IntegrationTests.Tests.Power
{
var map = mapManager.CreateMap();
var grid = mapManager.CreateGrid(map);
var gridOwner = grid.Owner;
// Power only works when anchored
for (var i = 0; i < 4; i++)
{
grid.SetTile(new Vector2i(0, i), new Tile(1));
entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, i));
entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, i));
}
var terminal = entityManager.SpawnEntity("CableTerminal", grid.ToCoordinates(0, 1));
var terminal = entityManager.SpawnEntity("CableTerminal", gridOwner.ToCoordinates(0, 1));
entityManager.GetComponent<TransformComponent>(terminal).LocalRotation = Angle.FromDegrees(180);
var batteryEnt = entityManager.SpawnEntity("FullBatteryDummy", grid.ToCoordinates(0, 2));
var supplyEnt = entityManager.SpawnEntity("GeneratorDummy", grid.ToCoordinates(0, 0));
var consumerEnt = entityManager.SpawnEntity("ConsumerDummy", grid.ToCoordinates(0, 3));
var batteryEnt = entityManager.SpawnEntity("FullBatteryDummy", gridOwner.ToCoordinates(0, 2));
var supplyEnt = entityManager.SpawnEntity("GeneratorDummy", gridOwner.ToCoordinates(0, 0));
var consumerEnt = entityManager.SpawnEntity("ConsumerDummy", gridOwner.ToCoordinates(0, 3));
consumer = entityManager.GetComponent<PowerConsumerComponent>(consumerEnt);
supplier = entityManager.GetComponent<PowerSupplierComponent>(supplyEnt);
@@ -712,20 +721,21 @@ namespace Content.IntegrationTests.Tests.Power
{
var map = mapManager.CreateMap();
var grid = mapManager.CreateGrid(map);
var gridOwner = grid.Owner;
// Power only works when anchored
for (var i = 0; i < 4; i++)
{
grid.SetTile(new Vector2i(0, i), new Tile(1));
entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, i));
entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, i));
}
var terminal = entityManager.SpawnEntity("CableTerminal", grid.ToCoordinates(0, 1));
var terminal = entityManager.SpawnEntity("CableTerminal", gridOwner.ToCoordinates(0, 1));
entityManager.GetComponent<TransformComponent>(terminal).LocalRotation = Angle.FromDegrees(180);
var batteryEnt = entityManager.SpawnEntity("FullBatteryDummy", grid.ToCoordinates(0, 2));
var supplyEnt = entityManager.SpawnEntity("GeneratorDummy", grid.ToCoordinates(0, 0));
var consumerEnt = entityManager.SpawnEntity("ConsumerDummy", grid.ToCoordinates(0, 3));
var batteryEnt = entityManager.SpawnEntity("FullBatteryDummy", gridOwner.ToCoordinates(0, 2));
var supplyEnt = entityManager.SpawnEntity("GeneratorDummy", gridOwner.ToCoordinates(0, 0));
var consumerEnt = entityManager.SpawnEntity("ConsumerDummy", gridOwner.ToCoordinates(0, 3));
consumer = entityManager.GetComponent<PowerConsumerComponent>(consumerEnt);
supplier = entityManager.GetComponent<PowerSupplierComponent>(supplyEnt);
@@ -787,6 +797,7 @@ namespace Content.IntegrationTests.Tests.Power
{
var map = mapManager.CreateMap();
var grid = mapManager.CreateGrid(map);
var gridOwner = grid.Owner;
// Map layout here is
// C - consumer
@@ -800,18 +811,18 @@ namespace Content.IntegrationTests.Tests.Power
for (var i = 0; i < 5; i++)
{
grid.SetTile(new Vector2i(0, i), new Tile(1));
entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, i));
entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, i));
}
entityManager.SpawnEntity("CableTerminal", grid.ToCoordinates(0, 2));
var terminal = entityManager.SpawnEntity("CableTerminal", grid.ToCoordinates(0, 2));
entityManager.SpawnEntity("CableTerminal", gridOwner.ToCoordinates(0, 2));
var terminal = entityManager.SpawnEntity("CableTerminal", gridOwner.ToCoordinates(0, 2));
entityManager.GetComponent<TransformComponent>(terminal).LocalRotation = Angle.FromDegrees(180);
var batteryEnt1 = entityManager.SpawnEntity("FullBatteryDummy", grid.ToCoordinates(0, 1));
var batteryEnt2 = entityManager.SpawnEntity("FullBatteryDummy", grid.ToCoordinates(0, 3));
var supplyEnt = entityManager.SpawnEntity("GeneratorDummy", grid.ToCoordinates(0, 2));
var consumerEnt1 = entityManager.SpawnEntity("ConsumerDummy", grid.ToCoordinates(0, 0));
var consumerEnt2 = entityManager.SpawnEntity("ConsumerDummy", grid.ToCoordinates(0, 4));
var batteryEnt1 = entityManager.SpawnEntity("FullBatteryDummy", gridOwner.ToCoordinates(0, 1));
var batteryEnt2 = entityManager.SpawnEntity("FullBatteryDummy", gridOwner.ToCoordinates(0, 3));
var supplyEnt = entityManager.SpawnEntity("GeneratorDummy", gridOwner.ToCoordinates(0, 2));
var consumerEnt1 = entityManager.SpawnEntity("ConsumerDummy", gridOwner.ToCoordinates(0, 0));
var consumerEnt2 = entityManager.SpawnEntity("ConsumerDummy", gridOwner.ToCoordinates(0, 4));
consumer1 = entityManager.GetComponent<PowerConsumerComponent>(consumerEnt1);
consumer2 = entityManager.GetComponent<PowerConsumerComponent>(consumerEnt2);
@@ -888,6 +899,7 @@ namespace Content.IntegrationTests.Tests.Power
{
var map = mapManager.CreateMap();
var grid = mapManager.CreateGrid(map);
var gridOwner = grid.Owner;
// Layout is two generators, two batteries, and one load. As to why two: because previously this test
// would fail ONLY if there were more than two batteries present, because each of them tries to supply
@@ -900,16 +912,16 @@ namespace Content.IntegrationTests.Tests.Power
for (var i = -2; i <= 2; i++)
{
grid.SetTile(new Vector2i(0, i), new Tile(1));
entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, i));
entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, i));
}
var batteryEnt1 = entityManager.SpawnEntity("FullBatteryDummy", grid.ToCoordinates(0, 2));
var batteryEnt2 = entityManager.SpawnEntity("FullBatteryDummy", grid.ToCoordinates(0, -2));
var batteryEnt1 = entityManager.SpawnEntity("FullBatteryDummy", gridOwner.ToCoordinates(0, 2));
var batteryEnt2 = entityManager.SpawnEntity("FullBatteryDummy", gridOwner.ToCoordinates(0, -2));
var supplyEnt1 = entityManager.SpawnEntity("GeneratorDummy", grid.ToCoordinates(0, 1));
var supplyEnt2 = entityManager.SpawnEntity("GeneratorDummy", grid.ToCoordinates(0, -1));
var supplyEnt1 = entityManager.SpawnEntity("GeneratorDummy", gridOwner.ToCoordinates(0, 1));
var supplyEnt2 = entityManager.SpawnEntity("GeneratorDummy", gridOwner.ToCoordinates(0, -1));
var consumerEnt = entityManager.SpawnEntity("ConsumerDummy", grid.ToCoordinates(0, 0));
var consumerEnt = entityManager.SpawnEntity("ConsumerDummy", gridOwner.ToCoordinates(0, 0));
consumer = entityManager.GetComponent<PowerConsumerComponent>(consumerEnt);
supplier1 = entityManager.GetComponent<PowerSupplierComponent>(supplyEnt1);
@@ -981,6 +993,7 @@ namespace Content.IntegrationTests.Tests.Power
{
var map = mapManager.CreateMap();
var grid = mapManager.CreateGrid(map);
var gridOwner = grid.Owner;
// Map layout here is
// C - consumer
@@ -994,18 +1007,18 @@ namespace Content.IntegrationTests.Tests.Power
for (var i = 0; i < 5; i++)
{
grid.SetTile(new Vector2i(0, i), new Tile(1));
entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, i));
entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, i));
}
entityManager.SpawnEntity("CableTerminal", grid.ToCoordinates(0, 2));
var terminal = entityManager.SpawnEntity("CableTerminal", grid.ToCoordinates(0, 2));
entityManager.SpawnEntity("CableTerminal", gridOwner.ToCoordinates(0, 2));
var terminal = entityManager.SpawnEntity("CableTerminal", gridOwner.ToCoordinates(0, 2));
entityManager.GetComponent<TransformComponent>(terminal).LocalRotation = Angle.FromDegrees(180);
var batteryEnt1 = entityManager.SpawnEntity("FullBatteryDummy", grid.ToCoordinates(0, 1));
var batteryEnt2 = entityManager.SpawnEntity("FullBatteryDummy", grid.ToCoordinates(0, 3));
var supplyEnt = entityManager.SpawnEntity("GeneratorDummy", grid.ToCoordinates(0, 2));
var consumerEnt1 = entityManager.SpawnEntity("ConsumerDummy", grid.ToCoordinates(0, 0));
var consumerEnt2 = entityManager.SpawnEntity("ConsumerDummy", grid.ToCoordinates(0, 4));
var batteryEnt1 = entityManager.SpawnEntity("FullBatteryDummy", gridOwner.ToCoordinates(0, 1));
var batteryEnt2 = entityManager.SpawnEntity("FullBatteryDummy", gridOwner.ToCoordinates(0, 3));
var supplyEnt = entityManager.SpawnEntity("GeneratorDummy", gridOwner.ToCoordinates(0, 2));
var consumerEnt1 = entityManager.SpawnEntity("ConsumerDummy", gridOwner.ToCoordinates(0, 0));
var consumerEnt2 = entityManager.SpawnEntity("ConsumerDummy", gridOwner.ToCoordinates(0, 4));
consumer1 = entityManager.GetComponent<PowerConsumerComponent>(consumerEnt1);
consumer2 = entityManager.GetComponent<PowerConsumerComponent>(consumerEnt2);
@@ -1068,20 +1081,21 @@ namespace Content.IntegrationTests.Tests.Power
{
var map = mapManager.CreateMap();
var grid = mapManager.CreateGrid(map);
var gridOwner = grid.Owner;
// Power only works when anchored
for (var i = 0; i < 4; i++)
{
grid.SetTile(new Vector2i(0, i), new Tile(1));
entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, i));
entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, i));
}
var terminal = entityManager.SpawnEntity("CableTerminal", grid.ToCoordinates(0, 1));
var terminal = entityManager.SpawnEntity("CableTerminal", gridOwner.ToCoordinates(0, 1));
entityManager.GetComponent<TransformComponent>(terminal).LocalRotation = Angle.FromDegrees(180);
var batteryEnt = entityManager.SpawnEntity("FullBatteryDummy", grid.ToCoordinates(0, 2));
var supplyEnt = entityManager.SpawnEntity("GeneratorDummy", grid.ToCoordinates(0, 0));
var consumerEnt = entityManager.SpawnEntity("ConsumerDummy", grid.ToCoordinates(0, 3));
var batteryEnt = entityManager.SpawnEntity("FullBatteryDummy", gridOwner.ToCoordinates(0, 2));
var supplyEnt = entityManager.SpawnEntity("GeneratorDummy", gridOwner.ToCoordinates(0, 0));
var consumerEnt = entityManager.SpawnEntity("ConsumerDummy", gridOwner.ToCoordinates(0, 3));
consumer = entityManager.GetComponent<PowerConsumerComponent>(consumerEnt);
supplier = entityManager.GetComponent<PowerSupplierComponent>(supplyEnt);
@@ -1153,6 +1167,7 @@ namespace Content.IntegrationTests.Tests.Power
{
var map = mapManager.CreateMap();
var grid = mapManager.CreateGrid(map);
var gridOwner = grid.Owner;
// Power only works when anchored
for (var i = 0; i < 4; i++)
@@ -1160,15 +1175,15 @@ namespace Content.IntegrationTests.Tests.Power
grid.SetTile(new Vector2i(0, i), new Tile(1));
}
var leftEnt = entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, 0));
entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, 1));
entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, 2));
var rightEnt = entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, 3));
var leftEnt = entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, 0));
entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, 1));
entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, 2));
var rightEnt = entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, 3));
var terminal = entityManager.SpawnEntity("CableTerminal", grid.ToCoordinates(0, 1));
var terminal = entityManager.SpawnEntity("CableTerminal", gridOwner.ToCoordinates(0, 1));
entityManager.GetComponent<TransformComponent>(terminal).LocalRotation = Angle.FromDegrees(180);
var battery = entityManager.SpawnEntity("FullBatteryDummy", grid.ToCoordinates(0, 2));
var battery = entityManager.SpawnEntity("FullBatteryDummy", gridOwner.ToCoordinates(0, 2));
var batteryNodeContainer = entityManager.GetComponent<NodeContainerComponent>(battery);
if (nodeContainer.TryGetNode<CableNode>(entityManager.GetComponent<NodeContainerComponent>(leftEnt),
@@ -1216,6 +1231,7 @@ namespace Content.IntegrationTests.Tests.Power
{
var map = mapManager.CreateMap();
var grid = mapManager.CreateGrid(map);
var gridOwner = grid.Owner;
// Power only works when anchored
for (var i = 0; i < 3; i++)
@@ -1223,14 +1239,14 @@ namespace Content.IntegrationTests.Tests.Power
grid.SetTile(new Vector2i(0, i), new Tile(1));
}
entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, 0));
entityManager.SpawnEntity("CableHV", grid.ToCoordinates(0, 1));
entityManager.SpawnEntity("CableMV", grid.ToCoordinates(0, 1));
entityManager.SpawnEntity("CableMV", grid.ToCoordinates(0, 2));
entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, 0));
entityManager.SpawnEntity("CableHV", gridOwner.ToCoordinates(0, 1));
entityManager.SpawnEntity("CableMV", gridOwner.ToCoordinates(0, 1));
entityManager.SpawnEntity("CableMV", gridOwner.ToCoordinates(0, 2));
var generatorEnt = entityManager.SpawnEntity("GeneratorDummy", grid.ToCoordinates(0, 0));
var substationEnt = entityManager.SpawnEntity("SubstationDummy", grid.ToCoordinates(0, 1));
var apcEnt = entityManager.SpawnEntity("ApcDummy", grid.ToCoordinates(0, 2));
var generatorEnt = entityManager.SpawnEntity("GeneratorDummy", gridOwner.ToCoordinates(0, 0));
var substationEnt = entityManager.SpawnEntity("SubstationDummy", gridOwner.ToCoordinates(0, 1));
var apcEnt = entityManager.SpawnEntity("ApcDummy", gridOwner.ToCoordinates(0, 2));
var generatorSupplier = entityManager.GetComponent<PowerSupplierComponent>(generatorEnt);
substationNetBattery = entityManager.GetComponent<PowerNetworkBatteryComponent>(substationEnt);
@@ -1273,6 +1289,7 @@ namespace Content.IntegrationTests.Tests.Power
{
var map = mapManager.CreateMap();
var grid = mapManager.CreateGrid(map);
var gridOwner = grid.Owner;
const int range = 5;
@@ -1282,15 +1299,15 @@ namespace Content.IntegrationTests.Tests.Power
grid.SetTile(new Vector2i(0, i), new Tile(1));
}
var apcEnt = entityManager.SpawnEntity("ApcDummy", grid.ToCoordinates(0, 0));
var apcExtensionEnt = entityManager.SpawnEntity("CableApcExtension", grid.ToCoordinates(0, 0));
var apcEnt = entityManager.SpawnEntity("ApcDummy", gridOwner.ToCoordinates(0, 0));
var apcExtensionEnt = entityManager.SpawnEntity("CableApcExtension", gridOwner.ToCoordinates(0, 0));
// Create a powered receiver in range (range is 0 indexed)
var powerReceiverEnt = entityManager.SpawnEntity("ApcPowerReceiverDummy", grid.ToCoordinates(0, range - 1));
var powerReceiverEnt = entityManager.SpawnEntity("ApcPowerReceiverDummy", gridOwner.ToCoordinates(0, range - 1));
receiver = entityManager.GetComponent<ApcPowerReceiverComponent>(powerReceiverEnt);
// Create an unpowered receiver outside range
var unpoweredReceiverEnt = entityManager.SpawnEntity("ApcPowerReceiverDummy", grid.ToCoordinates(0, range));
var unpoweredReceiverEnt = entityManager.SpawnEntity("ApcPowerReceiverDummy", gridOwner.ToCoordinates(0, range));
unpoweredReceiver = entityManager.GetComponent<ApcPowerReceiverComponent>(unpoweredReceiverEnt);
var battery = entityManager.GetComponent<BatteryComponent>(apcEnt);

View File

@@ -59,7 +59,7 @@ public sealed class PrototypeSaveTest
var tileDefinition = tileDefinitionManager["FloorSteel"]; // Wires n such disable ambiance while under the floor
var tile = new Tile(tileDefinition.TileId);
var coordinates = grid.ToCoordinates();
var coordinates = grid.Owner.ToCoordinates();
grid.SetTile(coordinates, tile);
});
@@ -94,7 +94,7 @@ public sealed class PrototypeSaveTest
await server.WaitAssertion(() =>
{
Assert.That(!mapManager.IsMapInitialized(mapId));
var testLocation = grid.ToCoordinates();
var testLocation = grid.Owner.ToCoordinates();
Assert.Multiple(() =>
{

View File

@@ -1,11 +1,6 @@
using Content.Server.GameTicking;
using Content.Server.Ghost.Components;
using Content.Server.Players;
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Content.Shared.Ghost;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Configuration;
using Robust.Shared.Console;
using Robust.Shared.Map;
@@ -17,7 +12,6 @@ namespace Content.Server.Administration.Commands;
public sealed class PersistenceSave : IConsoleCommand
{
[Dependency] private readonly IConfigurationManager _config = default!;
[Dependency] private readonly IEntityManager _entities = default!;
[Dependency] private readonly IEntitySystemManager _system = default!;
[Dependency] private readonly IMapManager _map = default!;

View File

@@ -3,7 +3,6 @@ using Content.Shared.Maps;
using Robust.Shared.Console;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Random;
namespace Content.Server.Administration.Commands;
@@ -11,7 +10,6 @@ namespace Content.Server.Administration.Commands;
public sealed class VariantizeCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly ITileDefinitionManager _tileDefManager = default!;
public string Command => "variantize";

View File

@@ -154,7 +154,7 @@ namespace Content.Server.Administration.Managers
plyData.ExplicitlyDeadminned = false;
reg.Data.Active = true;
if (reg.Data.Stealth)
if (!reg.Data.Stealth)
{
_chat.SendAdminAnnouncement(Loc.GetString("admin-manager-self-re-admin-message", ("newAdminName", session.Name)));
}

View File

@@ -8,6 +8,7 @@ using Content.Shared.Mobs.Components;
using Content.Shared.Teleportation.Components;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Collections;
using Robust.Shared.Random;
namespace Content.Server.Anomaly.Effects;
@@ -35,20 +36,19 @@ public sealed class BluespaceAnomalySystem : EntitySystem
var range = component.MaxShuffleRadius * args.Severity;
var mobs = new HashSet<Entity<MobStateComponent>>();
_lookup.GetEntitiesInRange(xform.Coordinates, range, mobs);
var allEnts = new List<EntityUid>(mobs.Select(m => m.Owner)) { uid };
var coords = new List<Vector2>();
var allEnts = new ValueList<EntityUid>(mobs.Select(m => m.Owner)) { uid };
var coords = new ValueList<Vector2>();
foreach (var ent in allEnts)
{
if (xformQuery.TryGetComponent(ent, out var xf))
coords.Add(xf.MapPosition.Position);
if (xformQuery.TryGetComponent(ent, out var allXform))
coords.Add(_xform.GetWorldPosition(allXform));
}
_random.Shuffle(coords);
for (var i = 0; i < allEnts.Count; i++)
{
_adminLogger.Add(LogType.Teleport, $"{ToPrettyString(allEnts[i])} has been shuffled to {coords[i]} by the {ToPrettyString(uid)} at {xform.Coordinates}");
_xform.SetWorldPosition(allEnts[i], coords[i], xformQuery);
_xform.SetWorldPosition(allEnts[i], coords[i]);
}
}

View File

@@ -2,7 +2,6 @@ using Content.Shared.Anomaly;
using Content.Shared.Anomaly.Components;
using Content.Shared.Anomaly.Effects;
using Content.Shared.Anomaly.Effects.Components;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Components;
using Robust.Shared.Random;
@@ -12,7 +11,6 @@ namespace Content.Server.Anomaly.Effects;
public sealed class EntityAnomalySystem : SharedEntityAnomalySystem
{
[Dependency] private readonly SharedAnomalySystem _anomaly = default!;
[Dependency] private readonly IMapManager _map = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedMapSystem _mapSystem = default!;

View File

@@ -1,8 +1,6 @@
using Content.Server.Atmos;
using Content.Server.Atmos.Components;
using Content.Server.Atmos.Piping.Components;
using Content.Shared.Atmos;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
using System.Diagnostics.CodeAnalysis;
@@ -15,7 +13,6 @@ public sealed class AirFilterSystem : EntitySystem
{
[Dependency] private readonly AtmosphereSystem _atmosphere = default!;
[Dependency] private readonly IMapManager _map = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
public override void Initialize()
{

View File

@@ -1,4 +1,3 @@
using System.Numerics;
using Content.Server.Atmos.Components;
using Content.Server.Body.Components;
using Content.Server.Body.Systems;
@@ -17,8 +16,6 @@ using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Player;
using Robust.Shared.Random;
namespace Content.Server.Atmos.EntitySystems
@@ -33,7 +30,6 @@ namespace Content.Server.Atmos.EntitySystems
[Dependency] private readonly SharedContainerSystem _containers = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly ThrowingSystem _throwing = default!;

View File

@@ -27,7 +27,6 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
public sealed class GasVolumePumpSystem : EntitySystem
{
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly TransformSystem _transformSystem = default!;
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!;
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;

View File

@@ -13,7 +13,6 @@ using Content.Shared.Atmos;
using Content.Shared.Atmos.Piping.Binary.Components;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.Database;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.Lock;
using Robust.Server.GameObjects;
@@ -29,8 +28,6 @@ public sealed class GasCanisterSystem : EntitySystem
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedContainerSystem _container = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;
[Dependency] private readonly NodeContainerSystem _nodeContainer = default!;

View File

@@ -10,8 +10,6 @@ using Content.Shared.Mobs.Systems;
using Content.Shared.Movement.Events;
using Content.Shared.Movement.Systems;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Random;
using Robust.Shared.Timing;
using System.Numerics;
@@ -23,9 +21,7 @@ public sealed class BodySystem : SharedBodySystem
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly HumanoidAppearanceSystem _humanoidSystem = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedMindSystem _mindSystem = default!;
[Dependency] private readonly IRobustRandom _random = default!;
public override void Initialize()
{

View File

@@ -1,7 +1,6 @@
using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Body.Components;
using Content.Server.Hands.Systems;
using Content.Server.Popups;
using Content.Shared.Alert;
using Content.Shared.Atmos;
@@ -11,7 +10,6 @@ using Content.Shared.Internals;
using Content.Shared.Inventory;
using Content.Shared.Verbs;
using Robust.Shared.Containers;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.Server.Body.Systems;

View File

@@ -37,7 +37,6 @@ public sealed partial class CargoSystem : SharedCargoSystem
[Dependency] private readonly PricingSystem _pricing = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedTransformSystem _xformSystem = default!;
[Dependency] private readonly ShuttleConsoleSystem _console = default!;
[Dependency] private readonly StackSystem _stack = default!;
[Dependency] private readonly StationSystem _station = default!;

View File

@@ -12,7 +12,6 @@ using Content.Shared.Mobs.Systems;
using Content.Shared.Stacks;
using Robust.Shared.Console;
using Robust.Shared.Containers;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
@@ -27,7 +26,6 @@ public sealed class PricingSystem : EntitySystem
{
[Dependency] private readonly IComponentFactory _factory = default!;
[Dependency] private readonly IConsoleHost _consoleHost = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly BodySystem _bodySystem = default!;
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;

View File

@@ -4,7 +4,6 @@ using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.FixedPoint;
using Robust.Shared.Containers;
using Robust.Shared.Map;
using Robust.Shared.Network;
using Robust.Shared.Utility;
using System.Numerics;
@@ -12,8 +11,6 @@ namespace Content.Server.Chemistry.Containers.EntitySystems;
public sealed partial class SolutionContainerSystem : SharedSolutionContainerSystem
{
[Dependency] private readonly INetManager _netManager = default!;
public override void Initialize()
{
base.Initialize();

View File

@@ -1,4 +1,3 @@
using Content.Server.Administration.Logs;
using Content.Server.Chemistry.Components;
using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Server.Nutrition.EntitySystems;
@@ -30,7 +29,6 @@ namespace Content.Server.Chemistry.EntitySystems
[Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!;
[Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly OpenableSystem _openable = default!;
public override void Initialize()

View File

@@ -2,7 +2,6 @@ using System.Numerics;
using Content.Server.Administration;
using Content.Shared.Administration;
using Robust.Shared.Console;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
namespace Content.Server.Decals;
@@ -11,7 +10,6 @@ namespace Content.Server.Decals;
public sealed class EditDecalCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
public string Command => "editdecal";
public string Description => "Edits a decal.";

View File

@@ -1,9 +1,7 @@
using Content.Server.Administration;
using Content.Shared.Administration;
using Robust.Shared.Console;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using SQLitePCL;
namespace Content.Server.Decals.Commands
{
@@ -11,7 +9,6 @@ namespace Content.Server.Decals.Commands
public sealed class RemoveDecalCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
public string Command => "rmdecal";
public string Description => "removes a decal";

View File

@@ -1,4 +1,3 @@
using System.Linq;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Disposal.Tube;
using Content.Server.Disposal.Tube.Components;
@@ -12,14 +11,12 @@ using Robust.Shared.Containers;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Random;
namespace Content.Server.Disposal.Unit.EntitySystems
{
public sealed class DisposableSystem : EntitySystem
{
[Dependency] private readonly ThrowingSystem _throwing = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly DisposalUnitSystem _disposalUnitSystem = default!;

View File

@@ -41,8 +41,32 @@ public sealed partial class ElectrifiedComponent : Component
[DataField("lowVoltageNode")]
public string? LowVoltageNode;
/// <summary>
/// Damage multiplier for HV electrocution
/// </summary>
[DataField]
public float HighVoltageDamageMultiplier = 3f;
/// <summary>
/// Shock time multiplier for HV electrocution
/// </summary>
[DataField]
public float HighVoltageTimeMultiplier = 1.5f;
/// <summary>
/// Damage multiplier for MV electrocution
/// </summary>
[DataField]
public float MediumVoltageDamageMultiplier = 2f;
/// <summary>
/// Shock time multiplier for MV electrocution
/// </summary>
[DataField]
public float MediumVoltageTimeMultiplier = 1.25f;
[DataField("shockDamage")]
public int ShockDamage = 20;
public float ShockDamage = 7.5f;
/// <summary>
/// Shock time, in seconds.

View File

@@ -15,10 +15,4 @@ public sealed partial class ElectrocutionComponent : Component
[DataField("timeLeft")]
public float TimeLeft;
[DataField("accumDamage")]
public float AccumulatedDamage;
[DataField("baseDamage")]
public float BaseDamage = 20f;
}

View File

@@ -17,7 +17,6 @@ using Content.Shared.Interaction;
using Content.Shared.Inventory;
using Content.Shared.Jittering;
using Content.Shared.Maps;
using Content.Shared.Mobs;
using Content.Shared.Popups;
using Content.Shared.Speech.EntitySystems;
using Content.Shared.StatusEffect;
@@ -98,29 +97,18 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
private void UpdateElectrocutions(float frameTime)
{
var query = EntityQueryEnumerator<ElectrocutionComponent, PowerConsumerComponent>();
while (query.MoveNext(out var uid, out var electrocution, out var consumer))
while (query.MoveNext(out var uid, out var electrocution, out _))
{
var timePassed = Math.Min(frameTime, electrocution.TimeLeft);
electrocution.TimeLeft -= timePassed;
electrocution.AccumulatedDamage += electrocution.BaseDamage * (consumer.ReceivedPower / consumer.DrawRate) * timePassed;
if (!MathHelper.CloseTo(electrocution.TimeLeft, 0))
continue;
if (EntityManager.EntityExists(electrocution.Electrocuting))
{
// TODO: damage should be scaled by shock damage multiplier
// TODO: better paralyze/jitter timing
var damage = new DamageSpecifier(_prototypeManager.Index<DamageTypePrototype>(DamageType), (int) electrocution.AccumulatedDamage);
// We tried damage scaling based on power in the past and it really wasn't good.
// Various scaling types didn't fix tiders and HV grilles instantly critting players.
var actual = _damageable.TryChangeDamage(electrocution.Electrocuting, damage, origin: electrocution.Source);
if (actual != null)
{
_adminLogger.Add(LogType.Electrocution,
$"{ToPrettyString(electrocution.Electrocuting):entity} received {actual.GetTotal():damage} powered electrocution damage from {ToPrettyString(electrocution.Source):source}");
}
}
QueueDel(uid);
}
}
@@ -198,7 +186,7 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
if (!_meleeWeapon.GetDamage(args.Used, args.User).Any())
return;
DoCommonElectrocution(args.User, uid, component.UnarmedHitShock, component.UnarmedHitStun, false, 1);
DoCommonElectrocution(args.User, uid, component.UnarmedHitShock, component.UnarmedHitStun, false);
}
private void OnElectrifiedInteractUsing(EntityUid uid, ElectrifiedComponent electrified, InteractUsingEvent args)
@@ -213,16 +201,6 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
TryDoElectrifiedAct(uid, args.User, siemens, electrified);
}
private float CalculateElectrifiedDamageScale(float power)
{
// A logarithm allows a curve of damage that grows quickly, but slows down dramatically past a value. This keeps the damage to a reasonable range.
const float DamageShift = 1.67f; // Shifts the curve for an overall higher or lower damage baseline
const float CeilingCoefficent = 1.35f; // Adjusts the approach to maximum damage, higher = Higher top damage
const float LogGrowth = 0.00001f; // Adjusts the growth speed of the curve
return DamageShift + MathF.Log(power * LogGrowth) * CeilingCoefficent;
}
public bool TryDoElectrifiedAct(EntityUid uid, EntityUid targetUid,
float siemens = 1,
ElectrifiedComponent? electrified = null,
@@ -263,19 +241,15 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
}
var node = PoweredNode(uid, electrified, nodeContainer);
if (node?.NodeGroup is not IBasePowerNet powerNet)
if (node?.NodeGroup is not IBasePowerNet)
return false;
var net = powerNet.NetworkNode;
var supp = net.LastCombinedMaxSupply;
if (supp <= 0f)
return false;
// Initial damage scales off of the available supply on the principle that the victim has shorted the entire powernet through their body.
var damageScale = CalculateElectrifiedDamageScale(supp);
if (damageScale <= 0f)
return false;
var (damageScalar, timeScalar) = node.NodeGroupID switch
{
NodeGroupID.HVPower => (electrified.HighVoltageDamageMultiplier, electrified.HighVoltageTimeMultiplier),
NodeGroupID.MVPower => (electrified.MediumVoltageDamageMultiplier, electrified.MediumVoltageTimeMultiplier),
_ => (1f, 1f)
};
{
var lastRet = true;
@@ -286,8 +260,8 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
entity,
uid,
node,
(int) MathF.Ceiling(electrified.ShockDamage * damageScale * MathF.Pow(RecursiveDamageMultiplier, depth)),
TimeSpan.FromSeconds(electrified.ShockTime * MathF.Min(1f + MathF.Log2(1f + damageScale), 3f) * MathF.Pow(RecursiveTimeMultiplier, depth)),
(int) (electrified.ShockDamage * MathF.Pow(RecursiveDamageMultiplier, depth) * damageScalar),
TimeSpan.FromSeconds(electrified.ShockTime * MathF.Pow(RecursiveTimeMultiplier, depth) * timeScalar),
true,
electrified.SiemensCoefficient);
}

View File

@@ -1,4 +1,3 @@
using System.Linq;
using System.Numerics;
using Content.Shared.CCVar;
using Content.Shared.Damage;
@@ -17,7 +16,6 @@ using Robust.Shared.Random;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using TimedDespawnComponent = Robust.Shared.Spawners.TimedDespawnComponent;
using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
namespace Content.Server.Explosion.EntitySystems;
@@ -48,13 +46,6 @@ public sealed partial class ExplosionSystem
/// </summary>
private Explosion? _activeExplosion;
/// <summary>
/// While processing an explosion, the "progress" is sent to clients, so that the explosion fireball effect
/// syncs up with the damage. When the tile iteration increments, an update needs to be sent to clients.
/// This integer keeps track of the last value sent to clients.
/// </summary>
private int _previousTileIteration;
/// <summary>
/// This list is used when raising <see cref="BeforeExplodeEvent"/> to avoid allocating a new list per event.
/// </summary>
@@ -112,8 +103,6 @@ public sealed partial class ExplosionSystem
if (_activeExplosion == null)
continue;
_previousTileIteration = 0;
// just a lil nap
if (SleepNodeSys)
{

View File

@@ -1,10 +1,8 @@
using Content.Shared.StatusEffect;
using Content.Shared.Inventory;
using Content.Shared.Item;
using Content.Shared.Eye.Blinding.Components;
using Content.Shared.Eye.Blinding.Systems;
using Content.Shared.Tools.Components;
using Content.Shared.Item.ItemToggle;
using Content.Shared.Item.ItemToggle.Components;
namespace Content.Server.Eye.Blinding.EyeProtection
@@ -13,7 +11,6 @@ namespace Content.Server.Eye.Blinding.EyeProtection
{
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
[Dependency] private readonly BlindableSystem _blindingSystem = default!;
[Dependency] private readonly SharedItemToggleSystem _itemToggle = default!;
public override void Initialize()
{

View File

@@ -1,7 +0,0 @@
namespace Content.Server.Fluids.Components;
[RegisterComponent]
public sealed partial class PreventSpillerComponent : Component
{
}

View File

@@ -1,5 +1,4 @@
using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Server.Fluids.Components;
using Content.Server.Nutrition.EntitySystems;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.EntitySystems;
@@ -8,7 +7,6 @@ using Content.Shared.Chemistry.Reagent;
using Content.Shared.Clothing.Components;
using Content.Shared.CombatMode.Pacification;
using Content.Shared.Database;
using Content.Shared.DoAfter;
using Content.Shared.FixedPoint;
using Content.Shared.Fluids.Components;
using Content.Shared.IdentityManagement;
@@ -16,7 +14,6 @@ using Content.Shared.Inventory.Events;
using Content.Shared.Popups;
using Content.Shared.Spillable;
using Content.Shared.Throwing;
using Content.Shared.Verbs;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Player;
@@ -24,9 +21,6 @@ namespace Content.Server.Fluids.EntitySystems;
public sealed partial class PuddleSystem
{
[Dependency] private readonly OpenableSystem _openable = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
protected override void InitializeSpillable()
{
base.InitializeSpillable();
@@ -34,7 +28,6 @@ public sealed partial class PuddleSystem
SubscribeLocalEvent<SpillableComponent, LandEvent>(SpillOnLand);
// Openable handles the event if it's closed
SubscribeLocalEvent<SpillableComponent, MeleeHitEvent>(SplashOnMeleeHit, after: [typeof(OpenableSystem)]);
SubscribeLocalEvent<SpillableComponent, GetVerbsEvent<Verb>>(AddSpillVerb);
SubscribeLocalEvent<SpillableComponent, GotEquippedEvent>(OnGotEquipped);
SubscribeLocalEvent<SpillableComponent, SolutionContainerOverflowEvent>(OnOverflow);
SubscribeLocalEvent<SpillableComponent, SpillDoAfterEvent>(OnDoAfter);
@@ -134,7 +127,7 @@ public sealed partial class PuddleSystem
if (!_solutionContainerSystem.TryGetSolution(entity.Owner, entity.Comp.SolutionName, out var soln, out var solution))
return;
if (_openable.IsClosed(entity.Owner))
if (Openable.IsClosed(entity.Owner))
return;
if (args.User != null)
@@ -153,7 +146,7 @@ public sealed partial class PuddleSystem
private void OnAttemptPacifiedThrow(Entity<SpillableComponent> ent, ref AttemptPacifiedThrowEvent args)
{
// Dont care about closed containers.
if (_openable.IsClosed(ent))
if (Openable.IsClosed(ent))
return;
// Dont care about empty containers.
@@ -163,57 +156,6 @@ public sealed partial class PuddleSystem
args.Cancel("pacified-cannot-throw-spill");
}
private void AddSpillVerb(Entity<SpillableComponent> entity, ref GetVerbsEvent<Verb> args)
{
if (!args.CanAccess || !args.CanInteract)
return;
if (!_solutionContainerSystem.TryGetSolution(args.Target, entity.Comp.SolutionName, out var soln, out var solution))
return;
if (_openable.IsClosed(args.Target))
return;
if (solution.Volume == FixedPoint2.Zero)
return;
if (_entityManager.HasComponent<PreventSpillerComponent>(args.User))
return;
Verb verb = new()
{
Text = Loc.GetString("spill-target-verb-get-data-text")
};
// TODO VERB ICONS spill icon? pouring out a glass/beaker?
if (entity.Comp.SpillDelay == null)
{
var target = args.Target;
verb.Act = () =>
{
var puddleSolution = _solutionContainerSystem.SplitSolution(soln.Value, solution.Volume);
TrySpillAt(Transform(target).Coordinates, puddleSolution, out _);
};
}
else
{
var user = args.User;
verb.Act = () =>
{
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, user, entity.Comp.SpillDelay ?? 0, new SpillDoAfterEvent(), entity.Owner, target: entity.Owner)
{
BreakOnDamage = true,
BreakOnMove = true,
NeedHand = true,
});
};
}
verb.Impact = LogImpact.Medium; // dangerous reagent reaction are logged separately.
verb.DoContactInteraction = true;
args.Verbs.Add(verb);
}
private void OnDoAfter(Entity<SpillableComponent> entity, ref SpillDoAfterEvent args)
{
if (args.Handled || args.Cancelled || args.Args.Target == null)

View File

@@ -46,7 +46,6 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly ITileDefinitionManager _tileDefMan = default!;
[Dependency] private readonly AudioSystem _audio = default!;
[Dependency] private readonly DoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly ReactiveSystem _reactive = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
@@ -551,11 +550,8 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
#region Spill
/// <summary>
/// First splashes reagent on reactive entities near the spilling entity, then spills the rest regularly to a
/// puddle. This is intended for 'destructive' spills, like when entities are destroyed or thrown.
/// </summary>
public bool TrySplashSpillAt(EntityUid uid,
/// <inheritdoc/>
public override bool TrySplashSpillAt(EntityUid uid,
EntityCoordinates coordinates,
Solution solution,
out EntityUid puddleUid,
@@ -600,11 +596,8 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
return TrySpillAt(coordinates, solution, out puddleUid, sound);
}
/// <summary>
/// Spills solution at the specified coordinates.
/// Will add to an existing puddle if present or create a new one if not.
/// </summary>
public bool TrySpillAt(EntityCoordinates coordinates, Solution solution, out EntityUid puddleUid, bool sound = true)
/// <inheritdoc/>
public override bool TrySpillAt(EntityCoordinates coordinates, Solution solution, out EntityUid puddleUid, bool sound = true)
{
if (solution.Volume == 0)
{
@@ -622,10 +615,8 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
return TrySpillAt(_map.GetTileRef(gridUid.Value, mapGrid, coordinates), solution, out puddleUid, sound);
}
/// <summary>
/// <see cref="TrySpillAt(Robust.Shared.Map.EntityCoordinates,Content.Shared.Chemistry.Components.Solution,out Robust.Shared.GameObjects.EntityUid,bool)"/>
/// </summary>
public bool TrySpillAt(EntityUid uid, Solution solution, out EntityUid puddleUid, bool sound = true,
/// <inheritdoc/>
public override bool TrySpillAt(EntityUid uid, Solution solution, out EntityUid puddleUid, bool sound = true,
TransformComponent? transformComponent = null)
{
if (!Resolve(uid, ref transformComponent, false))
@@ -637,10 +628,8 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
return TrySpillAt(transformComponent.Coordinates, solution, out puddleUid, sound: sound);
}
/// <summary>
/// <see cref="TrySpillAt(Robust.Shared.Map.EntityCoordinates,Content.Shared.Chemistry.Components.Solution,out Robust.Shared.GameObjects.EntityUid,bool)"/>
/// </summary>
public bool TrySpillAt(TileRef tileRef, Solution solution, out EntityUid puddleUid, bool sound = true,
/// <inheritdoc/>
public override bool TrySpillAt(TileRef tileRef, Solution solution, out EntityUid puddleUid, bool sound = true,
bool tileReact = true)
{
if (solution.Volume <= 0)

View File

@@ -1,4 +1,5 @@
using Content.Server.Administration.Logs;
using Content.Server.Chat.Managers;
using Content.Server.GameTicking.Presets;
using Content.Server.GameTicking.Rules.Components;
using Content.Shared.Random;
@@ -17,6 +18,7 @@ public sealed class SecretRuleSystem : GameRuleSystem<SecretRuleComponent>
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly IChatManager _chatManager = default!;
protected override void Added(EntityUid uid, SecretRuleComponent component, GameRuleComponent gameRule, GameRuleAddedEvent args)
{
@@ -42,6 +44,7 @@ public sealed class SecretRuleSystem : GameRuleSystem<SecretRuleComponent>
var preset = _prototypeManager.Index<WeightedRandomPrototype>(presetString).Pick(_random);
Log.Info($"Selected {preset} for secret.");
_adminLogger.Add(LogType.EventStarted, $"Selected {preset} for secret.");
_chatManager.SendAdminAnnouncement(Loc.GetString("rule-secret-selected-preset", ("preset", preset)));
var rules = _prototypeManager.Index<GamePresetPrototype>(preset).Rules;
foreach (var rule in rules)

View File

@@ -1,23 +1,16 @@
using System.Linq;
using System.Numerics;
using Content.Server.Gateway.Components;
using Content.Server.Parallax;
using Content.Server.Procedural;
using Content.Server.Salvage;
using Content.Shared.CCVar;
using Content.Shared.Dataset;
using Content.Shared.Maps;
using Content.Shared.Movement.Components;
using Content.Shared.Parallax.Biomes;
using Content.Shared.Physics;
using Content.Shared.Procedural;
using Content.Shared.Salvage;
using Robust.Shared.Configuration;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Collision.Shapes;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Timing;
@@ -40,7 +33,6 @@ public sealed class GatewayGeneratorSystem : EntitySystem
[Dependency] private readonly DungeonSystem _dungeon = default!;
[Dependency] private readonly GatewaySystem _gateway = default!;
[Dependency] private readonly MetaDataSystem _metadata = default!;
[Dependency] private readonly RestrictedRangeSystem _restricted = default!;
[Dependency] private readonly SharedMapSystem _maps = default!;
[Dependency] private readonly TileSystem _tile = default!;

View File

@@ -1,6 +1,5 @@
using Content.Server.UserInterface;
using Content.Shared.Instruments;
using Robust.Server.GameObjects;
using Robust.Shared.Player;
namespace Content.Server.Instruments;

View File

@@ -1,4 +1,3 @@
using Content.Shared.ActionBlocker;
using Content.Shared.Interaction;
using Content.Shared.Storage;
using JetBrains.Annotations;
@@ -14,7 +13,6 @@ namespace Content.Server.Interaction
[UsedImplicitly]
public sealed partial class InteractionSystem : SharedInteractionSystem
{
[Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!;
[Dependency] private readonly SharedContainerSystem _container = default!;
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;

View File

@@ -13,24 +13,27 @@ namespace Content.Server.Kitchen.Components
[Access(typeof(ReagentGrinderSystem)), RegisterComponent]
public sealed partial class ReagentGrinderComponent : Component
{
[DataField, ViewVariables(VVAccess.ReadWrite)]
[DataField]
public int StorageMaxEntities = 6;
[DataField("workTime"), ViewVariables(VVAccess.ReadWrite)]
[DataField]
public TimeSpan WorkTime = TimeSpan.FromSeconds(3.5); // Roughly matches the grind/juice sounds.
[DataField, ViewVariables(VVAccess.ReadWrite)]
[DataField]
public float WorkTimeMultiplier = 1;
[DataField("clickSound"), ViewVariables(VVAccess.ReadWrite)]
[DataField]
public SoundSpecifier ClickSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/machine_switch.ogg");
[DataField("grindSound"), ViewVariables(VVAccess.ReadWrite)]
[DataField]
public SoundSpecifier GrindSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/blender.ogg");
[DataField("juiceSound"), ViewVariables(VVAccess.ReadWrite)]
[DataField]
public SoundSpecifier JuiceSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/juicer.ogg");
[DataField]
public GrinderAutoMode AutoMode = GrinderAutoMode.Off;
public EntityUid? AudioStream;
}

View File

@@ -53,11 +53,19 @@ namespace Content.Server.Kitchen.EntitySystems
SubscribeLocalEvent<ReagentGrinderComponent, EntRemovedFromContainerMessage>(OnContainerModified);
SubscribeLocalEvent<ReagentGrinderComponent, ContainerIsRemovingAttemptEvent>(OnEntRemoveAttempt);
SubscribeLocalEvent<ReagentGrinderComponent, ReagentGrinderToggleAutoModeMessage>(OnToggleAutoModeMessage);
SubscribeLocalEvent<ReagentGrinderComponent, ReagentGrinderStartMessage>(OnStartMessage);
SubscribeLocalEvent<ReagentGrinderComponent, ReagentGrinderEjectChamberAllMessage>(OnEjectChamberAllMessage);
SubscribeLocalEvent<ReagentGrinderComponent, ReagentGrinderEjectChamberContentMessage>(OnEjectChamberContentMessage);
}
private void OnToggleAutoModeMessage(Entity<ReagentGrinderComponent> entity, ref ReagentGrinderToggleAutoModeMessage message)
{
entity.Comp.AutoMode = (GrinderAutoMode) (((byte) entity.Comp.AutoMode + 1) % Enum.GetValues(typeof(GrinderAutoMode)).Length);
UpdateUiState(entity);
}
public override void Update(float frameTime)
{
base.Update(frameTime);
@@ -148,6 +156,12 @@ namespace Content.Server.Kitchen.EntitySystems
var outputContainer = _itemSlotsSystem.GetItemOrNull(uid, SharedReagentGrinder.BeakerSlotId);
_appearanceSystem.SetData(uid, ReagentGrinderVisualState.BeakerAttached, outputContainer.HasValue);
if (reagentGrinder.AutoMode != GrinderAutoMode.Off && !HasComp<ActiveReagentGrinderComponent>(uid))
{
var program = reagentGrinder.AutoMode == GrinderAutoMode.Grind ? GrinderProgram.Grind : GrinderProgram.Juice;
DoWork(uid, reagentGrinder, program);
}
}
private void OnInteractUsing(Entity<ReagentGrinderComponent> entity, ref InteractUsingEvent args)
@@ -185,6 +199,10 @@ namespace Content.Server.Kitchen.EntitySystems
private void UpdateUiState(EntityUid uid)
{
ReagentGrinderComponent? grinderComp = null;
if (!Resolve(uid, ref grinderComp))
return;
var inputContainer = _containerSystem.EnsureContainer<Container>(uid, SharedReagentGrinder.InputContainerId);
var outputContainer = _itemSlotsSystem.GetItemOrNull(uid, SharedReagentGrinder.BeakerSlotId);
Solution? containerSolution = null;
@@ -206,6 +224,7 @@ namespace Content.Server.Kitchen.EntitySystems
this.IsPowered(uid, EntityManager),
canJuice,
canGrind,
grinderComp.AutoMode,
GetNetEntityArray(inputContainer.ContainedEntities.ToArray()),
containerSolution?.Contents.ToArray()
);

View File

@@ -20,7 +20,6 @@ using Content.Server.Body.Systems;
using Robust.Server.Containers;
using Robust.Server.GameObjects;
using Robust.Shared.Containers;
using Robust.Shared.Map;
using Robust.Shared.Player;
namespace Content.Server.Mech.Systems;
@@ -33,8 +32,6 @@ public sealed partial class MechSystem : SharedMechSystem
[Dependency] private readonly BatterySystem _battery = default!;
[Dependency] private readonly ContainerSystem _container = default!;
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly IMapManager _map = default!;
[Dependency] private readonly MapSystem _mapSystem = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;

View File

@@ -9,7 +9,6 @@ using Content.Server.Popups;
using Content.Server.Station.Systems;
using Content.Shared.Damage;
using Content.Shared.DeviceNetwork;
using Content.Shared.Emp;
using Content.Shared.Examine;
using Content.Shared.Inventory.Events;
using Content.Shared.Medical.SuitSensor;
@@ -27,7 +26,6 @@ public sealed class SuitSensorSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly CrewMonitoringServerSystem _monitoringServerSystem = default!;
[Dependency] private readonly DeviceNetworkSystem _deviceNetworkSystem = default!;
[Dependency] private readonly IdCardSystem _idCardSystem = default!;
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;

View File

@@ -1,14 +1,11 @@
using Content.Server.Ninja.Events;
using Content.Server.Power.EntitySystems;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
using Content.Shared.Interaction;
using Content.Shared.Ninja.Components;
using Content.Shared.Ninja.Systems;
using Content.Shared.Popups;
using Content.Shared.Stunnable;
using Content.Shared.Whitelist;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Timing;
@@ -23,7 +20,6 @@ public sealed class StunProviderSystem : SharedStunProviderSystem
[Dependency] private readonly BatterySystem _battery = default!;
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedNinjaGlovesSystem _gloves = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;

View File

@@ -5,7 +5,6 @@ using Content.Shared.Nutrition.Components;
using Content.Shared.Chemistry.Components;
using Content.Shared.Examine;
using Content.Shared.FixedPoint;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Interaction;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
@@ -19,7 +18,6 @@ namespace Content.Server.Nutrition.EntitySystems
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly TransformSystem _xformSystem = default!;
public override void Initialize()

View File

@@ -1,7 +1,6 @@
using Content.Server.Objectives.Components;
using Content.Server.Warps;
using Content.Shared.Objectives.Components;
using Content.Shared.Mind;
using Content.Shared.Ninja.Components;
using Robust.Shared.Random;
using Content.Server.Roles;
@@ -16,7 +15,6 @@ public sealed class NinjaConditionsSystem : EntitySystem
{
[Dependency] private readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly NumberObjectiveSystem _number = default!;
[Dependency] private readonly SharedMindSystem _mind = default!;
[Dependency] private readonly IRobustRandom _random = default!;
public override void Initialize()

View File

@@ -2,7 +2,6 @@ using Content.Server.Administration.Logs;
using Content.Server.Chat.Managers;
using Content.Server.Projectiles;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Map;
using Robust.Shared.Timing;
using Robust.Server.GameObjects;
using Robust.Shared.Configuration;
@@ -13,7 +12,6 @@ public sealed partial class ParticleAcceleratorSystem : EntitySystem
{
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IChatManager _chat = default!;
[Dependency] private readonly ProjectileSystem _projectileSystem = default!;

View File

@@ -32,7 +32,6 @@ public sealed partial class PolymorphSystem : EntitySystem
[Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly ActionsSystem _actions = default!;
[Dependency] private readonly ActionContainerSystem _actionContainer = default!;
[Dependency] private readonly AudioSystem _audio = default!;
[Dependency] private readonly SharedBuckleSystem _buckle = default!;
[Dependency] private readonly ContainerSystem _container = default!;
@@ -119,7 +118,10 @@ public sealed partial class PolymorphSystem : EntitySystem
private void OnPolymorphActionEvent(Entity<PolymorphableComponent> ent, ref PolymorphActionEvent args)
{
PolymorphEntity(ent, args.Prototype.Configuration);
if (!_proto.TryIndex(args.ProtoId, out var prototype))
return;
PolymorphEntity(ent, prototype.Configuration);
}
private void OnRevertPolymorphActionEvent(Entity<PolymorphedEntityComponent> ent,
@@ -349,7 +351,9 @@ public sealed partial class PolymorphSystem : EntitySystem
if (target.Comp.PolymorphActions.ContainsKey(id))
return;
var polyProto = _proto.Index(id);
if (!_proto.TryIndex(id, out var polyProto))
return;
var entProto = _proto.Index(polyProto.Configuration.Entity);
EntityUid? actionId = default!;
@@ -367,7 +371,7 @@ public sealed partial class PolymorphSystem : EntitySystem
baseAction.Icon = new SpriteSpecifier.EntityPrototype(polyProto.Configuration.Entity);
if (baseAction is InstantActionComponent action)
action.Event = new PolymorphActionEvent(prototype: polyProto);
action.Event = new PolymorphActionEvent(id);
}
public void RemovePolymorphAction(ProtoId<PolymorphPrototype> id, Entity<PolymorphableComponent> target)

View File

@@ -3,8 +3,8 @@ using Content.Server.Administration;
using Content.Server.Polymorph.Systems;
using Content.Shared.Administration;
using Content.Shared.Polymorph;
using Robust.Shared.Prototypes;
using Robust.Shared.Toolshed;
using Robust.Shared.Toolshed.TypeParsers;
namespace Content.Server.Polymorph.Toolshed;
@@ -15,22 +15,26 @@ namespace Content.Server.Polymorph.Toolshed;
public sealed class PolymorphCommand : ToolshedCommand
{
private PolymorphSystem? _system;
[Dependency] private IPrototypeManager _proto = default!;
[CommandImplementation]
public EntityUid? Polymorph(
[PipedArgument] EntityUid input,
[CommandArgument] Prototype<PolymorphPrototype> prototype
[CommandArgument] ProtoId<PolymorphPrototype> protoId
)
{
_system ??= GetSys<PolymorphSystem>();
return _system.PolymorphEntity(input, prototype.Value.Configuration);
if (!_proto.TryIndex(protoId, out var prototype))
return null;
return _system.PolymorphEntity(input, prototype.Configuration);
}
[CommandImplementation]
public IEnumerable<EntityUid> Polymorph(
[PipedArgument] IEnumerable<EntityUid> input,
[CommandArgument] Prototype<PolymorphPrototype> prototype
[CommandArgument] ProtoId<PolymorphPrototype> protoId
)
=> input.Select(x => Polymorph(x, prototype)).Where(x => x is not null).Select(x => (EntityUid)x!);
=> input.Select(x => Polymorph(x, protoId)).Where(x => x is not null).Select(x => (EntityUid)x!);
}

View File

@@ -1,6 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using Content.Server.Power.Components;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Components;
@@ -9,8 +8,6 @@ namespace Content.Server.Power.EntitySystems
{
public sealed class ExtensionCableSystem : EntitySystem
{
[Dependency] private readonly IMapManager _mapManager = default!;
public override void Initialize()
{
base.Initialize();

View File

@@ -1,5 +1,4 @@
using Content.Server.DoAfter;
using Content.Server.NodeContainer.NodeGroups;
using Content.Server.Popups;
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
@@ -28,7 +27,6 @@ public sealed class PortableGeneratorSystem : SharedPortableGeneratorSystem
[Dependency] private readonly GeneratorSystem _generator = default!;
[Dependency] private readonly PowerSwitchableSystem _switchable = default!;
[Dependency] private readonly ActiveGeneratorRevvingSystem _revving = default!;
[Dependency] private readonly PowerNetSystem _powerNet = default!;
public override void Initialize()
{

View File

@@ -11,7 +11,6 @@ using Content.Shared.Nutrition.Components;
using Content.Shared.Nutrition.EntitySystems;
using Content.Shared.Pointing;
using Content.Shared.RatKing;
using Robust.Server.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Random;
@@ -26,7 +25,6 @@ namespace Content.Server.RatKing
[Dependency] private readonly HungerSystem _hunger = default!;
[Dependency] private readonly NPCSystem _npc = default!;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly TransformSystem _xform = default!;
public override void Initialize()
{

View File

@@ -5,14 +5,12 @@ using Content.Shared.Roles;
using Content.Shared.Roles.Jobs;
using Robust.Server.Player;
using Robust.Shared.Console;
using Robust.Shared.Prototypes;
namespace Content.Server.Roles
{
[AdminCommand(AdminFlags.Admin)]
public sealed class RemoveRoleCommand : IConsoleCommand
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
public string Command => "rmrole";

View File

@@ -11,7 +11,6 @@ namespace Content.Server.Sandbox.Commands
[AnyCommand]
public sealed class ColorNetworkCommand : IConsoleCommand
{
[Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly IEntityManager _entManager = default!;
public string Command => "colornetwork";

View File

@@ -1,13 +1,10 @@
using System.Linq;
using System.Numerics;
using Content.Server.Administration;
using Content.Server.GameTicking;
using Content.Server.GameTicking.Events;
using Content.Server.Parallax;
using Content.Server.DeviceNetwork;
using Content.Server.DeviceNetwork.Components;
using Content.Server.DeviceNetwork.Systems;
using Content.Server.Salvage;
using Content.Server.Screens.Components;
using Content.Server.Shuttles.Components;
using Content.Server.Shuttles.Events;
@@ -22,7 +19,6 @@ using Content.Shared.Movement.Components;
using Content.Shared.Parallax.Biomes;
using Content.Shared.Salvage;
using Content.Shared.Shuttles.Components;
using Robust.Shared.Spawners;
using Content.Shared.Tiles;
using Robust.Server.GameObjects;
using Robust.Shared.Collections;
@@ -51,7 +47,6 @@ public sealed class ArrivalsSystem : EntitySystem
[Dependency] private readonly GameTicker _ticker = default!;
[Dependency] private readonly MapLoaderSystem _loader = default!;
[Dependency] private readonly DeviceNetworkSystem _deviceNetworkSystem = default!;
[Dependency] private readonly RestrictedRangeSystem _restricted = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly ShuttleSystem _shuttles = default!;
[Dependency] private readonly StationSpawningSystem _stationSpawning = default!;

View File

@@ -1,6 +1,5 @@
using System.Numerics;
using Content.Server.Audio;
using Content.Server.Construction;
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
using Content.Server.Shuttles.Components;
@@ -25,7 +24,6 @@ namespace Content.Server.Shuttles.Systems;
public sealed class ThrusterSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly ITileDefinitionManager _tileDefManager = default!;
[Dependency] private readonly AmbientSoundSystem _ambient = default!;
[Dependency] private readonly FixtureSystem _fixtureSystem = default!;

View File

@@ -19,7 +19,6 @@ using Content.Shared.Silicons.Laws.Components;
using Content.Shared.Stunnable;
using Content.Shared.Wires;
using Robust.Server.GameObjects;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Toolshed;
@@ -38,7 +37,6 @@ public sealed class SiliconLawSystem : SharedSiliconLawSystem
[Dependency] private readonly SharedStunSystem _stunSystem = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly SharedRoleSystem _roles = default!;
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
/// <inheritdoc/>
public override void Initialize()

View File

@@ -24,7 +24,6 @@ public sealed class RadiationCollectorSystem : EntitySystem
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
[Dependency] private readonly UseDelaySystem _useDelay = default!;
[Dependency] private readonly BatterySystem _batterySystem = default!;
private const string GasTankContainer = "gas_tank";

View File

@@ -18,7 +18,6 @@ namespace Content.Server.Spreader;
/// </summary>
public sealed class SpreaderSystem : EntitySystem
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly SharedMapSystem _map = default!;

View File

@@ -25,7 +25,6 @@ public sealed partial class StationJobsSystem : EntitySystem
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly GameTicker _gameTicker = default!;
[Dependency] private readonly StationSystem _stationSystem = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
/// <inheritdoc/>

View File

@@ -29,7 +29,6 @@ public sealed class StationSystem : EntitySystem
{
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
[Dependency] private readonly ILogManager _logManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly ChatSystem _chatSystem = default!;

View File

@@ -2,10 +2,8 @@ using Content.Server.GameTicking.Rules.Components;
using Content.Server.Ninja.Systems;
using Content.Server.Station.Components;
using Content.Server.StationEvents.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Random;
namespace Content.Server.StationEvents.Events;
@@ -14,7 +12,6 @@ namespace Content.Server.StationEvents.Events;
/// </summary>
public sealed class NinjaSpawnRule : StationEventSystem<NinjaSpawnRuleComponent>
{
[Dependency] private readonly SpaceNinjaSystem _ninja = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
protected override void Started(EntityUid uid, NinjaSpawnRuleComponent comp, GameRuleComponent gameRule, GameRuleStartedEvent args)

View File

@@ -1,10 +1,7 @@
using Content.Server.Chat.Systems;
using Content.Server.Speech;
using Content.Shared.Speech;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Timing;
namespace Content.Server.SurveillanceCamera;
@@ -18,8 +15,6 @@ public sealed class SurveillanceCameraSpeakerSystem : EntitySystem
[Dependency] private readonly SpeechSoundSystem _speechSound = default!;
[Dependency] private readonly ChatSystem _chatSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
/// <inheritdoc/>
public override void Initialize()

View File

@@ -11,7 +11,6 @@ using Content.Shared.Database;
using Content.Shared.Inventory;
using Content.Shared.Rejuvenate;
using Content.Shared.Temperature;
using Robust.Server.GameObjects;
using Robust.Shared.Physics.Components;
namespace Content.Server.Temperature.Systems;
@@ -22,7 +21,6 @@ public sealed class TemperatureSystem : EntitySystem
[Dependency] private readonly AtmosphereSystem _atmosphere = default!;
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly TransformSystem _transform = default!;
/// <summary>
/// All the components that will have their damage updated at the end of the tick.

View File

@@ -1,6 +1,5 @@
using System.Linq;
using System.Numerics;
using Content.Server.Administration.Logs;
using Content.Server.Cargo.Systems;
using Content.Server.Interaction;
using Content.Server.Power.EntitySystems;
@@ -29,7 +28,6 @@ namespace Content.Server.Weapons.Ranged.Systems;
public sealed partial class GunSystem : SharedGunSystem
{
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly IComponentFactory _factory = default!;
[Dependency] private readonly BatterySystem _battery = default!;
[Dependency] private readonly DamageExamineSystem _damageExamine = default!;

View File

@@ -1,7 +1,6 @@
using Content.Server.Atmos.EntitySystems;
using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
using Robust.Server.GameObjects;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Systems;
@@ -9,7 +8,6 @@ public sealed class ArtifactGasTriggerSystem : EntitySystem
{
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly ArtifactSystem _artifactSystem = default!;
[Dependency] private readonly TransformSystem _transformSystem = default!;
public override void Initialize()
{

View File

@@ -3,7 +3,6 @@ using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
using Content.Shared.Interaction;
using Content.Shared.Temperature;
using Content.Shared.Weapons.Melee.Events;
using Robust.Server.GameObjects;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Systems;
@@ -11,7 +10,6 @@ public sealed class ArtifactHeatTriggerSystem : EntitySystem
{
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly ArtifactSystem _artifactSystem = default!;
[Dependency] private readonly TransformSystem _transformSystem = default!;
public override void Initialize()
{

View File

@@ -1,6 +1,5 @@
using Content.Server.Atmos.EntitySystems;
using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
using Robust.Server.GameObjects;
namespace Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Systems;
@@ -11,7 +10,6 @@ public sealed class ArtifactPressureTriggerSystem : EntitySystem
{
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly ArtifactSystem _artifactSystem = default!;
[Dependency] private readonly TransformSystem _transformSystem = default!;
public override void Update(float frameTime)
{

View File

@@ -2,9 +2,7 @@ using System.Linq;
using Content.Server.Body.Systems;
using Content.Server.Chat;
using Content.Server.Chat.Systems;
using Content.Server.Cloning;
using Content.Server.Emoting.Systems;
using Content.Server.Inventory;
using Content.Server.Speech.EntitySystems;
using Content.Shared.Bed.Sleep;
using Content.Shared.Cloning;
@@ -31,7 +29,6 @@ namespace Content.Server.Zombies
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly BloodstreamSystem _bloodstream = default!;
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly ServerInventorySystem _inv = default!;
[Dependency] private readonly ChatSystem _chat = default!;
[Dependency] private readonly AutoEmoteSystem _autoEmote = default!;
[Dependency] private readonly EmoteOnDamageSystem _emoteOnDamage = default!;

View File

@@ -34,7 +34,6 @@ public sealed partial class ClimbSystem : VirtualController
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly FixtureSystem _fixtureSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedBodySystem _bodySystem = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;

View File

@@ -114,8 +114,7 @@ public abstract class SharedFlatpackSystem : EntitySystem
if (!Resolve(ent, ref ent.Comp))
return;
EntProtoId machinePrototypeId;
string? entityPrototype;
var machinePrototypeId = new EntProtoId();
if (TryComp<MachineBoardComponent>(board, out var machineBoard) && machineBoard.Prototype is not null)
machinePrototypeId = machineBoard.Prototype;
else if (TryComp<ComputerBoardComponent>(board, out var computerBoard) && computerBoard.Prototype is not null)

View File

@@ -1,6 +1,5 @@
using System.Numerics;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
namespace Content.Shared.Coordinates
{
@@ -20,17 +19,5 @@ namespace Content.Shared.Coordinates
{
return new EntityCoordinates(id, x, y);
}
[Obsolete]
public static EntityCoordinates ToCoordinates(this MapGridComponent grid, float x, float y)
{
return ToCoordinates(grid.Owner, x, y);
}
[Obsolete]
public static EntityCoordinates ToCoordinates(this MapGridComponent grid)
{
return ToCoordinates(grid.Owner, Vector2.Zero);
}
}
}

View File

@@ -127,9 +127,6 @@ public abstract class SharedDisposalUnitSystem : EntitySystem
return damageState != null && (!component.MobsCanEnter || _mobState.IsDead(entity, damageState));
}
/// <summary>
/// TODO: Proper prediction
/// </summary>
public abstract void DoInsertDisposalUnit(EntityUid uid, EntityUid toInsert, EntityUid user, SharedDisposalUnitComponent? disposal = null);
[Serializable, NetSerializable]

View File

@@ -0,0 +1,12 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Fluids.Components;
/// <summary>
/// Blocks this entity's ability to spill solution containing entities via the verb menu.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class PreventSpillerComponent : Component
{
}

View File

@@ -2,6 +2,12 @@ using Content.Shared.FixedPoint;
namespace Content.Shared.Fluids.Components;
/// <summary>
/// Makes a solution contained in this entity spillable.
/// Spills can occur when a container with this component overflows,
/// is used to melee attack something, is equipped (see <see cref="SpillWorn"/>),
/// lands after being thrown, or has the Spill verb used.
/// </summary>
[RegisterComponent]
public sealed partial class SpillableComponent : Component
{

View File

@@ -1,14 +1,23 @@
using Content.Shared.Database;
using Content.Shared.DoAfter;
using Content.Shared.Examine;
using Content.Shared.FixedPoint;
using Content.Shared.Fluids.Components;
using Content.Shared.Nutrition.EntitySystems;
using Content.Shared.Spillable;
using Content.Shared.Verbs;
using Content.Shared.Weapons.Melee;
namespace Content.Shared.Fluids;
public abstract partial class SharedPuddleSystem
{
[Dependency] protected readonly SharedOpenableSystem Openable = default!;
protected virtual void InitializeSpillable()
{
SubscribeLocalEvent<SpillableComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<SpillableComponent, GetVerbsEvent<Verb>>(AddSpillVerb);
}
private void OnExamined(Entity<SpillableComponent> entity, ref ExaminedEvent args)
@@ -21,4 +30,55 @@ public abstract partial class SharedPuddleSystem
args.PushMarkup(Loc.GetString("spill-examine-spillable-weapon"));
}
}
private void AddSpillVerb(Entity<SpillableComponent> entity, ref GetVerbsEvent<Verb> args)
{
if (!args.CanAccess || !args.CanInteract)
return;
if (!_solutionContainerSystem.TryGetSolution(args.Target, entity.Comp.SolutionName, out var soln, out var solution))
return;
if (Openable.IsClosed(args.Target))
return;
if (solution.Volume == FixedPoint2.Zero)
return;
if (HasComp<PreventSpillerComponent>(args.User))
return;
Verb verb = new()
{
Text = Loc.GetString("spill-target-verb-get-data-text")
};
// TODO VERB ICONS spill icon? pouring out a glass/beaker?
if (entity.Comp.SpillDelay == null)
{
var target = args.Target;
verb.Act = () =>
{
var puddleSolution = _solutionContainerSystem.SplitSolution(soln.Value, solution.Volume);
TrySpillAt(Transform(target).Coordinates, puddleSolution, out _);
};
}
else
{
var user = args.User;
verb.Act = () =>
{
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, user, entity.Comp.SpillDelay ?? 0, new SpillDoAfterEvent(), entity.Owner, target: entity.Owner)
{
BreakOnDamage = true,
BreakOnMove = true,
NeedHand = true,
});
};
}
verb.Impact = LogImpact.Medium; // dangerous reagent reaction are logged separately.
verb.DoContactInteraction = true;
args.Verbs.Add(verb);
}
}

View File

@@ -1,12 +1,14 @@
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.DoAfter;
using Content.Shared.DragDrop;
using Content.Shared.Examine;
using Content.Shared.FixedPoint;
using Content.Shared.Fluids.Components;
using Content.Shared.Movement.Events;
using Content.Shared.StepTrigger.Components;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
namespace Content.Shared.Fluids;
@@ -15,6 +17,7 @@ public abstract partial class SharedPuddleSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
/// <summary>
/// The lowest threshold to be considered for puddle sprite states as well as slipperiness of a puddle.
@@ -106,4 +109,54 @@ public abstract partial class SharedPuddleSystem : EntitySystem
args.PushMarkup(Loc.GetString("puddle-component-examine-evaporating-no"));
}
}
#region Spill
// These methods are in Shared to make it easier to interact with PuddleSystem in Shared code.
// Note that they always fail when run on the client, not creating a puddle and returning false.
// Adding proper prediction to this system would require spawning temporary puddle entities on the
// client and replacing or merging them with the ones spawned by the server when the client goes to
// replicate those, and I am not enough of a wizard to attempt implementing that.
/// <summary>
/// First splashes reagent on reactive entities near the spilling entity, then spills the rest regularly to a
/// puddle. This is intended for 'destructive' spills, like when entities are destroyed or thrown.
/// </summary>
/// <remarks>
/// On the client, this will always set <paramref name="puddleUid"/> to <see cref="EntityUid.Invalid"> and return false.
/// </remarks>
public abstract bool TrySplashSpillAt(EntityUid uid,
EntityCoordinates coordinates,
Solution solution,
out EntityUid puddleUid,
bool sound = true,
EntityUid? user = null);
/// <summary>
/// Spills solution at the specified coordinates.
/// Will add to an existing puddle if present or create a new one if not.
/// </summary>
/// <remarks>
/// On the client, this will always set <paramref name="puddleUid"/> to <see cref="EntityUid.Invalid"> and return false.
/// </remarks>
public abstract bool TrySpillAt(EntityCoordinates coordinates, Solution solution, out EntityUid puddleUid, bool sound = true);
/// <summary>
/// <see cref="TrySpillAt(EntityCoordinates, Solution, out EntityUid, bool)"/>
/// </summary>
/// <remarks>
/// On the client, this will always set <paramref name="puddleUid"/> to <see cref="EntityUid.Invalid"> and return false.
/// </remarks>
public abstract bool TrySpillAt(EntityUid uid, Solution solution, out EntityUid puddleUid, bool sound = true,
TransformComponent? transformComponent = null);
/// <summary>
/// <see cref="TrySpillAt(EntityCoordinates, Solution, out EntityUid, bool)"/>
/// </summary>
/// <remarks>
/// On the client, this will always set <paramref name="puddleUid"/> to <see cref="EntityUid.Invalid"> and return false.
/// </remarks>
public abstract bool TrySpillAt(TileRef tileRef, Solution solution, out EntityUid puddleUid, bool sound = true,
bool tileReact = true);
#endregion Spill
}

View File

@@ -10,6 +10,12 @@ namespace Content.Shared.Kitchen
public static string InputContainerId = "inputContainer";
}
[Serializable, NetSerializable]
public sealed class ReagentGrinderToggleAutoModeMessage : BoundUserInterfaceMessage
{
public ReagentGrinderToggleAutoModeMessage() { }
}
[Serializable, NetSerializable]
public sealed class ReagentGrinderStartMessage : BoundUserInterfaceMessage
{
@@ -75,6 +81,13 @@ namespace Content.Shared.Kitchen
Key
}
public enum GrinderAutoMode : byte
{
Off,
Grind,
Juice
}
[NetSerializable, Serializable]
public sealed class ReagentGrinderInterfaceState : BoundUserInterfaceState
{
@@ -85,13 +98,16 @@ namespace Content.Shared.Kitchen
public bool CanGrind;
public NetEntity[] ChamberContents;
public ReagentQuantity[]? ReagentQuantities;
public ReagentGrinderInterfaceState(bool isBusy, bool hasBeaker, bool powered, bool canJuice, bool canGrind, NetEntity[] chamberContents, ReagentQuantity[]? heldBeakerContents)
public GrinderAutoMode AutoMode;
public ReagentGrinderInterfaceState(bool isBusy, bool hasBeaker, bool powered, bool canJuice, bool canGrind, GrinderAutoMode autoMode, NetEntity[] chamberContents, ReagentQuantity[]? heldBeakerContents)
{
IsBusy = isBusy;
HasBeakerIn = hasBeaker;
Powered = powered;
CanJuice = canJuice;
CanGrind = canGrind;
AutoMode = autoMode;
ChamberContents = chamberContents;
ReagentQuantities = heldBeakerContents;
}

View File

@@ -7,7 +7,7 @@ namespace Content.Shared.Light.Components;
[NetworkedComponent]
public abstract partial class SharedExpendableLightComponent : Component
{
public static readonly AudioParams LoopedSoundParams = new(0, 1, "Master", 62.5f, 1, 1, true, 0.3f);
public static readonly AudioParams LoopedSoundParams = new(0, 1, 62.5f, 1, 1, true, 0.3f);
[ViewVariables(VVAccess.ReadOnly)]
public ExpendableLightState CurrentState { get; set; }

View File

@@ -13,7 +13,6 @@ public sealed class TurfSystem : EntitySystem
{
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly IMapManager _mapMan = default!;
/// <summary>
/// Returns true if a given tile is blocked by physics-enabled entities.

View File

@@ -1,18 +1,20 @@
using Content.Shared.Actions;
using Robust.Shared.Prototypes;
namespace Content.Shared.Polymorph;
public sealed partial class PolymorphActionEvent : InstantActionEvent
{
/// <summary>
/// The polymorph prototype containing all the information about
/// the specific polymorph.
/// The polymorph proto id, containing all the information about
/// the specific polymorph.
/// </summary>
public PolymorphPrototype Prototype = default!;
[DataField]
public ProtoId<PolymorphPrototype>? ProtoId;
public PolymorphActionEvent(PolymorphPrototype prototype) : this()
public PolymorphActionEvent(ProtoId<PolymorphPrototype> protoId) : this()
{
Prototype = prototype;
ProtoId = protoId;
}
}

View File

@@ -25,7 +25,6 @@ namespace Content.Shared.RCD.Systems;
public sealed class RCDSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IMapManager _mapMan = default!;
[Dependency] private readonly INetManager _net = default!;
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
[Dependency] private readonly ITileDefinitionManager _tileDefMan = default!;
@@ -39,7 +38,7 @@ public sealed class RCDSystem : EntitySystem
[Dependency] private readonly TurfSystem _turf = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
private readonly int RcdModeCount = Enum.GetValues(typeof(RcdMode)).Length;
private readonly int _rcdModeCount = Enum.GetValues(typeof(RcdMode)).Length;
public override void Initialize()
{
@@ -310,7 +309,7 @@ public sealed class RCDSystem : EntitySystem
_audio.PlayPredicted(comp.SwapModeSound, uid, user);
var mode = (int) comp.Mode;
mode = ++mode % RcdModeCount;
mode = ++mode % _rcdModeCount;
comp.Mode = (RcdMode) mode;
Dirty(uid, comp);

View File

@@ -1,4 +1,3 @@
using Content.Shared.Interaction;
using Content.Shared.Popups;
using Content.Shared.Interaction.Events;
using Content.Shared.Remotes.Components;
@@ -8,8 +7,6 @@ namespace Content.Shared.Remotes.EntitySystems;
public abstract class SharedDoorRemoteSystem : EntitySystem
{
[Dependency] protected readonly SharedPopupSystem Popup = default!;
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
// I'm so sorry [Dependency] private readonly SharedAirlockSystem _sharedAirlockSystem = default!;
public override void Initialize()
{

View File

@@ -10,11 +10,6 @@ namespace Content.Shared.Shuttles.Components;
[Access(typeof(SharedShuttleSystem))]
public sealed partial class IFFComponent : Component
{
/// <summary>
/// Should we show IFF by default?
/// </summary>
public const bool ShowIFFDefault = true;
public static readonly Color SelfColor = Color.MediumSpringGreen;
/// <summary>

View File

@@ -28,11 +28,6 @@ public abstract partial class SharedShuttleSystem
public string? GetIFFLabel(EntityUid gridUid, bool self = false, IFFComponent? component = null)
{
if (!IFFComponent.ShowIFFDefault)
{
return null;
}
var entName = MetaData(gridUid).EntityName;
if (self)

View File

@@ -146,7 +146,6 @@ public abstract partial class SharedShuttleSystem : EntitySystem
// Just checks if any grids inside of a buffer range at the target position.
_grids.Clear();
var ftlRange = FTLRange;
var mapCoordinates = coordinates.ToMap(EntityManager, XformSystem);
var ourPos = Maps.GetGridPosition((shuttleUid, shuttlePhysics, shuttleXform));

View File

@@ -19,17 +19,16 @@ public sealed class DumpableSystem : EntitySystem
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedContainerSystem _container = default!;
[Dependency] private readonly SharedDisposalUnitSystem _disposalUnitSystem = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
private EntityQuery<TransformComponent> _xformQuery;
private EntityQuery<ItemComponent> _itemQuery;
public override void Initialize()
{
base.Initialize();
_xformQuery = GetEntityQuery<TransformComponent>();
_itemQuery = GetEntityQuery<ItemComponent>();
SubscribeLocalEvent<DumpableComponent, AfterInteractEvent>(OnAfterInteract, after: new[]{ typeof(SharedEntityStorageSystem) });
SubscribeLocalEvent<DumpableComponent, GetVerbsEvent<AlternativeVerb>>(AddDumpVerb);
SubscribeLocalEvent<DumpableComponent, GetVerbsEvent<UtilityVerb>>(AddUtilityVerbs);
@@ -111,7 +110,7 @@ public sealed class DumpableSystem : EntitySystem
}
}
private void StartDoAfter(EntityUid storageUid, EntityUid? targetUid, EntityUid userUid, DumpableComponent dumpable)
private void StartDoAfter(EntityUid storageUid, EntityUid targetUid, EntityUid userUid, DumpableComponent dumpable)
{
if (!TryComp<StorageComponent>(storageUid, out var storage))
return;
@@ -120,7 +119,7 @@ public sealed class DumpableSystem : EntitySystem
foreach (var entity in storage.Container.ContainedEntities)
{
if (!TryComp<ItemComponent>(entity, out var itemComp) ||
if (!_itemQuery.TryGetComponent(entity, out var itemComp) ||
!_prototypeManager.TryIndex(itemComp.Size, out var itemSize))
{
continue;
@@ -138,33 +137,16 @@ public sealed class DumpableSystem : EntitySystem
});
}
private void OnDoAfter(EntityUid uid, DumpableComponent component, DoAfterEvent args)
private void OnDoAfter(EntityUid uid, DumpableComponent component, DumpableDoAfterEvent args)
{
if (args.Handled || args.Cancelled || !TryComp<StorageComponent>(uid, out var storage))
if (args.Handled || args.Cancelled || !TryComp<StorageComponent>(uid, out var storage) || storage.Container.ContainedEntities.Count == 0)
return;
Queue<EntityUid> dumpQueue = new();
foreach (var entity in storage.Container.ContainedEntities)
{
dumpQueue.Enqueue(entity);
}
if (dumpQueue.Count == 0)
return;
foreach (var entity in dumpQueue)
{
var transform = Transform(entity);
_container.AttachParentToContainerOrGrid((entity, transform));
_transformSystem.SetLocalPositionRotation(entity, transform.LocalPosition + _random.NextVector2Box() / 2, _random.NextAngle(), transform);
}
if (args.Args.Target == null)
return;
var dumpQueue = new Queue<EntityUid>(storage.Container.ContainedEntities);
var dumped = false;
if (_disposalUnitSystem.HasDisposals(args.Args.Target.Value))
if (_disposalUnitSystem.HasDisposals(args.Args.Target))
{
dumped = true;
@@ -173,22 +155,31 @@ public sealed class DumpableSystem : EntitySystem
_disposalUnitSystem.DoInsertDisposalUnit(args.Args.Target.Value, entity, args.Args.User);
}
}
else if (HasComp<PlaceableSurfaceComponent>(args.Args.Target.Value))
else if (HasComp<PlaceableSurfaceComponent>(args.Args.Target))
{
dumped = true;
var targetPos = _xformQuery.GetComponent(args.Args.Target.Value).LocalPosition;
var targetPos = _transformSystem.GetWorldPosition(args.Args.Target.Value);
foreach (var entity in dumpQueue)
{
_transformSystem.SetLocalPosition(entity, targetPos + _random.NextVector2Box() / 4);
_transformSystem.SetWorldPosition(entity, targetPos + _random.NextVector2Box() / 4);
}
}
else
{
var targetPos = _transformSystem.GetWorldPosition(uid);
foreach (var entity in dumpQueue)
{
var transform = Transform(entity);
_transformSystem.SetWorldPositionRotation(entity, targetPos + _random.NextVector2Box() / 4, _random.NextAngle(), transform);
}
}
if (dumped)
{
// TODO: Predicted when above predicted
_audio.PlayPvs(component.DumpSound, uid);
_audio.PlayPredicted(component.DumpSound, uid, args.User);
}
}
}

View File

@@ -102,7 +102,7 @@ public abstract partial class SharedGunSystem
// TODO: Actions need doing for guns anyway.
private sealed partial class CycleModeEvent : InstantActionEvent
{
public SelectiveFire Mode;
public SelectiveFire Mode = default;
}
private void OnCycleMode(EntityUid uid, GunComponent component, CycleModeEvent args)

Some files were not shown because too many files have changed in this diff Show More