Various system spring cleaning (#36206)

* Various systems warnings cleanup

* Last changes before submitting PR

* Add guard for transform component, fix failing test

* Small corrections

* Audio params to specifiers datafields

* Using audio params on components and configs
This commit is contained in:
J
2025-04-16 11:08:22 +00:00
committed by GitHub
parent 2a80540b70
commit b1c08582d5
27 changed files with 101 additions and 46 deletions

View File

@@ -52,7 +52,7 @@ public sealed class TimerTriggerVisualizerSystem : VisualizerSystem<TimerTrigger
{ {
case TriggerVisualState.Primed: case TriggerVisualState.Primed:
if (!AnimationSystem.HasRunningAnimation(uid, animPlayer, TimerTriggerVisualsComponent.AnimationKey)) if (!AnimationSystem.HasRunningAnimation(uid, animPlayer, TimerTriggerVisualsComponent.AnimationKey))
AnimationSystem.Play(uid, animPlayer, comp.PrimingAnimation, TimerTriggerVisualsComponent.AnimationKey); AnimationSystem.Play((uid, animPlayer), comp.PrimingAnimation, TimerTriggerVisualsComponent.AnimationKey);
break; break;
case TriggerVisualState.Unprimed: case TriggerVisualState.Unprimed:
args.Sprite.LayerSetState(TriggerVisualLayers.Base, comp.UnprimedSprite); args.Sprite.LayerSetState(TriggerVisualLayers.Base, comp.UnprimedSprite);

View File

@@ -1,4 +1,4 @@
using Content.Shared.CartridgeLoader.Cartridges; using Content.Shared.CartridgeLoader.Cartridges;
using Content.Shared.Paper; using Content.Shared.Paper;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
@@ -26,7 +26,7 @@ public sealed partial class LogProbeCartridgeComponent : Component
/// The sound to make when we scan something with access /// The sound to make when we scan something with access
/// </summary> /// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)] [DataField, ViewVariables(VVAccess.ReadWrite)]
public SoundSpecifier SoundScan = new SoundPathSpecifier("/Audio/Machines/scan_finish.ogg"); public SoundSpecifier SoundScan = new SoundPathSpecifier("/Audio/Machines/scan_finish.ogg", AudioParams.Default.WithVariation(0.25f));
/// <summary> /// <summary>
/// Paper to spawn when printing logs. /// Paper to spawn when printing logs.

View File

@@ -1,6 +1,5 @@
using Content.Shared.Access.Components; using Content.Shared.Access.Components;
using Content.Shared.Administration.Logs; using Content.Shared.Administration.Logs;
using Content.Shared.Audio;
using Content.Shared.CartridgeLoader; using Content.Shared.CartridgeLoader;
using Content.Shared.CartridgeLoader.Cartridges; using Content.Shared.CartridgeLoader.Cartridges;
using Content.Shared.Database; using Content.Shared.Database;
@@ -8,6 +7,7 @@ using Content.Shared.Hands.EntitySystems;
using Content.Shared.Labels.EntitySystems; using Content.Shared.Labels.EntitySystems;
using Content.Shared.Paper; using Content.Shared.Paper;
using Content.Shared.Popups; using Content.Shared.Popups;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
using Robust.Shared.Random; using Robust.Shared.Random;
using Robust.Shared.Timing; using Robust.Shared.Timing;
@@ -52,7 +52,7 @@ public sealed class LogProbeCartridgeSystem : EntitySystem
return; return;
//Play scanning sound with slightly randomized pitch //Play scanning sound with slightly randomized pitch
_audio.PlayEntity(ent.Comp.SoundScan, args.InteractEvent.User, target, AudioHelpers.WithVariation(0.25f, _random)); _audio.PlayEntity(ent.Comp.SoundScan, args.InteractEvent.User, target);
_popup.PopupCursor(Loc.GetString("log-probe-scan", ("device", target)), args.InteractEvent.User); _popup.PopupCursor(Loc.GetString("log-probe-scan", ("device", target)), args.InteractEvent.User);
ent.Comp.EntityName = Name(target); ent.Comp.EntityName = Name(target);

View File

@@ -33,12 +33,14 @@ namespace Content.Server.Containers
private void OnDeconstruct(EntityUid uid, EmptyOnMachineDeconstructComponent component, MachineDeconstructedEvent ev) private void OnDeconstruct(EntityUid uid, EmptyOnMachineDeconstructComponent component, MachineDeconstructedEvent ev)
{ {
if (!EntityManager.TryGetComponent<ContainerManagerComponent>(uid, out var mComp)) if (!TryComp<ContainerManagerComponent>(uid, out var mComp))
return; return;
var baseCoords = EntityManager.GetComponent<TransformComponent>(uid).Coordinates;
var baseCoords = Transform(uid).Coordinates;
foreach (var v in component.Containers) foreach (var v in component.Containers)
{ {
if (mComp.TryGetContainer(v, out var container)) if (_container.TryGetContainer(uid, v, out var container, mComp))
{ {
_container.EmptyContainer(container, true, baseCoords); _container.EmptyContainer(container, true, baseCoords);
} }

View File

@@ -36,6 +36,7 @@ namespace Content.Server.Decals
[Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!; [Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly SharedMapSystem _mapSystem = default!; [Dependency] private readonly SharedMapSystem _mapSystem = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
private readonly Dictionary<NetEntity, HashSet<Vector2i>> _dirtyChunks = new(); private readonly Dictionary<NetEntity, HashSet<Vector2i>> _dirtyChunks = new();
private readonly Dictionary<ICommonSession, Dictionary<NetEntity, HashSet<Vector2i>>> _previousSentChunks = new(); private readonly Dictionary<ICommonSession, Dictionary<NetEntity, HashSet<Vector2i>>> _previousSentChunks = new();
@@ -249,7 +250,7 @@ namespace Content.Server.Decals
if (!coordinates.IsValid(EntityManager)) if (!coordinates.IsValid(EntityManager))
return; return;
var gridId = coordinates.GetGridUid(EntityManager); var gridId = _transform.GetGrid(coordinates);
if (gridId == null) if (gridId == null)
return; return;
@@ -296,7 +297,7 @@ namespace Content.Server.Decals
if (!PrototypeManager.HasIndex<DecalPrototype>(decal.Id)) if (!PrototypeManager.HasIndex<DecalPrototype>(decal.Id))
return false; return false;
var gridId = coordinates.GetGridUid(EntityManager); var gridId = _transform.GetGrid(coordinates);
if (!TryComp(gridId, out MapGridComponent? grid)) if (!TryComp(gridId, out MapGridComponent? grid))
return false; return false;

View File

@@ -259,7 +259,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
var newPosition = destination * progress; var newPosition = destination * progress;
// This is some supreme shit code. // This is some supreme shit code.
_xformSystem.SetCoordinates(uid, origin.Offset(newPosition).WithEntityId(currentTube)); _xformSystem.SetCoordinates(uid, _xformSystem.WithEntityId(origin.Offset(newPosition), currentTube));
continue; continue;
} }

View File

@@ -17,6 +17,7 @@ namespace Content.Server.Engineering.EntitySystems
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!; [Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly StackSystem _stackSystem = default!; [Dependency] private readonly StackSystem _stackSystem = default!;
[Dependency] private readonly TurfSystem _turfSystem = default!; [Dependency] private readonly TurfSystem _turfSystem = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
public override void Initialize() public override void Initialize()
{ {
@@ -31,7 +32,7 @@ namespace Content.Server.Engineering.EntitySystems
return; return;
if (string.IsNullOrEmpty(component.Prototype)) if (string.IsNullOrEmpty(component.Prototype))
return; return;
if (!TryComp<MapGridComponent>(args.ClickLocation.GetGridUid(EntityManager), out var grid)) if (!TryComp<MapGridComponent>(_transform.GetGrid(args.ClickLocation), out var grid))
return; return;
if (!grid.TryGetTileRef(args.ClickLocation, out var tileRef)) if (!grid.TryGetTileRef(args.ClickLocation, out var tileRef))
return; return;

View File

@@ -56,6 +56,7 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
[Dependency] private readonly StepTriggerSystem _stepTrigger = default!; [Dependency] private readonly StepTriggerSystem _stepTrigger = default!;
[Dependency] private readonly SpeedModifierContactsSystem _speedModContacts = default!; [Dependency] private readonly SpeedModifierContactsSystem _speedModContacts = default!;
[Dependency] private readonly TileFrictionController _tile = default!; [Dependency] private readonly TileFrictionController _tile = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[ValidatePrototypeId<ReagentPrototype>] [ValidatePrototypeId<ReagentPrototype>]
private const string Blood = "Blood"; private const string Blood = "Blood";
@@ -626,7 +627,8 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
return false; return false;
} }
var gridUid = coordinates.GetGridUid(EntityManager); var gridUid = _transform.GetGrid(coordinates);
if (!TryComp<MapGridComponent>(gridUid, out var mapGrid)) if (!TryComp<MapGridComponent>(gridUid, out var mapGrid))
{ {
puddleUid = EntityUid.Invalid; puddleUid = EntityUid.Invalid;

View File

@@ -27,6 +27,7 @@ public sealed class IdentitySystem : SharedIdentitySystem
[Dependency] private readonly SharedContainerSystem _container = default!; [Dependency] private readonly SharedContainerSystem _container = default!;
[Dependency] private readonly HumanoidAppearanceSystem _humanoid = default!; [Dependency] private readonly HumanoidAppearanceSystem _humanoid = default!;
[Dependency] private readonly CriminalRecordsConsoleSystem _criminalRecordsConsole = default!; [Dependency] private readonly CriminalRecordsConsoleSystem _criminalRecordsConsole = default!;
[Dependency] private readonly GrammarSystem _grammarSystem = default!;
private HashSet<EntityUid> _queuedIdentityUpdates = new(); private HashSet<EntityUid> _queuedIdentityUpdates = new();
@@ -102,7 +103,7 @@ public sealed class IdentitySystem : SharedIdentitySystem
// If presumed name is null and we're using that, we set proper noun to be false ("the old woman") // If presumed name is null and we're using that, we set proper noun to be false ("the old woman")
if (name != representation.TrueName && representation.PresumedName == null) if (name != representation.TrueName && representation.PresumedName == null)
identityGrammar.ProperNoun = false; _grammarSystem.SetProperNoun((uid, grammar), false);
Dirty(ident, identityGrammar); Dirty(ident, identityGrammar);
} }

View File

@@ -130,7 +130,7 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem
private EntityCoordinates? SelectRandomTileInRange(TransformComponent userXform, float radius) private EntityCoordinates? SelectRandomTileInRange(TransformComponent userXform, float radius)
{ {
var userCoords = userXform.Coordinates.ToMap(EntityManager, _xform); var userCoords = _xform.ToMapCoordinates(userXform.Coordinates);
_targetGrids.Clear(); _targetGrids.Clear();
_lookupSystem.GetEntitiesInRange(userCoords, radius, _targetGrids); _lookupSystem.GetEntitiesInRange(userCoords, radius, _targetGrids);
Entity<MapGridComponent>? targetGrid = null; Entity<MapGridComponent>? targetGrid = null;

View File

@@ -225,7 +225,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
{ {
var metadataQuery = EntityManager.GetEntityQuery<MetaDataComponent>(); var metadataQuery = EntityManager.GetEntityQuery<MetaDataComponent>();
if (Deleted(uid, metadataQuery)) if (Deleted(uid))
return Array.Empty<(NetEntity, string)>(); return Array.Empty<(NetEntity, string)>();
var list = new ValueList<(NetEntity, string)>(); var list = new ValueList<(NetEntity, string)>();
@@ -380,7 +380,6 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
} }
var activeQuery = EntityManager.GetEntityQuery<ActiveInstrumentComponent>(); var activeQuery = EntityManager.GetEntityQuery<ActiveInstrumentComponent>();
var metadataQuery = EntityManager.GetEntityQuery<MetaDataComponent>();
var transformQuery = EntityManager.GetEntityQuery<TransformComponent>(); var transformQuery = EntityManager.GetEntityQuery<TransformComponent>();
var query = AllEntityQuery<ActiveInstrumentComponent, InstrumentComponent>(); var query = AllEntityQuery<ActiveInstrumentComponent, InstrumentComponent>();
@@ -388,7 +387,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
{ {
if (instrument.Master is {} master) if (instrument.Master is {} master)
{ {
if (Deleted(master, metadataQuery)) if (Deleted(master))
{ {
Clean(uid, instrument); Clean(uid, instrument);
} }

View File

@@ -5,7 +5,6 @@ using Content.Server.Medical.Components;
using Content.Server.Popups; using Content.Server.Popups;
using Content.Server.Stack; using Content.Server.Stack;
using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Audio;
using Content.Shared.Damage; using Content.Shared.Damage;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.DoAfter; using Content.Shared.DoAfter;
@@ -21,6 +20,7 @@ using Content.Shared.Popups;
using Content.Shared.Stacks; using Content.Shared.Stacks;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
using Robust.Shared.Random; using Robust.Shared.Random;
using Robust.Shared.Audio;
namespace Content.Server.Medical; namespace Content.Server.Medical;
@@ -31,7 +31,6 @@ public sealed class HealingSystem : EntitySystem
[Dependency] private readonly DamageableSystem _damageable = default!; [Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!; [Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!; [Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly StackSystem _stacks = default!; [Dependency] private readonly StackSystem _stacks = default!;
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!; [Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
[Dependency] private readonly MobThresholdSystem _mobThresholdSystem = default!; [Dependency] private readonly MobThresholdSystem _mobThresholdSystem = default!;
@@ -115,7 +114,7 @@ public sealed class HealingSystem : EntitySystem
$"{EntityManager.ToPrettyString(args.User):user} healed themselves for {total:damage} damage"); $"{EntityManager.ToPrettyString(args.User):user} healed themselves for {total:damage} damage");
} }
_audio.PlayPvs(healing.HealingEndSound, entity.Owner, AudioHelpers.WithVariation(0.125f, _random).WithVolume(1f)); _audio.PlayPvs(healing.HealingEndSound, entity.Owner);
// Logic to determine the whether or not to repeat the healing action // Logic to determine the whether or not to repeat the healing action
args.Repeat = (HasDamage(entity, healing) && !dontRepeat); args.Repeat = (HasDamage(entity, healing) && !dontRepeat);
@@ -198,8 +197,7 @@ public sealed class HealingSystem : EntitySystem
return false; return false;
} }
_audio.PlayPvs(component.HealingBeginSound, uid, _audio.PlayPvs(component.HealingBeginSound, uid);
AudioHelpers.WithVariation(0.125f, _random).WithVolume(1f));
var isNotSelf = user != target; var isNotSelf = user != target;

View File

@@ -215,7 +215,7 @@ public sealed class MindSystem : SharedMindSystem
// not implicitly via optional arguments. // not implicitly via optional arguments.
var position = Deleted(mind.OwnedEntity) var position = Deleted(mind.OwnedEntity)
? _gameTicker.GetObserverSpawnPoint().ToMap(EntityManager, _transform) ? _transform.ToMapCoordinates(_gameTicker.GetObserverSpawnPoint())
: _transform.GetMapCoordinates(mind.OwnedEntity.Value); : _transform.GetMapCoordinates(mind.OwnedEntity.Value);
entity = Spawn(GameTicker.ObserverPrototypeName, position); entity = Spawn(GameTicker.ObserverPrototypeName, position);
@@ -336,7 +336,7 @@ public sealed class MindSystem : SharedMindSystem
if (_players.TryGetSessionById(userId.Value, out var ret)) if (_players.TryGetSessionById(userId.Value, out var ret))
{ {
mind.Session = ret; mind.Session = ret;
_pvsOverride.AddSessionOverride(netMind, ret); _pvsOverride.AddSessionOverride(mindId, ret);
_players.SetAttachedEntity(ret, mind.CurrentEntity); _players.SetAttachedEntity(ret, mind.CurrentEntity);
} }
} }

View File

@@ -256,7 +256,7 @@ public sealed partial class BiomeSystem : SharedBiomeSystem
private void OnFTLStarted(ref FTLStartedEvent ev) private void OnFTLStarted(ref FTLStartedEvent ev)
{ {
var targetMap = ev.TargetCoordinates.ToMap(EntityManager, _transform); var targetMap = _transform.ToMapCoordinates(ev.TargetCoordinates);
var targetMapUid = _mapManager.GetMapEntityId(targetMap.MapId); var targetMapUid = _mapManager.GetMapEntityId(targetMap.MapId);
if (!TryComp<BiomeComponent>(targetMapUid, out var biome)) if (!TryComp<BiomeComponent>(targetMapUid, out var biome))

View File

@@ -25,7 +25,7 @@ public sealed class PointSystem : SharedPointSystem
private void OnStartup(EntityUid uid, PointManagerComponent component, ComponentStartup args) private void OnStartup(EntityUid uid, PointManagerComponent component, ComponentStartup args)
{ {
_pvsOverride.AddGlobalOverride(GetNetEntity(uid)); _pvsOverride.AddGlobalOverride(uid);
} }
/// <summary> /// <summary>

View File

@@ -69,7 +69,7 @@ public sealed partial class CableSystem : EntitySystem
// anchor state can change as a result of deletion (detach to null). // anchor state can change as a result of deletion (detach to null).
// We don't want to spawn an entity when deleted. // We don't want to spawn an entity when deleted.
if (!TryLifeStage(uid, out var life) || life >= EntityLifeStage.Terminating) if (TerminatingOrDeleted(uid))
return; return;
// This entity should not be un-anchorable. But this can happen if the grid-tile is deleted (RCD, explosion, // This entity should not be un-anchorable. But this can happen if the grid-tile is deleted (RCD, explosion,

View File

@@ -9,6 +9,7 @@ using Content.Shared.Singularity.Components;
using Content.Shared.Singularity.EntitySystems; using Content.Shared.Singularity.EntitySystems;
using Content.Shared.Tag; using Content.Shared.Tag;
using Robust.Shared.Containers; using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Map.Components; using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Components;
@@ -477,7 +478,7 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
if (drop_container is null) if (drop_container is null)
_containerSystem.TryGetContainingContainer((uid, null, null), out drop_container); _containerSystem.TryGetContainingContainer((uid, null, null), out drop_container);
foreach (var container in comp.GetAllContainers()) foreach (var container in _containerSystem.GetAllContainers(uid))
{ {
ConsumeEntitiesInContainer(args.EventHorizonUid, container, args.EventHorizon, drop_container); ConsumeEntitiesInContainer(args.EventHorizonUid, container, args.EventHorizon, drop_container);
} }

View File

@@ -64,7 +64,7 @@ public sealed class SingularityAttractorSystem : EntitySystem
attractor.LastPulseTime = _timing.CurTime; attractor.LastPulseTime = _timing.CurTime;
var mapPos = xform.Coordinates.ToMap(EntityManager, _transform); var mapPos = _transform.ToMapCoordinates(xform.Coordinates);
if (mapPos == MapCoordinates.Nullspace) if (mapPos == MapCoordinates.Nullspace)
return; return;
@@ -72,7 +72,7 @@ public sealed class SingularityAttractorSystem : EntitySystem
var query = EntityQuery<SingularityComponent, RandomWalkComponent, TransformComponent>(); var query = EntityQuery<SingularityComponent, RandomWalkComponent, TransformComponent>();
foreach (var (singulo, walk, singuloXform) in query) foreach (var (singulo, walk, singuloXform) in query)
{ {
var singuloMapPos = singuloXform.Coordinates.ToMap(EntityManager, _transform); var singuloMapPos = _transform.ToMapCoordinates(singuloXform.Coordinates);
if (singuloMapPos.MapId != mapPos.MapId) if (singuloMapPos.MapId != mapPos.MapId)
continue; continue;

View File

@@ -1,13 +1,11 @@
using Content.Shared.Clothing.Components; using Content.Shared.Clothing.Components;
using Content.Shared.Hands.Components; using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems; using Content.Shared.Hands.EntitySystems;
using Content.Shared.Humanoid;
using Content.Shared.Interaction.Events; using Content.Shared.Interaction.Events;
using Content.Shared.Inventory; using Content.Shared.Inventory;
using Content.Shared.Inventory.Events; using Content.Shared.Inventory.Events;
using Content.Shared.Item; using Content.Shared.Item;
using Content.Shared.Strip.Components; using Content.Shared.Strip.Components;
using Robust.Shared.Containers;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
namespace Content.Shared.Clothing.EntitySystems; namespace Content.Shared.Clothing.EntitySystems;
@@ -15,10 +13,8 @@ namespace Content.Shared.Clothing.EntitySystems;
public abstract class ClothingSystem : EntitySystem public abstract class ClothingSystem : EntitySystem
{ {
[Dependency] private readonly SharedItemSystem _itemSys = default!; [Dependency] private readonly SharedItemSystem _itemSys = default!;
[Dependency] private readonly SharedContainerSystem _containerSys = default!;
[Dependency] private readonly InventorySystem _invSystem = default!; [Dependency] private readonly InventorySystem _invSystem = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!; [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly HideLayerClothingSystem _hideLayer = default!;
public override void Initialize() public override void Initialize()
{ {

View File

@@ -71,7 +71,7 @@ public sealed class DashAbilitySystem : EntitySystem
} }
var origin = _transform.GetMapCoordinates(user); var origin = _transform.GetMapCoordinates(user);
var target = args.Target.ToMap(EntityManager, _transform); var target = _transform.ToMapCoordinates(args.Target);
if (!_examine.InRangeUnOccluded(origin, target, SharedInteractionSystem.MaxRaycastRange, null)) if (!_examine.InRangeUnOccluded(origin, target, SharedInteractionSystem.MaxRaycastRange, null))
{ {
// can only dash if the destination is visible on screen // can only dash if the destination is visible on screen

View File

@@ -15,7 +15,6 @@ namespace Content.Shared.Ninja.Systems;
public sealed class EmagProviderSystem : EntitySystem public sealed class EmagProviderSystem : EntitySystem
{ {
[Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly EmagSystem _emag = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!; [Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!; [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
[Dependency] private readonly SharedNinjaGlovesSystem _gloves = default!; [Dependency] private readonly SharedNinjaGlovesSystem _gloves = default!;

View File

@@ -45,6 +45,7 @@ public class RCDSystem : EntitySystem
[Dependency] private readonly EntityLookupSystem _lookup = default!; [Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly IPrototypeManager _protoManager = default!; [Dependency] private readonly IPrototypeManager _protoManager = default!;
[Dependency] private readonly SharedMapSystem _mapSystem = default!; [Dependency] private readonly SharedMapSystem _mapSystem = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly TagSystem _tags = default!; [Dependency] private readonly TagSystem _tags = default!;
private readonly int _instantConstructionDelay = 0; private readonly int _instantConstructionDelay = 0;
@@ -561,12 +562,12 @@ public class RCDSystem : EntitySystem
public bool TryGetMapGridData(EntityCoordinates location, [NotNullWhen(true)] out MapGridData? mapGridData) public bool TryGetMapGridData(EntityCoordinates location, [NotNullWhen(true)] out MapGridData? mapGridData)
{ {
mapGridData = null; mapGridData = null;
var gridUid = location.GetGridUid(EntityManager); var gridUid = _transform.GetGrid(location);
if (!TryComp<MapGridComponent>(gridUid, out var mapGrid)) if (!TryComp<MapGridComponent>(gridUid, out var mapGrid))
{ {
location = location.AlignWithClosestGridTile(1.75f, EntityManager); location = location.AlignWithClosestGridTile(1.75f, EntityManager);
gridUid = location.GetGridUid(EntityManager); gridUid = _transform.GetGrid(location);
// Check if we got a grid ID the second time round // Check if we got a grid ID the second time round
if (!TryComp(gridUid, out mapGrid)) if (!TryComp(gridUid, out mapGrid))

View File

@@ -1,4 +1,4 @@
using System.Numerics; using System.Numerics;
using Content.Shared.Random.Helpers; using Content.Shared.Random.Helpers;
using Robust.Shared.Random; using Robust.Shared.Random;
using Robust.Shared.Utility; using Robust.Shared.Utility;
@@ -20,7 +20,7 @@ public sealed class RandomHelperSystem : EntitySystem
var offset = new Vector2(randomX, randomY); var offset = new Vector2(randomX, randomY);
var xform = Transform(entity); var xform = Transform(entity);
_transform.SetLocalPosition(xform, xform.LocalPosition + offset); _transform.SetLocalPosition(entity, xform.LocalPosition + offset, xform);
} }
public void RandomOffset(EntityUid entity, float min, float max) public void RandomOffset(EntityUid entity, float min, float max)

View File

@@ -1,4 +1,4 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using Content.Shared.Physics; using Content.Shared.Physics;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Physics.Systems; using Robust.Shared.Physics.Systems;
@@ -16,7 +16,7 @@ namespace Content.Shared.Spawning
SharedPhysicsSystem? physicsManager = null) SharedPhysicsSystem? physicsManager = null)
{ {
physicsManager ??= entityManager.System<SharedPhysicsSystem>(); physicsManager ??= entityManager.System<SharedPhysicsSystem>();
var mapCoordinates = coordinates.ToMap(entityManager, entityManager.System<SharedTransformSystem>()); var mapCoordinates = entityManager.System<SharedTransformSystem>().ToMapCoordinates(coordinates);
return entityManager.SpawnIfUnobstructed(prototypeName, mapCoordinates, collisionLayer, box, physicsManager); return entityManager.SpawnIfUnobstructed(prototypeName, mapCoordinates, collisionLayer, box, physicsManager);
} }

View File

@@ -59,14 +59,14 @@ public sealed class FloorTileSystem : EntitySystem
// this looks a bit sussy but it might be because it needs to be able to place off of grids and expand them // this looks a bit sussy but it might be because it needs to be able to place off of grids and expand them
var location = args.ClickLocation.AlignWithClosestGridTile(); var location = args.ClickLocation.AlignWithClosestGridTile();
var locationMap = location.ToMap(EntityManager, _transform); var locationMap = _transform.ToMapCoordinates(location);
if (locationMap.MapId == MapId.Nullspace) if (locationMap.MapId == MapId.Nullspace)
return; return;
var physicQuery = GetEntityQuery<PhysicsComponent>(); var physicQuery = GetEntityQuery<PhysicsComponent>();
var transformQuery = GetEntityQuery<TransformComponent>(); var transformQuery = GetEntityQuery<TransformComponent>();
var map = location.ToMap(EntityManager, _transform); var map = _transform.ToMapCoordinates(location);
// Disallow placement close to grids. // Disallow placement close to grids.
// FTLing close is okay but this makes alignment too finnicky. // FTLing close is okay but this makes alignment too finnicky.
@@ -92,7 +92,7 @@ public sealed class FloorTileSystem : EntitySystem
return; return;
} }
var userPos = transformQuery.GetComponent(args.User).Coordinates.ToMapPos(EntityManager, _transform); var userPos = _transform.ToMapCoordinates(transformQuery.GetComponent(args.User).Coordinates).Position;
var dir = userPos - map.Position; var dir = userPos - map.Position;
var canAccessCenter = false; var canAccessCenter = false;
if (dir.LengthSquared() > 0.01) if (dir.LengthSquared() > 0.01)

View File

@@ -93,8 +93,14 @@
bloodlossModifier: -4 bloodlossModifier: -4
healingBeginSound: healingBeginSound:
path: "/Audio/Items/Medical/brutepack_begin.ogg" path: "/Audio/Items/Medical/brutepack_begin.ogg"
params:
volume: 1.0
variation: 0.125
healingEndSound: healingEndSound:
path: "/Audio/Items/Medical/brutepack_end.ogg" path: "/Audio/Items/Medical/brutepack_end.ogg"
params:
volume: 1.0
variation: 0.125
- type: Stack - type: Stack
stackType: Cloth stackType: Cloth
baseLayer: base baseLayer: base

View File

@@ -38,8 +38,14 @@
Caustic: -1.5 Caustic: -1.5
healingBeginSound: healingBeginSound:
path: "/Audio/Items/Medical/ointment_begin.ogg" path: "/Audio/Items/Medical/ointment_begin.ogg"
params:
volume: 1.0
variation: 0.125
healingEndSound: healingEndSound:
path: "/Audio/Items/Medical/ointment_end.ogg" path: "/Audio/Items/Medical/ointment_end.ogg"
params:
volume: 1.0
variation: 0.125
- type: Stack - type: Stack
stackType: Ointment stackType: Ointment
count: 10 count: 10
@@ -89,8 +95,14 @@
Caustic: -10 Caustic: -10
healingBeginSound: healingBeginSound:
path: "/Audio/Items/Medical/ointment_begin.ogg" path: "/Audio/Items/Medical/ointment_begin.ogg"
params:
volume: 1.0
variation: 0.125
healingEndSound: healingEndSound:
path: "/Audio/Items/Medical/ointment_end.ogg" path: "/Audio/Items/Medical/ointment_end.ogg"
params:
volume: 1.0
variation: 0.125
- type: Stack - type: Stack
stackType: RegenerativeMesh stackType: RegenerativeMesh
count: 10 count: 10
@@ -128,8 +140,14 @@
Brute: -15 # 5 for each type in the group Brute: -15 # 5 for each type in the group
healingBeginSound: healingBeginSound:
path: "/Audio/Items/Medical/brutepack_begin.ogg" path: "/Audio/Items/Medical/brutepack_begin.ogg"
params:
volume: 1.0
variation: 0.125
healingEndSound: healingEndSound:
path: "/Audio/Items/Medical/brutepack_end.ogg" path: "/Audio/Items/Medical/brutepack_end.ogg"
params:
volume: 1.0
variation: 0.125
- type: Stack - type: Stack
stackType: Brutepack stackType: Brutepack
count: 10 count: 10
@@ -178,8 +196,14 @@
bloodlossModifier: -10 # a suture should stop ongoing bleeding bloodlossModifier: -10 # a suture should stop ongoing bleeding
healingBeginSound: healingBeginSound:
path: "/Audio/Items/Medical/brutepack_begin.ogg" path: "/Audio/Items/Medical/brutepack_begin.ogg"
params:
volume: 1.0
variation: 0.125
healingEndSound: healingEndSound:
path: "/Audio/Items/Medical/brutepack_end.ogg" path: "/Audio/Items/Medical/brutepack_end.ogg"
params:
volume: 1.0
variation: 0.125
- type: Stack - type: Stack
stackType: MedicatedSuture stackType: MedicatedSuture
count: 10 count: 10
@@ -218,8 +242,14 @@
ModifyBloodLevel: 15 #restores about 5% blood per use on standard humanoids. ModifyBloodLevel: 15 #restores about 5% blood per use on standard humanoids.
healingBeginSound: healingBeginSound:
path: "/Audio/Items/Medical/brutepack_begin.ogg" path: "/Audio/Items/Medical/brutepack_begin.ogg"
params:
volume: 1.0
variation: 0.125
healingEndSound: healingEndSound:
path: "/Audio/Items/Medical/brutepack_end.ogg" path: "/Audio/Items/Medical/brutepack_end.ogg"
params:
volume: 1.0
variation: 0.125
- type: Stack - type: Stack
stackType: Bloodpack stackType: Bloodpack
count: 10 count: 10
@@ -268,8 +298,14 @@
delay: 0.5 delay: 0.5
healingBeginSound: healingBeginSound:
path: "/Audio/Items/Medical/brutepack_begin.ogg" path: "/Audio/Items/Medical/brutepack_begin.ogg"
params:
volume: 1.0
variation: 0.125
healingEndSound: healingEndSound:
path: "/Audio/Items/Medical/brutepack_end.ogg" path: "/Audio/Items/Medical/brutepack_end.ogg"
params:
volume: 1.0
variation: 0.125
- type: entity - type: entity
name: roll of gauze name: roll of gauze
@@ -298,8 +334,14 @@
bloodlossModifier: -10 bloodlossModifier: -10
healingBeginSound: healingBeginSound:
path: "/Audio/Items/Medical/brutepack_begin.ogg" path: "/Audio/Items/Medical/brutepack_begin.ogg"
params:
volume: 1.0
variation: 0.125
healingEndSound: healingEndSound:
path: "/Audio/Items/Medical/brutepack_end.ogg" path: "/Audio/Items/Medical/brutepack_end.ogg"
params:
volume: 1.0
variation: 0.125
- type: Stack - type: Stack
stackType: Gauze stackType: Gauze
count: 10 count: 10
@@ -359,8 +401,14 @@
selfHealPenaltyMultiplier: 0 selfHealPenaltyMultiplier: 0
healingBeginSound: healingBeginSound:
path: "/Audio/Items/Medical/ointment_begin.ogg" path: "/Audio/Items/Medical/ointment_begin.ogg"
params:
volume: 1.0
variation: 0.125
healingEndSound: healingEndSound:
path: "/Audio/Items/Medical/ointment_end.ogg" path: "/Audio/Items/Medical/ointment_end.ogg"
params:
volume: 1.0
variation: 0.125
# Pills # Pills
- type: entity - type: entity