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:
@@ -52,7 +52,7 @@ public sealed class TimerTriggerVisualizerSystem : VisualizerSystem<TimerTrigger
|
||||
{
|
||||
case TriggerVisualState.Primed:
|
||||
if (!AnimationSystem.HasRunningAnimation(uid, animPlayer, TimerTriggerVisualsComponent.AnimationKey))
|
||||
AnimationSystem.Play(uid, animPlayer, comp.PrimingAnimation, TimerTriggerVisualsComponent.AnimationKey);
|
||||
AnimationSystem.Play((uid, animPlayer), comp.PrimingAnimation, TimerTriggerVisualsComponent.AnimationKey);
|
||||
break;
|
||||
case TriggerVisualState.Unprimed:
|
||||
args.Sprite.LayerSetState(TriggerVisualLayers.Base, comp.UnprimedSprite);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Content.Shared.CartridgeLoader.Cartridges;
|
||||
using Content.Shared.CartridgeLoader.Cartridges;
|
||||
using Content.Shared.Paper;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Prototypes;
|
||||
@@ -26,7 +26,7 @@ public sealed partial class LogProbeCartridgeComponent : Component
|
||||
/// The sound to make when we scan something with access
|
||||
/// </summary>
|
||||
[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>
|
||||
/// Paper to spawn when printing logs.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Content.Shared.Access.Components;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.CartridgeLoader;
|
||||
using Content.Shared.CartridgeLoader.Cartridges;
|
||||
using Content.Shared.Database;
|
||||
@@ -8,6 +7,7 @@ using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Labels.EntitySystems;
|
||||
using Content.Shared.Paper;
|
||||
using Content.Shared.Popups;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Timing;
|
||||
@@ -52,7 +52,7 @@ public sealed class LogProbeCartridgeSystem : EntitySystem
|
||||
return;
|
||||
|
||||
//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);
|
||||
|
||||
ent.Comp.EntityName = Name(target);
|
||||
|
||||
@@ -33,12 +33,14 @@ namespace Content.Server.Containers
|
||||
|
||||
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;
|
||||
var baseCoords = EntityManager.GetComponent<TransformComponent>(uid).Coordinates;
|
||||
|
||||
var baseCoords = Transform(uid).Coordinates;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace Content.Server.Decals
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedMapSystem _mapSystem = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
|
||||
private readonly Dictionary<NetEntity, HashSet<Vector2i>> _dirtyChunks = new();
|
||||
private readonly Dictionary<ICommonSession, Dictionary<NetEntity, HashSet<Vector2i>>> _previousSentChunks = new();
|
||||
@@ -249,7 +250,7 @@ namespace Content.Server.Decals
|
||||
if (!coordinates.IsValid(EntityManager))
|
||||
return;
|
||||
|
||||
var gridId = coordinates.GetGridUid(EntityManager);
|
||||
var gridId = _transform.GetGrid(coordinates);
|
||||
|
||||
if (gridId == null)
|
||||
return;
|
||||
@@ -296,7 +297,7 @@ namespace Content.Server.Decals
|
||||
if (!PrototypeManager.HasIndex<DecalPrototype>(decal.Id))
|
||||
return false;
|
||||
|
||||
var gridId = coordinates.GetGridUid(EntityManager);
|
||||
var gridId = _transform.GetGrid(coordinates);
|
||||
if (!TryComp(gridId, out MapGridComponent? grid))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
||||
var newPosition = destination * progress;
|
||||
|
||||
// This is some supreme shit code.
|
||||
_xformSystem.SetCoordinates(uid, origin.Offset(newPosition).WithEntityId(currentTube));
|
||||
_xformSystem.SetCoordinates(uid, _xformSystem.WithEntityId(origin.Offset(newPosition), currentTube));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace Content.Server.Engineering.EntitySystems
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
|
||||
[Dependency] private readonly StackSystem _stackSystem = default!;
|
||||
[Dependency] private readonly TurfSystem _turfSystem = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -31,7 +32,7 @@ namespace Content.Server.Engineering.EntitySystems
|
||||
return;
|
||||
if (string.IsNullOrEmpty(component.Prototype))
|
||||
return;
|
||||
if (!TryComp<MapGridComponent>(args.ClickLocation.GetGridUid(EntityManager), out var grid))
|
||||
if (!TryComp<MapGridComponent>(_transform.GetGrid(args.ClickLocation), out var grid))
|
||||
return;
|
||||
if (!grid.TryGetTileRef(args.ClickLocation, out var tileRef))
|
||||
return;
|
||||
|
||||
@@ -56,6 +56,7 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
|
||||
[Dependency] private readonly StepTriggerSystem _stepTrigger = default!;
|
||||
[Dependency] private readonly SpeedModifierContactsSystem _speedModContacts = default!;
|
||||
[Dependency] private readonly TileFrictionController _tile = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
|
||||
[ValidatePrototypeId<ReagentPrototype>]
|
||||
private const string Blood = "Blood";
|
||||
@@ -626,7 +627,8 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
|
||||
return false;
|
||||
}
|
||||
|
||||
var gridUid = coordinates.GetGridUid(EntityManager);
|
||||
var gridUid = _transform.GetGrid(coordinates);
|
||||
|
||||
if (!TryComp<MapGridComponent>(gridUid, out var mapGrid))
|
||||
{
|
||||
puddleUid = EntityUid.Invalid;
|
||||
|
||||
@@ -27,6 +27,7 @@ public sealed class IdentitySystem : SharedIdentitySystem
|
||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||
[Dependency] private readonly HumanoidAppearanceSystem _humanoid = default!;
|
||||
[Dependency] private readonly CriminalRecordsConsoleSystem _criminalRecordsConsole = default!;
|
||||
[Dependency] private readonly GrammarSystem _grammarSystem = default!;
|
||||
|
||||
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 (name != representation.TrueName && representation.PresumedName == null)
|
||||
identityGrammar.ProperNoun = false;
|
||||
_grammarSystem.SetProperNoun((uid, grammar), false);
|
||||
|
||||
Dirty(ident, identityGrammar);
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem
|
||||
|
||||
private EntityCoordinates? SelectRandomTileInRange(TransformComponent userXform, float radius)
|
||||
{
|
||||
var userCoords = userXform.Coordinates.ToMap(EntityManager, _xform);
|
||||
var userCoords = _xform.ToMapCoordinates(userXform.Coordinates);
|
||||
_targetGrids.Clear();
|
||||
_lookupSystem.GetEntitiesInRange(userCoords, radius, _targetGrids);
|
||||
Entity<MapGridComponent>? targetGrid = null;
|
||||
|
||||
@@ -225,7 +225,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
|
||||
{
|
||||
var metadataQuery = EntityManager.GetEntityQuery<MetaDataComponent>();
|
||||
|
||||
if (Deleted(uid, metadataQuery))
|
||||
if (Deleted(uid))
|
||||
return Array.Empty<(NetEntity, string)>();
|
||||
|
||||
var list = new ValueList<(NetEntity, string)>();
|
||||
@@ -380,7 +380,6 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
|
||||
}
|
||||
|
||||
var activeQuery = EntityManager.GetEntityQuery<ActiveInstrumentComponent>();
|
||||
var metadataQuery = EntityManager.GetEntityQuery<MetaDataComponent>();
|
||||
var transformQuery = EntityManager.GetEntityQuery<TransformComponent>();
|
||||
|
||||
var query = AllEntityQuery<ActiveInstrumentComponent, InstrumentComponent>();
|
||||
@@ -388,7 +387,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
|
||||
{
|
||||
if (instrument.Master is {} master)
|
||||
{
|
||||
if (Deleted(master, metadataQuery))
|
||||
if (Deleted(master))
|
||||
{
|
||||
Clean(uid, instrument);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ using Content.Server.Medical.Components;
|
||||
using Content.Server.Popups;
|
||||
using Content.Server.Stack;
|
||||
using Content.Shared.Chemistry.EntitySystems;
|
||||
using Content.Shared.Audio;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.DoAfter;
|
||||
@@ -21,6 +20,7 @@ using Content.Shared.Popups;
|
||||
using Content.Shared.Stacks;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Audio;
|
||||
|
||||
namespace Content.Server.Medical;
|
||||
|
||||
@@ -31,7 +31,6 @@ public sealed class HealingSystem : EntitySystem
|
||||
[Dependency] private readonly DamageableSystem _damageable = default!;
|
||||
[Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!;
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
|
||||
[Dependency] private readonly IRobustRandom _random = default!;
|
||||
[Dependency] private readonly StackSystem _stacks = default!;
|
||||
[Dependency] private readonly SharedInteractionSystem _interactionSystem = 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");
|
||||
}
|
||||
|
||||
_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
|
||||
args.Repeat = (HasDamage(entity, healing) && !dontRepeat);
|
||||
@@ -198,8 +197,7 @@ public sealed class HealingSystem : EntitySystem
|
||||
return false;
|
||||
}
|
||||
|
||||
_audio.PlayPvs(component.HealingBeginSound, uid,
|
||||
AudioHelpers.WithVariation(0.125f, _random).WithVolume(1f));
|
||||
_audio.PlayPvs(component.HealingBeginSound, uid);
|
||||
|
||||
var isNotSelf = user != target;
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ public sealed class MindSystem : SharedMindSystem
|
||||
// not implicitly via optional arguments.
|
||||
|
||||
var position = Deleted(mind.OwnedEntity)
|
||||
? _gameTicker.GetObserverSpawnPoint().ToMap(EntityManager, _transform)
|
||||
? _transform.ToMapCoordinates(_gameTicker.GetObserverSpawnPoint())
|
||||
: _transform.GetMapCoordinates(mind.OwnedEntity.Value);
|
||||
|
||||
entity = Spawn(GameTicker.ObserverPrototypeName, position);
|
||||
@@ -336,7 +336,7 @@ public sealed class MindSystem : SharedMindSystem
|
||||
if (_players.TryGetSessionById(userId.Value, out var ret))
|
||||
{
|
||||
mind.Session = ret;
|
||||
_pvsOverride.AddSessionOverride(netMind, ret);
|
||||
_pvsOverride.AddSessionOverride(mindId, ret);
|
||||
_players.SetAttachedEntity(ret, mind.CurrentEntity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ public sealed partial class BiomeSystem : SharedBiomeSystem
|
||||
|
||||
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);
|
||||
|
||||
if (!TryComp<BiomeComponent>(targetMapUid, out var biome))
|
||||
|
||||
@@ -25,7 +25,7 @@ public sealed class PointSystem : SharedPointSystem
|
||||
|
||||
private void OnStartup(EntityUid uid, PointManagerComponent component, ComponentStartup args)
|
||||
{
|
||||
_pvsOverride.AddGlobalOverride(GetNetEntity(uid));
|
||||
_pvsOverride.AddGlobalOverride(uid);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -69,7 +69,7 @@ public sealed partial class CableSystem : EntitySystem
|
||||
|
||||
// anchor state can change as a result of deletion (detach to null).
|
||||
// We don't want to spawn an entity when deleted.
|
||||
if (!TryLifeStage(uid, out var life) || life >= EntityLifeStage.Terminating)
|
||||
if (TerminatingOrDeleted(uid))
|
||||
return;
|
||||
|
||||
// This entity should not be un-anchorable. But this can happen if the grid-tile is deleted (RCD, explosion,
|
||||
|
||||
@@ -9,6 +9,7 @@ using Content.Shared.Singularity.Components;
|
||||
using Content.Shared.Singularity.EntitySystems;
|
||||
using Content.Shared.Tag;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Physics.Components;
|
||||
@@ -477,7 +478,7 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
|
||||
if (drop_container is null)
|
||||
_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);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public sealed class SingularityAttractorSystem : EntitySystem
|
||||
|
||||
attractor.LastPulseTime = _timing.CurTime;
|
||||
|
||||
var mapPos = xform.Coordinates.ToMap(EntityManager, _transform);
|
||||
var mapPos = _transform.ToMapCoordinates(xform.Coordinates);
|
||||
|
||||
if (mapPos == MapCoordinates.Nullspace)
|
||||
return;
|
||||
@@ -72,7 +72,7 @@ public sealed class SingularityAttractorSystem : EntitySystem
|
||||
var query = EntityQuery<SingularityComponent, RandomWalkComponent, TransformComponent>();
|
||||
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)
|
||||
continue;
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
using Content.Shared.Clothing.Components;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Inventory.Events;
|
||||
using Content.Shared.Item;
|
||||
using Content.Shared.Strip.Components;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Clothing.EntitySystems;
|
||||
@@ -15,10 +13,8 @@ namespace Content.Shared.Clothing.EntitySystems;
|
||||
public abstract class ClothingSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedItemSystem _itemSys = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _containerSys = default!;
|
||||
[Dependency] private readonly InventorySystem _invSystem = default!;
|
||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||
[Dependency] private readonly HideLayerClothingSystem _hideLayer = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
@@ -71,7 +71,7 @@ public sealed class DashAbilitySystem : EntitySystem
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
// can only dash if the destination is visible on screen
|
||||
|
||||
@@ -15,7 +15,6 @@ namespace Content.Shared.Ninja.Systems;
|
||||
public sealed class EmagProviderSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly EmagSystem _emag = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedNinjaGlovesSystem _gloves = default!;
|
||||
|
||||
@@ -45,6 +45,7 @@ public class RCDSystem : EntitySystem
|
||||
[Dependency] private readonly EntityLookupSystem _lookup = default!;
|
||||
[Dependency] private readonly IPrototypeManager _protoManager = default!;
|
||||
[Dependency] private readonly SharedMapSystem _mapSystem = default!;
|
||||
[Dependency] private readonly SharedTransformSystem _transform = default!;
|
||||
[Dependency] private readonly TagSystem _tags = default!;
|
||||
|
||||
private readonly int _instantConstructionDelay = 0;
|
||||
@@ -561,12 +562,12 @@ public class RCDSystem : EntitySystem
|
||||
public bool TryGetMapGridData(EntityCoordinates location, [NotNullWhen(true)] out MapGridData? mapGridData)
|
||||
{
|
||||
mapGridData = null;
|
||||
var gridUid = location.GetGridUid(EntityManager);
|
||||
var gridUid = _transform.GetGrid(location);
|
||||
|
||||
if (!TryComp<MapGridComponent>(gridUid, out var mapGrid))
|
||||
{
|
||||
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
|
||||
if (!TryComp(gridUid, out mapGrid))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Numerics;
|
||||
using System.Numerics;
|
||||
using Content.Shared.Random.Helpers;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -20,7 +20,7 @@ public sealed class RandomHelperSystem : EntitySystem
|
||||
var offset = new Vector2(randomX, randomY);
|
||||
|
||||
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)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Shared.Physics;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
@@ -16,7 +16,7 @@ namespace Content.Shared.Spawning
|
||||
SharedPhysicsSystem? physicsManager = null)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
var location = args.ClickLocation.AlignWithClosestGridTile();
|
||||
var locationMap = location.ToMap(EntityManager, _transform);
|
||||
var locationMap = _transform.ToMapCoordinates(location);
|
||||
if (locationMap.MapId == MapId.Nullspace)
|
||||
return;
|
||||
|
||||
var physicQuery = GetEntityQuery<PhysicsComponent>();
|
||||
var transformQuery = GetEntityQuery<TransformComponent>();
|
||||
|
||||
var map = location.ToMap(EntityManager, _transform);
|
||||
var map = _transform.ToMapCoordinates(location);
|
||||
|
||||
// Disallow placement close to grids.
|
||||
// FTLing close is okay but this makes alignment too finnicky.
|
||||
@@ -92,7 +92,7 @@ public sealed class FloorTileSystem : EntitySystem
|
||||
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 canAccessCenter = false;
|
||||
if (dir.LengthSquared() > 0.01)
|
||||
|
||||
@@ -93,8 +93,14 @@
|
||||
bloodlossModifier: -4
|
||||
healingBeginSound:
|
||||
path: "/Audio/Items/Medical/brutepack_begin.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
healingEndSound:
|
||||
path: "/Audio/Items/Medical/brutepack_end.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
- type: Stack
|
||||
stackType: Cloth
|
||||
baseLayer: base
|
||||
|
||||
@@ -38,8 +38,14 @@
|
||||
Caustic: -1.5
|
||||
healingBeginSound:
|
||||
path: "/Audio/Items/Medical/ointment_begin.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
healingEndSound:
|
||||
path: "/Audio/Items/Medical/ointment_end.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
- type: Stack
|
||||
stackType: Ointment
|
||||
count: 10
|
||||
@@ -89,8 +95,14 @@
|
||||
Caustic: -10
|
||||
healingBeginSound:
|
||||
path: "/Audio/Items/Medical/ointment_begin.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
healingEndSound:
|
||||
path: "/Audio/Items/Medical/ointment_end.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
- type: Stack
|
||||
stackType: RegenerativeMesh
|
||||
count: 10
|
||||
@@ -128,8 +140,14 @@
|
||||
Brute: -15 # 5 for each type in the group
|
||||
healingBeginSound:
|
||||
path: "/Audio/Items/Medical/brutepack_begin.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
healingEndSound:
|
||||
path: "/Audio/Items/Medical/brutepack_end.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
- type: Stack
|
||||
stackType: Brutepack
|
||||
count: 10
|
||||
@@ -178,8 +196,14 @@
|
||||
bloodlossModifier: -10 # a suture should stop ongoing bleeding
|
||||
healingBeginSound:
|
||||
path: "/Audio/Items/Medical/brutepack_begin.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
healingEndSound:
|
||||
path: "/Audio/Items/Medical/brutepack_end.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
- type: Stack
|
||||
stackType: MedicatedSuture
|
||||
count: 10
|
||||
@@ -218,8 +242,14 @@
|
||||
ModifyBloodLevel: 15 #restores about 5% blood per use on standard humanoids.
|
||||
healingBeginSound:
|
||||
path: "/Audio/Items/Medical/brutepack_begin.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
healingEndSound:
|
||||
path: "/Audio/Items/Medical/brutepack_end.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
- type: Stack
|
||||
stackType: Bloodpack
|
||||
count: 10
|
||||
@@ -268,8 +298,14 @@
|
||||
delay: 0.5
|
||||
healingBeginSound:
|
||||
path: "/Audio/Items/Medical/brutepack_begin.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
healingEndSound:
|
||||
path: "/Audio/Items/Medical/brutepack_end.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
|
||||
- type: entity
|
||||
name: roll of gauze
|
||||
@@ -298,8 +334,14 @@
|
||||
bloodlossModifier: -10
|
||||
healingBeginSound:
|
||||
path: "/Audio/Items/Medical/brutepack_begin.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
healingEndSound:
|
||||
path: "/Audio/Items/Medical/brutepack_end.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
- type: Stack
|
||||
stackType: Gauze
|
||||
count: 10
|
||||
@@ -359,8 +401,14 @@
|
||||
selfHealPenaltyMultiplier: 0
|
||||
healingBeginSound:
|
||||
path: "/Audio/Items/Medical/ointment_begin.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
healingEndSound:
|
||||
path: "/Audio/Items/Medical/ointment_end.ogg"
|
||||
params:
|
||||
volume: 1.0
|
||||
variation: 0.125
|
||||
|
||||
# Pills
|
||||
- type: entity
|
||||
|
||||
Reference in New Issue
Block a user