From 45bc0e2dfae0bf048866fa07f78c81381a7a2083 Mon Sep 17 00:00:00 2001 From: Plykiya <58439124+Plykiya@users.noreply.github.com> Date: Wed, 8 May 2024 03:21:59 -0700 Subject: [PATCH 001/111] Katana Dash checks based on vision rather than collision (#27793) * Fix dash check * unused * obsolete function --------- Co-authored-by: plykiya --- Content.Shared/Ninja/Systems/DashAbilitySystem.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Content.Shared/Ninja/Systems/DashAbilitySystem.cs b/Content.Shared/Ninja/Systems/DashAbilitySystem.cs index f9e5d4a1f6..4853968b61 100644 --- a/Content.Shared/Ninja/Systems/DashAbilitySystem.cs +++ b/Content.Shared/Ninja/Systems/DashAbilitySystem.cs @@ -4,8 +4,8 @@ using Content.Shared.Charges.Systems; using Content.Shared.Hands.EntitySystems; using Content.Shared.Interaction; using Content.Shared.Ninja.Components; -using Content.Shared.Physics; using Content.Shared.Popups; +using Content.Shared.Examine; using Robust.Shared.Audio.Systems; using Robust.Shared.Timing; @@ -20,7 +20,7 @@ public sealed class DashAbilitySystem : EntitySystem [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedChargesSystem _charges = default!; [Dependency] private readonly SharedHandsSystem _hands = default!; - [Dependency] private readonly SharedInteractionSystem _interaction = default!; + [Dependency] private readonly ExamineSystemShared _examine = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly ActionContainerSystem _actionContainer = default!; @@ -79,11 +79,10 @@ public sealed class DashAbilitySystem : EntitySystem _popup.PopupClient(Loc.GetString("dash-ability-no-charges", ("item", uid)), user, user); return; } - - var origin = Transform(user).MapPosition; + var origin = _transform.GetMapCoordinates(user); var target = args.Target.ToMap(EntityManager, _transform); // prevent collision with the user duh - if (!_interaction.InRangeUnobstructed(origin, target, 0f, CollisionGroup.Opaque, uid => uid == user)) + if (!_examine.InRangeUnOccluded(origin, target, SharedInteractionSystem.MaxRaycastRange, null)) { // can only dash if the destination is visible on screen _popup.PopupClient(Loc.GetString("dash-ability-cant-see", ("item", uid)), user, user); From 401350759cd6486afa577c12b4536f39491b5254 Mon Sep 17 00:00:00 2001 From: DrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com> Date: Wed, 8 May 2024 03:22:09 -0700 Subject: [PATCH 002/111] Move step sound distance and footstep variation to MobMoverComponent (#27799) --- .../Movement/Components/MobMoverComponent.cs | 9 +++++++++ .../Movement/Systems/SharedMoverController.cs | 11 ++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Content.Shared/Movement/Components/MobMoverComponent.cs b/Content.Shared/Movement/Components/MobMoverComponent.cs index a77f415b93..7ad7961ed7 100644 --- a/Content.Shared/Movement/Components/MobMoverComponent.cs +++ b/Content.Shared/Movement/Components/MobMoverComponent.cs @@ -14,6 +14,15 @@ namespace Content.Shared.Movement.Components [DataField] public float PushStrength = 600f; + [DataField, AutoNetworkedField] + public float StepSoundMoveDistanceRunning = 2; + + [DataField, AutoNetworkedField] + public float StepSoundMoveDistanceWalking = 1.5f; + + [DataField, AutoNetworkedField] + public float FootstepVariation; + [ViewVariables(VVAccess.ReadWrite)] public EntityCoordinates LastPosition { get; set; } diff --git a/Content.Shared/Movement/Systems/SharedMoverController.cs b/Content.Shared/Movement/Systems/SharedMoverController.cs index 92b953aca9..68e384a1b4 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.cs @@ -58,11 +58,6 @@ namespace Content.Shared.Movement.Systems protected EntityQuery CanMoveInAirQuery; protected EntityQuery NoRotateQuery; - private const float StepSoundMoveDistanceRunning = 2; - private const float StepSoundMoveDistanceWalking = 1.5f; - - private const float FootstepVariation = 0f; - /// /// /// @@ -258,7 +253,7 @@ namespace Content.Shared.Movement.Systems var audioParams = sound.Params .WithVolume(sound.Params.Volume + soundModifier) - .WithVariation(sound.Params.Variation ?? FootstepVariation); + .WithVariation(sound.Params.Variation ?? mobMover.FootstepVariation); // If we're a relay target then predict the sound for all relays. if (relayTarget != null) @@ -404,7 +399,9 @@ namespace Content.Shared.Movement.Systems return false; var coordinates = xform.Coordinates; - var distanceNeeded = mover.Sprinting ? StepSoundMoveDistanceRunning : StepSoundMoveDistanceWalking; + var distanceNeeded = mover.Sprinting + ? mobMover.StepSoundMoveDistanceRunning + : mobMover.StepSoundMoveDistanceWalking; // Handle footsteps. if (!weightless) From 130ab51e38d8f2b1c1f7aeb588949999a506c424 Mon Sep 17 00:00:00 2001 From: PJBot Date: Wed, 8 May 2024 10:23:05 +0000 Subject: [PATCH 003/111] Automatic changelog update --- Resources/Changelog/Changelog.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index 87acc64faf..1b771c46da 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,11 +1,4 @@ Entries: -- author: Rainfey - changes: - - message: Disallow multiple antag roles per player - type: Fix - id: 6056 - time: '2024-02-29T06:25:10.0000000+00:00' - url: https://github.com/space-wizards/space-station-14/pull/23445 - author: Kukutis96513 changes: - message: Changed the amount of plushies in the lizard plushie crate. @@ -3851,3 +3844,10 @@ id: 6555 time: '2024-05-08T07:30:53.0000000+00:00' url: https://github.com/space-wizards/space-station-14/pull/27734 +- author: Plykiya + changes: + - message: The ninja's katana dash is now more reliable. + type: Fix + id: 6556 + time: '2024-05-08T10:21:59.0000000+00:00' + url: https://github.com/space-wizards/space-station-14/pull/27793 From c1ed8542647e1f0e62757917e8338370426ae3f5 Mon Sep 17 00:00:00 2001 From: K-Dynamic <20566341+K-Dynamic@users.noreply.github.com> Date: Thu, 9 May 2024 00:30:43 +1200 Subject: [PATCH 004/111] Bike Horn, Clown Recorder, Suspenders for Theatrical Performances Crate (#27668) added clown and mime item to theatrical crate --- Resources/Prototypes/Catalog/Fills/Crates/service.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Resources/Prototypes/Catalog/Fills/Crates/service.yml b/Resources/Prototypes/Catalog/Fills/Crates/service.yml index 38cd6975ee..35e66ac4d3 100644 --- a/Resources/Prototypes/Catalog/Fills/Crates/service.yml +++ b/Resources/Prototypes/Catalog/Fills/Crates/service.yml @@ -89,6 +89,9 @@ - id: RevolverCapGun - id: BarberScissors - id: ClothingUniformJumpskirtOldDress + - id: BikeHorn + - id: ClownRecorder + - id: ClothingBeltSuspenders - type: entity id: CrateServiceCustomSmokable From 00aa6d0bdd47361ff2eed204c8e3a65c491e2845 Mon Sep 17 00:00:00 2001 From: PJBot Date: Wed, 8 May 2024 12:31:49 +0000 Subject: [PATCH 005/111] Automatic changelog update --- Resources/Changelog/Changelog.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index 1b771c46da..56661b6a02 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,11 +1,4 @@ Entries: -- author: Kukutis96513 - changes: - - message: Changed the amount of plushies in the lizard plushie crate. - type: Tweak - id: 6057 - time: '2024-02-29T16:45:04.0000000+00:00' - url: https://github.com/space-wizards/space-station-14/pull/25122 - author: Aexxie changes: - message: Nutribricks spawn in Survival Kits in place of Tinned Meat. @@ -3851,3 +3844,11 @@ id: 6556 time: '2024-05-08T10:21:59.0000000+00:00' url: https://github.com/space-wizards/space-station-14/pull/27793 +- author: K-Dynamic + changes: + - message: Bike Horns, Suspenders and the Clown Recorder are now available from + the Theatrical Performances Crate + type: Tweak + id: 6557 + time: '2024-05-08T12:30:43.0000000+00:00' + url: https://github.com/space-wizards/space-station-14/pull/27668 From 85780dce96efcae5c67e2ee836d760c9ff8ece2b Mon Sep 17 00:00:00 2001 From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Wed, 8 May 2024 13:14:17 +0000 Subject: [PATCH 006/111] fix mapping door access (#27784) Co-authored-by: deltanedas <@deltanedas:kde.org> --- Content.Shared/Access/Systems/AccessReaderSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Shared/Access/Systems/AccessReaderSystem.cs b/Content.Shared/Access/Systems/AccessReaderSystem.cs index 89c08e0a4e..3670e24bd3 100644 --- a/Content.Shared/Access/Systems/AccessReaderSystem.cs +++ b/Content.Shared/Access/Systems/AccessReaderSystem.cs @@ -153,7 +153,7 @@ public sealed class AccessReaderSystem : EntitySystem return IsAllowedInternal(access, stationKeys, reader); if (!_containerSystem.TryGetContainer(target, reader.ContainerAccessProvider, out var container)) - return false; + return Paused(target); // when mapping, containers with electronics arent spawned foreach (var entity in container.ContainedEntities) { From db4c9787c985bc30440c63e9aa5bc3a6cae29b8a Mon Sep 17 00:00:00 2001 From: Plykiya <58439124+Plykiya@users.noreply.github.com> Date: Wed, 8 May 2024 08:54:17 -0700 Subject: [PATCH 007/111] Fix Supplybot Ghostrole (#27811) * Add raffle to supply bot * Add GhostTakeoverAvailable --------- Co-authored-by: plykiya --- Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml b/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml index b405a67d06..3c61306e04 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/silicon.yml @@ -339,8 +339,12 @@ layers: - state: supplybot - type: GhostRole + makeSentient: true name: ghost-role-information-supplybot-name description: ghost-role-information-supplybot-description + raffle: + settings: default + - type: GhostTakeoverAvailable - type: Construction graph: SupplyBot node: bot From 4c68fce06449995ebdc4dc5ad7ddf86a325b42c5 Mon Sep 17 00:00:00 2001 From: Plykiya <58439124+Plykiya@users.noreply.github.com> Date: Wed, 8 May 2024 22:54:48 -0700 Subject: [PATCH 008/111] Adds supplybot to crafting menu (#27827) Add supplybot to crafting menu Co-authored-by: plykiya --- Resources/Prototypes/Recipes/Crafting/bots.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Resources/Prototypes/Recipes/Crafting/bots.yml b/Resources/Prototypes/Recipes/Crafting/bots.yml index 9a70a19c86..3031f4a780 100644 --- a/Resources/Prototypes/Recipes/Crafting/bots.yml +++ b/Resources/Prototypes/Recipes/Crafting/bots.yml @@ -62,3 +62,16 @@ icon: sprite: Mobs/Silicon/Bots/mimebot.rsi state: mimebot + +- type: construction + name: supplybot + id: supplybot + graph: SupplyBot + startNode: start + targetNode: bot + category: construction-category-utilities + objectType: Item + description: This bot can be loaded with cargo to make deliveries. + icon: + sprite: Mobs/Silicon/Bots/supplybot.rsi + state: supplybot From 1f67733775ba8acdaa7458addf1aaff0fc48b1d9 Mon Sep 17 00:00:00 2001 From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Thu, 9 May 2024 05:55:15 +0000 Subject: [PATCH 009/111] fix mech energy display for 0 (#27828) Co-authored-by: deltanedas <@deltanedas:kde.org> --- Content.Client/Mech/Ui/MechMenu.xaml.cs | 14 +++++++++++--- Resources/Locale/en-US/mech/mech.ftl | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Content.Client/Mech/Ui/MechMenu.xaml.cs b/Content.Client/Mech/Ui/MechMenu.xaml.cs index 8d1d936031..fad7648808 100644 --- a/Content.Client/Mech/Ui/MechMenu.xaml.cs +++ b/Content.Client/Mech/Ui/MechMenu.xaml.cs @@ -35,9 +35,17 @@ public sealed partial class MechMenu : FancyWindow IntegrityDisplayBar.Value = integrityPercent.Float(); IntegrityDisplay.Text = Loc.GetString("mech-integrity-display", ("amount", (integrityPercent*100).Int())); - var energyPercent = mechComp.Energy / mechComp.MaxEnergy; - EnergyDisplayBar.Value = energyPercent.Float(); - EnergyDisplay.Text = Loc.GetString("mech-energy-display", ("amount", (energyPercent*100).Int())); + if (mechComp.MaxEnergy != 0f) + { + var energyPercent = mechComp.Energy / mechComp.MaxEnergy; + EnergyDisplayBar.Value = energyPercent.Float(); + EnergyDisplay.Text = Loc.GetString("mech-energy-display", ("amount", (energyPercent*100).Int())); + } + else + { + EnergyDisplayBar.Value = 0f; + EnergyDisplay.Text = Loc.GetString("mech-energy-missing"); + } SlotDisplay.Text = Loc.GetString("mech-slot-display", ("amount", mechComp.MaxEquipmentAmount - mechComp.EquipmentContainer.ContainedEntities.Count)); diff --git a/Resources/Locale/en-US/mech/mech.ftl b/Resources/Locale/en-US/mech/mech.ftl index 19f570a2a1..9d4f7ef0e0 100644 --- a/Resources/Locale/en-US/mech/mech.ftl +++ b/Resources/Locale/en-US/mech/mech.ftl @@ -13,6 +13,7 @@ mech-menu-title = mech control panel mech-integrity-display = Integrity: {$amount}% mech-energy-display = Energy: {$amount}% +mech-energy-missing = Energy: MISSING mech-slot-display = Open Slots: {$amount} mech-no-enter = You cannot pilot this. From 372807673b15a296170599f62c0576de0b7daa23 Mon Sep 17 00:00:00 2001 From: Rio <110139251+Riolume@users.noreply.github.com> Date: Thu, 9 May 2024 00:56:13 -0500 Subject: [PATCH 010/111] Drinking from spray bottles (#27815) Added drinking from spray bottles --- Resources/Audio/Effects/spray3.ogg | Bin 0 -> 12266 bytes .../Objects/Specific/Janitorial/spray.yml | 6 ++++++ 2 files changed, 6 insertions(+) create mode 100644 Resources/Audio/Effects/spray3.ogg diff --git a/Resources/Audio/Effects/spray3.ogg b/Resources/Audio/Effects/spray3.ogg new file mode 100644 index 0000000000000000000000000000000000000000..a9f493198c78e125bdc69bb0b6432a00cea36037 GIT binary patch literal 12266 zcmaia2UHYKv+t0jNR}il0>ToMEDI7PE;(lvBCPH&%{uIZ|-s$bPq&sk-2b9Dd}_~%N*{5yEgMVE_0i{fVQWNhht zGle2q`p+ZoD7S+;6y=+h|8?E0yrD$H&qN4?uK%yA5A81_Hju7k>0t3l*~uJYV`;2) z%N`;J;pXJx=H%w&fv_ms+F3d{nL3-=xj=7tqhS193YB=Kg#uuMGh7OgF5l5;O#mPS zfR~I=f;cldXd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6gmN5!VerKu#Xj@Y>`}L@#PB~$%o0Bs9 z+p{X{Y^@YLKnC9t-U<3$BN0Q{@vjqS@sr8XU(ZostQ`s_tsKGb{!cO@oEP_6{`4<> z{n&U{Sw?`4%wp*1PPtrY+$VfS`MOvJZjv9hewiqz2JRlbmO5s?Ns(L8UpieIE}bv~ z?1*~p39vMYC5Lc>d#+VeuU>NLBT>%^rQf-+1vPvi<@V6{9^+(SJ?l*Uvt6!sSgYz@F@0zDVN##BjZWR!P z8clOFeXgyfJr`GGZ-Lb6dw=*eJ4B$kRO#azYuUHf<&>VkyZq(3;>8=P^CFg+!E*`w zKSkX!=*Z9*l`c>Ap-@GNpu&&x+O#%}P4dTO?CxQE&_>2Oy)mMR1rGD4<~%YDEn4fe zdqRw)(U&{vD<@0}+uHf4lmmzX{li74uz(ar_i8L#zDj%u&?2=Xbcp5zV|optfBm&e z>A8P8YPio1;zeTDjZ8Rr`K!m2P6F6Kk<v zw`{b($u#5ZnE7C$3F1H}_ua@0W4Y*^6aWDhO@E)VEGd$7w-Mb(%Le}(e{*$y+53Kc LYWYO5ALai5WeH8u literal 0 HcmV?d00001 diff --git a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/spray.yml b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/spray.yml index 64b3568adf..cddf7f6075 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/spray.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/spray.yml @@ -5,6 +5,12 @@ suffix: Empty description: A spray bottle with an unscrewable top. components: + - type: Drink + solution: spray + ignoreEmpty: true + useSound: + path: /Audio/Effects/spray3.ogg + transferAmount: 10 - type: Tag tags: - Spray From a7b86f724edaf24caa09edb70efe358165d63c53 Mon Sep 17 00:00:00 2001 From: PJBot Date: Thu, 9 May 2024 05:57:19 +0000 Subject: [PATCH 011/111] Automatic changelog update --- Resources/Changelog/Changelog.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index 56661b6a02..6e45f18579 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,15 +1,4 @@ Entries: -- author: Aexxie - changes: - - message: Nutribricks spawn in Survival Kits in place of Tinned Meat. - type: Tweak - - message: Lizards can now eat Nutribricks. - type: Fix - - message: Moths can eat Nutribrick wrappers. - type: Add - id: 6058 - time: '2024-02-29T21:39:53.0000000+00:00' - url: https://github.com/space-wizards/space-station-14/pull/25659 - author: Flareguy changes: - message: Big O2 tanks and N2 tanks no longer spawn in any departmental locker. @@ -3852,3 +3841,12 @@ id: 6557 time: '2024-05-08T12:30:43.0000000+00:00' url: https://github.com/space-wizards/space-station-14/pull/27668 +- author: Riolume + changes: + - message: Added ability to drink from spray bottles + type: Add + - message: Can now see the amount of liquid in spray bottles + type: Add + id: 6558 + time: '2024-05-09T05:56:13.0000000+00:00' + url: https://github.com/space-wizards/space-station-14/pull/27815 From a2329889aa40ef30ca29c1e508e7460ebc710477 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Thu, 9 May 2024 16:00:16 +1000 Subject: [PATCH 012/111] Add CanAttack check if target is in a container (#27689) --- Content.Shared/ActionBlocker/ActionBlockerSystem.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Content.Shared/ActionBlocker/ActionBlockerSystem.cs b/Content.Shared/ActionBlocker/ActionBlockerSystem.cs index f5ed2df227..47b3997806 100644 --- a/Content.Shared/ActionBlocker/ActionBlockerSystem.cs +++ b/Content.Shared/ActionBlocker/ActionBlockerSystem.cs @@ -169,8 +169,16 @@ namespace Content.Shared.ActionBlocker public bool CanAttack(EntityUid uid, EntityUid? target = null, Entity? weapon = null, bool disarm = false) { + // If target is in a container can we attack + if (target != null && _container.IsEntityInContainer(target.Value)) + { + return false; + } + _container.TryGetOuterContainer(uid, Transform(uid), out var outerContainer); - if (target != null && target != outerContainer?.Owner && _container.IsEntityInContainer(uid)) + + // If we're in a container can we attack the target. + if (target != null && target != outerContainer?.Owner && _container.IsEntityInContainer(uid)) { var containerEv = new CanAttackFromContainerEvent(uid, target); RaiseLocalEvent(uid, containerEv); From 4d991d1554c4b9b954b4d44b74f06ff76e359bab Mon Sep 17 00:00:00 2001 From: Alzore <140123969+Blackern5000@users.noreply.github.com> Date: Thu, 9 May 2024 01:00:47 -0500 Subject: [PATCH 013/111] Atmos pipes now deal blunt damage (#27673) * pipe * weak * inhand * IT WORKS * inventory --- .../Structures/Piping/Atmospherics/pipes.yml | 68 +++++++++++++++++- .../pipe.rsi/Bend-inhand-left.png | Bin 0 -> 6821 bytes .../pipe.rsi/Bend-inhand-right.png | Bin 0 -> 6825 bytes .../pipe.rsi/Fourway-inhand-left.png | Bin 0 -> 6914 bytes .../pipe.rsi/Fourway-inhand-right.png | Bin 0 -> 6915 bytes .../pipe.rsi/TJunction-inhand-left.png | Bin 0 -> 6895 bytes .../pipe.rsi/TJunction-inhand-right.png | Bin 0 -> 6893 bytes .../Atmospherics/pipe.rsi/inhand-left.png | Bin 0 -> 6818 bytes .../Atmospherics/pipe.rsi/inhand-right.png | Bin 0 -> 6826 bytes .../Piping/Atmospherics/pipe.rsi/meta.json | 46 +++++++++++- .../Piping/Atmospherics/pipe.rsi/pipeBend.png | Bin 3965 -> 621 bytes .../Atmospherics/pipe.rsi/storageBend.png | Bin 0 -> 449 bytes .../Atmospherics/pipe.rsi/storageStraight.png | Bin 0 -> 503 bytes .../pipe.rsi/storageTJunction.png | Bin 0 -> 509 bytes 14 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/Bend-inhand-left.png create mode 100644 Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/Bend-inhand-right.png create mode 100644 Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/Fourway-inhand-left.png create mode 100644 Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/Fourway-inhand-right.png create mode 100644 Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/TJunction-inhand-left.png create mode 100644 Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/TJunction-inhand-right.png create mode 100644 Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/inhand-left.png create mode 100644 Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/inhand-right.png create mode 100644 Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/storageBend.png create mode 100644 Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/storageStraight.png create mode 100644 Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/storageTJunction.png diff --git a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/pipes.yml b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/pipes.yml index e5b77095b0..0025fc5ae1 100644 --- a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/pipes.yml +++ b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/pipes.yml @@ -1,4 +1,4 @@ -- type: entity +- type: entity abstract: true id: GasPipeBase parent: BaseItem @@ -101,6 +101,20 @@ - type: Construction graph: GasPipe node: straight + - type: Item + size: Normal + storedSprite: + sprite: Structures/Piping/Atmospherics/pipe.rsi + state: storageStraight + shape: + - 0,0,0,2 + - type: MeleeWeapon + attackRate: 1 + damage: + types: + Blunt: 8 + soundHit: + collection: MetalThud # this NEEDS to changed to the metal pipe falling sound effect on april first every year - type: entity parent: GasPipeBase @@ -120,6 +134,27 @@ - type: Construction graph: GasPipe node: bend + - type: Item + size: Small + shape: + - 0,0,1,0 + - 1,1,1,1 + heldPrefix: Bend + storedSprite: + sprite: Structures/Piping/Atmospherics/pipe.rsi + state: storageBend + - type: MeleeWeapon + wideAnimationRotation: 180 + attackRate: 1 + damage: + types: + Blunt: 6 + soundHit: + collection: MetalThud + - type: DamageOtherOnHit + damage: + types: + Blunt: 3 #This should be 6 but throwing damage is doubled at the moment for some reason so for now it's 3 - type: entity parent: GasPipeBase @@ -139,6 +174,23 @@ - type: Construction graph: GasPipe node: tjunction + - type: Item + size: Normal + shape: + - 0,0,2,0 + - 1,1,1,1 + heldPrefix: TJunction + storedSprite: + sprite: Structures/Piping/Atmospherics/pipe.rsi + state: storageTJunction + - type: MeleeWeapon + wideAnimationRotation: 90 + attackRate: 0.75 + damage: + types: + Blunt: 10 + soundHit: + collection: MetalThud - type: entity parent: GasPipeBase @@ -160,6 +212,20 @@ - type: Construction graph: GasPipe node: fourway + - type: Item + size: Normal + shape: + - 1,0,1,2 + - 0,1,2,1 + heldPrefix: Fourway + - type: MeleeWeapon + wideAnimationRotation: 90 + attackRate: 0.75 + damage: + types: + Blunt: 10 + soundHit: + collection: MetalThud - type: entity id: GasPipeBroken diff --git a/Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/Bend-inhand-left.png b/Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/Bend-inhand-left.png new file mode 100644 index 0000000000000000000000000000000000000000..f4f60cdd179557f334a87c09f05076ca6ada9ab7 GIT binary patch literal 6821 zcmd^EZ)_Y#6~Cf_N~)9=K0qLd^`##ubiK1X`(Nj49bej5?S}M0w|~9o zoKx2}C@7Zh&O7_w@4b05@88V*2M^r2bH{sk)M~Yzv-?|f@Oyjmx$bT7{kV7h_waK~ zG*BdBagnPR@=4c%`e0Y z?YnIn^d<=l96mYh^?|xpYuq;M6MBrtg2OwWKUIJ2>9cjgV^j6RS{t?dGknS0e=_8U zP9B)2Cy!B!)o*L=+|d}?fY9SH5r)04AKAmHdJ1gA|H-ga7gCb=*i?Nwkti&*4+=9u z$OUau7b(&W!LTM}%`jBsRzX3sCLt_gBr4cek*z91{#OTag3t(=YtOar$i>0aRDCIq z`?e$v27}1~o(#f{BwLmxAw^OY5h%pygddZk=tp}pkQ}DPBN}@B*b96ifhA6`98c9j z<7_Iueu?czxxK)0(vb8ec@ia4O9>e*>H5oIH`RbqiFbLA`*8%ca!K1?3gRGI3f6%x zUyld?6Sv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d=rp9z<&7-*MD6Xe|Y?c Q1buejf!33IKl$1J0Pg`AsQ>@~ literal 0 HcmV?d00001 diff --git a/Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/Bend-inhand-right.png b/Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/Bend-inhand-right.png new file mode 100644 index 0000000000000000000000000000000000000000..dfd245221f8af9ded5edfb2937d1c6abd14bb37d GIT binary patch literal 6825 zcmd^EZ-`u16`!irG;KcFG>Hg4ClrkK?fY}ze`hCdcG6_2v)yh+y0J9$zI*SReP(9f zv2~8D^0TKLQTMAi94Mhzon1&+egC7*rfZ9UT51u>k&%T+= zrrX_B0vXtuefOR7JLjHr&$;K^`?Z;(uG-58prbkNpvT z?ucd&>?@u7&4>R25ASPE)F(=%pMCT0|KK~}`L6E4!%?Yp_Xqjk9i?Z!yR%ftk>=Wb*WU@+v{R-l*NL}nto@zeC>so%YskG%a7`Hx!#>*^ZvmT zAv<(px|={bPVW-%6e?N%ppdgJ9jumk_|VW}+iN#dj99j-PKu(+6ycv^>9~G#$-OVJ|QJJU3VdD^);YGVlCEYoj3woC8zDq2XPS1 z2dhBmuLlHxiR<-T#zX!BVuRA`P?fWEaW0X zM5c>HMPXFL#DFhqVb4Pt5!X8)bZiw^&tjgXn41iX4T};DD*)?RiMF<3 zC?a)joq4W>kVe*_t*h&VLZ;)e#^%9NM6in}5y6xswXH_5Xz55*RfWjRcGsaTQy8-h z+=oq#fHwn{YE;FR$FLDZ zuO6&WB{7^!WeSrgR7MTkyC&-8SWB29;R zfK`cQBTYdXvrU`{7y&aR=%CM&-0?!{>6aRZ*s;P;p5*%VLKlY-<2&hiIonFJ`XbqB zfV{sMJDBhyqe}P&#$eV1qnRQJPs-ts@Y|Z^n?M)XN5U`7v(C*nz67ODHIhFHym$$R zY@!J}#9B7v1aOe8h&*EDZ_wBgUR<}SVKXuqwro+=Awo?ZbzSxptH!rHRdG9cNls)2Bn}E25lj)K7}|CaJSp? z3FdiDTI|rYUCQgf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U7^WpR90Cb!(B5LBQ@Sk2CZmm zw$X2@A`gF@5PUZoldoGD4_}`#`MQ;HneU;B<7dUDq!q(4PjI>$9!O5WjRVapvW(#1 zW94uweZi^I(qzto14%FFq!p>jvGPS5w!^EjC0>MVp<^Vj1sW?6j>4S-Ji%&37aqY= zd}%@}a8pu)E0K2=-#!gjI2|LozT)K2!lf9}lr;?@seI(>X;n|~<(oj)AuJv+4j?R(xjb7#lT-`HN-`itLPKHBlA6L0Q4 z{)3k7?y+_ZNyS_4gCA0L=6Tdt) z`{tD+ySnb>X+2PoFIOerRkKez3bKc>e1G1EJ< aC;L$M&gb`ktt+@-8W|kTo$EjP#s2_Xvp0_b literal 0 HcmV?d00001 diff --git a/Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/Fourway-inhand-right.png b/Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/Fourway-inhand-right.png new file mode 100644 index 0000000000000000000000000000000000000000..a59a79716590c16ca73b03a028f4bf46cadc11ac GIT binary patch literal 6915 zcmd^EYiJzT6&_i!QRKSKqiqsX@N{EB>vneDPgZNoT3c4)RTOEHNG&A3bMKwiRJ%Lt znb9*e)Q0{r^g#)V_hnBbc8@LjbYf|=f|q8nNpc5^d-@9t79iAV zh}eaCtr1uY1GyHk1^-9Ge2#6Agfj!V!AK%ISsr7DJfE^^UgNN!>8x(%MOD`o{qw9O zh$=70yex2%Y$<}JNNoEr2jW<^;1kChFCA@*gQtPqbQm@*o}Zte&(F(w&#&^LX_~ws z@sh*=1s5zfLbSj&f_r0-HcW{I*ms+u>owR27TMlxIFJL4#2w! zJTeEJsQhuBU-mH)5kvUNF-efjGI8IlMx&d||Pnkp4S%)`z(=jQ!;I2a& zy@^R%E|2_Q025e4K1HGDS3Iv)jMvgwVoi2vsI_+3&phfjh&La6w!p7tiIz_%7A>KW z79|0ei70S_R1sB6RxMHgoFH0)kb#IPI}pkqah=5kK?ZhC5G%l_z{1tP5Hn|pI+-Cf z2nx{$v1iFr0D>*Y^Xn)qx^+~ge6vw4@T-FIFUuLx4!sX}POCwhpXgP{$DUZH7gfL9l{EfOU*mTT|0Sj@YJ39ovv)1#d!ITU9ZE zOc%jw+XqWzjBJ@;4or#LwpB3V3{{pSNyGv*?M-M)MM@0~wP4#uK-&RJ6e1zRiL~8D zSVs~i*#K=7O-qa*I3UFls4B}?(rvN{BREu&B@q+_m+6~v8Kj{+fl#n*!N$Z9Ipk22 zBdX$XrfCbDso4Tn422q^+C{&3C>v|p2wp!(ql{TDTO*AiL=eFvrDCLr3ySC>(hb3+ z9JYzfVNt=HtzZYT7et{*B!ysz#B11-m}~BM;L zYAl<7(!DX03tAcA1JYWQ`O-9);Ab$hGPb|O*_Ir4L(gz4@wBl%=O&D&cp+vxo1{%z z+XN-OUc8qcjW+%0GzJ#<^%@^&Vc<;A%G6;=>$%Ysw}yQ+irUbmeKxgz^SPlDkyy_R z*foN@t+t=Bh%PXRsKoT8RU4-bXCXQ?wV-!}CaYCh6~zL7%~*=mdNUcdqP5vpzo|YboPZk#TGUikhJ%l_!=3bF z?gFh%mRvZH45Ch2Q`#JBUvy!cT8}OBB4&#NBXcd#@v|MjKs-L4M5{`g<( zxs}q%_ddBeSK49Be5*RV{|B_ZICsnbUvm%4J~UVA`STkuedTXI>nYFVKl} Pm`09_mYz9$;`Dz3>cTgh literal 0 HcmV?d00001 diff --git a/Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/TJunction-inhand-left.png b/Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/TJunction-inhand-left.png new file mode 100644 index 0000000000000000000000000000000000000000..8b14c9117a5c62f47ebb87ecb7885308eb2ad4be GIT binary patch literal 6895 zcmd^EeQX>@6<^~TQYS%(RuC$xtS(hZD0@4*v)?_RF&I<@BQAJH}k$`PK_PhzqS9Kevad|jvg2phu=NXXHzeHf9ppl{|Y}n z!TA2Y+;hMF@Sot}j;W#25XZgnmCgSmeek?x?4k0$a=E;)u&{mmb{M#?{)cBHx^Vp9 z#Ny&2x96kZ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abMx$uad(n}Lo zgPW2DT#3A~@aHGtI_2-9BSYoM{eOG;#rHmjw)BpjSzLT+=1jQrh2GyP)hFJ%bv;Tr|KVg{M_~a*PnRh z^TV$m@43?d?e|?8{=&B3z5J^?uV1>*|A{MaKJ(f&p;6s+-|?*{PQQ8Ak$!Km_wmzL zCysoucFjEh{im<`C*HIB4EOP#zR92V|5&>4$ES;zX21BEd$#>%PxIc#xE=53fAEjp zuWstQHgwHA_pC8|@-MISJhS;r*UwL!`}e(jUfb07`Xg6={^Y4sd-+2#;P(RaT!*n9Eell%Xvp1-)+{YC!kvx8rS3nz{n-FI;0xxGg|_a7!W BGZFv* literal 0 HcmV?d00001 diff --git a/Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/TJunction-inhand-right.png b/Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/TJunction-inhand-right.png new file mode 100644 index 0000000000000000000000000000000000000000..828920b400236e34ae5a502190109c1cf8a9c2a1 GIT binary patch literal 6893 zcmd^EYit}>72beJ(>!RPph7^(WQ(G{#`At=y{Y4MVoTZ7*jvS^M3g)C-m$0I-C1_V z_S%5tl!|vBKiVKFP>L#{@`IA9RayzDjuf7vR76O;ghT}hR0JxoibxGI=k7c_>#S4P zHYido?XKs}Io~<=oO{ka=ibkc967XO>#nW2TyDqkP-zr??`EGZ?}YEKy>RL;@Utlx zJ#--V%qt&$4IX+X`pf;f+_R5tyNuoi&)Y{1R|YGU%I@8}7Zw&^;6~^2FBx4pdSq;I zaWQxI9pC&H8*U683v#(_H?z;C+!J5@KrZ*e<6dPv94{ZXv0v*&#CK?KtJVPOT&}Rc z)j;?p4LOHSc=f*g>)%<(a~|o-AJxiYxiLT|y`i}#9h*B+!E-0EMe_TLJGK^DHXzh! zh`3g*S`X}2U%m}&!~bkp$a8Iy@MK@UpGoA#%Ol)?-=v(@tMgdY4bHH7CCxBY<1S7X zB~1_&K@oXbu~pGlWiI~9gE)>WG>L1EmJY_^;HfV^8HNp85N2j(dS{egzd0dDm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-%7r*x1gA>mlKRofB z{)=?-((MUs<&{^ZGtb=lk1v1!=(Vr(|NX-Gf1RFw&wao7!z(WxTs^nv(lO|x5iBEm@Kea3y*8l(j literal 0 HcmV?d00001 diff --git a/Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/inhand-right.png b/Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/inhand-right.png new file mode 100644 index 0000000000000000000000000000000000000000..6c8c55a515cf198adc7dde1072a354c7aef4f884 GIT binary patch literal 6826 zcmd^EeTZCF6`x=l+>}sh3szg{V^YCt-@K3ezL}l6*-5&ab~fA1mTXi)@4NTD*=J_v zP3FDbokVCsL!uz~hc*QfK`RJKTdP4Riqh;KEd+`pMXFFJ(t?UMh^-ccdhYw$HYw)ux zTzKF>>6w@B`ZGN2Zca6(N~Pz%ar1xhP4GO?ojD$sN;lueKf6lb{>~kx(#KBti%Zc` z;~|Fx?Fy!W%PReL7pP06>izvLCMQ`WxUA`SCd+UA;@4%tr<3JldP8n>r`fVUbEe0R zo|#)DXHF8EmhZ3a+gt5BfY4?U7W(a0Cv^Ig~7Gjd<T$H%-mFPf%q=mt-U%SyYju$&RK9>0cSd2|~3;J!heQC=~}!ljY?o z>N=9NwzgJTLzSS{loZ>xC0UhJRRjt#Jl%D7h z19{FI`Q9eH{LR3mSl{1-l)p(xW0!OPSHT3%bdTXE=q(08tCp;#`OKQa^mM#-gijsw zJ2Y4e@2yJ1EPVM4VzD}oSWT5-nJBU-tBZ>6Al*^S&&Y}+%LRypasZ(bP~SV9As}EE zWn~cO~MjAc`aI-L!4z~PS68|(HK6N%^DM+!9iwqH& zE*2GqQ4tdZzNm#g4`D=Xvnug01c*$X*j?$^Ca|8xJWDZm7#15AB^p)$*0U0AZNpGR z>e@Qk=$h^VGZw_pU1sYq2oQE-{L6_-I8 zs!#|8*OgsDJw?PGvqh?Fo@m>yEZT-E6V1|?rRXE{ONNTER*c}ygOq2?M#Guygb{`a zo~_roB0eZ$D%iASn~B7wNF<6zL{}po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G@L%WOkH|fiTjLZ| z(DjmP??Y1AHi)r!)^r5H%~$@Mcz9Yobf^;}=RnuzDpohjWKfA0;3scC-EVf?(o zF#o0#ISuunzdr>+GwsB{^HfppzG^*dvph z+bgc*5yxHLQd>gjr^{{sHc25bS$ z{14byDcw83YF_{V00v@9M??Ss00000`9r&Z00009a7bBm001r{001r{0eGc9b^rhX z2XskIMF-^p76=X|fYSJ>000AENkl@Wg7`q zQRT_2$#p`gR;!4jD6I$`$N9E8 zbQ}l6;Sc~YnM^=BoetXVwp5J;r4*d=h5mdr8sX{b3D?)xxWB(&8H6ARWE4d>K0e05 z!2tk(5Rz7jQc6@R6-X&Do6SH7L6Ri!JP$$$06?qNLbKTc3TPn zr8IS`JQ-tS0AxKt_dueQ0MrIksZ`7i0nRyG*EM$!P;Nh)&CG6wRP|*XfNa@mY#N+S zr|>+_>^(pTVP+km8VUdy4u@Lj@}&j9IY+D2GB*qK`+YQw^Z_?FH)iVt zE-x>wK47ht;5yCf17NT|KuQVU_c5Q(v9q&dW(X({#_j<{b)%&OAcRPVH%9IODh(1s z@cQ~{ZU|&Ef^h&CV~|p6)c~ahz!<}PJ}<-rm~K;&=lY-Y2aA5q!^1;_VOU5SWIBsK zJ3GsDkJ27w=kox*=o7w+clC^FwOWifExY(Aim5dvwzL!Rco79pP;PU?P^Vl znXU^xKR@H~@iBGlpHkM}^Z9INm%S$Y+jU*My}f}_`pH88{Smnq03|)SySw`@#8N9u zgN!k3ifN6<^D4?V4uH}6003s|1ByD3C?x=^4=C_Nrj!7zKEUb&tUkc%1FSw^L-YY3 X-_^u=F}^#^00000NkvXXu0mjfO~0Yv diff --git a/Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/storageBend.png b/Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/storageBend.png new file mode 100644 index 0000000000000000000000000000000000000000..39ffe213efb7142a4979c79f1dd7fcfc0a12c6ad GIT binary patch literal 449 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`0p1o(uwN=iz~%gcLsc*MoUwY9Z1H#hIvwQJ9wJ=?c$pFVwhU0q#BNXX2Y zGi79C9335{rKPuS-MVGV7DYwH$jHe3`}gnLw{ORe9YDjnSNGQdDT$IGzu^Da0mE5g zy;ndroCO|{#S9F3iXhC$9{uM(Q1G6oi(^QH``c-E`I;4Y+$MHe&HR18;=j49#KEqm zc{iuMS#-Zu(e}v_Uh%M<{K`%BLK;g~ovKe-R@9|`(Po~BL+&ffoeNJ~b~N|Bz4VQb z>D6Q}o6-x?*@|iRpEfD=HyK@hg>N>cpb9)*e=jx@jigy^sa%e#%aH`0&H5u3s0VZd4( zbs;;h!9w?f-)5#GJFE3wS(G>g4~nz?>sSBX*#CxIW0QOf_a^xhbsyqf9^4UDDRTL7 T=93vHk{CQ){an^LB{Ts52b91~ literal 0 HcmV?d00001 diff --git a/Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/storageStraight.png b/Resources/Textures/Structures/Piping/Atmospherics/pipe.rsi/storageStraight.png new file mode 100644 index 0000000000000000000000000000000000000000..715aeb58249c6800597e1df477b52ba8b12fcbc1 GIT binary patch literal 503 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!7>k44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O_~~1^9%xN=iz4czD#+)y2idH8(f!+O;brB&4maOIWL(^++MrA~|zF+Yw;Ip|6j~>hFSqmJB z6*HoAF2r!`D%<Z+DrE!kc_@}avL=4xm4u_9t)GMw^)_ct2X6#khxDdmcAjzx8lHSictN38+h64{` z3@$VMXKg+$6Z28jVm)OMA?CrRuXQLL+7Kg@zu6#k(K}G&P z^0_Aun^x|b{#W5}hW2mAHkE0A75=iM+H3qiXnm?~!a`-$??>$K@Hk44ofy`glX(f`u%tWsIx;Y9 z?C1WI$O`0#1o(uwN=iz~%gf8i$S5i*T3cItczDFc#kIAyH8(f6wzlrtwQJ9wJv(;n z*uH)HzJ2@l@87>=%a-ZWr`Ofhg@lAGU%q_i%$X}ztZ;O6l$Ms>x^=6RloZflU#{s{ zKuV@0$S?RmZonYE>CttdI?e)*$YKTtJw*^^WRL#yALwu{PZ!6K2=}+sE*2e95OBRI zA*SM(dm-xS|Np@bZ$vgZx&OYhSABdj;Rb?bH5qiEU6g)TF>sP%rS{-vjnL@<&+j$QRUq5YqYZ ak8O8h+LGPoYjuG^#o+1c=d#Wzp$P!xC*IHi literal 0 HcmV?d00001 From 9d4ead30b9d948d75f2dc46e0e81d17cbffa11cc Mon Sep 17 00:00:00 2001 From: PJBot Date: Thu, 9 May 2024 06:01:53 +0000 Subject: [PATCH 014/111] Automatic changelog update --- Resources/Changelog/Changelog.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index 6e45f18579..671fe20475 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,15 +1,4 @@ Entries: -- author: Flareguy - changes: - - message: Big O2 tanks and N2 tanks no longer spawn in any departmental locker. - Use tank dispensers to get them instead. - type: Tweak - - message: Removed all instances where N2 tanks spawned as counterparts to O2 tanks. - This includes things like lockers, suit storages, and the emergency toolbox. - type: Remove - id: 6059 - time: '2024-02-29T21:40:17.0000000+00:00' - url: https://github.com/space-wizards/space-station-14/pull/25660 - author: Potato1234_x changes: - message: Added fill levels to bowls, chefs rejoice! @@ -3850,3 +3839,10 @@ id: 6558 time: '2024-05-09T05:56:13.0000000+00:00' url: https://github.com/space-wizards/space-station-14/pull/27815 +- author: Blackern5000 + changes: + - message: Atmos metal pipes now deal blunt damage. + type: Add + id: 6559 + time: '2024-05-09T06:00:48.0000000+00:00' + url: https://github.com/space-wizards/space-station-14/pull/27673 From 515456824812ebd125ce8ee2dbf9df0c2470c391 Mon Sep 17 00:00:00 2001 From: Plykiya <58439124+Plykiya@users.noreply.github.com> Date: Wed, 8 May 2024 23:03:44 -0700 Subject: [PATCH 015/111] Add Missing Unlocks to Emagged Lathes and Move Recipes to Protolathe (#27575) * Add missing emag recipes to lathes * Move autolathe dynamic recipes over to the protolathe * No disablers! * Move blast grenades to protolathe as well * Forgot about tranq shells * forgotten things from the autolathe PR * Altered lathe descriptions to more accurately reflect their purpose --------- Co-authored-by: Plykiya --- .../Entities/Structures/Machines/lathe.yml | 82 +++++++++++-------- 1 file changed, 48 insertions(+), 34 deletions(-) diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml index 5830813f8f..f29e5f155a 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml @@ -89,7 +89,7 @@ id: Autolathe parent: BaseLatheLube name: autolathe - description: It produces items using metal and glass. + description: It produces basic items using metal and glass. components: - type: Sprite sprite: Structures/Machines/autolathe.rsi @@ -200,6 +200,7 @@ emagStaticRecipes: - BoxLethalshot - BoxShotgunFlare + - BoxShotgunSlug - MagazineBoxLightRifle - MagazineBoxMagnum - MagazineBoxPistol @@ -210,43 +211,16 @@ - MagazinePistolEmpty - MagazinePistolSubMachineGun - MagazinePistolSubMachineGunEmpty + - MagazinePistolSubMachineGunTopMounted + - MagazinePistolSubMachineGunTopMountedEmpty - MagazineRifle - MagazineRifleEmpty - MagazineShotgun - MagazineShotgunEmpty - - ShellTranquilizer + - MagazineShotgunSlug + - RiotShield - SpeedLoaderMagnum - SpeedLoaderMagnumEmpty - emagDynamicRecipes: - - BoxBeanbag - - BoxShotgunIncendiary - - BoxShotgunUranium - - GrenadeBlast - - GrenadeEMP - - GrenadeFlash - - MagazineBoxLightRifleIncendiary - - MagazineBoxLightRifleUranium - - MagazineBoxMagnumIncendiary - - MagazineBoxMagnumUranium - - MagazineBoxPistolIncendiary - - MagazineBoxPistolUranium - - MagazineBoxRifleIncendiary - - MagazineBoxRifleUranium - - MagazineGrenadeEmpty - - MagazineLightRifleIncendiary - - MagazineLightRifleUranium - - MagazinePistolIncendiary - - MagazinePistolUranium - - MagazineRifleIncendiary - - MagazineRifleUranium - - MagazineShotgunBeanbag - - MagazineShotgunIncendiary - - MagazineShotgunIncendiary - - PowerCageHigh - - PowerCageMedium - - PowerCageSmall - - SpeedLoaderMagnumIncendiary - - SpeedLoaderMagnumUranium - type: entity id: AutolatheHyperConvection @@ -263,7 +237,7 @@ id: Protolathe parent: BaseLatheLube name: protolathe - description: Converts raw materials into useful objects. + description: Converts raw materials into advanced items. components: - type: Sprite sprite: Structures/Machines/protolathe.rsi @@ -357,10 +331,44 @@ - DeviceQuantumSpinInverter - type: EmagLatheRecipes emagDynamicRecipes: + - BoxBeanbag + - BoxShotgunIncendiary + - BoxShotgunUranium - ExplosivePayload - - WeaponLaserCarbine + - GrenadeBlast + - GrenadeEMP + - GrenadeFlash + - HoloprojectorSecurity + - MagazineBoxLightRifleIncendiary + - MagazineBoxLightRifleUranium + - MagazineBoxMagnumIncendiary + - MagazineBoxMagnumUranium + - MagazineBoxPistolIncendiary + - MagazineBoxPistolUranium + - MagazineBoxRifleIncendiary + - MagazineBoxRifleUranium + - MagazineGrenadeEmpty + - MagazineLightRifleIncendiary + - MagazineLightRifleUranium + - MagazinePistolIncendiary + - MagazinePistolUranium + - MagazineRifleIncendiary + - MagazineRifleUranium + - MagazineShotgunBeanbag + - MagazineShotgunIncendiary + - MagazineShotgunIncendiary + - PortableRecharger + - PowerCageHigh + - PowerCageMedium + - PowerCageSmall + - ShellTranquilizer + - SpeedLoaderMagnumIncendiary + - SpeedLoaderMagnumUranium + - TelescopicShield + - Truncheon - WeaponAdvancedLaser - WeaponLaserCannon + - WeaponLaserCarbine - WeaponXrayCannon - type: entity @@ -488,6 +496,12 @@ - MassMediaCircuitboard - ReagentGrinderIndustrialMachineCircuitboard - JukeboxCircuitBoard + - type: EmagLatheRecipes + emagDynamicRecipes: + - ShuttleGunDusterCircuitboard + - ShuttleGunFriendshipCircuitboard + - ShuttleGunPerforatorCircuitboard + - ShuttleGunSvalinnMachineGunCircuitboard - type: MaterialStorage whitelist: tags: From 38a2beff920c39b08736dc30904c3ac4867051f3 Mon Sep 17 00:00:00 2001 From: PJBot Date: Thu, 9 May 2024 06:04:51 +0000 Subject: [PATCH 016/111] Automatic changelog update --- Resources/Changelog/Changelog.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index 671fe20475..85dbb7b0b0 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,11 +1,4 @@ Entries: -- author: Potato1234_x - changes: - - message: Added fill levels to bowls, chefs rejoice! - type: Add - id: 6060 - time: '2024-02-29T21:41:14.0000000+00:00' - url: https://github.com/space-wizards/space-station-14/pull/25639 - author: Plykiya changes: - message: Dragging objects over gas pipes no longer slows you down. @@ -3846,3 +3839,16 @@ id: 6559 time: '2024-05-09T06:00:48.0000000+00:00' url: https://github.com/space-wizards/space-station-14/pull/27673 +- author: Plykiya + changes: + - message: The emagged protolathe can now print truncheons and the new T3 portable + recharger. + type: Add + - message: The emagged circuit printer can now print ship guns. + type: Add + - message: Autolathe emagged recipes that are research gated have been moved over + to the protolathe. + type: Tweak + id: 6560 + time: '2024-05-09T06:03:45.0000000+00:00' + url: https://github.com/space-wizards/space-station-14/pull/27575 From 1593a11aa90318b1ca75ffff0c60a8cf083380da Mon Sep 17 00:00:00 2001 From: Plykiya <58439124+Plykiya@users.noreply.github.com> Date: Wed, 8 May 2024 23:11:50 -0700 Subject: [PATCH 017/111] Make ERT use short raffle timer (#27830) Co-authored-by: plykiya --- .../Entities/Mobs/Player/humanoid.yml | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Resources/Prototypes/Entities/Mobs/Player/humanoid.yml b/Resources/Prototypes/Entities/Mobs/Player/humanoid.yml index 2435770ff2..918f24cd69 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/humanoid.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/humanoid.yml @@ -27,7 +27,7 @@ name: ghost-role-information-Death-Squad-name description: ghost-role-information-Death-Squad-description raffle: - settings: default + settings: short - type: GhostTakeoverAvailable - type: Loadout prototypes: [ DeathSquadGear ] @@ -65,7 +65,7 @@ name: ghost-role-information-ert-leader-name description: ghost-role-information-ert-leader-description raffle: - settings: default + settings: short - type: GhostTakeoverAvailable - type: Loadout prototypes: [ ERTLeaderGear ] @@ -97,7 +97,7 @@ name: ghost-role-information-ert-leader-name description: ghost-role-information-ert-leader-description raffle: - settings: default + settings: short - type: GhostTakeoverAvailable - type: Loadout prototypes: [ ERTLeaderGearEVA ] @@ -121,7 +121,7 @@ name: ghost-role-information-ert-leader-name description: ghost-role-information-ert-leader-description raffle: - settings: default + settings: short - type: GhostTakeoverAvailable - type: Loadout prototypes: [ ERTLeaderGearEVALecter ] @@ -154,7 +154,7 @@ name: ghost-role-information-ert-chaplain-name description: ghost-role-information-ert-chaplain-description raffle: - settings: default + settings: short - type: GhostTakeoverAvailable - type: RandomMetadata nameSegments: @@ -185,7 +185,7 @@ name: ghost-role-information-ert-chaplain-name description: ghost-role-information-ert-chaplain-description raffle: - settings: default + settings: short - type: GhostTakeoverAvailable - type: Loadout prototypes: [ ERTChaplainGearEVA ] @@ -218,7 +218,7 @@ name: ghost-role-information-ert-janitor-name description: ghost-role-information-ert-janitor-description raffle: - settings: default + settings: short - type: GhostTakeoverAvailable - type: RandomMetadata nameSegments: @@ -249,7 +249,7 @@ name: ghost-role-information-ert-janitor-name description: ghost-role-information-ert-janitor-description raffle: - settings: default + settings: short - type: GhostTakeoverAvailable - type: Loadout prototypes: [ ERTJanitorGearEVA ] @@ -282,7 +282,7 @@ name: ghost-role-information-ert-engineer-name description: ghost-role-information-ert-engineer-description raffle: - settings: default + settings: short - type: GhostTakeoverAvailable - type: RandomMetadata nameSegments: @@ -313,7 +313,7 @@ name: ghost-role-information-ert-engineer-name description: ghost-role-information-ert-engineer-description raffle: - settings: default + settings: short - type: GhostTakeoverAvailable - type: Loadout prototypes: [ ERTEngineerGearEVA ] @@ -346,7 +346,7 @@ name: ghost-role-information-ert-security-name description: ghost-role-information-ert-security-description raffle: - settings: default + settings: short - type: GhostTakeoverAvailable - type: RandomMetadata nameSegments: @@ -377,7 +377,7 @@ name: ghost-role-information-ert-security-name description: ghost-role-information-ert-security-description raffle: - settings: default + settings: short - type: GhostTakeoverAvailable - type: Loadout prototypes: [ ERTSecurityGearEVA ] @@ -400,7 +400,7 @@ name: ghost-role-information-ert-security-name description: ghost-role-information-ert-security-description raffle: - settings: default + settings: short - type: GhostTakeoverAvailable - type: Loadout prototypes: [ ERTSecurityGearEVALecter ] @@ -433,7 +433,7 @@ name: ghost-role-information-ert-medical-name description: ghost-role-information-ert-medical-description raffle: - settings: default + settings: short - type: GhostTakeoverAvailable - type: RandomMetadata nameSegments: @@ -464,7 +464,7 @@ name: ghost-role-information-ert-medical-name description: ghost-role-information-ert-medical-description raffle: - settings: default + settings: short - type: GhostTakeoverAvailable - type: Loadout prototypes: [ ERTMedicalGearEVA ] @@ -494,7 +494,7 @@ name: ghost-role-information-cburn-agent-name description: ghost-role-information-cburn-agent-description raffle: - settings: default + settings: short - type: GhostTakeoverAvailable - type: RandomMetadata nameSegments: From fe35188e2c7b3f7cf209aebf7f97c184e30ae8fb Mon Sep 17 00:00:00 2001 From: lzk <124214523+lzk228@users.noreply.github.com> Date: Thu, 9 May 2024 08:33:08 +0200 Subject: [PATCH 018/111] Add auto map vote cvar (#27496) * Add auto map vote cvar * :trollface: --- Content.Server/GameTicking/GameTicker.RoundFlow.cs | 8 ++++++++ Content.Shared/CCVar/CCVars.cs | 6 ++++++ Resources/ConfigPresets/WizardsDen/wizardsDen.toml | 1 + 3 files changed, 15 insertions(+) diff --git a/Content.Server/GameTicking/GameTicker.RoundFlow.cs b/Content.Server/GameTicking/GameTicker.RoundFlow.cs index df597e69b2..d01838964a 100644 --- a/Content.Server/GameTicking/GameTicker.RoundFlow.cs +++ b/Content.Server/GameTicking/GameTicker.RoundFlow.cs @@ -4,12 +4,14 @@ using Content.Server.Discord; using Content.Server.GameTicking.Events; using Content.Server.Ghost; using Content.Server.Maps; +using Content.Server.Voting.Managers; using Content.Shared.CCVar; using Content.Shared.Database; using Content.Shared.GameTicking; using Content.Shared.Mind; using Content.Shared.Players; using Content.Shared.Preferences; +using Content.Shared.Voting; using JetBrains.Annotations; using Prometheus; using Robust.Server.Maps; @@ -27,6 +29,7 @@ namespace Content.Server.GameTicking { [Dependency] private readonly DiscordWebhook _discord = default!; [Dependency] private readonly ITaskManager _taskManager = default!; + [Dependency] private readonly IVoteManager _voteManager = default!; private static readonly Counter RoundNumberMetric = Metrics.CreateCounter( "ss14_round_number", @@ -508,6 +511,11 @@ namespace Content.Server.GameTicking SendStatusToAll(); UpdateInfoText(); + if (_configurationManager.GetCVar(CCVars.GameAutoMapVote)) + { + _voteManager.CreateStandardVote(null, StandardVoteType.Map); + } + ReqWindowAttentionAll(); } } diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 36de8857fb..c46f5fb923 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -330,6 +330,12 @@ namespace Content.Shared.CCVar public static readonly CVarDef DebugCoordinatesAdminOnly = CVarDef.Create("game.debug_coordinates_admin_only", true, CVar.SERVER | CVar.REPLICATED); + /// + /// Controls if lobby has an automatic map vote. + /// + public static readonly CVarDef + GameAutoMapVote = CVarDef.Create("game.lobby_auto_map_vote", true, CVar.ARCHIVE | CVar.SERVERONLY); + #if EXCEPTION_TOLERANCE /// /// Amount of times round start must fail before the server is shut down. diff --git a/Resources/ConfigPresets/WizardsDen/wizardsDen.toml b/Resources/ConfigPresets/WizardsDen/wizardsDen.toml index 413de472bf..a30313665e 100644 --- a/Resources/ConfigPresets/WizardsDen/wizardsDen.toml +++ b/Resources/ConfigPresets/WizardsDen/wizardsDen.toml @@ -4,6 +4,7 @@ [game] desc = "Official English Space Station 14 servers. Vanilla, low roleplay." lobbyenabled = true +lobby_auto_map_vote = false soft_max_players = 80 panic_bunker.enabled = true panic_bunker.disable_with_admins = true From 24ab5c098251254e69264bda2a45c7c639244a68 Mon Sep 17 00:00:00 2001 From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Thu, 9 May 2024 06:35:11 +0000 Subject: [PATCH 019/111] ninja criminal records hacking (#24982) * more humour * spotted a troll * add TryFindObjective to MindSystem * replace copypaste bool conditions with CodeCondition * use CodeConditionSystem in ninja + add handling for criminal hack * add criminal records hacking * update objectives * :trollface: --------- Co-authored-by: deltanedas <@deltanedas:kde.org> --- .../Systems/CriminalRecordsHackerSystem.cs | 7 ++ .../Systems/CriminalRecordsHackerSystem.cs | 62 +++++++++++++++ .../Ninja/Systems/NinjaGlovesSystem.cs | 10 ++- .../Ninja/Systems/SpaceNinjaSystem.cs | 29 +++++-- .../Ninja/Systems/SpiderChargeSystem.cs | 5 +- .../Components/CodeConditionSystem.cs | 17 +++++ .../SpiderChargeConditionComponent.cs | 3 - .../Components/TerrorConditionComponent.cs | 17 ----- .../Objectives/Systems/CodeConditionSystem.cs | 76 +++++++++++++++++++ .../Systems/NinjaConditionsSystem.cs | 13 ---- .../CriminalRecordsHackerComponent.cs | 31 ++++++++ .../SharedCriminalRecordsHackerSystem.cs | 48 ++++++++++++ Content.Shared/Mind/SharedMindSystem.cs | 24 ++++++ .../Ninja/Components/SpaceNinjaComponent.cs | 20 ++++- .../Ninja/Systems/SharedNinjaGlovesSystem.cs | 2 + .../Locale/en-US/ninja/ninja-actions.ftl | 2 + .../Prototypes/Datasets/criminal_records.yml | 6 ++ Resources/Prototypes/GameRules/midround.yml | 1 + .../Prototypes/Objectives/base_objectives.yml | 8 ++ Resources/Prototypes/Objectives/ninja.yml | 18 ++++- 20 files changed, 349 insertions(+), 50 deletions(-) create mode 100644 Content.Client/CriminalRecords/Systems/CriminalRecordsHackerSystem.cs create mode 100644 Content.Server/CriminalRecords/Systems/CriminalRecordsHackerSystem.cs create mode 100644 Content.Server/Objectives/Components/CodeConditionSystem.cs delete mode 100644 Content.Server/Objectives/Components/TerrorConditionComponent.cs create mode 100644 Content.Server/Objectives/Systems/CodeConditionSystem.cs create mode 100644 Content.Shared/CriminalRecords/Components/CriminalRecordsHackerComponent.cs create mode 100644 Content.Shared/CriminalRecords/Systems/SharedCriminalRecordsHackerSystem.cs diff --git a/Content.Client/CriminalRecords/Systems/CriminalRecordsHackerSystem.cs b/Content.Client/CriminalRecords/Systems/CriminalRecordsHackerSystem.cs new file mode 100644 index 0000000000..21fccc880d --- /dev/null +++ b/Content.Client/CriminalRecords/Systems/CriminalRecordsHackerSystem.cs @@ -0,0 +1,7 @@ +using Content.Shared.CriminalRecords.Systems; + +namespace Content.Client.CriminalRecords.Systems; + +public sealed class CriminalRecordsHackerSystem : SharedCriminalRecordsHackerSystem +{ +} diff --git a/Content.Server/CriminalRecords/Systems/CriminalRecordsHackerSystem.cs b/Content.Server/CriminalRecords/Systems/CriminalRecordsHackerSystem.cs new file mode 100644 index 0000000000..91285a1ca7 --- /dev/null +++ b/Content.Server/CriminalRecords/Systems/CriminalRecordsHackerSystem.cs @@ -0,0 +1,62 @@ +using Content.Server.Chat.Systems; +using Content.Server.Station.Systems; +using Content.Server.StationRecords.Systems; +using Content.Shared.CriminalRecords; +using Content.Shared.CriminalRecords.Components; +using Content.Shared.CriminalRecords.Systems; +using Content.Shared.Dataset; +using Content.Shared.Security; +using Robust.Shared.Prototypes; +using Robust.Shared.Random; + +namespace Content.Server.CriminalRecords.Systems; + +public sealed class CriminalRecordsHackerSystem : SharedCriminalRecordsHackerSystem +{ + [Dependency] private readonly ChatSystem _chat = default!; + [Dependency] private readonly IPrototypeManager _proto = default!; + [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly StationSystem _station = default!; + [Dependency] private readonly StationRecordsSystem _records = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnDoAfter); + } + + private void OnDoAfter(Entity ent, ref CriminalRecordsHackDoAfterEvent args) + { + if (args.Cancelled || args.Handled || args.Target == null) + return; + + if (_station.GetOwningStation(ent) is not {} station) + return; + + var reasons = _proto.Index(ent.Comp.Reasons); + foreach (var (key, record) in _records.GetRecordsOfType(station)) + { + var reason = _random.Pick(reasons.Values); + record.Status = SecurityStatus.Wanted; + record.Reason = reason; + // no radio message since spam + // no history since lazy and its easy to remove anyway + // main damage with this is existing arrest warrants are lost and to anger beepsky + } + + _chat.DispatchGlobalAnnouncement(Loc.GetString(ent.Comp.Announcement), playSound: true, colorOverride: Color.Red); + + // once is enough + RemComp(ent); + + var ev = new CriminalRecordsHackedEvent(ent, args.Target.Value); + RaiseLocalEvent(args.User, ref ev); + } +} + +/// +/// Raised on the user after hacking a criminal records console. +/// +[ByRefEvent] +public record struct CriminalRecordsHackedEvent(EntityUid User, EntityUid Target); diff --git a/Content.Server/Ninja/Systems/NinjaGlovesSystem.cs b/Content.Server/Ninja/Systems/NinjaGlovesSystem.cs index d84a728775..2c0f6c63e3 100644 --- a/Content.Server/Ninja/Systems/NinjaGlovesSystem.cs +++ b/Content.Server/Ninja/Systems/NinjaGlovesSystem.cs @@ -1,8 +1,9 @@ using Content.Server.Communications; using Content.Server.Mind; using Content.Server.Ninja.Events; -using Content.Server.Objectives.Components; +using Content.Server.Objectives.Systems; using Content.Shared.Communications; +using Content.Shared.CriminalRecords.Components; using Content.Shared.Ninja.Components; using Content.Shared.Ninja.Systems; using Content.Shared.Research.Components; @@ -16,6 +17,7 @@ namespace Content.Server.Ninja.Systems; public sealed class NinjaGlovesSystem : SharedNinjaGlovesSystem { [Dependency] private readonly EmagProviderSystem _emagProvider = default!; + [Dependency] private readonly CodeConditionSystem _codeCondition = default!; [Dependency] private readonly CommsHackerSystem _commsHacker = default!; [Dependency] private readonly MindSystem _mind = default!; [Dependency] private readonly SharedStunProviderSystem _stunProvider = default!; @@ -88,12 +90,16 @@ public sealed class NinjaGlovesSystem : SharedNinjaGlovesSystem EnsureComp(user); // prevent calling in multiple threats by toggling gloves after - if (_mind.TryGetObjectiveComp(user, out var obj) && !obj.CalledInThreat) + if (!_codeCondition.IsCompleted(user, ninja.TerrorObjective)) { var hacker = EnsureComp(user); var rule = _ninja.NinjaRule(user); if (rule != null) _commsHacker.SetThreats(user, rule.Threats, hacker); } + if (!_codeCondition.IsCompleted(user, ninja.MassArrestObjective)) + { + EnsureComp(user); + } } } diff --git a/Content.Server/Ninja/Systems/SpaceNinjaSystem.cs b/Content.Server/Ninja/Systems/SpaceNinjaSystem.cs index 835ac7ad6c..1dfaf4f339 100644 --- a/Content.Server/Ninja/Systems/SpaceNinjaSystem.cs +++ b/Content.Server/Ninja/Systems/SpaceNinjaSystem.cs @@ -1,12 +1,15 @@ using Content.Server.Communications; using Content.Server.Chat.Managers; +using Content.Server.CriminalRecords.Systems; using Content.Server.GameTicking.Rules.Components; +using Content.Server.GenericAntag; +using Content.Server.Objectives.Components; +using Content.Server.Objectives.Systems; using Content.Server.Power.Components; using Content.Server.Power.EntitySystems; using Content.Server.PowerCell; using Content.Server.Research.Systems; using Content.Server.Roles; -using Content.Server.GenericAntag; using Content.Shared.Alert; using Content.Shared.Clothing.EntitySystems; using Content.Shared.Doors.Components; @@ -19,7 +22,6 @@ using Content.Shared.Rounding; using Robust.Shared.Audio; using Robust.Shared.Player; using System.Diagnostics.CodeAnalysis; -using Content.Server.Objectives.Components; using Robust.Shared.Audio.Systems; namespace Content.Server.Ninja.Systems; @@ -28,7 +30,6 @@ namespace Content.Server.Ninja.Systems; // engi -> saboteur // medi -> idk reskin it // other -> assault -// TODO: when criminal records is merged, hack it to set everyone to arrest /// /// Main ninja system that handles ninja setup, provides helper methods for the rest of the code to use. @@ -37,6 +38,7 @@ public sealed class SpaceNinjaSystem : SharedSpaceNinjaSystem { [Dependency] private readonly AlertsSystem _alerts = default!; [Dependency] private readonly BatterySystem _battery = default!; + [Dependency] private readonly CodeConditionSystem _codeCondition = default!; [Dependency] private readonly IChatManager _chatMan = default!; [Dependency] private readonly PowerCellSystem _powerCell = default!; [Dependency] private readonly RoleSystem _role = default!; @@ -52,6 +54,7 @@ public sealed class SpaceNinjaSystem : SharedSpaceNinjaSystem SubscribeLocalEvent(OnDoorjack); SubscribeLocalEvent(OnResearchStolen); SubscribeLocalEvent(OnThreatCalledIn); + SubscribeLocalEvent(OnCriminalRecordsHacked); } public override void Update(float frameTime) @@ -216,11 +219,21 @@ public sealed class SpaceNinjaSystem : SharedSpaceNinjaSystem Popup.PopupEntity(str, uid, uid, PopupType.Medium); } - private void OnThreatCalledIn(EntityUid uid, SpaceNinjaComponent comp, ref ThreatCalledInEvent args) + private void OnThreatCalledIn(Entity ent, ref ThreatCalledInEvent args) { - if (_mind.TryGetObjectiveComp(uid, out var obj)) - { - obj.CalledInThreat = true; - } + _codeCondition.SetCompleted(ent.Owner, ent.Comp.TerrorObjective); + } + + private void OnCriminalRecordsHacked(Entity ent, ref CriminalRecordsHackedEvent args) + { + _codeCondition.SetCompleted(ent.Owner, ent.Comp.MassArrestObjective); + } + + /// + /// Called by when it detonates. + /// + public void DetonatedSpiderCharge(Entity ent) + { + _codeCondition.SetCompleted(ent.Owner, ent.Comp.SpiderChargeObjective); } } diff --git a/Content.Server/Ninja/Systems/SpiderChargeSystem.cs b/Content.Server/Ninja/Systems/SpiderChargeSystem.cs index 948d715f0a..64c958d6f1 100644 --- a/Content.Server/Ninja/Systems/SpiderChargeSystem.cs +++ b/Content.Server/Ninja/Systems/SpiderChargeSystem.cs @@ -19,6 +19,7 @@ public sealed class SpiderChargeSystem : EntitySystem [Dependency] private readonly MindSystem _mind = default!; [Dependency] private readonly PopupSystem _popup = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; + [Dependency] private readonly SpaceNinjaSystem _ninja = default!; public override void Initialize() { @@ -76,10 +77,10 @@ public sealed class SpiderChargeSystem : EntitySystem /// private void OnExplode(EntityUid uid, SpiderChargeComponent comp, TriggerEvent args) { - if (comp.Planter == null || !_mind.TryGetObjectiveComp(comp.Planter.Value, out var obj)) + if (!TryComp(comp.Planter, out var ninja)) return; // assumes the target was destroyed, that the charge wasn't moved somehow - obj.Detonated = true; + _ninja.DetonatedSpiderCharge((comp.Planter.Value, ninja)); } } diff --git a/Content.Server/Objectives/Components/CodeConditionSystem.cs b/Content.Server/Objectives/Components/CodeConditionSystem.cs new file mode 100644 index 0000000000..581098c3f7 --- /dev/null +++ b/Content.Server/Objectives/Components/CodeConditionSystem.cs @@ -0,0 +1,17 @@ +using Content.Server.Objectives.Systems; + +namespace Content.Server.Objectives.Components; + +/// +/// An objective that is set to complete by code in another system. +/// Use to check and set this. +/// +[RegisterComponent, Access(typeof(CodeConditionSystem))] +public sealed partial class CodeConditionComponent : Component +{ + /// + /// Whether the objective is complete or not. + /// + [DataField] + public bool Completed; +} diff --git a/Content.Server/Objectives/Components/SpiderChargeConditionComponent.cs b/Content.Server/Objectives/Components/SpiderChargeConditionComponent.cs index 368c9f27ed..9983b35969 100644 --- a/Content.Server/Objectives/Components/SpiderChargeConditionComponent.cs +++ b/Content.Server/Objectives/Components/SpiderChargeConditionComponent.cs @@ -9,9 +9,6 @@ namespace Content.Server.Objectives.Components; [RegisterComponent, Access(typeof(NinjaConditionsSystem), typeof(SpiderChargeSystem), typeof(SpaceNinjaSystem))] public sealed partial class SpiderChargeConditionComponent : Component { - [DataField, ViewVariables(VVAccess.ReadWrite)] - public bool Detonated; - /// /// Warp point that the spider charge has to target /// diff --git a/Content.Server/Objectives/Components/TerrorConditionComponent.cs b/Content.Server/Objectives/Components/TerrorConditionComponent.cs deleted file mode 100644 index acd3218ad4..0000000000 --- a/Content.Server/Objectives/Components/TerrorConditionComponent.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Content.Server.Objectives.Systems; -using Content.Shared.Ninja.Systems; - -namespace Content.Server.Objectives.Components; - -/// -/// Requires that the player is a ninja and has called in a threat. -/// -[RegisterComponent, Access(typeof(NinjaConditionsSystem), typeof(SharedSpaceNinjaSystem))] -public sealed partial class TerrorConditionComponent : Component -{ - /// - /// Whether the comms console has been hacked - /// - [DataField("calledInThreat"), ViewVariables(VVAccess.ReadWrite)] - public bool CalledInThreat; -} diff --git a/Content.Server/Objectives/Systems/CodeConditionSystem.cs b/Content.Server/Objectives/Systems/CodeConditionSystem.cs new file mode 100644 index 0000000000..7ba312f4bb --- /dev/null +++ b/Content.Server/Objectives/Systems/CodeConditionSystem.cs @@ -0,0 +1,76 @@ +using Content.Server.Objectives.Components; +using Content.Shared.Objectives.Components; +using Content.Shared.Mind; +using Content.Shared.Mind.Components; + +namespace Content.Server.Objectives.Systems; + +/// +/// Handles progress and provides API for systems to use. +/// +public sealed class CodeConditionSystem : EntitySystem +{ + [Dependency] private readonly SharedMindSystem _mind = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnGetProgress); + } + + private void OnGetProgress(Entity ent, ref ObjectiveGetProgressEvent args) + { + args.Progress = ent.Comp.Completed ? 1f : 0f; + } + + /// + /// Returns whether an objective is completed. + /// + public bool IsCompleted(Entity ent) + { + if (!Resolve(ent, ref ent.Comp)) + return false; + + return ent.Comp.Completed; + } + + /// + /// Returns true if a mob's objective with a certain prototype is completed. + /// + public bool IsCompleted(Entity mob, string prototype) + { + if (_mind.GetMind(mob, mob.Comp) is not {} mindId) + return false; + + if (!_mind.TryFindObjective(mindId, prototype, out var obj)) + return false; + + return IsCompleted(obj.Value); + } + + /// + /// Sets an objective's completed field. + /// + public void SetCompleted(Entity ent, bool completed = true) + { + if (!Resolve(ent, ref ent.Comp)) + return; + + ent.Comp.Completed = completed; + } + + /// + /// Sets a mob's objective to complete. + /// + public void SetCompleted(Entity mob, string prototype, bool completed = true) + { + if (_mind.GetMind(mob, mob.Comp) is not {} mindId) + return; + + if (!_mind.TryFindObjective(mindId, prototype, out var obj)) + return; + + SetCompleted(obj.Value, completed); + } +} diff --git a/Content.Server/Objectives/Systems/NinjaConditionsSystem.cs b/Content.Server/Objectives/Systems/NinjaConditionsSystem.cs index 888a365a5d..47c54b937a 100644 --- a/Content.Server/Objectives/Systems/NinjaConditionsSystem.cs +++ b/Content.Server/Objectives/Systems/NinjaConditionsSystem.cs @@ -23,11 +23,8 @@ public sealed class NinjaConditionsSystem : EntitySystem SubscribeLocalEvent(OnSpiderChargeRequirementCheck); SubscribeLocalEvent(OnSpiderChargeAfterAssign); - SubscribeLocalEvent(OnSpiderChargeGetProgress); SubscribeLocalEvent(OnStealResearchGetProgress); - - SubscribeLocalEvent(OnTerrorGetProgress); } // doorjack @@ -88,11 +85,6 @@ public sealed class NinjaConditionsSystem : EntitySystem _metaData.SetEntityName(uid, title, args.Meta); } - private void OnSpiderChargeGetProgress(EntityUid uid, SpiderChargeConditionComponent comp, ref ObjectiveGetProgressEvent args) - { - args.Progress = comp.Detonated ? 1f : 0f; - } - // steal research private void OnStealResearchGetProgress(EntityUid uid, StealResearchConditionComponent comp, ref ObjectiveGetProgressEvent args) @@ -108,9 +100,4 @@ public sealed class NinjaConditionsSystem : EntitySystem return MathF.Min(comp.DownloadedNodes.Count / (float) target, 1f); } - - private void OnTerrorGetProgress(EntityUid uid, TerrorConditionComponent comp, ref ObjectiveGetProgressEvent args) - { - args.Progress = comp.CalledInThreat ? 1f : 0f; - } } diff --git a/Content.Shared/CriminalRecords/Components/CriminalRecordsHackerComponent.cs b/Content.Shared/CriminalRecords/Components/CriminalRecordsHackerComponent.cs new file mode 100644 index 0000000000..189a387a5d --- /dev/null +++ b/Content.Shared/CriminalRecords/Components/CriminalRecordsHackerComponent.cs @@ -0,0 +1,31 @@ +using Content.Shared.CriminalRecords.Systems; +using Content.Shared.Dataset; +using Robust.Shared.GameStates; +using Robust.Shared.Prototypes; + +namespace Content.Shared.CriminalRecords.Components; + +/// +/// Lets the user hack a criminal records console, once. +/// Everyone is set to wanted with a randomly picked reason. +/// +[RegisterComponent, NetworkedComponent, Access(typeof(SharedCriminalRecordsHackerSystem))] +public sealed partial class CriminalRecordsHackerComponent : Component +{ + /// + /// How long the doafter is for hacking it. + /// + public TimeSpan Delay = TimeSpan.FromSeconds(20); + + /// + /// Dataset of random reasons to use. + /// + [DataField] + public ProtoId Reasons = "CriminalRecordsWantedReasonPlaceholders"; + + /// + /// Announcement made after the console is hacked. + /// + [DataField] + public LocId Announcement = "ninja-criminal-records-hack-announcement"; +} diff --git a/Content.Shared/CriminalRecords/Systems/SharedCriminalRecordsHackerSystem.cs b/Content.Shared/CriminalRecords/Systems/SharedCriminalRecordsHackerSystem.cs new file mode 100644 index 0000000000..e8e8e524e2 --- /dev/null +++ b/Content.Shared/CriminalRecords/Systems/SharedCriminalRecordsHackerSystem.cs @@ -0,0 +1,48 @@ +using Content.Shared.CriminalRecords.Components; +using Content.Shared.DoAfter; +using Content.Shared.Interaction; +using Content.Shared.Ninja.Systems; +using Robust.Shared.Serialization; + +namespace Content.Shared.CriminalRecords.Systems; + +public abstract class SharedCriminalRecordsHackerSystem : EntitySystem +{ + [Dependency] private readonly SharedDoAfterSystem _doAfter = default!; + [Dependency] private readonly SharedNinjaGlovesSystem _gloves = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnBeforeInteractHand); + } + + private void OnBeforeInteractHand(Entity ent, ref BeforeInteractHandEvent args) + { + // TODO: generic event + if (args.Handled || !_gloves.AbilityCheck(ent, args, out var target)) + return; + + if (!HasComp(target)) + return; + + var doAfterArgs = new DoAfterArgs(EntityManager, ent, ent.Comp.Delay, new CriminalRecordsHackDoAfterEvent(), target: target, used: ent, eventTarget: ent) + { + BreakOnDamage = true, + BreakOnUserMove = true, + MovementThreshold = 0.5f + }; + + _doAfter.TryStartDoAfter(doAfterArgs); + args.Handled = true; + } +} + +/// +/// Raised on the user when the doafter completes. +/// +[Serializable, NetSerializable] +public sealed partial class CriminalRecordsHackDoAfterEvent : SimpleDoAfterEvent +{ +} diff --git a/Content.Shared/Mind/SharedMindSystem.cs b/Content.Shared/Mind/SharedMindSystem.cs index 1898126d80..7887b8f9b2 100644 --- a/Content.Shared/Mind/SharedMindSystem.cs +++ b/Content.Shared/Mind/SharedMindSystem.cs @@ -383,6 +383,30 @@ public abstract class SharedMindSystem : EntitySystem return false; } + /// + /// Tries to find an objective that has the same prototype as the argument. + /// + /// + /// Will not work for objectives that have no prototype, or duplicate objectives with the same prototype. + /// + public bool TryFindObjective(Entity mind, string prototype, [NotNullWhen(true)] out EntityUid? objective) + { + objective = null; + if (!Resolve(mind, ref mind.Comp)) + return false; + + foreach (var uid in mind.Comp.Objectives) + { + if (MetaData(uid).EntityPrototype?.ID == prototype) + { + objective = uid; + return true; + } + } + + return false; + } + public bool TryGetSession(EntityUid? mindId, [NotNullWhen(true)] out ICommonSession? session) { session = null; diff --git a/Content.Shared/Ninja/Components/SpaceNinjaComponent.cs b/Content.Shared/Ninja/Components/SpaceNinjaComponent.cs index dff4b56aa4..0f3bff265c 100644 --- a/Content.Shared/Ninja/Components/SpaceNinjaComponent.cs +++ b/Content.Shared/Ninja/Components/SpaceNinjaComponent.cs @@ -1,6 +1,6 @@ using Content.Shared.Ninja.Systems; using Robust.Shared.GameStates; -using Robust.Shared.Serialization; +using Robust.Shared.Prototypes; namespace Content.Shared.Ninja.Components; @@ -35,4 +35,22 @@ public sealed partial class SpaceNinjaComponent : Component /// [DataField("katana"), AutoNetworkedField] public EntityUid? Katana; + + /// + /// Objective to complete after calling in a threat. + /// + [DataField] + public EntProtoId TerrorObjective = "TerrorObjective"; + + /// + /// Objective to complete after setting everyone to arrest. + /// + [DataField] + public EntProtoId MassArrestObjective = "MassArrestObjective"; + + /// + /// Objective to complete after the spider charge detonates. + /// + [DataField] + public EntProtoId SpiderChargeObjective = "SpiderChargeObjective"; } diff --git a/Content.Shared/Ninja/Systems/SharedNinjaGlovesSystem.cs b/Content.Shared/Ninja/Systems/SharedNinjaGlovesSystem.cs index 815464bf7a..f61d0c6a90 100644 --- a/Content.Shared/Ninja/Systems/SharedNinjaGlovesSystem.cs +++ b/Content.Shared/Ninja/Systems/SharedNinjaGlovesSystem.cs @@ -1,6 +1,7 @@ using Content.Shared.Actions; using Content.Shared.CombatMode; using Content.Shared.Communications; +using Content.Shared.CriminalRecords.Components; using Content.Shared.Examine; using Content.Shared.Hands.Components; using Content.Shared.Interaction; @@ -62,6 +63,7 @@ public abstract class SharedNinjaGlovesSystem : EntitySystem RemComp(user); RemComp(user); RemComp(user); + RemComp(user); } /// diff --git a/Resources/Locale/en-US/ninja/ninja-actions.ftl b/Resources/Locale/en-US/ninja/ninja-actions.ftl index b42da33a29..f01f02a60e 100644 --- a/Resources/Locale/en-US/ninja/ninja-actions.ftl +++ b/Resources/Locale/en-US/ninja/ninja-actions.ftl @@ -4,3 +4,5 @@ ninja-suit-cooldown = The suit needs time to recuperate from the last attack. ninja-research-steal-fail = No new research nodes were stolen... ninja-research-steal-success = Stole {$count} new nodes from {THE($server)}. + +ninja-criminal-records-hack-announcement = ERROR: Criminal records has detected a [REDACTED] error #*;" diff --git a/Resources/Prototypes/Datasets/criminal_records.yml b/Resources/Prototypes/Datasets/criminal_records.yml index ee28309184..fe21757cd2 100644 --- a/Resources/Prototypes/Datasets/criminal_records.yml +++ b/Resources/Prototypes/Datasets/criminal_records.yml @@ -2,17 +2,23 @@ - type: dataset id: CriminalRecordsWantedReasonPlaceholders values: + - Ate a delicious valid salad - Ate their own shoes - Being a clown - Being a mime - Breathed the wrong way - Broke into evac - Did literally nothing + - Did their job - Didn't say hello to me - Drank one too many + - Had two toolboxes, that's too many - Lied on common radio - Looked at me funny + - Lubed up the entire way to evac + - Set AME up on time - Slipped the HoS - Stole the clown's mask - Told an unfunny joke - Wore a gasmask + - Wore boxing gloves diff --git a/Resources/Prototypes/GameRules/midround.yml b/Resources/Prototypes/GameRules/midround.yml index c417132992..5a4cde3101 100644 --- a/Resources/Prototypes/GameRules/midround.yml +++ b/Resources/Prototypes/GameRules/midround.yml @@ -12,6 +12,7 @@ - DoorjackObjective - SpiderChargeObjective - TerrorObjective + - MassArrestObjective - NinjaSurviveObjective - type: NinjaRule threats: NinjaThreats diff --git a/Resources/Prototypes/Objectives/base_objectives.yml b/Resources/Prototypes/Objectives/base_objectives.yml index e24b26e6e8..2ab5149213 100644 --- a/Resources/Prototypes/Objectives/base_objectives.yml +++ b/Resources/Prototypes/Objectives/base_objectives.yml @@ -103,3 +103,11 @@ id: BaseSurviveObjective components: - type: SurviveCondition + +# objective progress is controlled by a system and not the objective itself +- type: entity + abstract: true + parent: BaseObjective + id: BaseCodeObjective + components: + - type: CodeCondition diff --git a/Resources/Prototypes/Objectives/ninja.yml b/Resources/Prototypes/Objectives/ninja.yml index f2ac97be58..0203059c2c 100644 --- a/Resources/Prototypes/Objectives/ninja.yml +++ b/Resources/Prototypes/Objectives/ninja.yml @@ -46,7 +46,7 @@ - type: entity noSpawn: true - parent: BaseNinjaObjective + parent: [BaseNinjaObjective, BaseCodeObjective] id: SpiderChargeObjective description: This bomb can be detonated in a specific location. Note that the bomb will not work anywhere else! components: @@ -54,7 +54,6 @@ icon: sprite: Objects/Weapons/Bombs/spidercharge.rsi state: icon - - type: SpiderChargeCondition - type: entity noSpawn: true @@ -70,7 +69,7 @@ - type: entity noSpawn: true - parent: BaseNinjaObjective + parent: [BaseNinjaObjective, BaseCodeObjective] id: TerrorObjective name: Call in a threat description: Use your gloves on a communication console in order to bring another threat to the station. @@ -79,4 +78,15 @@ icon: sprite: Objects/Fun/Instruments/otherinstruments.rsi state: red_phone - - type: TerrorCondition + +- type: entity + noSpawn: true + parent: [BaseNinjaObjective, BaseCodeObjective] + id: MassArrestObjective + name: Set everyone to wanted + description: Use your gloves to hack a criminal records console, setting the entire station to be wanted! + components: + - type: Objective + icon: + sprite: Objects/Weapons/Melee/stunbaton.rsi + state: stunbaton_on From b33730db22cd6d505a79e0b7fa39c34425d9639e Mon Sep 17 00:00:00 2001 From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Thu, 9 May 2024 06:36:07 +0000 Subject: [PATCH 020/111] malf killer 9000 (robotics console) (#24855) * create devicenet frequencies * create borg transponder and give it to all nt borgs * add robotics console * actually implement battery charge display + some fix * tab * real explosion * little safer * disable destroy button clientside too when on cooldown * m * how do i do this when i review things... Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * webedit ops Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * ui updates * oracle java * do a thing * update ui when a borg times out * maybe fix test * add IsLocked to LockSystem * make destroying gib the chassis again, so emagging isnt sus * use locking * require using alt click to unlock so normal click is open ui * the * use LogType.Action * take this L * pocket lint? * sharer * pro ops * robor pushmarkup * m * update and make it not use prototype anymore * frame0 * update yaml * untroll * bad * h --------- Co-authored-by: deltanedas <@deltanedas:kde.org> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> --- .../Robotics/Systems/RoboticsConsoleSystem.cs | 7 + .../UI/RoboticsConsoleBoundUserInterface.cs | 50 ++++++ .../Robotics/UI/RoboticsConsoleWindow.xaml | 40 +++++ .../Robotics/UI/RoboticsConsoleWindow.xaml.cs | 148 ++++++++++++++++++ .../Robotics/Systems/RoboticsConsoleSystem.cs | 146 +++++++++++++++++ .../Silicons/Borgs/BorgSystem.Transponder.cs | 107 +++++++++++++ Content.Server/Silicons/Borgs/BorgSystem.cs | 7 + Content.Shared/Lock/LockComponent.cs | 8 +- Content.Shared/Lock/LockSystem.cs | 16 +- .../Components/RoboticsConsoleComponent.cs | 53 +++++++ Content.Shared/Robotics/RoboticsConsoleUi.cs | 126 +++++++++++++++ .../Systems/SharedRoboticsConsoleSystem.cs | 8 + .../Components/BorgTransponderComponent.cs | 43 +++++ Resources/Locale/en-US/borg/borg.ftl | 5 + .../Locale/en-US/devices/device-network.ftl | 2 + .../research/components/robotics-console.ftl | 19 +++ .../Device/devicenet_frequencies.yml | 11 ++ .../Mobs/Cyborgs/base_borg_chassis.yml | 19 ++- .../Entities/Mobs/Cyborgs/borg_chassis.yml | 30 ++++ .../Devices/Circuitboards/computer.yml | 11 ++ .../Machines/Computers/computers.yml | 39 +++++ 21 files changed, 891 insertions(+), 4 deletions(-) create mode 100644 Content.Client/Robotics/Systems/RoboticsConsoleSystem.cs create mode 100644 Content.Client/Robotics/UI/RoboticsConsoleBoundUserInterface.cs create mode 100644 Content.Client/Robotics/UI/RoboticsConsoleWindow.xaml create mode 100644 Content.Client/Robotics/UI/RoboticsConsoleWindow.xaml.cs create mode 100644 Content.Server/Robotics/Systems/RoboticsConsoleSystem.cs create mode 100644 Content.Server/Silicons/Borgs/BorgSystem.Transponder.cs create mode 100644 Content.Shared/Robotics/Components/RoboticsConsoleComponent.cs create mode 100644 Content.Shared/Robotics/RoboticsConsoleUi.cs create mode 100644 Content.Shared/Robotics/Systems/SharedRoboticsConsoleSystem.cs create mode 100644 Content.Shared/Silicons/Borgs/Components/BorgTransponderComponent.cs create mode 100644 Resources/Locale/en-US/research/components/robotics-console.ftl diff --git a/Content.Client/Robotics/Systems/RoboticsConsoleSystem.cs b/Content.Client/Robotics/Systems/RoboticsConsoleSystem.cs new file mode 100644 index 0000000000..0219c965cd --- /dev/null +++ b/Content.Client/Robotics/Systems/RoboticsConsoleSystem.cs @@ -0,0 +1,7 @@ +using Content.Shared.Robotics.Systems; + +namespace Content.Client.Robotics.Systems; + +public sealed class RoboticsConsoleSystem : SharedRoboticsConsoleSystem +{ +} diff --git a/Content.Client/Robotics/UI/RoboticsConsoleBoundUserInterface.cs b/Content.Client/Robotics/UI/RoboticsConsoleBoundUserInterface.cs new file mode 100644 index 0000000000..6185979eee --- /dev/null +++ b/Content.Client/Robotics/UI/RoboticsConsoleBoundUserInterface.cs @@ -0,0 +1,50 @@ +using Content.Shared.Robotics; +using Robust.Client.GameObjects; + +namespace Content.Client.Robotics.UI; + +public sealed class RoboticsConsoleBoundUserInterface : BoundUserInterface +{ + [ViewVariables] + public RoboticsConsoleWindow _window = default!; + + public RoboticsConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) + { + } + + protected override void Open() + { + base.Open(); + + _window = new RoboticsConsoleWindow(Owner); + _window.OnDisablePressed += address => + { + SendMessage(new RoboticsConsoleDisableMessage(address)); + }; + _window.OnDestroyPressed += address => + { + SendMessage(new RoboticsConsoleDestroyMessage(address)); + }; + _window.OnClose += Close; + + _window.OpenCentered(); + } + + protected override void UpdateState(BoundUserInterfaceState state) + { + base.UpdateState(state); + + if (state is not RoboticsConsoleState cast) + return; + + _window?.UpdateState(cast); + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + + if (disposing) + _window?.Dispose(); + } +} diff --git a/Content.Client/Robotics/UI/RoboticsConsoleWindow.xaml b/Content.Client/Robotics/UI/RoboticsConsoleWindow.xaml new file mode 100644 index 0000000000..a3b3978790 --- /dev/null +++ b/Content.Client/Robotics/UI/RoboticsConsoleWindow.xaml @@ -0,0 +1,40 @@ + + + + + + + + + + /// - public HumanoidCharacterProfile() : this( - "John Doe", - "", - SharedHumanoidAppearanceSystem.DefaultSpecies, - 18, - Sex.Male, - Gender.Male, - new HumanoidCharacterAppearance(), - SpawnPriorityPreference.None, - new Dictionary - { - {SharedGameTicker.FallbackOverflowJob, JobPriority.High} - }, - PreferenceUnavailableMode.SpawnAsOverflow, - new List(), - new List(), - new Dictionary()) + public HumanoidCharacterProfile() { } @@ -140,23 +189,10 @@ namespace Content.Shared.Preferences /// Humanoid character profile with default settings. public static HumanoidCharacterProfile DefaultWithSpecies(string species = SharedHumanoidAppearanceSystem.DefaultSpecies) { - return new( - "John Doe", - "", - species, - 18, - Sex.Male, - Gender.Male, - HumanoidCharacterAppearance.DefaultWithSpecies(species), - SpawnPriorityPreference.None, - new Dictionary - { - {SharedGameTicker.FallbackOverflowJob, JobPriority.High} - }, - PreferenceUnavailableMode.SpawnAsOverflow, - new List(), - new List(), - new Dictionary()); + return new() + { + Species = species, + }; } // TODO: This should eventually not be a visual change only. @@ -201,36 +237,17 @@ namespace Content.Shared.Preferences var name = GetName(species, gender); - return new HumanoidCharacterProfile(name, "", species, age, sex, gender, HumanoidCharacterAppearance.Random(species, sex), SpawnPriorityPreference.None, - new Dictionary - { - {SharedGameTicker.FallbackOverflowJob, JobPriority.High}, - }, PreferenceUnavailableMode.StayInLobby, new List(), new List(), new Dictionary()); + return new HumanoidCharacterProfile() + { + Name = name, + Sex = sex, + Age = age, + Gender = gender, + Species = species, + Appearance = HumanoidCharacterAppearance.Random(species, sex), + }; } - public string Name { get; private set; } - public string FlavorText { get; private set; } - public string Species { get; private set; } - - [DataField("age")] - public int Age { get; private set; } - - [DataField("sex")] - public Sex Sex { get; private set; } - - [DataField("gender")] - public Gender Gender { get; private set; } - - public ICharacterAppearance CharacterAppearance => Appearance; - - [DataField("appearance")] - public HumanoidCharacterAppearance Appearance { get; private set; } - public SpawnPriorityPreference SpawnPriority { get; private set; } - public IReadOnlyDictionary JobPriorities => _jobPriorities; - public IReadOnlyList AntagPreferences => _antagPreferences; - public IReadOnlyList TraitPreferences => _traitPreferences; - public PreferenceUnavailableMode PreferenceUnavailable { get; private set; } - public HumanoidCharacterProfile WithName(string name) { return new(this) { Name = name }; @@ -274,7 +291,10 @@ namespace Content.Shared.Preferences public HumanoidCharacterProfile WithJobPriorities(IEnumerable> jobPriorities) { - return new(this, new Dictionary(jobPriorities), _antagPreferences, _traitPreferences, _loadouts); + return new(this) + { + _jobPriorities = new Dictionary(jobPriorities), + }; } public HumanoidCharacterProfile WithJobPriority(string jobId, JobPriority priority) @@ -288,7 +308,11 @@ namespace Content.Shared.Preferences { dictionary[jobId] = priority; } - return new(this, dictionary, _antagPreferences, _traitPreferences, _loadouts); + + return new(this) + { + _jobPriorities = dictionary, + }; } public HumanoidCharacterProfile WithPreferenceUnavailable(PreferenceUnavailableMode mode) @@ -298,50 +322,47 @@ namespace Content.Shared.Preferences public HumanoidCharacterProfile WithAntagPreferences(IEnumerable antagPreferences) { - return new(this, _jobPriorities, new List(antagPreferences), _traitPreferences, _loadouts); + return new(this) + { + _antagPreferences = new HashSet(antagPreferences), + }; } public HumanoidCharacterProfile WithAntagPreference(string antagId, bool pref) { - var list = new List(_antagPreferences); + var list = new HashSet(_antagPreferences); if (pref) { - if (!list.Contains(antagId)) - { - list.Add(antagId); - } + list.Add(antagId); } else { - if (list.Contains(antagId)) - { - list.Remove(antagId); - } + list.Remove(antagId); } - return new(this, _jobPriorities, list, _traitPreferences, _loadouts); + return new(this) + { + _antagPreferences = list, + }; } public HumanoidCharacterProfile WithTraitPreference(string traitId, bool pref) { - var list = new List(_traitPreferences); + var list = new HashSet(_traitPreferences); - // TODO: Maybe just refactor this to HashSet? Same with _antagPreferences if (pref) { - if (!list.Contains(traitId)) - { - list.Add(traitId); - } + list.Add(traitId); } else { - if (list.Contains(traitId)) - { - list.Remove(traitId); - } + list.Remove(traitId); } - return new(this, _jobPriorities, _antagPreferences, list, _loadouts); + + return new(this) + { + _traitPreferences = list, + }; } public string Summary => @@ -498,10 +519,10 @@ namespace Content.Shared.Preferences PreferenceUnavailable = prefsUnavailableMode; _antagPreferences.Clear(); - _antagPreferences.AddRange(antags); + _antagPreferences.UnionWith(antags); _traitPreferences.Clear(); - _traitPreferences.AddRange(traits); + _traitPreferences.UnionWith(traits); // Checks prototypes exist for all loadouts and dump / set to default if not. var toRemove = new ValueList(); @@ -514,7 +535,7 @@ namespace Content.Shared.Preferences continue; } - loadouts.EnsureValid(session, collection); + loadouts.EnsureValid(this, session, collection); } foreach (var value in toRemove) @@ -540,27 +561,26 @@ namespace Content.Shared.Preferences public override bool Equals(object? obj) { - return obj is HumanoidCharacterProfile other && MemberwiseEquals(other); + return ReferenceEquals(this, obj) || obj is HumanoidCharacterProfile other && Equals(other); } public override int GetHashCode() { - return HashCode.Combine( - HashCode.Combine( - Name, - Species, - Age, - Sex, - Gender, - Appearance - ), - SpawnPriority, - PreferenceUnavailable, - _jobPriorities, - _antagPreferences, - _traitPreferences, - _loadouts - ); + var hashCode = new HashCode(); + hashCode.Add(_jobPriorities); + hashCode.Add(_antagPreferences); + hashCode.Add(_traitPreferences); + hashCode.Add(_loadouts); + hashCode.Add(Name); + hashCode.Add(FlavorText); + hashCode.Add(Species); + hashCode.Add(Age); + hashCode.Add((int)Sex); + hashCode.Add((int)Gender); + hashCode.Add(Appearance); + hashCode.Add((int)SpawnPriority); + hashCode.Add((int)PreferenceUnavailable); + return hashCode.ToHashCode(); } public void SetLoadout(RoleLoadout loadout) @@ -582,10 +602,12 @@ namespace Content.Shared.Preferences } copied[loadout.Role] = loadout.Clone(); - return new(this, _jobPriorities, _antagPreferences, _traitPreferences, copied); + var profile = Clone(); + profile._loadouts = copied; + return profile; } - public RoleLoadout GetLoadoutOrDefault(string id, IEntityManager entManager, IPrototypeManager protoManager) + public RoleLoadout GetLoadoutOrDefault(string id, ProtoId? species, IEntityManager entManager, IPrototypeManager protoManager) { if (!_loadouts.TryGetValue(id, out var loadout)) { @@ -596,5 +618,10 @@ namespace Content.Shared.Preferences loadout.SetDefault(protoManager); return loadout; } + + public HumanoidCharacterProfile Clone() + { + return new HumanoidCharacterProfile(this); + } } } diff --git a/Content.Shared/Preferences/Loadouts/Effects/GroupLoadoutEffect.cs b/Content.Shared/Preferences/Loadouts/Effects/GroupLoadoutEffect.cs index 5a2cd87cc1..1be75f7dbc 100644 --- a/Content.Shared/Preferences/Loadouts/Effects/GroupLoadoutEffect.cs +++ b/Content.Shared/Preferences/Loadouts/Effects/GroupLoadoutEffect.cs @@ -13,13 +13,13 @@ public sealed partial class GroupLoadoutEffect : LoadoutEffect [DataField(required: true)] public ProtoId Proto; - public override bool Validate(RoleLoadout loadout, ICommonSession session, IDependencyCollection collection, [NotNullWhen(false)] out FormattedMessage? reason) + public override bool Validate(HumanoidCharacterProfile profile, RoleLoadout loadout, ICommonSession session, IDependencyCollection collection, [NotNullWhen(false)] out FormattedMessage? reason) { var effectsProto = collection.Resolve().Index(Proto); foreach (var effect in effectsProto.Effects) { - if (!effect.Validate(loadout, session, collection, out reason)) + if (!effect.Validate(profile, loadout, session, collection, out reason)) return false; } diff --git a/Content.Shared/Preferences/Loadouts/Effects/JobRequirementLoadoutEffect.cs b/Content.Shared/Preferences/Loadouts/Effects/JobRequirementLoadoutEffect.cs index 4a750a5578..54576d3a53 100644 --- a/Content.Shared/Preferences/Loadouts/Effects/JobRequirementLoadoutEffect.cs +++ b/Content.Shared/Preferences/Loadouts/Effects/JobRequirementLoadoutEffect.cs @@ -15,7 +15,7 @@ public sealed partial class JobRequirementLoadoutEffect : LoadoutEffect [DataField(required: true)] public JobRequirement Requirement = default!; - public override bool Validate(RoleLoadout loadout, ICommonSession session, IDependencyCollection collection, [NotNullWhen(false)] out FormattedMessage? reason) + public override bool Validate(HumanoidCharacterProfile profile, RoleLoadout loadout, ICommonSession session, IDependencyCollection collection, [NotNullWhen(false)] out FormattedMessage? reason) { var manager = collection.Resolve(); var playtimes = manager.GetPlayTimes(session); diff --git a/Content.Shared/Preferences/Loadouts/Effects/LoadoutEffect.cs b/Content.Shared/Preferences/Loadouts/Effects/LoadoutEffect.cs index 65694d52a1..f35b14e2e0 100644 --- a/Content.Shared/Preferences/Loadouts/Effects/LoadoutEffect.cs +++ b/Content.Shared/Preferences/Loadouts/Effects/LoadoutEffect.cs @@ -11,6 +11,7 @@ public abstract partial class LoadoutEffect /// Tries to validate the effect. /// public abstract bool Validate( + HumanoidCharacterProfile profile, RoleLoadout loadout, ICommonSession session, IDependencyCollection collection, diff --git a/Content.Shared/Preferences/Loadouts/Effects/PointsCostLoadoutEffect.cs b/Content.Shared/Preferences/Loadouts/Effects/PointsCostLoadoutEffect.cs index 3146ff6163..842b4cfc03 100644 --- a/Content.Shared/Preferences/Loadouts/Effects/PointsCostLoadoutEffect.cs +++ b/Content.Shared/Preferences/Loadouts/Effects/PointsCostLoadoutEffect.cs @@ -11,6 +11,7 @@ public sealed partial class PointsCostLoadoutEffect : LoadoutEffect public int Cost = 1; public override bool Validate( + HumanoidCharacterProfile profile, RoleLoadout loadout, ICommonSession session, IDependencyCollection collection, diff --git a/Content.Shared/Preferences/Loadouts/Effects/SpeciesLoadoutEffect.cs b/Content.Shared/Preferences/Loadouts/Effects/SpeciesLoadoutEffect.cs index 74673cbef3..8f886dd2ab 100644 --- a/Content.Shared/Preferences/Loadouts/Effects/SpeciesLoadoutEffect.cs +++ b/Content.Shared/Preferences/Loadouts/Effects/SpeciesLoadoutEffect.cs @@ -1,6 +1,26 @@ +using System.Diagnostics.CodeAnalysis; +using Content.Shared.Humanoid.Prototypes; +using Robust.Shared.Player; +using Robust.Shared.Prototypes; +using Robust.Shared.Utility; + namespace Content.Shared.Preferences.Loadouts.Effects; -public sealed class SpeciesLoadoutEffect +public sealed partial class SpeciesLoadoutEffect : LoadoutEffect { - + [DataField(required: true)] + public List> Species = new(); + + public override bool Validate(HumanoidCharacterProfile profile, RoleLoadout loadout, ICommonSession session, IDependencyCollection collection, + [NotNullWhen(false)] out FormattedMessage? reason) + { + if (Species.Contains(profile.Species)) + { + reason = null; + return true; + } + + reason = FormattedMessage.FromUnformatted(Loc.GetString("loadout-group-species-restriction")); + return false; + } } diff --git a/Content.Shared/Preferences/Loadouts/Loadout.cs b/Content.Shared/Preferences/Loadouts/Loadout.cs index 6a4373b621..dbe440f58b 100644 --- a/Content.Shared/Preferences/Loadouts/Loadout.cs +++ b/Content.Shared/Preferences/Loadouts/Loadout.cs @@ -6,8 +6,9 @@ namespace Content.Shared.Preferences.Loadouts; /// /// Specifies the selected prototype and custom data for a loadout. /// -[Serializable, NetSerializable] -public sealed class Loadout +[Serializable, NetSerializable, DataDefinition] +public sealed partial class Loadout { + [DataField] public ProtoId Prototype; } diff --git a/Content.Shared/Preferences/Loadouts/RoleLoadout.cs b/Content.Shared/Preferences/Loadouts/RoleLoadout.cs index e1c6f8395d..40e13f0edf 100644 --- a/Content.Shared/Preferences/Loadouts/RoleLoadout.cs +++ b/Content.Shared/Preferences/Loadouts/RoleLoadout.cs @@ -1,4 +1,6 @@ using System.Diagnostics.CodeAnalysis; +using System.Linq; +using Content.Shared.Humanoid.Prototypes; using Content.Shared.Random; using Robust.Shared.Collections; using Robust.Shared.Player; @@ -11,11 +13,13 @@ namespace Content.Shared.Preferences.Loadouts; /// /// Contains all of the selected data for a role's loadout. /// -[Serializable, NetSerializable] -public sealed class RoleLoadout +[Serializable, NetSerializable, DataDefinition] +public sealed partial class RoleLoadout : IEquatable { - public readonly ProtoId Role; + [DataField] + public ProtoId Role; + [DataField] public Dictionary, List> SelectedLoadouts = new(); /* @@ -44,7 +48,7 @@ public sealed class RoleLoadout /// /// Ensures all prototypes exist and effects can be applied. /// - public void EnsureValid(ICommonSession session, IDependencyCollection collection) + public void EnsureValid(HumanoidCharacterProfile profile, ICommonSession session, IDependencyCollection collection) { var groupRemove = new ValueList(); var protoManager = collection.Resolve(); @@ -81,7 +85,7 @@ public sealed class RoleLoadout } // Validate the loadout can be applied (e.g. points). - if (!IsValid(session, loadout.Prototype, collection, out _)) + if (!IsValid(profile, session, loadout.Prototype, collection, out _)) { loadouts.RemoveAt(i); continue; @@ -167,7 +171,7 @@ public sealed class RoleLoadout /// /// Returns whether a loadout is valid or not. /// - public bool IsValid(ICommonSession session, ProtoId loadout, IDependencyCollection collection, [NotNullWhen(false)] out FormattedMessage? reason) + public bool IsValid(HumanoidCharacterProfile profile, ICommonSession session, ProtoId loadout, IDependencyCollection collection, [NotNullWhen(false)] out FormattedMessage? reason) { reason = null; @@ -180,7 +184,7 @@ public sealed class RoleLoadout return false; } - if (!protoManager.TryIndex(Role, out var roleProto)) + if (!protoManager.HasIndex(Role)) { reason = FormattedMessage.FromUnformatted("loadouts-prototype-missing"); return false; @@ -190,7 +194,7 @@ public sealed class RoleLoadout foreach (var effect in loadoutProto.Effects) { - valid = valid && effect.Validate(this, session, collection, out reason); + valid = valid && effect.Validate(profile, this, session, collection, out reason); } return valid; @@ -257,4 +261,21 @@ public sealed class RoleLoadout return false; } + + public bool Equals(RoleLoadout? other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return Role.Equals(other.Role) && SelectedLoadouts.SequenceEqual(other.SelectedLoadouts) && Points == other.Points; + } + + public override bool Equals(object? obj) + { + return ReferenceEquals(this, obj) || obj is RoleLoadout other && Equals(other); + } + + public override int GetHashCode() + { + return HashCode.Combine(Role, SelectedLoadouts, Points); + } } diff --git a/Resources/Locale/en-US/preferences/ui/character-setup-gui.ftl b/Resources/Locale/en-US/preferences/ui/character-setup-gui.ftl index bd80815e23..b85d7be38e 100644 --- a/Resources/Locale/en-US/preferences/ui/character-setup-gui.ftl +++ b/Resources/Locale/en-US/preferences/ui/character-setup-gui.ftl @@ -1,7 +1,6 @@ character-setup-gui-character-setup-label = Character setup character-setup-gui-character-setup-stats-button = Stats character-setup-gui-character-setup-rules-button = Rules -character-setup-gui-character-setup-save-button = Save character-setup-gui-character-setup-close-button = Close character-setup-gui-create-new-character-button = Create new slot... character-setup-gui-create-new-character-button-tooltip = A maximum of {$maxCharacters} characters are allowed. diff --git a/Resources/Locale/en-US/preferences/ui/humanoid-profile-editor.ftl b/Resources/Locale/en-US/preferences/ui/humanoid-profile-editor.ftl index 139d222f79..c7a24d5405 100644 --- a/Resources/Locale/en-US/preferences/ui/humanoid-profile-editor.ftl +++ b/Resources/Locale/en-US/preferences/ui/humanoid-profile-editor.ftl @@ -19,6 +19,7 @@ humanoid-profile-editor-pronouns-neuter-text = It / It humanoid-profile-editor-import-button = Import humanoid-profile-editor-export-button = Export humanoid-profile-editor-save-button = Save +humanoid-profile-editor-reset-button = Reset humanoid-profile-editor-spawn-priority-label = Spawn priority: humanoid-profile-editor-eyes-label = Eye color: humanoid-profile-editor-jobs-tab = Jobs diff --git a/Resources/Prototypes/Species/vox.yml b/Resources/Prototypes/Species/vox.yml index 53ac4258bc..e3fdb2bf08 100644 --- a/Resources/Prototypes/Species/vox.yml +++ b/Resources/Prototypes/Species/vox.yml @@ -1,7 +1,7 @@ - type: species id: Vox name: species-name-vox - roundStart: false # sad... + roundStart: false # sad prototype: MobVox sprites: MobVoxSprites markingLimits: MobVoxMarkingLimits From b7c447f1c57910a9408f21c414a5f71f36c95971 Mon Sep 17 00:00:00 2001 From: PJBot Date: Sat, 11 May 2024 23:19:28 +0000 Subject: [PATCH 092/111] Automatic changelog update --- Resources/Changelog/Changelog.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index ae8a6fe600..c5e4d32fa2 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,11 +1,4 @@ Entries: -- author: metalgearsloth - changes: - - message: Fix expedition FTL. - type: Fix - id: 6086 - time: '2024-03-04T06:24:24.0000000+00:00' - url: https://github.com/space-wizards/space-station-14/pull/25823 - author: Nairodian changes: - message: Welding masks can now be made in the Autolathe. @@ -3864,3 +3857,16 @@ id: 6585 time: '2024-05-11T15:42:11.0000000+00:00' url: https://github.com/space-wizards/space-station-14/pull/27905 +- author: metalgearsloth + changes: + - message: Add a reset button to character setup. + type: Add + - message: Actually get the import / export character buttons working. + type: Add + - message: Fix performance drop in the eye color picker. + type: Fix + - message: Fix instances where role timers don't load properly in character setup. + type: Fix + id: 6586 + time: '2024-05-11T23:18:21.0000000+00:00' + url: https://github.com/space-wizards/space-station-14/pull/27576 From 829e12d26323a55d94639a213299d65ca716fa9d Mon Sep 17 00:00:00 2001 From: Ghagliiarghii <68826635+Ghagliiarghii@users.noreply.github.com> Date: Sat, 11 May 2024 21:18:17 -0400 Subject: [PATCH 093/111] Embed a few more Cryogenics chems in Guidebook (#27935) --- Resources/ServerInfo/Guidebook/Medical/Cryogenics.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Resources/ServerInfo/Guidebook/Medical/Cryogenics.xml b/Resources/ServerInfo/Guidebook/Medical/Cryogenics.xml index f70f43c8a8..1b3961f4f7 100644 --- a/Resources/ServerInfo/Guidebook/Medical/Cryogenics.xml +++ b/Resources/ServerInfo/Guidebook/Medical/Cryogenics.xml @@ -43,8 +43,12 @@ Once things have been set up, you're going to require a specific medication, Cry The standard pressure for a gas pump is 100.325 kpa. Cryoxadone works at under 170K, but it is standard practice to set the freezer to 100K for faster freezing. + + + + From db2beafd5996aacfddda8ef5ab41cd7188b8a592 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 11 May 2024 21:23:48 -0400 Subject: [PATCH 094/111] Update Credits (#27938) Co-authored-by: PJBot --- Resources/Credits/GitHub.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Credits/GitHub.txt b/Resources/Credits/GitHub.txt index 00d89d6d0d..5344b6a2db 100644 --- a/Resources/Credits/GitHub.txt +++ b/Resources/Credits/GitHub.txt @@ -1 +1 @@ -0x6273, 2013HORSEMEATSCANDAL, 20kdc, 21Melkuu, 4dplanner, 612git, 778b, Ablankmann, Acruid, actioninja, adamsong, Admiral-Obvious-001, Adrian16199, Aerocrux, Aexxie, Agoichi, Ahion, AJCM-git, AjexRose, Alekshhh, AlexMorgan3817, AlexUm418, AlmondFlour, AlphaQwerty, Altoids1, amylizzle, ancientpower, ArchPigeon, Arendian, arimah, Arteben, AruMoon, as334, AsikKEsel, asperger-sind, avghdev, AzzyIsNotHere, BananaFlambe, Baptr0b0t, BasedUser, beck-thompson, BellwetherLogic, BGare, BingoJohnson-zz, BismarckShuffle, Bixkitts, Blackern5000, Blazeror, Boaz1111, BobdaBiscuit, brainfood1183, Brandon-Huu, Bright0, brndd, BubblegumBlue, BYONDFuckery, c4llv07e, CakeQ, Callmore, CaptainSqrBeard, Carbonhell, casperr04, CatTheSystem, Centronias, chairbender, Charlese2, Cheackraze, cheesePizza2, Chief-Engineer, chromiumboy, Chronophylos, Ciac32, clement-or, Clyybber, Cojoke-dot, ColdAutumnRain, collinlunn, ComicIronic, coolmankid12345, corentt, crazybrain23, creadth, CrigCrag, Crotalus, CrudeWax, CrzyPotato, Cyberboss, d34d10cc, Daemon, daerSeebaer, dahnte, dakamakat, dakimasu, DamianX, DangerRevolution, daniel-cr, Darkenson, DawBla, dch-GH, Deahaka, DEATHB4DEFEAT, DeathCamel58, deathride58, DebugOk, Decappi, deepdarkdepths, deepy, Delete69, deltanedas, DerbyX, Doctor-Cpu, DoctorBeard, DogZeroX, dontbetank, Doru991, DoubleRiceEddiedd, DoutorWhite, DrMelon, DrSmugleaf, drteaspoon420, DTanxxx, DubiousDoggo, Duddino, DuskyJay, Dutch-VanDerLinde, Easypoller, eclips_e, EdenTheLiznerd, EEASAS, Efruit, ElectroSR, elthundercloud, Emisse, EmoGarbage404, Endecc, enumerate0, eoineoineoin, ERORR404V1, Errant-4, estacaoespacialpirata, exincore, exp111, Fahasor, FairlySadPanda, ficcialfaint, Fildrance, FillerVK, Fishfish458, Flareguy, FluffiestFloof, FluidRock, FoLoKe, fooberticus, Fortune117, freeman2651, Froffy025, Fromoriss, FungiFellow, GalacticChimp, gbasood, Geekyhobo, Genkail, Ghagliiarghii, Git-Nivrak, github-actions[bot], gituhabu, GNF54, Golinth, GoodWheatley, Gotimanga, graevy, GreyMario, gusxyz, Gyrandola, h3half, Hanzdegloker, Hardly3D, harikattar, Hebiman, Henry12116, HerCoyote23, hitomishirichan, Hmeister-real, HoofedEar, hord-brayden, hubismal, Hugal31, Huxellberger, Hyenh, iacore, IamVelcroboy, icekot8, igorsaux, ike709, Illiux, Ilya246, IlyaElDunaev, Injazz, Insineer, IntegerTempest, Interrobang01, IProduceWidgets, ItsMeThom, j-giebel, Jackal298, Jackrost, jamessimo, janekvap, Jark255, JerryImMouse, Jessetriesagain, jessicamaybe, Jezithyr, jicksaw, JiimBob, JoeHammad1844, joelhed, JohnGinnane, johnku1, joshepvodka, jproads, Jrpl, juliangiebel, JustArt1m, JustCone14, JustinTether, JustinTrotter, K-Dynamic, Kadeo64, KaiShibaa, kalane15, kalanosh, Keer-Sar, KEEYNy, Keikiru, Kelrak, kerisargit, keronshb, KIBORG04, Killerqu00, KingFroozy, kira-er, Kit0vras, KittenColony, Kmc2000, Ko4ergaPunk, komunre, koteq, KrasnoshchekovPavel, Krunklehorn, Kukutis96513, kxvvv, Lamrr, LankLTE, lapatison, Leander-0, LetterN, Level10Cybermancer, lever1209, LightVillet, liltenhead, LittleBuilderJane, Lomcastar, LordCarve, LordEclipse, luckyshotpictures, Lukasz825700516, lunarcomets, luringens, lvvova1, lzimann, lzk228, MACMAN2003, Macoron, MagnusCrowe, ManelNavola, Mangohydra, Matz05, MehimoNemo, MeltedPixel, MemeProof, Menshin, Mervill, metalgearsloth, mhamsterr, MilenVolf, Minty642, Mirino97, mirrorcult, MishaUnity, MisterMecky, Mith-randalf, Moneyl, Moomoobeef, moony, Morb0, Mr0maks, musicmanvr, Myakot, Myctai, N3X15, Nairodian, Naive817, namespace-Memory, NickPowers43, nikthechampiongr, Nimfar11, Nirnael, nmajask, nok-ko, Nopey, notafet, notquitehadouken, noudoit, noverd, nuke-haus, NULL882, OctoRocket, OldDanceJacket, onoira, osjarw, Owai-Seek, pali6, Pangogie, patrikturi, PaulRitter, Peptide90, peptron1, Phantom-Lily, pigeonpeas, pissdemon, PixelTheKermit, PJB3005, Plykiya, pofitlo, pointer-to-null, PolterTzi, PoorMansDreams, potato1234x, ProfanedBane, PrPleGoo, ps3moira, Psychpsyo, psykzz, PuroSlavKing, PursuitInAshes, quatre, QuietlyWhisper, qwerltaz, Radosvik, Radrark, Rainbeon, Rainfey, Rane, ravage123321, rbertoche, Redict, RedlineTriad, RednoWCirabrab, RemberBM, RemieRichards, RemTim, rene-descartes2021, RiceMar1244, RieBi, Rinkashikachi, Rockdtben, rolfero, rosieposieeee, Saakra, Samsterious, SaphireLattice, ScalyChimp, scrato, Scribbles0, Serkket, SethLafuente, ShadowCommander, Shadowtheprotogen546, shampunj, SignalWalker, Simyon264, Sirionaut, siyengar04, Skarletto, Skrauz, Skyedra, SlamBamActionman, slarticodefast, Slava0135, snebl, Snowni, snowsignal, SonicHDC, SoulFN, SoulSloth, SpaceManiac, SpeltIncorrectyl, SphiraI, spoogemonster, ssdaniel24, Stealthbomber16, StrawberryMoses, Subversionary, superjj18, SweptWasTaken, Szunti, takemysoult, TaralGit, Tayrtahn, tday93, TekuNut, TemporalOroboros, tentekal, Terraspark4941, tgrkzus, thatrandomcanadianguy, TheArturZh, theashtronaut, thedraccx, themias, Theomund, theOperand, TheShuEd, TimrodDX, Titian3, tkdrg, tmtmtl30, TokenStyle, tom-leys, tomasalves8, Tomeno, tosatur, TsjipTsjip, Tunguso4ka, TurboTrackerss14, Tyler-IN, Tyzemol, UbaserB, UBlueberry, UKNOWH, Uriende, UristMcDorf, Vaaankas, Varen, VasilisThePikachu, veliebm, Veritius, Vermidia, Verslebas, VigersRay, Visne, volundr-, Voomra, Vordenburg, vulppine, wafehling, waylon531, weaversam8, Willhelm53, wixoaGit, WlarusFromDaSpace, wrexbe, xRiriq, yathxyz, Ygg01, YotaXP, YuriyKiss, zach-hill, Zandario, Zap527, Zealith-Gamer, ZelteHonor, zerorulez, zionnBE, zlodo, ZNixian, ZoldorfTheWizard, Zumorica, Zymem +0x6273, 2013HORSEMEATSCANDAL, 20kdc, 21Melkuu, 4dplanner, 612git, 778b, Ablankmann, Acruid, actioninja, adamsong, Admiral-Obvious-001, Adrian16199, Aerocrux, Aexxie, Afrokada, Agoichi, Ahion, AJCM-git, AjexRose, Alekshhh, AlexMorgan3817, AlexUm418, AlmondFlour, AlphaQwerty, Altoids1, amylizzle, ancientpower, ArchPigeon, Arendian, arimah, Arteben, AruMoon, as334, AsikKEsel, asperger-sind, avghdev, AzzyIsNotHere, BananaFlambe, Baptr0b0t, BasedUser, beck-thompson, BellwetherLogic, BGare, BingoJohnson-zz, BismarckShuffle, Bixkitts, Blackern5000, Blazeror, Boaz1111, BobdaBiscuit, brainfood1183, Brandon-Huu, Bright0, brndd, BubblegumBlue, BYONDFuckery, c4llv07e, CakeQ, Callmore, CaptainSqrBeard, Carbonhell, casperr04, CatTheSystem, Centronias, chairbender, Charlese2, Cheackraze, cheesePizza2, Chief-Engineer, chromiumboy, Chronophylos, Ciac32, clement-or, Clyybber, Cojoke-dot, ColdAutumnRain, collinlunn, ComicIronic, coolmankid12345, corentt, crazybrain23, creadth, CrigCrag, Crotalus, CrudeWax, CrzyPotato, Cyberboss, d34d10cc, Daemon, daerSeebaer, dahnte, dakamakat, dakimasu, DamianX, DangerRevolution, daniel-cr, Darkenson, DawBla, dch-GH, Deahaka, DEATHB4DEFEAT, DeathCamel58, deathride58, DebugOk, Decappi, deepdarkdepths, deepy, Delete69, deltanedas, DerbyX, Doctor-Cpu, DoctorBeard, DogZeroX, dontbetank, Doru991, DoubleRiceEddiedd, DoutorWhite, DrMelon, DrSmugleaf, drteaspoon420, DTanxxx, DubiousDoggo, Duddino, DuskyJay, Dutch-VanDerLinde, Easypoller, eclips_e, EdenTheLiznerd, EEASAS, Efruit, ElectroSR, elthundercloud, Emisse, EmoGarbage404, Endecc, enumerate0, eoineoineoin, ERORR404V1, Errant-4, estacaoespacialpirata, exincore, exp111, Fahasor, FairlySadPanda, ficcialfaint, Fildrance, FillerVK, Fishfish458, Flareguy, FluffiestFloof, FluidRock, FoLoKe, fooberticus, Fortune117, freeman2651, Froffy025, Fromoriss, FungiFellow, GalacticChimp, gbasood, Geekyhobo, Genkail, Ghagliiarghii, Git-Nivrak, github-actions[bot], gituhabu, GNF54, Golinth, GoodWheatley, Gotimanga, graevy, GreyMario, gusxyz, Gyrandola, h3half, Hanzdegloker, Hardly3D, harikattar, Hebiman, Henry12116, HerCoyote23, hitomishirichan, Hmeister-real, HoofedEar, hord-brayden, hubismal, Hugal31, Huxellberger, Hyenh, iacore, IamVelcroboy, icekot8, igorsaux, ike709, Illiux, Ilya246, IlyaElDunaev, Injazz, Insineer, IntegerTempest, Interrobang01, IProduceWidgets, ItsMeThom, j-giebel, Jackal298, Jackrost, jamessimo, janekvap, Jark255, JerryImMouse, Jessetriesagain, jessicamaybe, Jezithyr, jicksaw, JiimBob, JoeHammad1844, joelhed, JohnGinnane, johnku1, joshepvodka, jproads, Jrpl, juliangiebel, JustArt1m, JustCone14, JustinTether, JustinTrotter, K-Dynamic, Kadeo64, KaiShibaa, kalane15, kalanosh, Keer-Sar, KEEYNy, Keikiru, Kelrak, kerisargit, keronshb, KIBORG04, Killerqu00, KingFroozy, kira-er, Kit0vras, KittenColony, Kmc2000, Ko4ergaPunk, komunre, koteq, Krunklehorn, Kukutis96513, kxvvv, Lamrr, LankLTE, lapatison, Leander-0, LetterN, Level10Cybermancer, lever1209, liltenhead, LittleBuilderJane, Lomcastar, LordCarve, LordEclipse, luckyshotpictures, Lukasz825700516, lunarcomets, luringens, lvvova1, lzimann, lzk228, MACMAN2003, Macoron, MagnusCrowe, ManelNavola, Mangohydra, Matz05, MehimoNemo, MeltedPixel, MemeProof, Menshin, Mervill, metalgearsloth, mhamsterr, MilenVolf, Minty642, Mirino97, mirrorcult, MishaUnity, MisterMecky, Mith-randalf, Moneyl, Moomoobeef, moony, Morb0, Mr0maks, musicmanvr, Myakot, Myctai, N3X15, Nairodian, Naive817, namespace-Memory, NickPowers43, nikthechampiongr, Nimfar11, Nirnael, nmajask, nok-ko, Nopey, notafet, notquitehadouken, noudoit, noverd, nuke-haus, NULL882, OctoRocket, OldDanceJacket, onoira, osjarw, Owai-Seek, pali6, Pangogie, patrikturi, PaulRitter, Peptide90, peptron1, Phantom-Lily, pigeonpeas, pissdemon, PixelTheKermit, PJB3005, Plykiya, pofitlo, pointer-to-null, PolterTzi, PoorMansDreams, potato1234x, ProfanedBane, PrPleGoo, ps3moira, Psychpsyo, psykzz, PuroSlavKing, PursuitInAshes, quatre, QuietlyWhisper, qwerltaz, Radosvik, Radrark, Rainbeon, Rainfey, Rane, ravage123321, rbertoche, Redict, RedlineTriad, RednoWCirabrab, RemberBM, RemieRichards, RemTim, rene-descartes2021, RiceMar1244, RieBi, Rinkashikachi, Rockdtben, rolfero, rosieposieeee, RumiTiger, Saakra, Samsterious, SaphireLattice, ScalyChimp, scrato, Scribbles0, Serkket, SethLafuente, ShadowCommander, Shadowtheprotogen546, shampunj, SignalWalker, Simyon264, Sirionaut, siyengar04, Skarletto, Skrauz, Skyedra, SlamBamActionman, slarticodefast, Slava0135, snebl, Snowni, snowsignal, SonicHDC, SoulFN, SoulSloth, SpaceManiac, SpeltIncorrectyl, SphiraI, spoogemonster, ssdaniel24, Stealthbomber16, StrawberryMoses, Subversionary, superjj18, SweptWasTaken, Szunti, takemysoult, TaralGit, Tayrtahn, tday93, TekuNut, TemporalOroboros, tentekal, Terraspark4941, tgrkzus, thatrandomcanadianguy, TheArturZh, theashtronaut, thedraccx, themias, Theomund, theOperand, TheShuEd, TimrodDX, Titian3, tkdrg, tmtmtl30, TokenStyle, tom-leys, tomasalves8, Tomeno, tosatur, TsjipTsjip, Tunguso4ka, TurboTrackerss14, Tyler-IN, Tyzemol, UbaserB, UBlueberry, UKNOWH, Uriende, UristMcDorf, Vaaankas, Varen, VasilisThePikachu, veliebm, Veritius, Vermidia, Verslebas, VigersRay, Visne, volundr-, Voomra, Vordenburg, vulppine, wafehling, waylon531, weaversam8, whateverusername0, Willhelm53, wixoaGit, WlarusFromDaSpace, wrexbe, xRiriq, yathxyz, Ygg01, YotaXP, YuriyKiss, zach-hill, Zandario, Zap527, Zealith-Gamer, ZelteHonor, zerorulez, zionnBE, zlodo, ZNixian, ZoldorfTheWizard, Zumorica, Zymem From cf148288a07809249b5569f8d77892284e634b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B6=D0=B5=D0=BA=D1=81=D0=BE=D0=BD=20=D0=9C=D0=B8?= =?UTF-8?q?=D1=81=D1=81=D0=B8=D1=81=D1=81=D0=B8=D0=BF=D0=BF=D0=B8?= Date: Sat, 11 May 2024 21:01:58 -0500 Subject: [PATCH 095/111] Add an admin smite for making people slip really far (and localize the admin smites better) (#27246) * Sliiiiiiiiiiiiiiiiiip * what * Localize! * antiterminate --- .../Systems/AdminVerbSystem.Smites.cs | 104 +++++++++++------- Content.Shared/Slippery/SlipperySystem.cs | 4 +- .../Locale/en-US/administration/smites.ftl | 48 +++++++- 3 files changed, 113 insertions(+), 43 deletions(-) diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs index bda60e9449..ed60fe5448 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs @@ -37,6 +37,7 @@ using Content.Shared.Movement.Components; using Content.Shared.Movement.Systems; using Content.Shared.Nutrition.Components; using Content.Shared.Popups; +using Content.Shared.Slippery; using Content.Shared.Tabletop.Components; using Content.Shared.Tools.Systems; using Content.Shared.Verbs; @@ -77,6 +78,7 @@ public sealed partial class AdminVerbSystem [Dependency] private readonly SharedContentEyeSystem _eyeSystem = default!; [Dependency] private readonly SharedTransformSystem _transformSystem = default!; [Dependency] private readonly SuperBonkSystem _superBonkSystem = default!; + [Dependency] private readonly SlipperySystem _slipperySystem = default!; // All smite verbs have names so invokeverb works. private void AddSmiteVerbs(GetVerbsEvent args) @@ -95,7 +97,7 @@ public sealed partial class AdminVerbSystem Verb explode = new() { - Text = "Explode", + Text = "admin-smite-explode-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/smite.svg.192dpi.png")), Act = () => @@ -115,7 +117,7 @@ public sealed partial class AdminVerbSystem Verb chess = new() { - Text = "Chess Dimension", + Text = "admin-smite-chess-dimension-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Objects/Fun/Tabletop/chessboard.rsi"), "chessboard"), Act = () => @@ -143,7 +145,7 @@ public sealed partial class AdminVerbSystem { Verb flames = new() { - Text = "Set Alight", + Text = "admin-smite-set-alight-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/Alerts/Fire/fire.png")), Act = () => @@ -165,7 +167,7 @@ public sealed partial class AdminVerbSystem Verb monkey = new() { - Text = "Monkeyify", + Text = "admin-smite-monkeyify-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Mobs/Animals/monkey.rsi"), "monkey"), Act = () => @@ -179,7 +181,7 @@ public sealed partial class AdminVerbSystem Verb disposalBin = new() { - Text = "Garbage Can", + Text = "admin-smite-electrocute-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Structures/Piping/disposal.rsi"), "disposal"), Act = () => @@ -196,7 +198,7 @@ public sealed partial class AdminVerbSystem { Verb hardElectrocute = new() { - Text = "Electrocute", + Text = "admin-smite-creampie-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Clothing/Hands/Gloves/Color/yellow.rsi"), "icon"), Act = () => @@ -241,7 +243,7 @@ public sealed partial class AdminVerbSystem { Verb creamPie = new() { - Text = "Creampie", + Text = "admin-smite-remove-blood-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Objects/Consumable/Food/Baked/pie.rsi"), "plain-slice"), Act = () => @@ -258,7 +260,7 @@ public sealed partial class AdminVerbSystem { Verb bloodRemoval = new() { - Text = "Remove blood", + Text = "admin-smite-vomit-organs-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Fluids/tomato_splat.rsi"), "puddle-1"), Act = () => @@ -281,7 +283,7 @@ public sealed partial class AdminVerbSystem { Verb vomitOrgans = new() { - Text = "Vomit organs", + Text = "admin-smite-remove-hands-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Fluids/vomit_toxin.rsi"), "vomit_toxin-1"), Act = () => @@ -309,7 +311,7 @@ public sealed partial class AdminVerbSystem Verb handsRemoval = new() { - Text = "Remove hands", + Text = "admin-smite-remove-hand-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/AdminActions/remove-hands.png")), Act = () => @@ -331,7 +333,7 @@ public sealed partial class AdminVerbSystem Verb handRemoval = new() { - Text = "Remove hand", + Text = "admin-smite-pinball-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/AdminActions/remove-hand.png")), Act = () => @@ -354,7 +356,7 @@ public sealed partial class AdminVerbSystem Verb stomachRemoval = new() { - Text = "Stomach Removal", + Text = "admin-smite-yeet-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Mobs/Species/Human/organs.rsi"), "stomach"), Act = () => @@ -374,7 +376,7 @@ public sealed partial class AdminVerbSystem Verb lungRemoval = new() { - Text = "Lungs Removal", + Text = "admin-smite-become-bread-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Mobs/Species/Human/organs.rsi"), "lung-r"), Act = () => @@ -397,7 +399,7 @@ public sealed partial class AdminVerbSystem { Verb pinball = new() { - Text = "Pinball", + Text = "admin-smite-ghostkick-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Objects/Fun/toys.rsi"), "basketball"), Act = () => @@ -431,7 +433,7 @@ public sealed partial class AdminVerbSystem Verb yeet = new() { - Text = "Yeet", + Text = "admin-smite-nyanify-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/eject.svg.192dpi.png")), Act = () => @@ -462,7 +464,7 @@ public sealed partial class AdminVerbSystem Verb bread = new() { - Text = "Become Bread", + Text = "admin-smite-kill-sign-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Objects/Consumable/Food/Baked/bread.rsi"), "plain"), Act = () => @@ -476,7 +478,7 @@ public sealed partial class AdminVerbSystem Verb mouse = new() { - Text = "Become Mouse", + Text = "admin-smite-cluwne-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Mobs/Animals/mouse.rsi"), "icon-0"), Act = () => @@ -492,7 +494,7 @@ public sealed partial class AdminVerbSystem { Verb ghostKick = new() { - Text = "Ghostkick", + Text = "admin-smite-anger-pointing-arrows-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/gavel.svg.192dpi.png")), Act = () => @@ -508,7 +510,7 @@ public sealed partial class AdminVerbSystem if (TryComp(args.Target, out var inventory)) { Verb nyanify = new() { - Text = "Nyanify", + Text = "admin-smite-dust-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Clothing/Head/Hats/catears.rsi"), "icon"), Act = () => @@ -525,7 +527,7 @@ public sealed partial class AdminVerbSystem Verb killSign = new() { - Text = "Kill sign", + Text = "admin-smite-buffering-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Objects/Misc/killsign.rsi"), "icon"), Act = () => @@ -539,7 +541,7 @@ public sealed partial class AdminVerbSystem Verb cluwne = new() { - Text = "Cluwne", + Text = "admin-smite-become-instrument-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Clothing/Mask/cluwne.rsi"), "icon"), @@ -555,7 +557,7 @@ public sealed partial class AdminVerbSystem Verb maiden = new() { - Text = "Maid", + Text = "admin-smite-remove-gravity-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Clothing/Uniforms/Jumpskirt/janimaid.rsi"), "icon"), Act = () => @@ -575,7 +577,7 @@ public sealed partial class AdminVerbSystem Verb angerPointingArrows = new() { - Text = "Anger Pointing Arrows", + Text = "admin-smite-reptilian-species-swap-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Interface/Misc/pointing.rsi"), "pointing"), Act = () => @@ -589,7 +591,7 @@ public sealed partial class AdminVerbSystem Verb dust = new() { - Text = "Dust", + Text = "admin-smite-locker-stuff-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Objects/Materials/materials.rsi"), "ash"), Act = () => @@ -605,7 +607,7 @@ public sealed partial class AdminVerbSystem Verb youtubeVideoSimulation = new() { - Text = "Buffering", + Text = "admin-smite-headstand-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/Misc/buffering_smite_icon.png")), Act = () => @@ -619,7 +621,7 @@ public sealed partial class AdminVerbSystem Verb instrumentation = new() { - Text = "Become Instrument", + Text = "admin-smite-become-mouse-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Objects/Fun/Instruments/h_synthesizer.rsi"), "icon"), Act = () => @@ -633,7 +635,7 @@ public sealed partial class AdminVerbSystem Verb noGravity = new() { - Text = "Remove gravity", + Text = "admin-smite-maid-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new("/Textures/Structures/Machines/gravity_generator.rsi"), "off"), Act = () => @@ -650,7 +652,7 @@ public sealed partial class AdminVerbSystem Verb reptilian = new() { - Text = "Reptilian Species Swap", + Text = "admin-smite-zoom-in-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Objects/Fun/toys.rsi"), "plushie_lizard"), Act = () => @@ -664,7 +666,7 @@ public sealed partial class AdminVerbSystem Verb locker = new() { - Text = "Locker stuff", + Text = "admin-smite-flip-eye-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new ("/Textures/Structures/Storage/closet.rsi"), "generic"), Act = () => @@ -686,7 +688,7 @@ public sealed partial class AdminVerbSystem Verb headstand = new() { - Text = "Headstand", + Text = "admin-smite-run-walk-swap-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/refresh.svg.192dpi.png")), Act = () => @@ -700,7 +702,7 @@ public sealed partial class AdminVerbSystem Verb zoomIn = new() { - Text = "Zoom in", + Text = "admin-smite-super-speed-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/AdminActions/zoom.png")), Act = () => @@ -715,7 +717,7 @@ public sealed partial class AdminVerbSystem Verb flipEye = new() { - Text = "Flip eye", + Text = "admin-smite-stomach-removal-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/AdminActions/flip.png")), Act = () => @@ -730,7 +732,7 @@ public sealed partial class AdminVerbSystem Verb runWalkSwap = new() { - Text = "Run Walk Swap", + Text = "admin-smite-speak-backwards-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/AdminActions/run-walk-swap.png")), Act = () => @@ -750,7 +752,7 @@ public sealed partial class AdminVerbSystem Verb backwardsAccent = new() { - Text = "Speak Backwards", + Text = "admin-smite-lung-removal-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/AdminActions/help-backwards.png")), Act = () => @@ -764,7 +766,7 @@ public sealed partial class AdminVerbSystem Verb disarmProne = new() { - Text = "Disarm Prone", + Text = "admin-smite-disarm-prone-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/Actions/disarm.png")), Act = () => @@ -778,7 +780,7 @@ public sealed partial class AdminVerbSystem Verb superSpeed = new() { - Text = "Super speed", + Text = "admin-smite-garbage-can-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/AdminActions/super_speed.png")), Act = () => @@ -797,7 +799,7 @@ public sealed partial class AdminVerbSystem //Bonk Verb superBonkLite = new() { - Text = "Super Bonk Lite", + Text = "admin-smite-super-bonk-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new("Structures/Furniture/Tables/glass.rsi"), "full"), Act = () => @@ -810,7 +812,7 @@ public sealed partial class AdminVerbSystem args.Verbs.Add(superBonkLite); Verb superBonk= new() { - Text = "Super Bonk", + Text = "admin-smite-super-bonk-lite-name", Category = VerbCategory.Smite, Icon = new SpriteSpecifier.Rsi(new("Structures/Furniture/Tables/generic.rsi"), "full"), Act = () => @@ -821,5 +823,31 @@ public sealed partial class AdminVerbSystem Impact = LogImpact.Extreme, }; args.Verbs.Add(superBonk); + + Verb superslip = new() + { + Text = "admin-smite-super-slip-name", + Category = VerbCategory.Smite, + Icon = new SpriteSpecifier.Rsi(new("Objects/Specific/Janitorial/soap.rsi"), "omega-4"), + Act = () => + { + var hadSlipComponent = EnsureComp(args.Target, out SlipperyComponent slipComponent); + if (!hadSlipComponent) + { + slipComponent.SuperSlippery = true; + slipComponent.ParalyzeTime = 5; + slipComponent.LaunchForwardsMultiplier = 20; + } + + _slipperySystem.TrySlip(args.Target, slipComponent, args.Target, requiresContact: false); + if (!hadSlipComponent) + { + RemComp(args.Target, slipComponent); + } + }, + Impact = LogImpact.Extreme, + Message = Loc.GetString("admin-smite-super-slip-description") + }; + args.Verbs.Add(superslip); } } diff --git a/Content.Shared/Slippery/SlipperySystem.cs b/Content.Shared/Slippery/SlipperySystem.cs index ff8b597a0d..5b2a2dfe45 100644 --- a/Content.Shared/Slippery/SlipperySystem.cs +++ b/Content.Shared/Slippery/SlipperySystem.cs @@ -67,7 +67,7 @@ public sealed class SlipperySystem : EntitySystem && _statusEffects.CanApplyEffect(toSlip, "Stun"); //Should be KnockedDown instead? } - private void TrySlip(EntityUid uid, SlipperyComponent component, EntityUid other) + public void TrySlip(EntityUid uid, SlipperyComponent component, EntityUid other, bool requiresContact = true) { if (HasComp(other) && !component.SuperSlippery) return; @@ -89,7 +89,7 @@ public sealed class SlipperySystem : EntitySystem { _physics.SetLinearVelocity(other, physics.LinearVelocity * component.LaunchForwardsMultiplier, body: physics); - if (component.SuperSlippery) + if (component.SuperSlippery && requiresContact) { var sliding = EnsureComp(other); sliding.CollidingEntities.Add(uid); diff --git a/Resources/Locale/en-US/administration/smites.ftl b/Resources/Locale/en-US/administration/smites.ftl index ff3e3b0901..51c86dfb44 100644 --- a/Resources/Locale/en-US/administration/smites.ftl +++ b/Resources/Locale/en-US/administration/smites.ftl @@ -14,6 +14,48 @@ admin-smite-run-walk-swap-prompt = You have to press shift to run! admin-smite-super-speed-prompt = You move at mach 0.8! admin-smite-lung-removal-self = You can't breathe! +## Smite names + +admin-smite-explode-name = Explode +admin-smite-chess-dimension-name = Chess Dimension +admin-smite-set-alight-name = Set Alight +admin-smite-monkeyify-name = Monkeyify +admin-smite-electrocute-name = Garbage Can +admin-smite-creampie-name = Electrocute +admin-smite-remove-blood-name = Creampie +admin-smite-vomit-organs-name = Remove blood +admin-smite-remove-hands-name = Vomit organs +admin-smite-remove-hand-name = Remove hands +admin-smite-pinball-name = Remove hand +admin-smite-yeet-name = Stomach Removal +admin-smite-become-bread-name = Lungs Removal +admin-smite-ghostkick-name = Pinball +admin-smite-nyanify-name = Yeet +admin-smite-kill-sign-name = Become Bread +admin-smite-cluwne-name = Become Mouse +admin-smite-anger-pointing-arrows-name = Ghostkick +admin-smite-dust-name = Nyanify +admin-smite-buffering-name = Kill sign +admin-smite-become-instrument-name = Cluwne +admin-smite-remove-gravity-name = Maid +admin-smite-reptilian-species-swap-name = Anger Pointing Arrows +admin-smite-locker-stuff-name = Dust +admin-smite-headstand-name = Buffering +admin-smite-become-mouse-name = Become Instrument +admin-smite-maid-name = Remove gravity +admin-smite-zoom-in-name = Reptilian Species Swap +admin-smite-flip-eye-name = Locker stuff +admin-smite-run-walk-swap-name = Headstand +admin-smite-super-speed-name = Zoom in +admin-smite-stomach-removal-name = Flip eye +admin-smite-speak-backwards-name = Run Walk Swap +admin-smite-lung-removal-name = Speak Backwards +admin-smite-disarm-prone-name = Disarm Prone +admin-smite-garbage-can-name = Super speed +admin-smite-super-bonk-name = Super Bonk Lite +admin-smite-super-bonk-lite-name = Super Bonk +admin-smite-terminate-name = Terminate +admin-smite-super-slip-name = Super Slip ## Smite descriptions @@ -21,12 +63,12 @@ admin-smite-explode-description = Explode them. admin-smite-chess-dimension-description = Banishment to the Chess Dimension. admin-smite-set-alight-description = Makes them burn. admin-smite-monkeyify-description = Turns the target into a monkey. -admin-smite-lung-cancer-description = Stage IIIA Lung Cancer, for when they really like the hit show Breaking Bad. admin-smite-electrocute-description = Electrocutes them, rendering anything they were wearing useless. admin-smite-creampie-description = A creampie, condensed into a button. admin-smite-remove-blood-description = Removes all of their blood, messily. admin-smite-vomit-organs-description = Causes them to vomit, organs included. admin-smite-remove-hands-description = Removes their hands. +admin-smite-remove-hand-description = Removes only one of their hands instead of all of them. admin-smite-pinball-description = Turns them into a super bouncy ball, flinging them around until they clip through the station into the abyss. admin-smite-yeet-description = Banishes them into the depths of space by turning on no-clip and tossing them. admin-smite-become-bread-description = It turns them into bread. Really, that's all it does. @@ -42,7 +84,6 @@ admin-smite-remove-gravity-description = Grants them anti-gravity. admin-smite-reptilian-species-swap-description = It changes their species to Reptilian. Useful for people who were being space racist. admin-smite-locker-stuff-description = Stuffs them in a (welded) locker. admin-smite-headstand-description = Vertically flips their sprite. -admin-smite-plasma-internals-description = Replaces the contents of their internals with plasma. admin-smite-become-mouse-description = They become a mouse. Squeak! admin-smite-maid-description = Forcibly converts them into a janitorial cat maid. This is actual torture for some players, use it wisely. admin-smite-zoom-in-description = Zooms in their view so that they can no longer see their surroundings. @@ -52,11 +93,12 @@ admin-smite-super-speed-description = Makes them really fast, causing them to tu admin-smite-stomach-removal-description = Removes their stomach, rendering them unable to eat. admin-smite-speak-backwards-description = Forces them to speak backwards, so they can't call for help. admin-smite-lung-removal-description = Removes their lungs, drowning them. -admin-smite-remove-hand-description = Removes only one of their hands instead of all of them. admin-smite-disarm-prone-description = Makes them get disarmed 100% of the time and cuffed instantly. admin-smite-garbage-can-description = Turn them into a garbage bin to emphasize what they remind you of. admin-smite-super-bonk-description = Slams them on every single table on the Station and beyond. admin-smite-super-bonk-lite-description= Slams them on every single table on the Station and beyond. Stops when the target is dead. +admin-smite-terminate-description = Creates a Terminator ghost role with the sole objective of killing them. +admin-smite-super-slip-description = Slips them really, really hard. ## Tricks descriptions From 1596e04d0f320ce5cc13296a53fbda868d2047a8 Mon Sep 17 00:00:00 2001 From: Kara Date: Sat, 11 May 2024 20:13:58 -0700 Subject: [PATCH 096/111] Resolve all non-obsoleting warnings in content (#27934) * Resolve all non-obsoleting warnings in content * Update ClientGameTicker.cs * Update SkeletonAccentSystem.cs * Update BwoinkSystem.cs --- .../Access/UI/IdCardConsoleBoundUserInterface.cs | 1 - .../Audio/Jukebox/JukeboxBoundUserInterface.cs | 1 - Content.Client/RCD/AlignRCDConstruction.cs | 13 ++++--------- .../Robotics/UI/RoboticsConsoleWindow.xaml.cs | 1 - Content.Client/Shuttles/UI/DockObject.xaml.cs | 4 ++++ Content.IntegrationTests/Tests/RoundEndTest.cs | 10 +++++----- .../Access/Systems/AccessOverriderSystem.cs | 1 - .../Administration/Systems/BwoinkSystem.cs | 7 +++++-- Content.Server/Anomaly/AnomalySystem.cs | 3 --- .../Atmos/EntitySystems/AirFilterSystem.cs | 1 - .../Chemistry/EntitySystems/HypospraySystem.cs | 1 - .../Unit/EntitySystems/DisposalUnitSystem.cs | 1 - Content.Server/Geras/GerasSystem.cs | 1 - Content.Server/Ghost/GhostSystem.cs | 1 - Content.Server/Ghost/Roles/GhostRoleSystem.cs | 1 - Content.Server/Ghost/Roles/UI/GhostRolesEui.cs | 2 +- Content.Server/Hands/Systems/HandsSystem.cs | 1 - Content.Server/IdentityManagement/IdentitySystem.cs | 2 +- Content.Server/Kitchen/EntitySystems/SharpSystem.cs | 7 ------- Content.Server/Ninja/Systems/NinjaGlovesSystem.cs | 1 - Content.Server/Power/Components/ChargerComponent.cs | 5 ----- .../Managers/ServerPreferencesManager.cs | 1 - Content.Server/Salvage/SpawnSalvageMissionJob.cs | 2 -- .../Speech/EntitySystems/SkeletonAccentSystem.cs | 7 +++++-- Content.Server/Station/Systems/StationSystem.cs | 6 ------ .../Traitor/Uplink/Commands/AddUplinkCommand.cs | 1 - Content.Server/Wires/WiresSystem.cs | 2 +- .../Equipment/Systems/TraversalDistorterSystem.cs | 1 - .../Zombies/InitialInfectedExemptComponent.cs | 2 +- .../Access/Components/IdCardConsoleComponent.cs | 2 -- .../EntitySystems/SharedSolutionContainerSystem.cs | 6 +++--- .../EntitySystems/SolutionTransferSystem.cs | 1 - Content.Shared/Mind/SharedMindSystem.cs | 1 - Content.Shared/Pinpointer/SharedNavMapSystem.cs | 1 - Content.Shared/Plunger/Systems/PlungerSystem.cs | 4 ++-- 35 files changed, 32 insertions(+), 70 deletions(-) diff --git a/Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs b/Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs index 5b7011c195..a321b4121e 100644 --- a/Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs +++ b/Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs @@ -1,6 +1,5 @@ using Content.Shared.Access; using Content.Shared.Access.Components; -using Content.Shared.Access; using Content.Shared.Access.Systems; using Content.Shared.Containers.ItemSlots; using Content.Shared.CrewManifest; diff --git a/Content.Client/Audio/Jukebox/JukeboxBoundUserInterface.cs b/Content.Client/Audio/Jukebox/JukeboxBoundUserInterface.cs index 072730d65d..60fe339069 100644 --- a/Content.Client/Audio/Jukebox/JukeboxBoundUserInterface.cs +++ b/Content.Client/Audio/Jukebox/JukeboxBoundUserInterface.cs @@ -9,7 +9,6 @@ namespace Content.Client.Audio.Jukebox; public sealed class JukeboxBoundUserInterface : BoundUserInterface { - [Dependency] private readonly IPlayerManager _player = default!; [Dependency] private readonly IPrototypeManager _protoManager = default!; [ViewVariables] diff --git a/Content.Client/RCD/AlignRCDConstruction.cs b/Content.Client/RCD/AlignRCDConstruction.cs index da7b22c91a..d5425425a7 100644 --- a/Content.Client/RCD/AlignRCDConstruction.cs +++ b/Content.Client/RCD/AlignRCDConstruction.cs @@ -16,9 +16,9 @@ public sealed class AlignRCDConstruction : PlacementMode { [Dependency] private readonly IEntityManager _entityManager = default!; [Dependency] private readonly IMapManager _mapManager = default!; - [Dependency] private readonly SharedMapSystem _mapSystem = default!; - [Dependency] private readonly RCDSystem _rcdSystem = default!; - [Dependency] private readonly SharedTransformSystem _transformSystem = default!; + private readonly SharedMapSystem _mapSystem; + private readonly RCDSystem _rcdSystem; + private readonly SharedTransformSystem _transformSystem; [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IStateManager _stateManager = default!; @@ -32,12 +32,7 @@ public sealed class AlignRCDConstruction : PlacementMode /// public AlignRCDConstruction(PlacementManager pMan) : base(pMan) { - var dependencies = IoCManager.Instance!; - _entityManager = dependencies.Resolve(); - _mapManager = dependencies.Resolve(); - _playerManager = dependencies.Resolve(); - _stateManager = dependencies.Resolve(); - + IoCManager.InjectDependencies(this); _mapSystem = _entityManager.System(); _rcdSystem = _entityManager.System(); _transformSystem = _entityManager.System(); diff --git a/Content.Client/Robotics/UI/RoboticsConsoleWindow.xaml.cs b/Content.Client/Robotics/UI/RoboticsConsoleWindow.xaml.cs index 3555099370..367114f2aa 100644 --- a/Content.Client/Robotics/UI/RoboticsConsoleWindow.xaml.cs +++ b/Content.Client/Robotics/UI/RoboticsConsoleWindow.xaml.cs @@ -17,7 +17,6 @@ public sealed partial class RoboticsConsoleWindow : FancyWindow { [Dependency] private readonly IEntityManager _entMan = default!; [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly IPrototypeManager _proto = default!; private readonly LockSystem _lock; private readonly SpriteSystem _sprite; diff --git a/Content.Client/Shuttles/UI/DockObject.xaml.cs b/Content.Client/Shuttles/UI/DockObject.xaml.cs index 9dae6b7a4d..d7d565a23e 100644 --- a/Content.Client/Shuttles/UI/DockObject.xaml.cs +++ b/Content.Client/Shuttles/UI/DockObject.xaml.cs @@ -1,6 +1,7 @@ using System.Text; using Content.Shared.Shuttles.BUIStates; using Content.Shared.Shuttles.Systems; +using JetBrains.Annotations; using Robust.Client.AutoGenerated; using Robust.Client.Graphics; using Robust.Client.UserInterface.Controls; @@ -12,7 +13,10 @@ namespace Content.Client.Shuttles.UI; [GenerateTypedNameReferences] public sealed partial class DockObject : PanelContainer { + [PublicAPI] public event Action? UndockPressed; + + [PublicAPI] public event Action? ViewPressed; public BoxContainer ContentsContainer => Contents; diff --git a/Content.IntegrationTests/Tests/RoundEndTest.cs b/Content.IntegrationTests/Tests/RoundEndTest.cs index 1ddddf66bc..6978085640 100644 --- a/Content.IntegrationTests/Tests/RoundEndTest.cs +++ b/Content.IntegrationTests/Tests/RoundEndTest.cs @@ -12,7 +12,7 @@ namespace Content.IntegrationTests.Tests { private sealed class RoundEndTestSystem : EntitySystem { - public int Count; + public int RoundCount; public override void Initialize() { @@ -22,7 +22,7 @@ namespace Content.IntegrationTests.Tests private void OnRoundEnd(RoundEndSystemChangedEvent ev) { - Interlocked.Increment(ref Count); + Interlocked.Increment(ref RoundCount); } } @@ -43,7 +43,7 @@ namespace Content.IntegrationTests.Tests var ticker = sysManager.GetEntitySystem(); var roundEndSystem = sysManager.GetEntitySystem(); var sys = server.System(); - sys.Count = 0; + sys.RoundCount = 0; await server.WaitAssertion(() => { @@ -128,8 +128,8 @@ namespace Content.IntegrationTests.Tests async Task WaitForEvent() { var timeout = Task.Delay(TimeSpan.FromSeconds(10)); - var currentCount = Thread.VolatileRead(ref sys.Count); - while (currentCount == Thread.VolatileRead(ref sys.Count) && !timeout.IsCompleted) + var currentCount = Thread.VolatileRead(ref sys.RoundCount); + while (currentCount == Thread.VolatileRead(ref sys.RoundCount) && !timeout.IsCompleted) { await pair.RunTicksSync(5); } diff --git a/Content.Server/Access/Systems/AccessOverriderSystem.cs b/Content.Server/Access/Systems/AccessOverriderSystem.cs index bc038fe4ff..c7b20513f4 100644 --- a/Content.Server/Access/Systems/AccessOverriderSystem.cs +++ b/Content.Server/Access/Systems/AccessOverriderSystem.cs @@ -28,7 +28,6 @@ public sealed class AccessOverriderSystem : SharedAccessOverriderSystem [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly SharedAudioSystem _audioSystem = default!; [Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!; - [Dependency] private readonly SharedContainerSystem _containerSystem = default!; public override void Initialize() { diff --git a/Content.Server/Administration/Systems/BwoinkSystem.cs b/Content.Server/Administration/Systems/BwoinkSystem.cs index 2e236688ac..a07115544b 100644 --- a/Content.Server/Administration/Systems/BwoinkSystem.cs +++ b/Content.Server/Administration/Systems/BwoinkSystem.cs @@ -25,7 +25,7 @@ using Robust.Shared.Utility; namespace Content.Server.Administration.Systems { [UsedImplicitly] - public sealed class BwoinkSystem : SharedBwoinkSystem + public sealed partial class BwoinkSystem : SharedBwoinkSystem { [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IAdminManager _adminManager = default!; @@ -36,6 +36,9 @@ namespace Content.Server.Administration.Systems [Dependency] private readonly SharedMindSystem _minds = default!; [Dependency] private readonly IAfkManager _afkManager = default!; + [GeneratedRegex(@"^https://discord\.com/api/webhooks/(\d+)/((?!.*/).*)$")] + private static partial Regex DiscordRegex(); + private ISawmill _sawmill = default!; private readonly HttpClient _httpClient = new(); private string _webhookUrl = string.Empty; @@ -157,7 +160,7 @@ namespace Content.Server.Administration.Systems return; // Basic sanity check and capturing webhook ID and token - var match = Regex.Match(url, @"^https://discord\.com/api/webhooks/(\d+)/((?!.*/).*)$"); + var match = DiscordRegex().Match(url); if (!match.Success) { diff --git a/Content.Server/Anomaly/AnomalySystem.cs b/Content.Server/Anomaly/AnomalySystem.cs index bae101de87..73658a0320 100644 --- a/Content.Server/Anomaly/AnomalySystem.cs +++ b/Content.Server/Anomaly/AnomalySystem.cs @@ -42,9 +42,6 @@ public sealed partial class AnomalySystem : SharedAnomalySystem [Dependency] private readonly RadiationSystem _radiation = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly UserInterfaceSystem _ui = default!; - [Dependency] private readonly IComponentFactory _componentFactory = default!; - [Dependency] private readonly ISerializationManager _serialization = default!; - [Dependency] private readonly IEntityManager _entity = default!; public const float MinParticleVariation = 0.8f; public const float MaxParticleVariation = 1.2f; diff --git a/Content.Server/Atmos/EntitySystems/AirFilterSystem.cs b/Content.Server/Atmos/EntitySystems/AirFilterSystem.cs index 2ab15cfb17..c3344c830c 100644 --- a/Content.Server/Atmos/EntitySystems/AirFilterSystem.cs +++ b/Content.Server/Atmos/EntitySystems/AirFilterSystem.cs @@ -12,7 +12,6 @@ namespace Content.Server.Atmos.EntitySystems; 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() diff --git a/Content.Server/Chemistry/EntitySystems/HypospraySystem.cs b/Content.Server/Chemistry/EntitySystems/HypospraySystem.cs index dfbe45c035..56cc0f9670 100644 --- a/Content.Server/Chemistry/EntitySystems/HypospraySystem.cs +++ b/Content.Server/Chemistry/EntitySystems/HypospraySystem.cs @@ -25,7 +25,6 @@ public sealed class HypospraySystem : SharedHypospraySystem { [Dependency] private readonly AudioSystem _audio = default!; [Dependency] private readonly InteractionSystem _interaction = default!; - [Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!; public override void Initialize() { diff --git a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs index b970ae4b0d..7f4ee87ee1 100644 --- a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs +++ b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs @@ -42,7 +42,6 @@ namespace Content.Server.Disposal.Unit.EntitySystems; public sealed class DisposalUnitSystem : SharedDisposalUnitSystem { [Dependency] private readonly IAdminLogManager _adminLogger = default!; - [Dependency] private readonly IRobustRandom _robustRandom = default!; [Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!; [Dependency] private readonly AppearanceSystem _appearance = default!; [Dependency] private readonly AtmosphereSystem _atmosSystem = default!; diff --git a/Content.Server/Geras/GerasSystem.cs b/Content.Server/Geras/GerasSystem.cs index e7999d64d8..f83f7c1999 100644 --- a/Content.Server/Geras/GerasSystem.cs +++ b/Content.Server/Geras/GerasSystem.cs @@ -11,7 +11,6 @@ namespace Content.Server.Geras; public sealed class GerasSystem : SharedGerasSystem { [Dependency] private readonly PolymorphSystem _polymorphSystem = default!; - [Dependency] private readonly MetaDataSystem _metaDataSystem = default!; [Dependency] private readonly ActionsSystem _actionsSystem = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; diff --git a/Content.Server/Ghost/GhostSystem.cs b/Content.Server/Ghost/GhostSystem.cs index b1fb67cce7..f4e6a4d607 100644 --- a/Content.Server/Ghost/GhostSystem.cs +++ b/Content.Server/Ghost/GhostSystem.cs @@ -44,7 +44,6 @@ namespace Content.Server.Ghost [Dependency] private readonly TransformSystem _transformSystem = default!; [Dependency] private readonly VisibilitySystem _visibilitySystem = default!; [Dependency] private readonly MetaDataSystem _metaData = default!; - [Dependency] private readonly IMapManager _mapManager = default!; private EntityQuery _ghostQuery; private EntityQuery _physicsQuery; diff --git a/Content.Server/Ghost/Roles/GhostRoleSystem.cs b/Content.Server/Ghost/Roles/GhostRoleSystem.cs index 5b9d6ae1ad..c198b54b1b 100644 --- a/Content.Server/Ghost/Roles/GhostRoleSystem.cs +++ b/Content.Server/Ghost/Roles/GhostRoleSystem.cs @@ -30,7 +30,6 @@ using Robust.Shared.Timing; using Robust.Shared.Utility; using Content.Server.Popups; using Content.Shared.Verbs; -using Robust.Shared.Prototypes; using Robust.Shared.Collections; namespace Content.Server.Ghost.Roles diff --git a/Content.Server/Ghost/Roles/UI/GhostRolesEui.cs b/Content.Server/Ghost/Roles/UI/GhostRolesEui.cs index fc73fc3454..c1e39919a2 100644 --- a/Content.Server/Ghost/Roles/UI/GhostRolesEui.cs +++ b/Content.Server/Ghost/Roles/UI/GhostRolesEui.cs @@ -6,7 +6,7 @@ namespace Content.Server.Ghost.Roles.UI { public sealed class GhostRolesEui : BaseEui { - [Dependency] private readonly GhostRoleSystem _ghostRoleSystem; + private readonly GhostRoleSystem _ghostRoleSystem; public GhostRolesEui() { diff --git a/Content.Server/Hands/Systems/HandsSystem.cs b/Content.Server/Hands/Systems/HandsSystem.cs index 4c6b80bd98..feae130ce8 100644 --- a/Content.Server/Hands/Systems/HandsSystem.cs +++ b/Content.Server/Hands/Systems/HandsSystem.cs @@ -33,7 +33,6 @@ namespace Content.Server.Hands.Systems [Dependency] private readonly StackSystem _stackSystem = default!; [Dependency] private readonly VirtualItemSystem _virtualItemSystem = default!; [Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!; - [Dependency] private readonly SharedHandsSystem _handsSystem = default!; [Dependency] private readonly SharedTransformSystem _transformSystem = default!; [Dependency] private readonly PullingSystem _pullingSystem = default!; [Dependency] private readonly ThrowingSystem _throwingSystem = default!; diff --git a/Content.Server/IdentityManagement/IdentitySystem.cs b/Content.Server/IdentityManagement/IdentitySystem.cs index a959b96ef9..4766b89172 100644 --- a/Content.Server/IdentityManagement/IdentitySystem.cs +++ b/Content.Server/IdentityManagement/IdentitySystem.cs @@ -19,7 +19,7 @@ namespace Content.Server.IdentityManagement; /// /// Responsible for updating the identity of an entity on init or clothing equip/unequip. /// -public class IdentitySystem : SharedIdentitySystem +public sealed class IdentitySystem : SharedIdentitySystem { [Dependency] private readonly IdCardSystem _idCard = default!; [Dependency] private readonly IAdminLogManager _adminLog = default!; diff --git a/Content.Server/Kitchen/EntitySystems/SharpSystem.cs b/Content.Server/Kitchen/EntitySystems/SharpSystem.cs index 3c1e89b1f2..431e438fd8 100644 --- a/Content.Server/Kitchen/EntitySystems/SharpSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/SharpSystem.cs @@ -3,24 +3,17 @@ using Content.Server.Kitchen.Components; using Content.Server.Nutrition.EntitySystems; using Content.Shared.Body.Components; using Content.Shared.Administration.Logs; -using Content.Shared.Body.Components; using Content.Shared.Database; using Content.Shared.Interaction; using Content.Shared.Nutrition.Components; -using Content.Server.Nutrition.EntitySystems; using Content.Shared.Popups; using Content.Shared.Storage; using Content.Shared.Verbs; using Content.Shared.Destructible; using Content.Shared.DoAfter; -using Content.Shared.Interaction; using Content.Shared.Kitchen; using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; -using Content.Shared.Nutrition.Components; -using Content.Shared.Popups; -using Content.Shared.Storage; -using Content.Shared.Verbs; using Robust.Server.Containers; using Robust.Shared.Random; using Robust.Shared.Utility; diff --git a/Content.Server/Ninja/Systems/NinjaGlovesSystem.cs b/Content.Server/Ninja/Systems/NinjaGlovesSystem.cs index 2c0f6c63e3..ac76ae6b77 100644 --- a/Content.Server/Ninja/Systems/NinjaGlovesSystem.cs +++ b/Content.Server/Ninja/Systems/NinjaGlovesSystem.cs @@ -19,7 +19,6 @@ public sealed class NinjaGlovesSystem : SharedNinjaGlovesSystem [Dependency] private readonly EmagProviderSystem _emagProvider = default!; [Dependency] private readonly CodeConditionSystem _codeCondition = default!; [Dependency] private readonly CommsHackerSystem _commsHacker = default!; - [Dependency] private readonly MindSystem _mind = default!; [Dependency] private readonly SharedStunProviderSystem _stunProvider = default!; [Dependency] private readonly SpaceNinjaSystem _ninja = default!; diff --git a/Content.Server/Power/Components/ChargerComponent.cs b/Content.Server/Power/Components/ChargerComponent.cs index e45ded071c..4a3c83ae03 100644 --- a/Content.Server/Power/Components/ChargerComponent.cs +++ b/Content.Server/Power/Components/ChargerComponent.cs @@ -1,10 +1,5 @@ using Content.Shared.Power; using Content.Shared.Whitelist; -using Content.Shared.Power; -using Content.Shared.Whitelist; -using Robust.Shared.GameObjects; -using Robust.Shared.Serialization.Manager.Attributes; -using Robust.Shared.ViewVariables; namespace Content.Server.Power.Components { diff --git a/Content.Server/Preferences/Managers/ServerPreferencesManager.cs b/Content.Server/Preferences/Managers/ServerPreferencesManager.cs index 7a80757435..1aad61715b 100644 --- a/Content.Server/Preferences/Managers/ServerPreferencesManager.cs +++ b/Content.Server/Preferences/Managers/ServerPreferencesManager.cs @@ -29,7 +29,6 @@ namespace Content.Server.Preferences.Managers [Dependency] private readonly IServerDbManager _db = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IDependencyCollection _dependencies = default!; - [Dependency] private readonly IPrototypeManager _protos = default!; // Cache player prefs on the server so we don't need as much async hell related to them. private readonly Dictionary _cachedPlayerPrefs = diff --git a/Content.Server/Salvage/SpawnSalvageMissionJob.cs b/Content.Server/Salvage/SpawnSalvageMissionJob.cs index 47123e9784..ce844e57a1 100644 --- a/Content.Server/Salvage/SpawnSalvageMissionJob.cs +++ b/Content.Server/Salvage/SpawnSalvageMissionJob.cs @@ -34,8 +34,6 @@ using Robust.Shared.Random; using Robust.Shared.Timing; using Robust.Shared.Utility; using Content.Server.Shuttles.Components; -using Content.Shared.Coordinates; -using Content.Shared.Shuttles.Components; namespace Content.Server.Salvage; diff --git a/Content.Server/Speech/EntitySystems/SkeletonAccentSystem.cs b/Content.Server/Speech/EntitySystems/SkeletonAccentSystem.cs index ead9b4382e..d143c25fdb 100644 --- a/Content.Server/Speech/EntitySystems/SkeletonAccentSystem.cs +++ b/Content.Server/Speech/EntitySystems/SkeletonAccentSystem.cs @@ -4,10 +4,13 @@ using Robust.Shared.Random; namespace Content.Server.Speech.EntitySystems; -public sealed class SkeletonAccentSystem : EntitySystem +public sealed partial class SkeletonAccentSystem : EntitySystem { [Dependency] private readonly IRobustRandom _random = default!; + [GeneratedRegex(@"(? DirectReplacements = new() { { "fuck you", "I've got a BONE to pick with you" }, @@ -45,7 +48,7 @@ public sealed class SkeletonAccentSystem : EntitySystem // Character manipulations: // At the start of words, any non-vowel + "one" becomes "bone", e.g. tone -> bone ; lonely -> bonely; clone -> clone (remains unchanged). - msg = Regex.Replace(msg, @"(? public override void Initialize() { diff --git a/Content.Server/Traitor/Uplink/Commands/AddUplinkCommand.cs b/Content.Server/Traitor/Uplink/Commands/AddUplinkCommand.cs index 79192f6b49..63be36b360 100644 --- a/Content.Server/Traitor/Uplink/Commands/AddUplinkCommand.cs +++ b/Content.Server/Traitor/Uplink/Commands/AddUplinkCommand.cs @@ -12,7 +12,6 @@ namespace Content.Server.Traitor.Uplink.Commands [AdminCommand(AdminFlags.Admin)] public sealed class AddUplinkCommand : IConsoleCommand { - [Dependency] private readonly IConfigurationManager _cfgManager = default!; [Dependency] private readonly IEntityManager _entManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; diff --git a/Content.Server/Wires/WiresSystem.cs b/Content.Server/Wires/WiresSystem.cs index 5d31a4d144..c643759f50 100644 --- a/Content.Server/Wires/WiresSystem.cs +++ b/Content.Server/Wires/WiresSystem.cs @@ -348,7 +348,7 @@ public sealed class WiresSystem : SharedWiresSystem } } - private class ActiveWireAction + private sealed class ActiveWireAction { /// /// The wire action's ID. This is so that once the action is finished, diff --git a/Content.Server/Xenoarchaeology/Equipment/Systems/TraversalDistorterSystem.cs b/Content.Server/Xenoarchaeology/Equipment/Systems/TraversalDistorterSystem.cs index 2092f79f05..d277792243 100644 --- a/Content.Server/Xenoarchaeology/Equipment/Systems/TraversalDistorterSystem.cs +++ b/Content.Server/Xenoarchaeology/Equipment/Systems/TraversalDistorterSystem.cs @@ -11,7 +11,6 @@ namespace Content.Server.Xenoarchaeology.Equipment.Systems; public sealed class TraversalDistorterSystem : EntitySystem { [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly PopupSystem _popup = default!; /// public override void Initialize() diff --git a/Content.Server/Zombies/InitialInfectedExemptComponent.cs b/Content.Server/Zombies/InitialInfectedExemptComponent.cs index 46077935c6..f2dfda3f87 100644 --- a/Content.Server/Zombies/InitialInfectedExemptComponent.cs +++ b/Content.Server/Zombies/InitialInfectedExemptComponent.cs @@ -1,7 +1,7 @@ namespace Content.Server.Zombies; [RegisterComponent] -public partial class InitialInfectedExemptComponent : Component +public sealed partial class InitialInfectedExemptComponent : Component { } diff --git a/Content.Shared/Access/Components/IdCardConsoleComponent.cs b/Content.Shared/Access/Components/IdCardConsoleComponent.cs index deeafe2793..4f1c27fb4d 100644 --- a/Content.Shared/Access/Components/IdCardConsoleComponent.cs +++ b/Content.Shared/Access/Components/IdCardConsoleComponent.cs @@ -3,8 +3,6 @@ using Content.Shared.Containers.ItemSlots; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; -using Robust.Shared.Prototypes; namespace Content.Shared.Access.Components; diff --git a/Content.Shared/Chemistry/EntitySystems/SharedSolutionContainerSystem.cs b/Content.Shared/Chemistry/EntitySystems/SharedSolutionContainerSystem.cs index fdb2f550f9..5e58a0944a 100644 --- a/Content.Shared/Chemistry/EntitySystems/SharedSolutionContainerSystem.cs +++ b/Content.Shared/Chemistry/EntitySystems/SharedSolutionContainerSystem.cs @@ -60,7 +60,7 @@ public abstract partial class SharedSolutionContainerSystem : EntitySystem [Dependency] protected readonly SharedAppearanceSystem AppearanceSystem = default!; [Dependency] protected readonly SharedHandsSystem Hands = default!; [Dependency] protected readonly SharedContainerSystem ContainerSystem = default!; - [Dependency] protected readonly MetaDataSystem MetaData = default!; + [Dependency] protected readonly MetaDataSystem MetaDataSys = default!; [Dependency] protected readonly INetManager NetManager = default!; public override void Initialize() @@ -1123,7 +1123,7 @@ public abstract partial class SharedSolutionContainerSystem : EntitySystem Dirty(uid, container); return solution; } - + private Entity SpawnSolutionUninitialized(ContainerSlot container, string name, FixedPoint2 maxVol, Solution prototype) { var coords = new EntityCoordinates(container.Owner, Vector2.Zero); @@ -1135,7 +1135,7 @@ public abstract partial class SharedSolutionContainerSystem : EntitySystem var relation = new ContainedSolutionComponent() { Container = container.Owner, ContainerName = name }; AddComp(uid, relation); - MetaData.SetEntityName(uid, $"solution - {name}"); + MetaDataSys.SetEntityName(uid, $"solution - {name}"); ContainerSystem.Insert(uid, container, force: true); return (uid, solution, relation); diff --git a/Content.Shared/Chemistry/EntitySystems/SolutionTransferSystem.cs b/Content.Shared/Chemistry/EntitySystems/SolutionTransferSystem.cs index 3bea79d345..b12778262c 100644 --- a/Content.Shared/Chemistry/EntitySystems/SolutionTransferSystem.cs +++ b/Content.Shared/Chemistry/EntitySystems/SolutionTransferSystem.cs @@ -17,7 +17,6 @@ namespace Content.Shared.Chemistry.EntitySystems; /// public sealed class SolutionTransferSystem : EntitySystem { - [Dependency] private readonly INetManager _net = default!; [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly SharedSolutionContainerSystem _solution = default!; diff --git a/Content.Shared/Mind/SharedMindSystem.cs b/Content.Shared/Mind/SharedMindSystem.cs index 7887b8f9b2..bf1065c1b1 100644 --- a/Content.Shared/Mind/SharedMindSystem.cs +++ b/Content.Shared/Mind/SharedMindSystem.cs @@ -26,7 +26,6 @@ public abstract class SharedMindSystem : EntitySystem [Dependency] private readonly SharedObjectivesSystem _objectives = default!; [Dependency] private readonly SharedPlayerSystem _player = default!; [Dependency] private readonly MetaDataSystem _metadata = default!; - [Dependency] private readonly ISharedPlayerManager _playerMan = default!; [ViewVariables] protected readonly Dictionary UserMinds = new(); diff --git a/Content.Shared/Pinpointer/SharedNavMapSystem.cs b/Content.Shared/Pinpointer/SharedNavMapSystem.cs index 0edcd5a437..ffe81c2d0e 100644 --- a/Content.Shared/Pinpointer/SharedNavMapSystem.cs +++ b/Content.Shared/Pinpointer/SharedNavMapSystem.cs @@ -23,7 +23,6 @@ public abstract class SharedNavMapSystem : EntitySystem public const int FloorMask = AllDirMask << (int) NavMapChunkType.Floor; [Robust.Shared.IoC.Dependency] private readonly TagSystem _tagSystem = default!; - [Robust.Shared.IoC.Dependency] private readonly IGameTiming _gameTiming = default!; private readonly string[] _wallTags = ["Wall", "Window"]; private EntityQuery _doorQuery; diff --git a/Content.Shared/Plunger/Systems/PlungerSystem.cs b/Content.Shared/Plunger/Systems/PlungerSystem.cs index 57bd77a7d9..fbefad9f6e 100644 --- a/Content.Shared/Plunger/Systems/PlungerSystem.cs +++ b/Content.Shared/Plunger/Systems/PlungerSystem.cs @@ -17,8 +17,8 @@ namespace Content.Shared.Plunger.Systems; /// public sealed class PlungerSystem : EntitySystem { - [Dependency] protected readonly IPrototypeManager _proto = default!; - [Dependency] protected readonly IRobustRandom _random = default!; + [Dependency] private readonly IPrototypeManager _proto = default!; + [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedDoAfterSystem _doAfter = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; From 8938e1d8b25d903355a9e058bbb12904a270ae06 Mon Sep 17 00:00:00 2001 From: ShadowCommander Date: Sun, 12 May 2024 07:30:17 -0700 Subject: [PATCH 097/111] Replace AttachToGridOrMap with DropNextTo (#27950) --- .../EntitySystems/SliceableFoodSystem.cs | 22 ++++--------------- .../Body/Systems/SharedBodySystem.Body.cs | 6 +++-- .../EntitySystems/SharedHandsSystem.Drop.cs | 11 +++------- 3 files changed, 11 insertions(+), 28 deletions(-) diff --git a/Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs b/Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs index ea422afdf0..f5d434090e 100644 --- a/Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/SliceableFoodSystem.cs @@ -110,15 +110,8 @@ namespace Content.Server.Nutrition.EntitySystems // try putting the slice into the container if the food being sliced is in a container! // this lets you do things like slice a pizza up inside of a hot food cart without making a food-everywhere mess - if (_containerSystem.TryGetContainingContainer(uid, out var container) && _containerSystem.CanInsert(sliceUid, container)) - { - _containerSystem.Insert(sliceUid, container); - } - else // puts it down "right-side up" - { - _xformSystem.AttachToGridOrMap(sliceUid); - _xformSystem.SetLocalRotation(sliceUid, 0); - } + _xformSystem.DropNextTo(sliceUid, (uid, transform)); + _xformSystem.SetLocalRotation(sliceUid, 0); return sliceUid; } @@ -143,15 +136,8 @@ namespace Content.Server.Nutrition.EntitySystems var trashUid = Spawn(foodComp.Trash, _xformSystem.GetMapCoordinates(uid)); // try putting the trash in the food's container too, to be consistent with slice spawning? - if (_containerSystem.TryGetContainingContainer(uid, out var container) && _containerSystem.CanInsert(trashUid, container)) - { - _containerSystem.Insert(trashUid, container); - } - else // puts it down "right-side up" - { - _xformSystem.AttachToGridOrMap(trashUid); - _xformSystem.SetLocalRotation(trashUid, 0); - } + _xformSystem.DropNextTo(trashUid, uid); + _xformSystem.SetLocalRotation(trashUid, 0); QueueDel(uid); } diff --git a/Content.Shared/Body/Systems/SharedBodySystem.Body.cs b/Content.Shared/Body/Systems/SharedBodySystem.Body.cs index 1a35afdbe0..250f90db8f 100644 --- a/Content.Shared/Body/Systems/SharedBodySystem.Body.cs +++ b/Content.Shared/Body/Systems/SharedBodySystem.Body.cs @@ -322,15 +322,17 @@ public partial class SharedBodySystem launchImpulseVariance:GibletLaunchImpulseVariance, launchCone: splatCone); } } + + var bodyTransform = Transform(bodyId); if (TryComp(bodyId, out var inventory)) { foreach (var item in _inventory.GetHandOrInventoryEntities(bodyId)) { - SharedTransform.AttachToGridOrMap(item); + SharedTransform.DropNextTo(item, (bodyId, bodyTransform)); gibs.Add(item); } } - _audioSystem.PlayPredicted(gibSoundOverride, Transform(bodyId).Coordinates, null); + _audioSystem.PlayPredicted(gibSoundOverride, bodyTransform.Coordinates, null); return gibs; } } diff --git a/Content.Shared/Hands/EntitySystems/SharedHandsSystem.Drop.cs b/Content.Shared/Hands/EntitySystems/SharedHandsSystem.Drop.cs index 7b169b5d0a..4d21e40a98 100644 --- a/Content.Shared/Hands/EntitySystems/SharedHandsSystem.Drop.cs +++ b/Content.Shared/Hands/EntitySystems/SharedHandsSystem.Drop.cs @@ -120,17 +120,12 @@ public abstract partial class SharedHandsSystem return true; var userXform = Transform(uid); - var isInContainer = ContainerSystem.IsEntityInContainer(uid); + var isInContainer = ContainerSystem.IsEntityOrParentInContainer(uid, xform: userXform); if (targetDropLocation == null || isInContainer) { - // If user is in a container, drop item into that container. Otherwise, attach to grid or map.\ - // TODO recursively check upwards for containers - - if (!isInContainer - || !ContainerSystem.TryGetContainingContainer(userXform.ParentUid, uid, out var container, skipExistCheck: true) - || !ContainerSystem.Insert((entity, itemXform), container)) - TransformSystem.AttachToGridOrMap(entity, itemXform); + // If user is in a container, drop item into that container. Otherwise, attach to grid or map. + TransformSystem.DropNextTo((entity, itemXform), (uid, userXform)); return true; } From 855234aa309b0329e1435466b09b85448fa31178 Mon Sep 17 00:00:00 2001 From: Kara Date: Sun, 12 May 2024 07:31:54 -0700 Subject: [PATCH 098/111] Resolve `'TransformComponent.MapPosition' is obsolete` in content (#27939) * Resolve `'TransformComponent.MapPosition' is obsolete: 'Use TransformSystem.GetMapCoordinates'` in content * build? --- .../UI/SpawnExplosion/SpawnExplosionWindow.xaml.cs | 6 ++++-- Content.Client/GPS/UI/HandheldGpsStatusControl.cs | 5 ++++- Content.Client/MouseRotator/MouseRotatorSystem.cs | 3 ++- .../Radiation/Overlays/RadiationPulseOverlay.cs | 9 +++++++-- Content.Client/Sprite/SpriteFadeSystem.cs | 4 +++- Content.Client/Tabletop/TabletopSystem.cs | 5 +++-- .../UserInterface/Systems/Chat/ChatUIController.cs | 5 +++-- Content.Client/Verbs/VerbSystem.cs | 5 +++-- Content.Client/Weapons/Melee/MeleeArcOverlay.cs | 6 ++++-- Content.Client/Weapons/Melee/MeleeSpreadCommand.cs | 3 ++- Content.Client/Weapons/Melee/MeleeWeaponSystem.cs | 2 +- Content.Client/Weapons/Ranged/GunSpreadOverlay.cs | 6 ++++-- Content.Client/Weapons/Ranged/Systems/GunSystem.cs | 3 ++- Content.IntegrationTests/Tests/Doors/AirlockTest.cs | 2 +- Content.IntegrationTests/Tests/Hands/HandTests.cs | 4 +++- .../Tests/Interaction/InRangeUnobstructed.cs | 4 +++- .../Administration/Commands/ExplosionCommand.cs | 3 ++- .../Administration/Systems/AdminVerbSystem.Smites.cs | 2 +- .../Anomaly/Effects/ElectricityAnomalySystem.cs | 2 +- .../Anomaly/Effects/InjectionAnomalySystem.cs | 4 +++- Content.Server/Beam/BeamSystem.cs | 6 ++++-- .../Chemistry/ReactionEffects/AreaReactionEffect.cs | 10 +++++++--- .../ReactionEffects/CreateEntityReactionEffect.cs | 2 +- .../Chemistry/ReactionEffects/EmpReactionEffect.cs | 6 ++++-- Content.Server/Cloning/CloningSystem.cs | 2 +- .../Construction/ConstructionSystem.Initial.cs | 2 +- .../Thresholds/Behaviors/SpawnEntitiesBehavior.cs | 7 +++++-- Content.Server/Disposal/Tube/DisposalTubeSystem.cs | 3 ++- Content.Server/Dragon/DragonSystem.cs | 2 +- Content.Server/Emp/EmpSystem.cs | 4 +++- .../Explosion/EntitySystems/SmokeOnTriggerSystem.cs | 7 +++++-- Content.Server/Fluids/EntitySystems/DrainSystem.cs | 4 +++- .../GameTicking/Rules/DeathMatchRuleSystem.cs | 4 +++- Content.Server/Gatherable/GatherableSystem.cs | 4 +++- Content.Server/Guardian/GuardianSystem.cs | 2 +- Content.Server/Kitchen/EntitySystems/SharpSystem.cs | 4 +++- Content.Server/Lightning/LightningSystem.cs | 4 +++- Content.Server/Lightning/LightningTargetSystem.cs | 4 +++- Content.Server/NPC/Systems/NPCSteeringSystem.cs | 2 +- Content.Server/NPC/Systems/NPCUtilitySystem.cs | 2 +- Content.Server/Nuke/NukeSystem.cs | 2 +- Content.Server/Nutrition/EntitySystems/FoodSystem.cs | 6 ++++-- Content.Server/PDA/Ringer/RingerSystem.cs | 3 ++- Content.Server/Payload/EntitySystems/PayloadSystem.cs | 4 +++- .../Pointing/EntitySystems/PointingSystem.cs | 2 +- Content.Server/Respawn/SpecialRespawnSystem.cs | 2 +- .../Singularity/EntitySystems/EventHorizonSystem.cs | 4 ++-- .../XenoArtifacts/Effects/Systems/EmpArtifactSystem.cs | 6 ++++-- .../Effects/Systems/SpawnArtifactSystem.cs | 2 +- .../Effects/Systems/ThrowArtifactSystem.cs | 4 +++- Content.Shared/DeviceLinking/SharedDeviceLinkSystem.cs | 3 ++- Content.Shared/Examine/ExamineSystemShared.cs | 8 ++++---- .../Hands/EntitySystems/SharedHandsSystem.Pickup.cs | 4 ++-- Content.Shared/Interaction/RotateToFaceSystem.cs | 2 +- Content.Shared/Interaction/SharedInteractionSystem.cs | 6 +++--- .../Storage/EntitySystems/MagnetPickupSystem.cs | 2 +- Content.Shared/Tabletop/SharedTabletopSystem.cs | 6 +++--- Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs | 2 +- .../Ranged/Systems/SharedGunSystem.Ballistic.cs | 4 ++-- 59 files changed, 152 insertions(+), 84 deletions(-) diff --git a/Content.Client/Administration/UI/SpawnExplosion/SpawnExplosionWindow.xaml.cs b/Content.Client/Administration/UI/SpawnExplosion/SpawnExplosionWindow.xaml.cs index 5f187cad79..b0d8a946ec 100644 --- a/Content.Client/Administration/UI/SpawnExplosion/SpawnExplosionWindow.xaml.cs +++ b/Content.Client/Administration/UI/SpawnExplosion/SpawnExplosionWindow.xaml.cs @@ -3,6 +3,7 @@ using Content.Shared.Explosion; using JetBrains.Annotations; using Robust.Client.AutoGenerated; using Robust.Client.Console; +using Robust.Client.GameObjects; using Robust.Client.Player; using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.XAML; @@ -22,7 +23,7 @@ public sealed partial class SpawnExplosionWindow : DefaultWindow [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IEntityManager _entMan = default!; - + private readonly SharedTransformSystem _transform = default!; private readonly SpawnExplosionEui _eui; private List _mapData = new(); @@ -37,6 +38,7 @@ public sealed partial class SpawnExplosionWindow : DefaultWindow { RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); + _transform = _entMan.System(); _eui = eui; ExplosionOption.OnItemSelected += ExplosionSelected; @@ -104,7 +106,7 @@ public sealed partial class SpawnExplosionWindow : DefaultWindow _pausePreview = true; MapOptions.Select(_mapData.IndexOf(transform.MapID)); - (MapX.Value, MapY.Value) = transform.MapPosition.Position; + (MapX.Value, MapY.Value) = _transform.GetMapCoordinates(_playerManager.LocalEntity!.Value, xform: transform).Position; _pausePreview = false; UpdatePreview(); diff --git a/Content.Client/GPS/UI/HandheldGpsStatusControl.cs b/Content.Client/GPS/UI/HandheldGpsStatusControl.cs index de6a1031ba..7dcf3f29c5 100644 --- a/Content.Client/GPS/UI/HandheldGpsStatusControl.cs +++ b/Content.Client/GPS/UI/HandheldGpsStatusControl.cs @@ -1,6 +1,7 @@ using Content.Client.GPS.Components; using Content.Client.Message; using Content.Client.Stylesheets; +using Robust.Client.GameObjects; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Shared.Timing; @@ -13,11 +14,13 @@ public sealed class HandheldGpsStatusControl : Control private readonly RichTextLabel _label; private float _updateDif; private readonly IEntityManager _entMan; + private readonly SharedTransformSystem _transform; public HandheldGpsStatusControl(Entity parent) { _parent = parent; _entMan = IoCManager.Resolve(); + _transform = _entMan.System(); _label = new RichTextLabel { StyleClasses = { StyleNano.StyleClassItemStatus } }; AddChild(_label); UpdateGpsDetails(); @@ -41,7 +44,7 @@ public sealed class HandheldGpsStatusControl : Control var posText = "Error"; if (_entMan.TryGetComponent(_parent, out TransformComponent? transComp)) { - var pos = transComp.MapPosition; + var pos = _transform.GetMapCoordinates(_parent.Owner, xform: transComp); var x = (int) pos.X; var y = (int) pos.Y; posText = $"({x}, {y})"; diff --git a/Content.Client/MouseRotator/MouseRotatorSystem.cs b/Content.Client/MouseRotator/MouseRotatorSystem.cs index 4894c17c4c..ce174c6144 100644 --- a/Content.Client/MouseRotator/MouseRotatorSystem.cs +++ b/Content.Client/MouseRotator/MouseRotatorSystem.cs @@ -2,6 +2,7 @@ using Robust.Client.Graphics; using Robust.Client.Input; using Robust.Client.Player; +using Robust.Client.Replays.Loading; using Robust.Shared.Map; using Robust.Shared.Timing; @@ -37,7 +38,7 @@ public sealed class MouseRotatorSystem : SharedMouseRotatorSystem if (mapPos.MapId == MapId.Nullspace) return; - var angle = (mapPos.Position - xform.MapPosition.Position).ToWorldAngle(); + var angle = (mapPos.Position - _transform.GetMapCoordinates(player.Value, xform: xform).Position).ToWorldAngle(); var curRot = _transform.GetWorldRotation(xform); diff --git a/Content.Client/Radiation/Overlays/RadiationPulseOverlay.cs b/Content.Client/Radiation/Overlays/RadiationPulseOverlay.cs index 9012767ef3..8d5607af2d 100644 --- a/Content.Client/Radiation/Overlays/RadiationPulseOverlay.cs +++ b/Content.Client/Radiation/Overlays/RadiationPulseOverlay.cs @@ -1,9 +1,11 @@ using System.Numerics; using Content.Shared.Radiation.Components; +using Robust.Client.GameObjects; using Robust.Client.Graphics; using Robust.Shared.Enums; using Robust.Shared.Graphics; using Robust.Shared.Map; +using Robust.Shared.Physics; using Robust.Shared.Prototypes; using Robust.Shared.Timing; @@ -14,6 +16,7 @@ namespace Content.Client.Radiation.Overlays [Dependency] private readonly IEntityManager _entityManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; + private TransformSystem? _transform; private const float MaxDist = 15.0f; @@ -72,6 +75,8 @@ namespace Content.Client.Radiation.Overlays //Queries all pulses on the map and either adds or removes them from the list of rendered pulses based on whether they should be drawn (in range? on the same z-level/map? pulse entity still exists?) private void RadiationQuery(IEye? currentEye) { + _transform ??= _entityManager.System(); + if (currentEye == null) { _pulses.Clear(); @@ -91,7 +96,7 @@ namespace Content.Client.Radiation.Overlays ( _baseShader.Duplicate(), new RadiationShaderInstance( - _entityManager.GetComponent(pulseEntity).MapPosition, + _transform.GetMapCoordinates(pulseEntity), pulse.VisualRange, pulse.StartTime, pulse.VisualDuration @@ -109,7 +114,7 @@ namespace Content.Client.Radiation.Overlays _entityManager.TryGetComponent(pulseEntity, out RadiationPulseComponent? pulse)) { var shaderInstance = _pulses[pulseEntity]; - shaderInstance.instance.CurrentMapCoords = _entityManager.GetComponent(pulseEntity).MapPosition; + shaderInstance.instance.CurrentMapCoords = _transform.GetMapCoordinates(pulseEntity); shaderInstance.instance.Range = pulse.VisualRange; } else { _pulses[pulseEntity].shd.Dispose(); diff --git a/Content.Client/Sprite/SpriteFadeSystem.cs b/Content.Client/Sprite/SpriteFadeSystem.cs index dda3a6c948..d9584b60a6 100644 --- a/Content.Client/Sprite/SpriteFadeSystem.cs +++ b/Content.Client/Sprite/SpriteFadeSystem.cs @@ -3,6 +3,7 @@ using Content.Shared.Sprite; using Robust.Client.GameObjects; using Robust.Client.Player; using Robust.Client.State; +using Robust.Shared.Physics; namespace Content.Client.Sprite; @@ -15,6 +16,7 @@ public sealed class SpriteFadeSystem : EntitySystem [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IStateManager _stateManager = default!; + [Dependency] private readonly SharedTransformSystem _transform = default!; private readonly HashSet _comps = new(); @@ -48,7 +50,7 @@ public sealed class SpriteFadeSystem : EntitySystem spriteQuery.TryGetComponent(player, out var playerSprite)) { var fadeQuery = GetEntityQuery(); - var mapPos = playerXform.MapPosition; + var mapPos = _transform.GetMapCoordinates(_playerManager.LocalEntity!.Value, xform: playerXform); // Also want to handle large entities even if they may not be clickable. foreach (var ent in state.GetClickableEntities(mapPos)) diff --git a/Content.Client/Tabletop/TabletopSystem.cs b/Content.Client/Tabletop/TabletopSystem.cs index 696c1455e0..0b55a1839c 100644 --- a/Content.Client/Tabletop/TabletopSystem.cs +++ b/Content.Client/Tabletop/TabletopSystem.cs @@ -258,7 +258,7 @@ namespace Content.Client.Tabletop // Set the dragging player on the component to noone if (broadcast && _draggedEntity != null && EntityManager.HasComponent(_draggedEntity.Value)) { - RaisePredictiveEvent(new TabletopMoveEvent(GetNetEntity(_draggedEntity.Value), Transform(_draggedEntity.Value).MapPosition, GetNetEntity(_table!.Value))); + RaisePredictiveEvent(new TabletopMoveEvent(GetNetEntity(_draggedEntity.Value), Transforms.GetMapCoordinates(_draggedEntity.Value), GetNetEntity(_table!.Value))); RaisePredictiveEvent(new TabletopDraggingPlayerChangedEvent(GetNetEntity(_draggedEntity.Value), false)); } @@ -277,7 +277,8 @@ namespace Content.Client.Tabletop if (coordinates == MapCoordinates.Nullspace) return MapCoordinates.Nullspace; var eye = viewport.Eye; - if (eye == null) return MapCoordinates.Nullspace; + if (eye == null) + return MapCoordinates.Nullspace; var size = (Vector2) viewport.ViewportSize / EyeManager.PixelsPerMeter; // Convert to tiles instead of pixels var eyePosition = eye.Position.Position; diff --git a/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs b/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs index 31e09e6603..334ba60873 100644 --- a/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs +++ b/Content.Client/UserInterface/Systems/Chat/ChatUIController.cs @@ -60,6 +60,7 @@ public sealed class ChatUIController : UIController [UISystemDependency] private readonly GhostSystem? _ghost = default; [UISystemDependency] private readonly TypingIndicatorSystem? _typingIndicator = default; [UISystemDependency] private readonly ChatSystem? _chatSys = default; + [UISystemDependency] private readonly TransformSystem? _transform = default; [ValidatePrototypeId] private const string ChatNamePalette = "ChatNames"; @@ -625,7 +626,7 @@ public sealed class ChatUIController : UIController var predicate = static (EntityUid uid, (EntityUid compOwner, EntityUid? attachedEntity) data) => uid == data.compOwner || uid == data.attachedEntity; var playerPos = player != null - ? EntityManager.GetComponent(player.Value).MapPosition + ? _transform?.GetMapCoordinates(player.Value) ?? MapCoordinates.Nullspace : MapCoordinates.Nullspace; var occluded = player != null && _examine.IsOccluded(player.Value); @@ -644,7 +645,7 @@ public sealed class ChatUIController : UIController continue; } - var otherPos = EntityManager.GetComponent(ent).MapPosition; + var otherPos = _transform?.GetMapCoordinates(ent) ?? MapCoordinates.Nullspace; if (occluded && !_examine.InRangeUnOccluded( playerPos, diff --git a/Content.Client/Verbs/VerbSystem.cs b/Content.Client/Verbs/VerbSystem.cs index 49a3785eb2..2e6c5f5809 100644 --- a/Content.Client/Verbs/VerbSystem.cs +++ b/Content.Client/Verbs/VerbSystem.cs @@ -22,6 +22,7 @@ namespace Content.Client.Verbs [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly ExamineSystem _examine = default!; [Dependency] private readonly TagSystem _tagSystem = default!; + [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly IStateManager _stateManager = default!; [Dependency] private readonly EntityLookupSystem _entityLookup = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; @@ -141,7 +142,7 @@ namespace Content.Client.Verbs if ((visibility & MenuVisibility.NoFov) == 0) { var xformQuery = GetEntityQuery(); - var playerPos = xformQuery.GetComponent(player.Value).MapPosition; + var playerPos = _transform.GetMapCoordinates(player.Value, xform: xformQuery.GetComponent(player.Value)); for (var i = entities.Count - 1; i >= 0; i--) { @@ -149,7 +150,7 @@ namespace Content.Client.Verbs if (!_examine.InRangeUnOccluded( playerPos, - xformQuery.GetComponent(entity).MapPosition, + _transform.GetMapCoordinates(entity, xform: xformQuery.GetComponent(entity)), ExamineSystemShared.ExamineRange, null)) { diff --git a/Content.Client/Weapons/Melee/MeleeArcOverlay.cs b/Content.Client/Weapons/Melee/MeleeArcOverlay.cs index dbd68c15e2..e7b6c8b0d6 100644 --- a/Content.Client/Weapons/Melee/MeleeArcOverlay.cs +++ b/Content.Client/Weapons/Melee/MeleeArcOverlay.cs @@ -20,10 +20,11 @@ public sealed class MeleeArcOverlay : Overlay private readonly IPlayerManager _playerManager; private readonly MeleeWeaponSystem _melee; private readonly SharedCombatModeSystem _combatMode; + private readonly SharedTransformSystem _transform = default!; public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV; - public MeleeArcOverlay(IEntityManager entManager, IEyeManager eyeManager, IInputManager inputManager, IPlayerManager playerManager, MeleeWeaponSystem melee, SharedCombatModeSystem combatMode) + public MeleeArcOverlay(IEntityManager entManager, IEyeManager eyeManager, IInputManager inputManager, IPlayerManager playerManager, MeleeWeaponSystem melee, SharedCombatModeSystem combatMode, SharedTransformSystem transform) { _entManager = entManager; _eyeManager = eyeManager; @@ -31,6 +32,7 @@ public sealed class MeleeArcOverlay : Overlay _playerManager = playerManager; _melee = melee; _combatMode = combatMode; + _transform = transform; } protected override void Draw(in OverlayDrawArgs args) @@ -52,7 +54,7 @@ public sealed class MeleeArcOverlay : Overlay if (mapPos.MapId != args.MapId) return; - var playerPos = xform.MapPosition; + var playerPos = _transform.GetMapCoordinates(player.Value, xform: xform); if (mapPos.MapId != playerPos.MapId) return; diff --git a/Content.Client/Weapons/Melee/MeleeSpreadCommand.cs b/Content.Client/Weapons/Melee/MeleeSpreadCommand.cs index 6b259a7fd5..eda469deaf 100644 --- a/Content.Client/Weapons/Melee/MeleeSpreadCommand.cs +++ b/Content.Client/Weapons/Melee/MeleeSpreadCommand.cs @@ -35,6 +35,7 @@ public sealed class MeleeSpreadCommand : IConsoleCommand collection.Resolve(), collection.Resolve(), sysManager.GetEntitySystem(), - sysManager.GetEntitySystem())); + sysManager.GetEntitySystem(), + sysManager.GetEntitySystem())); } } diff --git a/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs b/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs index 039af55bd0..d59d471f1a 100644 --- a/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs +++ b/Content.Client/Weapons/Melee/MeleeWeaponSystem.cs @@ -142,7 +142,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem // Light attack if (useDown == BoundKeyState.Down) { - var attackerPos = Transform(entity).MapPosition; + var attackerPos = TransformSystem.GetMapCoordinates(entity); if (mousePos.MapId != attackerPos.MapId || (attackerPos.Position - mousePos.Position).Length() > weapon.Range) diff --git a/Content.Client/Weapons/Ranged/GunSpreadOverlay.cs b/Content.Client/Weapons/Ranged/GunSpreadOverlay.cs index 62df764ae5..63d21c8463 100644 --- a/Content.Client/Weapons/Ranged/GunSpreadOverlay.cs +++ b/Content.Client/Weapons/Ranged/GunSpreadOverlay.cs @@ -18,8 +18,9 @@ public sealed class GunSpreadOverlay : Overlay private readonly IInputManager _input; private readonly IPlayerManager _player; private readonly GunSystem _guns; + private readonly SharedTransformSystem _transform; - public GunSpreadOverlay(IEntityManager entManager, IEyeManager eyeManager, IGameTiming timing, IInputManager input, IPlayerManager player, GunSystem system) + public GunSpreadOverlay(IEntityManager entManager, IEyeManager eyeManager, IGameTiming timing, IInputManager input, IPlayerManager player, GunSystem system, SharedTransformSystem transform) { _entManager = entManager; _eye = eyeManager; @@ -27,6 +28,7 @@ public sealed class GunSpreadOverlay : Overlay _timing = timing; _player = player; _guns = system; + _transform = transform; } protected override void Draw(in OverlayDrawArgs args) @@ -41,7 +43,7 @@ public sealed class GunSpreadOverlay : Overlay return; } - var mapPos = xform.MapPosition; + var mapPos = _transform.GetMapCoordinates(player.Value, xform: xform); if (mapPos.MapId == MapId.Nullspace) return; diff --git a/Content.Client/Weapons/Ranged/Systems/GunSystem.cs b/Content.Client/Weapons/Ranged/Systems/GunSystem.cs index 4a7711032e..ac5914d47c 100644 --- a/Content.Client/Weapons/Ranged/Systems/GunSystem.cs +++ b/Content.Client/Weapons/Ranged/Systems/GunSystem.cs @@ -60,7 +60,8 @@ public sealed partial class GunSystem : SharedGunSystem Timing, _inputManager, _player, - this)); + this, + TransformSystem)); } else { diff --git a/Content.IntegrationTests/Tests/Doors/AirlockTest.cs b/Content.IntegrationTests/Tests/Doors/AirlockTest.cs index 9f31231091..2fbaa91456 100644 --- a/Content.IntegrationTests/Tests/Doors/AirlockTest.cs +++ b/Content.IntegrationTests/Tests/Doors/AirlockTest.cs @@ -171,7 +171,7 @@ namespace Content.IntegrationTests.Tests.Doors // Sloth: Okay I'm sorry but I hate having to rewrite tests for every refactor // If you see this yell at me in discord so I can continue to pretend this didn't happen. // REMINDER THAT I STILL HAVE TO FIX THIS TEST EVERY OTHER PHYSICS PR - // Assert.That(AirlockPhysicsDummy.Transform.MapPosition.X, Is.GreaterThan(AirlockPhysicsDummyStartingX)); + // _transform.GetMapCoordinates(UID HERE, xform: Assert.That(AirlockPhysicsDummy.Transform).X, Is.GreaterThan(AirlockPhysicsDummyStartingX)); // Blocked by the airlock await server.WaitAssertion(() => diff --git a/Content.IntegrationTests/Tests/Hands/HandTests.cs b/Content.IntegrationTests/Tests/Hands/HandTests.cs index fdcd7f9096..9ecabbeebf 100644 --- a/Content.IntegrationTests/Tests/Hands/HandTests.cs +++ b/Content.IntegrationTests/Tests/Hands/HandTests.cs @@ -1,6 +1,7 @@ using System.Linq; using Content.Shared.Hands.Components; using Content.Shared.Hands.EntitySystems; +using Robust.Server.GameObjects; using Robust.Server.Player; using Robust.Shared.GameObjects; using Robust.Shared.Map; @@ -24,6 +25,7 @@ public sealed class HandTests var playerMan = server.ResolveDependency(); var mapMan = server.ResolveDependency(); var sys = entMan.System(); + var tSys = entMan.System(); var data = await pair.CreateTestMap(); await pair.RunTicksSync(5); @@ -35,7 +37,7 @@ public sealed class HandTests { player = playerMan.Sessions.First().AttachedEntity!.Value; var xform = entMan.GetComponent(player); - item = entMan.SpawnEntity("Crowbar", xform.MapPosition); + item = entMan.SpawnEntity("Crowbar", tSys.GetMapCoordinates(player, xform: xform)); hands = entMan.GetComponent(player); sys.TryPickup(player, item, hands.ActiveHand!); }); diff --git a/Content.IntegrationTests/Tests/Interaction/InRangeUnobstructed.cs b/Content.IntegrationTests/Tests/Interaction/InRangeUnobstructed.cs index b8828763a2..719367e54e 100644 --- a/Content.IntegrationTests/Tests/Interaction/InRangeUnobstructed.cs +++ b/Content.IntegrationTests/Tests/Interaction/InRangeUnobstructed.cs @@ -1,5 +1,6 @@ using System.Numerics; using Content.Shared.Interaction; +using Robust.Server.GameObjects; using Robust.Shared.Containers; using Robust.Shared.GameObjects; using Robust.Shared.Map; @@ -32,6 +33,7 @@ namespace Content.IntegrationTests.Tests.Interaction var sEntities = server.ResolveDependency(); var mapManager = server.ResolveDependency(); var conSystem = sEntities.EntitySysManager.GetEntitySystem(); + var tSystem = sEntities.EntitySysManager.GetEntitySystem(); EntityUid origin = default; EntityUid other = default; @@ -45,7 +47,7 @@ namespace Content.IntegrationTests.Tests.Interaction origin = sEntities.SpawnEntity(HumanId, coordinates); other = sEntities.SpawnEntity(HumanId, coordinates); conSystem.EnsureContainer(other, "InRangeUnobstructedTestOtherContainer"); - mapCoordinates = sEntities.GetComponent(other).MapPosition; + mapCoordinates = tSystem.GetMapCoordinates(other); }); await server.WaitIdleAsync(); diff --git a/Content.Server/Administration/Commands/ExplosionCommand.cs b/Content.Server/Administration/Commands/ExplosionCommand.cs index 56ed78b2e2..81daca59c4 100644 --- a/Content.Server/Administration/Commands/ExplosionCommand.cs +++ b/Content.Server/Administration/Commands/ExplosionCommand.cs @@ -8,6 +8,7 @@ using Robust.Shared.Map; using Robust.Shared.Prototypes; using System.Linq; using System.Numerics; +using Robust.Server.GameObjects; namespace Content.Server.Administration.Commands; @@ -105,7 +106,7 @@ public sealed class ExplosionCommand : IConsoleCommand if (args.Length > 4) coords = new MapCoordinates(new Vector2(x, y), xform.MapID); else - coords = xform.MapPosition; + coords = entMan.System().GetMapCoordinates(shell.Player.AttachedEntity.Value, xform: xform); } ExplosionPrototype? type; diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs index ed60fe5448..eb21662719 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs @@ -102,7 +102,7 @@ public sealed partial class AdminVerbSystem Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/smite.svg.192dpi.png")), Act = () => { - var coords = Transform(args.Target).MapPosition; + var coords = _transformSystem.GetMapCoordinates(args.Target); Timer.Spawn(_gameTiming.TickPeriod, () => _explosionSystem.QueueExplosion(coords, ExplosionSystem.DefaultExplosionPrototypeId, 4, 1, 2, maxTileBreak: 0), // it gibs, damage doesn't need to be high. diff --git a/Content.Server/Anomaly/Effects/ElectricityAnomalySystem.cs b/Content.Server/Anomaly/Effects/ElectricityAnomalySystem.cs index f2a060d629..bd4718e8e3 100644 --- a/Content.Server/Anomaly/Effects/ElectricityAnomalySystem.cs +++ b/Content.Server/Anomaly/Effects/ElectricityAnomalySystem.cs @@ -61,7 +61,7 @@ public sealed class ElectricityAnomalySystem : EntitySystem var damage = (int) (elec.MaxElectrocuteDamage * anom.Severity); var duration = elec.MaxElectrocuteDuration * anom.Severity; - foreach (var (ent, comp) in _lookup.GetEntitiesInRange(xform.MapPosition, range)) + foreach (var (ent, comp) in _lookup.GetEntitiesInRange(_transform.GetMapCoordinates(uid, xform), range)) { _electrocution.TryDoElectrocution(ent, uid, damage, duration, true, statusEffects: comp, ignoreInsulation: true); } diff --git a/Content.Server/Anomaly/Effects/InjectionAnomalySystem.cs b/Content.Server/Anomaly/Effects/InjectionAnomalySystem.cs index 731d853280..1fa0c00bd3 100644 --- a/Content.Server/Anomaly/Effects/InjectionAnomalySystem.cs +++ b/Content.Server/Anomaly/Effects/InjectionAnomalySystem.cs @@ -3,6 +3,7 @@ using Content.Server.Chemistry.Containers.EntitySystems; using Content.Shared.Anomaly.Components; using Content.Shared.Chemistry.Components.SolutionManager; using System.Linq; +using Robust.Server.GameObjects; namespace Content.Server.Anomaly.Effects; /// @@ -16,6 +17,7 @@ public sealed class InjectionAnomalySystem : EntitySystem { [Dependency] private readonly EntityLookupSystem _lookup = default!; [Dependency] private readonly SolutionContainerSystem _solutionContainer = default!; + [Dependency] private readonly TransformSystem _transform = default!; private EntityQuery _injectableQuery; @@ -45,7 +47,7 @@ public sealed class InjectionAnomalySystem : EntitySystem //We get all the entity in the radius into which the reagent will be injected. var xformQuery = GetEntityQuery(); var xform = xformQuery.GetComponent(entity); - var allEnts = _lookup.GetEntitiesInRange(xform.MapPosition, injectRadius) + var allEnts = _lookup.GetEntitiesInRange(_transform.GetMapCoordinates(entity, xform: xform), injectRadius) .Select(x => x.Owner).ToList(); //for each matching entity found diff --git a/Content.Server/Beam/BeamSystem.cs b/Content.Server/Beam/BeamSystem.cs index 33f2f252d9..ad67f983c2 100644 --- a/Content.Server/Beam/BeamSystem.cs +++ b/Content.Server/Beam/BeamSystem.cs @@ -3,6 +3,7 @@ using Content.Server.Beam.Components; using Content.Shared.Beam; using Content.Shared.Beam.Components; using Content.Shared.Physics; +using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Robust.Shared.Map; @@ -16,6 +17,7 @@ namespace Content.Server.Beam; public sealed class BeamSystem : SharedBeamSystem { [Dependency] private readonly FixtureSystem _fixture = default!; + [Dependency] private readonly TransformSystem _transform = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedBroadphaseSystem _broadphase = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!; @@ -144,8 +146,8 @@ public sealed class BeamSystem : SharedBeamSystem if (Deleted(user) || Deleted(target)) return; - var userMapPos = Transform(user).MapPosition; - var targetMapPos = Transform(target).MapPosition; + var userMapPos = _transform.GetMapCoordinates(user); + var targetMapPos = _transform.GetMapCoordinates(target); //The distance between the target and the user. var calculatedDistance = targetMapPos.Position - userMapPos.Position; diff --git a/Content.Server/Chemistry/ReactionEffects/AreaReactionEffect.cs b/Content.Server/Chemistry/ReactionEffects/AreaReactionEffect.cs index 024558f8de..ebbf4e0341 100644 --- a/Content.Server/Chemistry/ReactionEffects/AreaReactionEffect.cs +++ b/Content.Server/Chemistry/ReactionEffects/AreaReactionEffect.cs @@ -6,6 +6,7 @@ using Content.Shared.Database; using Content.Shared.FixedPoint; using Content.Shared.Maps; using JetBrains.Annotations; +using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Robust.Shared.Map; @@ -58,15 +59,18 @@ namespace Content.Server.Chemistry.ReactionEffects var splitSolution = args.Source.SplitSolution(args.Source.Volume); var transform = args.EntityManager.GetComponent(args.SolutionEntity); var mapManager = IoCManager.Resolve(); + var mapSys = args.EntityManager.System(); + var sys = args.EntityManager.System(); + var mapCoords = sys.GetMapCoordinates(args.SolutionEntity, xform: transform); - if (!mapManager.TryFindGridAt(transform.MapPosition, out _, out var grid) || - !grid.TryGetTileRef(transform.Coordinates, out var tileRef) || + if (!mapManager.TryFindGridAt(mapCoords, out var gridUid, out var grid) || + !mapSys.TryGetTileRef(gridUid, grid, transform.Coordinates, out var tileRef) || tileRef.Tile.IsSpace()) { return; } - var coords = grid.MapToGrid(transform.MapPosition); + var coords = mapSys.MapToGrid(gridUid, mapCoords); var ent = args.EntityManager.SpawnEntity(_prototypeId, coords.SnapToGrid()); var smoke = args.EntityManager.System(); diff --git a/Content.Server/Chemistry/ReactionEffects/CreateEntityReactionEffect.cs b/Content.Server/Chemistry/ReactionEffects/CreateEntityReactionEffect.cs index f8c0378452..0d5acc1722 100644 --- a/Content.Server/Chemistry/ReactionEffects/CreateEntityReactionEffect.cs +++ b/Content.Server/Chemistry/ReactionEffects/CreateEntityReactionEffect.cs @@ -34,7 +34,7 @@ public sealed partial class CreateEntityReactionEffect : ReagentEffect for (var i = 0; i < quantity; i++) { - var uid = args.EntityManager.SpawnEntity(Entity, transform.MapPosition); + var uid = args.EntityManager.SpawnEntity(Entity, transformSystem.GetMapCoordinates(args.SolutionEntity, xform: transform)); transformSystem.AttachToGridOrMap(uid); // TODO figure out how to properly spawn inside of containers diff --git a/Content.Server/Chemistry/ReactionEffects/EmpReactionEffect.cs b/Content.Server/Chemistry/ReactionEffects/EmpReactionEffect.cs index b6714ca28d..9a320ffc39 100644 --- a/Content.Server/Chemistry/ReactionEffects/EmpReactionEffect.cs +++ b/Content.Server/Chemistry/ReactionEffects/EmpReactionEffect.cs @@ -1,5 +1,6 @@ using Content.Server.Emp; using Content.Shared.Chemistry.Reagent; +using Robust.Server.GameObjects; using Robust.Shared.Prototypes; namespace Content.Server.Chemistry.ReactionEffects; @@ -37,11 +38,12 @@ public sealed partial class EmpReactionEffect : ReagentEffect public override void Effect(ReagentEffectArgs args) { + var tSys = args.EntityManager.System(); var transform = args.EntityManager.GetComponent(args.SolutionEntity); var range = MathF.Min((float) (args.Quantity*EmpRangePerUnit), EmpMaxRange); - args.EntityManager.System().EmpPulse( - transform.MapPosition, + args.EntityManager.System() + .EmpPulse(tSys.GetMapCoordinates(args.SolutionEntity, xform: transform), range, EnergyConsumption, DisableDuration); diff --git a/Content.Server/Cloning/CloningSystem.cs b/Content.Server/Cloning/CloningSystem.cs index def9950d90..3893f31d25 100644 --- a/Content.Server/Cloning/CloningSystem.cs +++ b/Content.Server/Cloning/CloningSystem.cs @@ -210,7 +210,7 @@ namespace Content.Server.Cloning } // end of genetic damage checks - var mob = Spawn(speciesPrototype.Prototype, Transform(uid).MapPosition); + var mob = Spawn(speciesPrototype.Prototype, _transformSystem.GetMapCoordinates(uid)); _humanoidSystem.CloneAppearance(bodyToClone, mob); var ev = new CloningEvent(bodyToClone, mob); diff --git a/Content.Server/Construction/ConstructionSystem.Initial.cs b/Content.Server/Construction/ConstructionSystem.Initial.cs index ede8d3064f..17ed5c90f4 100644 --- a/Content.Server/Construction/ConstructionSystem.Initial.cs +++ b/Content.Server/Construction/ConstructionSystem.Initial.cs @@ -79,7 +79,7 @@ namespace Content.Server.Construction } } - var pos = Transform(user).MapPosition; + var pos = _transformSystem.GetMapCoordinates(user); foreach (var near in _lookupSystem.GetEntitiesInRange(pos, 2f, LookupFlags.Contained | LookupFlags.Dynamic | LookupFlags.Sundries | LookupFlags.Approximate)) { diff --git a/Content.Server/Destructible/Thresholds/Behaviors/SpawnEntitiesBehavior.cs b/Content.Server/Destructible/Thresholds/Behaviors/SpawnEntitiesBehavior.cs index 0fa3c06c04..057b6df9df 100644 --- a/Content.Server/Destructible/Thresholds/Behaviors/SpawnEntitiesBehavior.cs +++ b/Content.Server/Destructible/Thresholds/Behaviors/SpawnEntitiesBehavior.cs @@ -3,6 +3,7 @@ using Content.Server.Forensics; using Content.Server.Stack; using Content.Shared.Prototypes; using Content.Shared.Stacks; +using Robust.Server.GameObjects; using Robust.Shared.Prototypes; using Robust.Shared.Random; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary; @@ -30,7 +31,8 @@ namespace Content.Server.Destructible.Thresholds.Behaviors public void Execute(EntityUid owner, DestructibleSystem system, EntityUid? cause = null) { - var position = system.EntityManager.GetComponent(owner).MapPosition; + var tSys = system.EntityManager.System(); + var position = tSys.GetMapCoordinates(owner); var getRandomVector = () => new Vector2(system.Random.NextFloat(-Offset, Offset), system.Random.NextFloat(-Offset, Offset)); @@ -48,7 +50,8 @@ namespace Content.Server.Destructible.Thresholds.Behaviors ? minMax.Min : system.Random.Next(minMax.Min, minMax.Max + 1); - if (count == 0) continue; + if (count == 0) + continue; if (EntityPrototypeHelpers.HasComponent(entityId, system.PrototypeManager, system.ComponentFactory)) { diff --git a/Content.Server/Disposal/Tube/DisposalTubeSystem.cs b/Content.Server/Disposal/Tube/DisposalTubeSystem.cs index f0f6e9142c..b38e6e78f4 100644 --- a/Content.Server/Disposal/Tube/DisposalTubeSystem.cs +++ b/Content.Server/Disposal/Tube/DisposalTubeSystem.cs @@ -31,6 +31,7 @@ namespace Content.Server.Disposal.Tube [Dependency] private readonly DisposableSystem _disposableSystem = default!; [Dependency] private readonly SharedContainerSystem _containerSystem = default!; [Dependency] private readonly AtmosphereSystem _atmosSystem = default!; + [Dependency] private readonly TransformSystem _transform = default!; public override void Initialize() { base.Initialize(); @@ -422,7 +423,7 @@ namespace Content.Server.Disposal.Tube return false; var xform = Transform(uid); - var holder = Spawn(DisposalEntryComponent.HolderPrototypeId, xform.MapPosition); + var holder = Spawn(DisposalEntryComponent.HolderPrototypeId, _transform.GetMapCoordinates(uid, xform: xform)); var holderComponent = Comp(holder); foreach (var entity in from.Container.ContainedEntities.ToArray()) diff --git a/Content.Server/Dragon/DragonSystem.cs b/Content.Server/Dragon/DragonSystem.cs index d33e6f3bef..1e29b80eba 100644 --- a/Content.Server/Dragon/DragonSystem.cs +++ b/Content.Server/Dragon/DragonSystem.cs @@ -165,7 +165,7 @@ public sealed partial class DragonSystem : EntitySystem return; } - var carpUid = Spawn(component.RiftPrototype, xform.MapPosition); + var carpUid = Spawn(component.RiftPrototype, _transform.GetMapCoordinates(uid, xform: xform)); component.Rifts.Add(carpUid); Comp(carpUid).Dragon = uid; } diff --git a/Content.Server/Emp/EmpSystem.cs b/Content.Server/Emp/EmpSystem.cs index 7c1a6f9b5d..d8eab0c5d1 100644 --- a/Content.Server/Emp/EmpSystem.cs +++ b/Content.Server/Emp/EmpSystem.cs @@ -4,6 +4,7 @@ using Content.Server.Radio; using Content.Server.SurveillanceCamera; using Content.Shared.Emp; using Content.Shared.Examine; +using Robust.Server.GameObjects; using Robust.Shared.Map; namespace Content.Server.Emp; @@ -11,6 +12,7 @@ namespace Content.Server.Emp; public sealed class EmpSystem : SharedEmpSystem { [Dependency] private readonly EntityLookupSystem _lookup = default!; + [Dependency] private readonly TransformSystem _transform = default!; public const string EmpPulseEffectPrototype = "EffectEmpPulse"; @@ -102,7 +104,7 @@ public sealed class EmpSystem : SharedEmpSystem private void HandleEmpTrigger(EntityUid uid, EmpOnTriggerComponent comp, TriggerEvent args) { - EmpPulse(Transform(uid).MapPosition, comp.Range, comp.EnergyConsumption, comp.DisableDuration); + EmpPulse(_transform.GetMapCoordinates(uid), comp.Range, comp.EnergyConsumption, comp.DisableDuration); args.Handled = true; } diff --git a/Content.Server/Explosion/EntitySystems/SmokeOnTriggerSystem.cs b/Content.Server/Explosion/EntitySystems/SmokeOnTriggerSystem.cs index 17ca972356..f958373ac7 100644 --- a/Content.Server/Explosion/EntitySystems/SmokeOnTriggerSystem.cs +++ b/Content.Server/Explosion/EntitySystems/SmokeOnTriggerSystem.cs @@ -4,6 +4,7 @@ using Content.Server.Fluids.EntitySystems; using Content.Shared.Chemistry.Components; using Content.Shared.Coordinates.Helpers; using Content.Shared.Maps; +using Robust.Server.GameObjects; using Robust.Shared.Map; namespace Content.Server.Explosion.EntitySystems; @@ -15,6 +16,7 @@ public sealed class SmokeOnTriggerSystem : SharedSmokeOnTriggerSystem { [Dependency] private readonly IMapManager _mapMan = default!; [Dependency] private readonly SmokeSystem _smoke = default!; + [Dependency] private readonly TransformSystem _transform = default!; public override void Initialize() { @@ -26,14 +28,15 @@ public sealed class SmokeOnTriggerSystem : SharedSmokeOnTriggerSystem private void OnTrigger(EntityUid uid, SmokeOnTriggerComponent comp, TriggerEvent args) { var xform = Transform(uid); - if (!_mapMan.TryFindGridAt(xform.MapPosition, out _, out var grid) || + var mapCoords = _transform.GetMapCoordinates(uid, xform); + if (!_mapMan.TryFindGridAt(mapCoords, out _, out var grid) || !grid.TryGetTileRef(xform.Coordinates, out var tileRef) || tileRef.Tile.IsSpace()) { return; } - var coords = grid.MapToGrid(xform.MapPosition); + var coords = grid.MapToGrid(mapCoords); var ent = Spawn(comp.SmokePrototype, coords.SnapToGrid()); if (!TryComp(ent, out var smoke)) { diff --git a/Content.Server/Fluids/EntitySystems/DrainSystem.cs b/Content.Server/Fluids/EntitySystems/DrainSystem.cs index 5fc406dca5..b79685d83b 100644 --- a/Content.Server/Fluids/EntitySystems/DrainSystem.cs +++ b/Content.Server/Fluids/EntitySystems/DrainSystem.cs @@ -13,6 +13,7 @@ using Content.Shared.Fluids.Components; using Content.Shared.Interaction; using Content.Shared.Tag; using Content.Shared.Verbs; +using Robust.Server.GameObjects; using Robust.Shared.Audio.Systems; using Robust.Shared.Collections; using Robust.Shared.Prototypes; @@ -31,6 +32,7 @@ public sealed class DrainSystem : SharedDrainSystem [Dependency] private readonly TagSystem _tagSystem = default!; [Dependency] private readonly DoAfterSystem _doAfterSystem = default!; [Dependency] private readonly PuddleSystem _puddleSystem = default!; + [Dependency] private readonly TransformSystem _transform = default!; [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; @@ -161,7 +163,7 @@ public sealed class DrainSystem : SharedDrainSystem puddles.Clear(); - foreach (var entity in _lookup.GetEntitiesInRange(xform.MapPosition, drain.Range)) + foreach (var entity in _lookup.GetEntitiesInRange(_transform.GetMapCoordinates(uid, xform), drain.Range)) { // No InRangeUnobstructed because there's no collision group that fits right now // and these are placed by mappers and not buildable/movable so shouldnt really be a problem... diff --git a/Content.Server/GameTicking/Rules/DeathMatchRuleSystem.cs b/Content.Server/GameTicking/Rules/DeathMatchRuleSystem.cs index 78b8a8a85c..ad7c63ff58 100644 --- a/Content.Server/GameTicking/Rules/DeathMatchRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/DeathMatchRuleSystem.cs @@ -9,6 +9,7 @@ using Content.Server.RoundEnd; using Content.Server.Station.Systems; using Content.Shared.Points; using Content.Shared.Storage; +using Robust.Server.GameObjects; using Robust.Server.Player; using Robust.Shared.Utility; @@ -25,6 +26,7 @@ public sealed class DeathMatchRuleSystem : GameRuleSystem().ToList(); - EntityManager.SpawnEntities(Transform(ev.Entity).MapPosition, spawns); + EntityManager.SpawnEntities(_transform.GetMapCoordinates(ev.Entity), spawns); } } diff --git a/Content.Server/Gatherable/GatherableSystem.cs b/Content.Server/Gatherable/GatherableSystem.cs index 7fbbf7f4f6..11295bb3a3 100644 --- a/Content.Server/Gatherable/GatherableSystem.cs +++ b/Content.Server/Gatherable/GatherableSystem.cs @@ -4,6 +4,7 @@ using Content.Shared.EntityList; using Content.Shared.Interaction; using Content.Shared.Tag; using Content.Shared.Weapons.Melee.Events; +using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Robust.Shared.Prototypes; @@ -18,6 +19,7 @@ public sealed partial class GatherableSystem : EntitySystem [Dependency] private readonly DestructibleSystem _destructible = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly TagSystem _tagSystem = default!; + [Dependency] private readonly TransformSystem _transform = default!; public override void Initialize() { @@ -61,7 +63,7 @@ public sealed partial class GatherableSystem : EntitySystem if (component.MappedLoot == null) return; - var pos = Transform(gatheredUid).MapPosition; + var pos = _transform.GetMapCoordinates(gatheredUid); foreach (var (tag, table) in component.MappedLoot) { diff --git a/Content.Server/Guardian/GuardianSystem.cs b/Content.Server/Guardian/GuardianSystem.cs index 97d4eb0680..203882ed9e 100644 --- a/Content.Server/Guardian/GuardianSystem.cs +++ b/Content.Server/Guardian/GuardianSystem.cs @@ -208,7 +208,7 @@ namespace Content.Server.Guardian var hostXform = Transform(args.Args.Target.Value); var host = EnsureComp(args.Args.Target.Value); // Use map position so it's not inadvertantly parented to the host + if it's in a container it spawns outside I guess. - var guardian = Spawn(component.GuardianProto, hostXform.MapPosition); + var guardian = Spawn(component.GuardianProto, _transform.GetMapCoordinates(args.Args.Target.Value, xform: hostXform)); _container.Insert(guardian, host.GuardianContainer); host.HostedGuardian = guardian; diff --git a/Content.Server/Kitchen/EntitySystems/SharpSystem.cs b/Content.Server/Kitchen/EntitySystems/SharpSystem.cs index 431e438fd8..b796687721 100644 --- a/Content.Server/Kitchen/EntitySystems/SharpSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/SharpSystem.cs @@ -15,6 +15,7 @@ using Content.Shared.Kitchen; using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; using Robust.Server.Containers; +using Robust.Server.GameObjects; using Robust.Shared.Random; using Robust.Shared.Utility; @@ -28,6 +29,7 @@ public sealed class SharpSystem : EntitySystem [Dependency] private readonly SharedPopupSystem _popupSystem = default!; [Dependency] private readonly ContainerSystem _containerSystem = default!; [Dependency] private readonly MobStateSystem _mobStateSystem = default!; + [Dependency] private readonly TransformSystem _transform = default!; [Dependency] private readonly IRobustRandom _robustRandom = default!; [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!; @@ -101,7 +103,7 @@ public sealed class SharpSystem : EntitySystem } var spawnEntities = EntitySpawnCollection.GetSpawns(butcher.SpawnedEntities, _robustRandom); - var coords = Transform(args.Args.Target.Value).MapPosition; + var coords = _transform.GetMapCoordinates(args.Args.Target.Value); EntityUid popupEnt = default!; foreach (var proto in spawnEntities) { diff --git a/Content.Server/Lightning/LightningSystem.cs b/Content.Server/Lightning/LightningSystem.cs index 4f975a60fd..2147ac80f2 100644 --- a/Content.Server/Lightning/LightningSystem.cs +++ b/Content.Server/Lightning/LightningSystem.cs @@ -3,6 +3,7 @@ using Content.Server.Beam; using Content.Server.Beam.Components; using Content.Server.Lightning.Components; using Content.Shared.Lightning; +using Robust.Server.GameObjects; using Robust.Shared.Random; namespace Content.Server.Lightning; @@ -20,6 +21,7 @@ public sealed class LightningSystem : SharedLightningSystem [Dependency] private readonly BeamSystem _beam = default!; [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly EntityLookupSystem _lookup = default!; + [Dependency] private readonly TransformSystem _transform = default!; public override void Initialize() { @@ -74,7 +76,7 @@ public sealed class LightningSystem : SharedLightningSystem //To Do: This is still pretty bad for perf but better than before and at least it doesn't re-allocate // several hashsets every time - var targets = _lookup.GetComponentsInRange(Transform(user).MapPosition, range).ToList(); + var targets = _lookup.GetComponentsInRange(_transform.GetMapCoordinates(user), range).ToList(); _random.Shuffle(targets); targets.Sort((x, y) => y.Priority.CompareTo(x.Priority)); diff --git a/Content.Server/Lightning/LightningTargetSystem.cs b/Content.Server/Lightning/LightningTargetSystem.cs index ccaa74e9e2..bc99def974 100644 --- a/Content.Server/Lightning/LightningTargetSystem.cs +++ b/Content.Server/Lightning/LightningTargetSystem.cs @@ -2,6 +2,7 @@ using Content.Server.Explosion.EntitySystems; using Content.Server.Lightning; using Content.Server.Lightning.Components; using Content.Shared.Damage; +using Robust.Server.GameObjects; namespace Content.Server.Tesla.EntitySystems; @@ -12,6 +13,7 @@ public sealed class LightningTargetSystem : EntitySystem { [Dependency] private readonly DamageableSystem _damageable = default!; [Dependency] private readonly ExplosionSystem _explosionSystem = default!; + [Dependency] private readonly TransformSystem _transform = default!; public override void Initialize() { @@ -29,7 +31,7 @@ public sealed class LightningTargetSystem : EntitySystem if (uid.Comp.LightningExplode) { _explosionSystem.QueueExplosion( - Transform(uid).MapPosition, + _transform.GetMapCoordinates(uid), uid.Comp.ExplosionPrototype, uid.Comp.TotalIntensity, uid.Comp.Dropoff, uid.Comp.MaxTileIntensity, diff --git a/Content.Server/NPC/Systems/NPCSteeringSystem.cs b/Content.Server/NPC/Systems/NPCSteeringSystem.cs index 153a173855..a77af94174 100644 --- a/Content.Server/NPC/Systems/NPCSteeringSystem.cs +++ b/Content.Server/NPC/Systems/NPCSteeringSystem.cs @@ -454,7 +454,7 @@ public sealed partial class NPCSteeringSystem : SharedNPCSteeringSystem } var targetPos = steering.Coordinates.ToMap(EntityManager, _transform); - var ourPos = xform.MapPosition; + var ourPos = _transform.GetMapCoordinates(uid, xform: xform); PrunePath(uid, ourPos, targetPos.Position - ourPos.Position, result.Path); steering.CurrentPath = new Queue(result.Path); diff --git a/Content.Server/NPC/Systems/NPCUtilitySystem.cs b/Content.Server/NPC/Systems/NPCUtilitySystem.cs index e8fb54022e..4b0ccafa1d 100644 --- a/Content.Server/NPC/Systems/NPCUtilitySystem.cs +++ b/Content.Server/NPC/Systems/NPCUtilitySystem.cs @@ -372,7 +372,7 @@ public sealed class NPCUtilitySystem : EntitySystem if (compQuery.Components.Count == 0) return; - var mapPos = _xformQuery.GetComponent(owner).MapPosition; + var mapPos = _transform.GetMapCoordinates(owner, xform: _xformQuery.GetComponent(owner)); _compTypes.Clear(); var i = -1; EntityPrototype.ComponentRegistryEntry compZero = default!; diff --git a/Content.Server/Nuke/NukeSystem.cs b/Content.Server/Nuke/NukeSystem.cs index b72be0b46c..db425b491e 100644 --- a/Content.Server/Nuke/NukeSystem.cs +++ b/Content.Server/Nuke/NukeSystem.cs @@ -450,7 +450,7 @@ public sealed class NukeSystem : EntitySystem if (stationUid != null) _alertLevel.SetLevel(stationUid.Value, component.AlertLevelOnActivate, true, true, true, true); - var pos = nukeXform.MapPosition; + var pos = _transform.GetMapCoordinates(uid, xform: nukeXform); var x = (int) pos.X; var y = (int) pos.Y; var posText = $"({x}, {y})"; diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index 49d7374041..2c7632aadc 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -31,6 +31,7 @@ using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Robust.Shared.Utility; using System.Linq; +using Robust.Server.GameObjects; namespace Content.Server.Nutrition.EntitySystems; @@ -52,6 +53,7 @@ public sealed class FoodSystem : EntitySystem [Dependency] private readonly SharedHandsSystem _hands = default!; [Dependency] private readonly SharedInteractionSystem _interaction = default!; [Dependency] private readonly SolutionContainerSystem _solutionContainer = default!; + [Dependency] private readonly TransformSystem _transform = default!; [Dependency] private readonly StackSystem _stack = default!; [Dependency] private readonly StomachSystem _stomach = default!; [Dependency] private readonly UtensilSystem _utensil = default!; @@ -150,7 +152,7 @@ public sealed class FoodSystem : EntitySystem return (false, true); // TODO make do-afters account for fixtures in the range check. - if (!Transform(user).MapPosition.InRange(Transform(target).MapPosition, MaxFeedDistance)) + if (!_transform.GetMapCoordinates(user).InRange(_transform.GetMapCoordinates(target), MaxFeedDistance)) { var message = Loc.GetString("interaction-system-user-interaction-cannot-reach"); _popup.PopupEntity(message, user, user); @@ -325,7 +327,7 @@ public sealed class FoodSystem : EntitySystem } //We're empty. Become trash. - var position = Transform(food).MapPosition; + var position = _transform.GetMapCoordinates(food); var finisher = Spawn(component.Trash, position); // If the user is holding the item diff --git a/Content.Server/PDA/Ringer/RingerSystem.cs b/Content.Server/PDA/Ringer/RingerSystem.cs index a10544d696..47ae41896e 100644 --- a/Content.Server/PDA/Ringer/RingerSystem.cs +++ b/Content.Server/PDA/Ringer/RingerSystem.cs @@ -25,6 +25,7 @@ namespace Content.Server.PDA.Ringer [Dependency] private readonly UserInterfaceSystem _ui = default!; [Dependency] private readonly AudioSystem _audio = default!; [Dependency] private readonly SharedPopupSystem _popupSystem = default!; + [Dependency] private readonly TransformSystem _transform = default!; private readonly Dictionary _lastSetRingtoneAt = new(); @@ -210,7 +211,7 @@ namespace Content.Server.PDA.Ringer _audio.PlayEntity( GetSound(ringer.Ringtone[ringer.NoteCount]), - Filter.Empty().AddInRange(ringerXform.MapPosition, ringer.Range), + Filter.Empty().AddInRange(_transform.GetMapCoordinates(uid, ringerXform), ringer.Range), uid, true, AudioParams.Default.WithMaxDistance(ringer.Range).WithVolume(ringer.Volume) diff --git a/Content.Server/Payload/EntitySystems/PayloadSystem.cs b/Content.Server/Payload/EntitySystems/PayloadSystem.cs index 85cf303d5d..15966956d4 100644 --- a/Content.Server/Payload/EntitySystems/PayloadSystem.cs +++ b/Content.Server/Payload/EntitySystems/PayloadSystem.cs @@ -10,6 +10,7 @@ using Robust.Shared.Containers; using Robust.Shared.Serialization.Manager; using Robust.Shared.Utility; using System.Linq; +using Robust.Server.GameObjects; namespace Content.Server.Payload.EntitySystems; @@ -17,6 +18,7 @@ public sealed class PayloadSystem : EntitySystem { [Dependency] private readonly TagSystem _tagSystem = default!; [Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!; + [Dependency] private readonly TransformSystem _transform = default!; [Dependency] private readonly IAdminLogManager _adminLogger = default!; [Dependency] private readonly IComponentFactory _componentFactory = default!; [Dependency] private readonly ISerializationManager _serializationManager = default!; @@ -158,7 +160,7 @@ public sealed class PayloadSystem : EntitySystem var solStringB = SolutionContainerSystem.ToPrettyString(solutionB); _adminLogger.Add(LogType.ChemicalReaction, - $"Chemical bomb payload {ToPrettyString(entity.Owner):payload} at {Transform(entity.Owner).MapPosition:location} is combining two solutions: {solStringA:solutionA} and {solStringB:solutionB}"); + $"Chemical bomb payload {ToPrettyString(entity.Owner):payload} at {_transform.GetMapCoordinates(entity.Owner):location} is combining two solutions: {solStringA:solutionA} and {solStringB:solutionB}"); solutionA.MaxVolume += solutionB.MaxVolume; _solutionContainerSystem.TryAddSolution(solnA.Value, solutionB); diff --git a/Content.Server/Pointing/EntitySystems/PointingSystem.cs b/Content.Server/Pointing/EntitySystems/PointingSystem.cs index 9b2e14eff8..7bbf6409cd 100644 --- a/Content.Server/Pointing/EntitySystems/PointingSystem.cs +++ b/Content.Server/Pointing/EntitySystems/PointingSystem.cs @@ -183,7 +183,7 @@ namespace Content.Server.Pointing.EntitySystems (eyeComp.VisibilityMask & layer) == 0) return false; - return Transform(ent).MapPosition.InRange(Transform(player).MapPosition, PointingRange); + return _transform.GetMapCoordinates(ent).InRange(_transform.GetMapCoordinates(player), PointingRange); } var viewers = Filter.Empty() diff --git a/Content.Server/Respawn/SpecialRespawnSystem.cs b/Content.Server/Respawn/SpecialRespawnSystem.cs index 2463bcd740..6c7bb5c923 100644 --- a/Content.Server/Respawn/SpecialRespawnSystem.cs +++ b/Content.Server/Respawn/SpecialRespawnSystem.cs @@ -95,7 +95,7 @@ public sealed class SpecialRespawnSystem : SharedSpecialRespawnSystem { var xform = Transform(entityGridUid.Value); var pos = xform.Coordinates; - var mapPos = xform.MapPosition; + var mapPos = _transform.GetMapCoordinates(entityGridUid.Value, xform: xform); var circle = new Circle(mapPos.Position, 2); var found = false; diff --git a/Content.Server/Singularity/EntitySystems/EventHorizonSystem.cs b/Content.Server/Singularity/EntitySystems/EventHorizonSystem.cs index 5874de2a7c..d7b83d4439 100644 --- a/Content.Server/Singularity/EntitySystems/EventHorizonSystem.cs +++ b/Content.Server/Singularity/EntitySystems/EventHorizonSystem.cs @@ -165,7 +165,7 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem var range2 = range * range; var xformQuery = EntityManager.GetEntityQuery(); var epicenter = _xformSystem.GetWorldPosition(xform, xformQuery); - foreach (var entity in _lookup.GetEntitiesInRange(xform.MapPosition, range, flags: LookupFlags.Uncontained)) + foreach (var entity in _lookup.GetEntitiesInRange(_xformSystem.GetMapCoordinates(uid, xform), range, flags: LookupFlags.Uncontained)) { if (entity == uid) continue; @@ -295,7 +295,7 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem if (!Resolve(uid, ref xform) || !Resolve(uid, ref eventHorizon)) return; - var mapPos = xform.MapPosition; + var mapPos = _xformSystem.GetMapCoordinates(uid, xform: xform); var box = Box2.CenteredAround(mapPos.Position, new Vector2(range, range)); var circle = new Circle(mapPos.Position, range); var grids = new List>(); diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/EmpArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/EmpArtifactSystem.cs index d4ed8272aa..970743f484 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/EmpArtifactSystem.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/EmpArtifactSystem.cs @@ -1,12 +1,14 @@ using Content.Server.Emp; using Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Components; using Content.Server.Xenoarchaeology.XenoArtifacts.Events; +using Robust.Server.GameObjects; namespace Content.Server.Xenoarchaeology.XenoArtifacts.Effects.Systems; public sealed class EmpArtifactSystem : EntitySystem { [Dependency] private readonly EmpSystem _emp = default!; + [Dependency] private readonly TransformSystem _transform = default!; /// public override void Initialize() @@ -16,6 +18,6 @@ public sealed class EmpArtifactSystem : EntitySystem private void OnActivate(EntityUid uid, EmpArtifactComponent component, ArtifactActivatedEvent args) { - _emp.EmpPulse(Transform(uid).MapPosition, component.Range, component.EnergyConsumption, component.DisableDuration); + _emp.EmpPulse(_transform.GetMapCoordinates(uid), component.Range, component.EnergyConsumption, component.DisableDuration); } -} \ No newline at end of file +} diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/SpawnArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/SpawnArtifactSystem.cs index fcb33ae41f..c262283787 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/SpawnArtifactSystem.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/SpawnArtifactSystem.cs @@ -32,7 +32,7 @@ public sealed class SpawnArtifactSystem : EntitySystem if (component.Spawns is not {} spawns) return; - var artifactCord = Transform(uid).MapPosition; + var artifactCord = _transform.GetMapCoordinates(uid); foreach (var spawn in EntitySpawnCollection.GetSpawns(spawns, _random)) { var dx = _random.NextFloat(-component.Range, component.Range); diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/ThrowArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/ThrowArtifactSystem.cs index 57a30a2fd9..8708e0ff4e 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/ThrowArtifactSystem.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/Effects/Systems/ThrowArtifactSystem.cs @@ -4,6 +4,7 @@ using Content.Server.Xenoarchaeology.XenoArtifacts.Events; using Content.Shared.Maps; using Content.Shared.Physics; using Content.Shared.Throwing; +using Robust.Server.GameObjects; using Robust.Shared.Map.Components; using Robust.Shared.Physics.Components; using Robust.Shared.Random; @@ -16,6 +17,7 @@ public sealed class ThrowArtifactSystem : EntitySystem [Dependency] private readonly EntityLookupSystem _lookup = default!; [Dependency] private readonly ThrowingSystem _throwing = default!; [Dependency] private readonly TileSystem _tile = default!; + [Dependency] private readonly TransformSystem _transform = default!; /// public override void Initialize() @@ -50,7 +52,7 @@ public sealed class ThrowArtifactSystem : EntitySystem var tempXform = Transform(ent); - var foo = tempXform.MapPosition.Position - xform.MapPosition.Position; + var foo = _transform.GetMapCoordinates(ent, xform: tempXform).Position - _transform.GetMapCoordinates(uid, xform: xform).Position; _throwing.TryThrow(ent, foo*2, component.ThrowStrength, uid, 0); } } diff --git a/Content.Shared/DeviceLinking/SharedDeviceLinkSystem.cs b/Content.Shared/DeviceLinking/SharedDeviceLinkSystem.cs index 83aa708589..79a32268e8 100644 --- a/Content.Shared/DeviceLinking/SharedDeviceLinkSystem.cs +++ b/Content.Shared/DeviceLinking/SharedDeviceLinkSystem.cs @@ -13,6 +13,7 @@ public abstract class SharedDeviceLinkSystem : EntitySystem [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly SharedPopupSystem _popupSystem = default!; [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!; + [Dependency] private readonly SharedTransformSystem _transform = default!; public const string InvokedPort = "link_port"; @@ -529,7 +530,7 @@ public abstract class SharedDeviceLinkSystem : EntitySystem private bool InRange(EntityUid sourceUid, EntityUid sinkUid, float range) { // TODO: This should be using an existing method and also coordinates inrange instead. - return Transform(sourceUid).MapPosition.InRange(Transform(sinkUid).MapPosition, range); + return _transform.GetMapCoordinates(sourceUid).InRange(_transform.GetMapCoordinates(sinkUid), range); } private void SendNewLinkEvent(EntityUid? user, EntityUid sourceUid, string source, EntityUid sinkUid, string sink) diff --git a/Content.Shared/Examine/ExamineSystemShared.cs b/Content.Shared/Examine/ExamineSystemShared.cs index 2a5201f768..8831213c35 100644 --- a/Content.Shared/Examine/ExamineSystemShared.cs +++ b/Content.Shared/Examine/ExamineSystemShared.cs @@ -210,8 +210,8 @@ namespace Content.Shared.Examine public bool InRangeUnOccluded(EntityUid origin, EntityUid other, float range = ExamineRange, Ignored? predicate = null, bool ignoreInsideBlocker = true) { var entMan = IoCManager.Resolve(); - var originPos = entMan.GetComponent(origin).MapPosition; - var otherPos = entMan.GetComponent(other).MapPosition; + var originPos = _transform.GetMapCoordinates(origin); + var otherPos = _transform.GetMapCoordinates(other); return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker); } @@ -219,7 +219,7 @@ namespace Content.Shared.Examine public bool InRangeUnOccluded(EntityUid origin, EntityCoordinates other, float range = ExamineRange, Ignored? predicate = null, bool ignoreInsideBlocker = true) { var entMan = IoCManager.Resolve(); - var originPos = entMan.GetComponent(origin).MapPosition; + var originPos = _transform.GetMapCoordinates(origin); var otherPos = other.ToMap(entMan, _transform); return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker); @@ -228,7 +228,7 @@ namespace Content.Shared.Examine public bool InRangeUnOccluded(EntityUid origin, MapCoordinates other, float range = ExamineRange, Ignored? predicate = null, bool ignoreInsideBlocker = true) { var entMan = IoCManager.Resolve(); - var originPos = entMan.GetComponent(origin).MapPosition; + var originPos = _transform.GetMapCoordinates(origin); return InRangeUnOccluded(originPos, other, range, predicate, ignoreInsideBlocker); } diff --git a/Content.Shared/Hands/EntitySystems/SharedHandsSystem.Pickup.cs b/Content.Shared/Hands/EntitySystems/SharedHandsSystem.Pickup.cs index 20e08b2767..d1f41738e9 100644 --- a/Content.Shared/Hands/EntitySystems/SharedHandsSystem.Pickup.cs +++ b/Content.Shared/Hands/EntitySystems/SharedHandsSystem.Pickup.cs @@ -108,10 +108,10 @@ public abstract partial class SharedHandsSystem : EntitySystem var xform = Transform(uid); var coordinateEntity = xform.ParentUid.IsValid() ? xform.ParentUid : uid; var itemXform = Transform(entity); - var itemPos = itemXform.MapPosition; + var itemPos = TransformSystem.GetMapCoordinates(entity, xform: itemXform); if (itemPos.MapId == xform.MapID - && (itemPos.Position - xform.MapPosition.Position).Length() <= MaxAnimationRange + && (itemPos.Position - TransformSystem.GetMapCoordinates(uid, xform: xform).Position).Length() <= MaxAnimationRange && MetaData(entity).VisibilityMask == MetaData(uid).VisibilityMask) // Don't animate aghost pickups. { var initialPosition = EntityCoordinates.FromMap(coordinateEntity, itemPos, TransformSystem, EntityManager); diff --git a/Content.Shared/Interaction/RotateToFaceSystem.cs b/Content.Shared/Interaction/RotateToFaceSystem.cs index ed950240af..7f73d3190f 100644 --- a/Content.Shared/Interaction/RotateToFaceSystem.cs +++ b/Content.Shared/Interaction/RotateToFaceSystem.cs @@ -70,7 +70,7 @@ namespace Content.Shared.Interaction if (!Resolve(user, ref xform)) return false; - var diff = coordinates - xform.MapPosition.Position; + var diff = coordinates - _transform.GetMapCoordinates(user, xform: xform).Position; if (diff.LengthSquared() <= 0.01f) return true; diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index 1f421d0e6f..8b3431cb02 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -665,14 +665,14 @@ namespace Content.Shared.Interaction else { // We'll still do the raycast from the centres but we'll bump the range as we know they're in range. - originPos = xformA.MapPosition; + originPos = _transform.GetMapCoordinates(origin, xform: xformA); range = (originPos.Position - targetPos.Position).Length(); } } // No fixtures, e.g. wallmounts. else { - originPos = Transform(origin).MapPosition; + originPos = _transform.GetMapCoordinates(origin); var otherParent = Transform(other).ParentUid; targetRot = otherParent.IsValid() ? Transform(otherParent).LocalRotation + otherAngle : otherAngle; } @@ -826,7 +826,7 @@ namespace Content.Shared.Interaction bool popup = false) { Ignored combinedPredicate = e => e == origin || (predicate?.Invoke(e) ?? false); - var originPosition = Transform(origin).MapPosition; + var originPosition = _transform.GetMapCoordinates(origin); var inRange = InRangeUnobstructed(originPosition, other, range, collisionMask, combinedPredicate, ShouldCheckAccess(origin)); if (!inRange && popup && _gameTiming.IsFirstTimePredicted) diff --git a/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs b/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs index 21861f57da..03da2d09b0 100644 --- a/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs +++ b/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs @@ -77,7 +77,7 @@ public sealed class MagnetPickupSystem : EntitySystem // the problem is that stack pickups delete the original entity, which is fine, but due to // game state handling we can't show a lerp animation for it. var nearXform = Transform(near); - var nearMap = nearXform.MapPosition; + var nearMap = _transform.GetMapCoordinates(near, xform: nearXform); var nearCoords = EntityCoordinates.FromMap(moverCoords.EntityId, nearMap, _transform, EntityManager); if (!_storage.Insert(uid, near, out var stacked, storageComp: storage, playSound: !playedSound)) diff --git a/Content.Shared/Tabletop/SharedTabletopSystem.cs b/Content.Shared/Tabletop/SharedTabletopSystem.cs index 7bfd9d3457..afa77a643a 100644 --- a/Content.Shared/Tabletop/SharedTabletopSystem.cs +++ b/Content.Shared/Tabletop/SharedTabletopSystem.cs @@ -16,7 +16,7 @@ namespace Content.Shared.Tabletop [Dependency] protected readonly ActionBlockerSystem ActionBlockerSystem = default!; [Dependency] private readonly SharedInteractionSystem _interactionSystem = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; - [Dependency] private readonly SharedTransformSystem _transforms = default!; + [Dependency] protected readonly SharedTransformSystem Transforms = default!; [Dependency] private readonly IMapManager _mapMan = default!; public override void Initialize() @@ -41,8 +41,8 @@ namespace Content.Shared.Tabletop // Move the entity and dirty it (we use the map ID from the entity so noone can try to be funny and move the item to another map) var transform = EntityManager.GetComponent(moved); - _transforms.SetParent(moved, transform, _mapMan.GetMapEntityId(transform.MapID)); - _transforms.SetLocalPositionNoLerp(transform, msg.Coordinates.Position); + Transforms.SetParent(moved, transform, _mapMan.GetMapEntityId(transform.MapID)); + Transforms.SetLocalPositionNoLerp(transform, msg.Coordinates.Position); } private void OnDraggingPlayerChanged(TabletopDraggingPlayerChangedEvent msg, EntitySessionEventArgs args) diff --git a/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs b/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs index dd297422c3..ad2249bfdd 100644 --- a/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs +++ b/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs @@ -220,7 +220,7 @@ public abstract partial class SharedTetherGunSystem : EntitySystem _blocker.UpdateCanMove(target); // Invisible tether entity - var tether = Spawn("TetherEntity", Transform(target).MapPosition); + var tether = Spawn("TetherEntity", TransformSystem.GetMapCoordinates(target)); var tetherPhysics = Comp(tether); component.TetherEntity = tether; _physics.WakeBody(tether); diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs index 11cfc88470..6242312b07 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Ballistic.cs @@ -35,7 +35,7 @@ public abstract partial class SharedGunSystem if (args.Handled) return; - ManualCycle(uid, component, Transform(uid).MapPosition, args.User); + ManualCycle(uid, component, TransformSystem.GetMapCoordinates(uid), args.User); args.Handled = true; } @@ -161,7 +161,7 @@ public abstract partial class SharedGunSystem { Text = Loc.GetString("gun-ballistic-cycle"), Disabled = GetBallisticShots(component) == 0, - Act = () => ManualCycle(uid, component, Transform(uid).MapPosition, args.User), + Act = () => ManualCycle(uid, component, TransformSystem.GetMapCoordinates(uid), args.User), }); } From 37099e481e3341bcf82939a677ef5c0df458abbb Mon Sep 17 00:00:00 2001 From: no <165581243+pissdemon@users.noreply.github.com> Date: Sun, 12 May 2024 16:35:30 +0200 Subject: [PATCH 099/111] Prevent admin-frozen players from ghosting or suiciding, add "Freeze And Mute" verb (#27813) * prevent admin-frozen players from ghosting or suiciding * Add "Freeze and Mute" admin verb * Allow "Freeze And Mute" admin verb when player is already frozen but not muted * Remove redundant scream handler (scream action just emotes, duh) * AdminFrozenSystem: clean imports * Update Content.Server/Chat/Commands/SuicideCommand.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Ghost.cs * retrigger ci (empty commit) --------- Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> --- .../Systems/AdminFrozenSystem.cs | 7 ++ .../Systems/AdminFrozenSystem.cs | 16 +++++ .../Administration/Systems/AdminVerbSystem.cs | 64 ++++++++++++++----- .../Chat/Commands/SuicideCommand.cs | 21 ++++-- Content.Server/Ghost/Ghost.cs | 21 ++++-- .../Administration/AdminFrozenComponent.cs | 9 ++- ...enSystem.cs => SharedAdminFrozenSystem.cs} | 20 +++++- .../en-US/administration/admin-verbs.ftl | 1 + .../en-US/chat/commands/ghost-command.ftl | 5 ++ .../en-US/chat/commands/suicide-command.ftl | 2 + 10 files changed, 138 insertions(+), 28 deletions(-) create mode 100644 Content.Client/Administration/Systems/AdminFrozenSystem.cs create mode 100644 Content.Server/Administration/Systems/AdminFrozenSystem.cs rename Content.Shared/Administration/{AdminFrozenSystem.cs => SharedAdminFrozenSystem.cs} (78%) create mode 100644 Resources/Locale/en-US/chat/commands/ghost-command.ftl diff --git a/Content.Client/Administration/Systems/AdminFrozenSystem.cs b/Content.Client/Administration/Systems/AdminFrozenSystem.cs new file mode 100644 index 0000000000..885585f985 --- /dev/null +++ b/Content.Client/Administration/Systems/AdminFrozenSystem.cs @@ -0,0 +1,7 @@ +using Content.Shared.Administration; + +namespace Content.Client.Administration.Systems; + +public sealed class AdminFrozenSystem : SharedAdminFrozenSystem +{ +} diff --git a/Content.Server/Administration/Systems/AdminFrozenSystem.cs b/Content.Server/Administration/Systems/AdminFrozenSystem.cs new file mode 100644 index 0000000000..baf7b682b8 --- /dev/null +++ b/Content.Server/Administration/Systems/AdminFrozenSystem.cs @@ -0,0 +1,16 @@ +using Content.Shared.Administration; + +namespace Content.Server.Administration.Systems; + +public sealed class AdminFrozenSystem : SharedAdminFrozenSystem +{ + /// + /// Freezes and mutes the given entity. + /// + public void FreezeAndMute(EntityUid uid) + { + var comp = EnsureComp(uid); + comp.Muted = true; + Dirty(uid, comp); + } +} diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.cs b/Content.Server/Administration/Systems/AdminVerbSystem.cs index 5bb75b4c99..7aa4c8b400 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.cs @@ -67,6 +67,7 @@ namespace Content.Server.Administration.Systems [Dependency] private readonly StationSystem _stations = default!; [Dependency] private readonly StationSpawningSystem _spawning = default!; [Dependency] private readonly ExamineSystemShared _examine = default!; + [Dependency] private readonly AdminFrozenSystem _freeze = default!; private readonly Dictionary> _openSolutionUis = new(); @@ -131,24 +132,57 @@ namespace Content.Server.Administration.Systems args.Verbs.Add(prayerVerb); // Freeze - var frozen = HasComp(args.Target); - args.Verbs.Add(new Verb + var frozen = TryComp(args.Target, out var frozenComp); + var frozenAndMuted = frozenComp?.Muted ?? false; + + if (!frozen) { - Priority = -1, // This is just so it doesn't change position in the menu between freeze/unfreeze. - Text = frozen - ? Loc.GetString("admin-verbs-unfreeze") - : Loc.GetString("admin-verbs-freeze"), - Category = VerbCategory.Admin, - Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/snow.svg.192dpi.png")), - Act = () => + args.Verbs.Add(new Verb { - if (frozen) - RemComp(args.Target); - else + Priority = -1, // This is just so it doesn't change position in the menu between freeze/unfreeze. + Text = Loc.GetString("admin-verbs-freeze"), + Category = VerbCategory.Admin, + Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/snow.svg.192dpi.png")), + Act = () => + { EnsureComp(args.Target); - }, - Impact = LogImpact.Medium, - }); + }, + Impact = LogImpact.Medium, + }); + } + + if (!frozenAndMuted) + { + // allow you to additionally mute someone when they are already frozen + args.Verbs.Add(new Verb + { + Priority = -1, // This is just so it doesn't change position in the menu between freeze/unfreeze. + Text = Loc.GetString("admin-verbs-freeze-and-mute"), + Category = VerbCategory.Admin, + Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/snow.svg.192dpi.png")), + Act = () => + { + _freeze.FreezeAndMute(args.Target); + }, + Impact = LogImpact.Medium, + }); + } + + if (frozen) + { + args.Verbs.Add(new Verb + { + Priority = -1, // This is just so it doesn't change position in the menu between freeze/unfreeze. + Text = Loc.GetString("admin-verbs-unfreeze"), + Category = VerbCategory.Admin, + Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/snow.svg.192dpi.png")), + Act = () => + { + RemComp(args.Target); + }, + Impact = LogImpact.Medium, + }); + } // Erase args.Verbs.Add(new Verb diff --git a/Content.Server/Chat/Commands/SuicideCommand.cs b/Content.Server/Chat/Commands/SuicideCommand.cs index c967ba78d7..0c541b48b7 100644 --- a/Content.Server/Chat/Commands/SuicideCommand.cs +++ b/Content.Server/Chat/Commands/SuicideCommand.cs @@ -1,4 +1,5 @@ using Content.Server.GameTicking; +using Content.Server.Popups; using Content.Shared.Administration; using Content.Shared.Mind; using Robust.Shared.Console; @@ -26,17 +27,27 @@ namespace Content.Server.Chat.Commands if (player.Status != SessionStatus.InGame || player.AttachedEntity == null) return; - var minds = IoCManager.Resolve().System(); + var entityManager = IoCManager.Resolve(); + var minds = entityManager.System(); // This check also proves mind not-null for at the end when the mob is ghosted. if (!minds.TryGetMind(player, out var mindId, out var mind) || mind.OwnedEntity is not { Valid: true } victim) { - shell.WriteLine("You don't have a mind!"); + shell.WriteLine(Loc.GetString("suicide-command-no-mind")); return; } - var gameTicker = EntitySystem.Get(); - var suicideSystem = EntitySystem.Get(); + if (entityManager.HasComponent(victim)) + { + var deniedMessage = Loc.GetString("suicide-command-denied"); + shell.WriteLine(deniedMessage); + entityManager.System() + .PopupEntity(deniedMessage, victim, victim); + return; + } + + var gameTicker = entityManager.System(); + var suicideSystem = entityManager.System(); if (suicideSystem.Suicide(victim)) { // Prevent the player from returning to the body. @@ -48,7 +59,7 @@ namespace Content.Server.Chat.Commands if (gameTicker.OnGhostAttempt(mindId, true, mind: mind)) return; - shell.WriteLine("You can't ghost right now."); + shell.WriteLine(Loc.GetString("ghost-command-denied")); } } } diff --git a/Content.Server/Ghost/Ghost.cs b/Content.Server/Ghost/Ghost.cs index 1453bf3faa..69d81d9592 100644 --- a/Content.Server/Ghost/Ghost.cs +++ b/Content.Server/Ghost/Ghost.cs @@ -1,4 +1,5 @@ using Content.Server.GameTicking; +using Content.Server.Popups; using Content.Shared.Administration; using Content.Shared.Mind; using Robust.Shared.Console; @@ -11,15 +12,25 @@ namespace Content.Server.Ghost [Dependency] private readonly IEntityManager _entities = default!; public string Command => "ghost"; - public string Description => "Give up on life and become a ghost."; - public string Help => "ghost"; + public string Description => Loc.GetString("ghost-command-description"); + public string Help => Loc.GetString("ghost-command-help-text"); public void Execute(IConsoleShell shell, string argStr, string[] args) { var player = shell.Player; if (player == null) { - shell.WriteLine("You have no session, you can't ghost."); + shell.WriteLine(Loc.GetString("ghost-command-no-session")); + return; + } + + if (player.AttachedEntity is { Valid: true } frozen && + _entities.HasComponent(frozen)) + { + var deniedMessage = Loc.GetString("ghost-command-denied"); + shell.WriteLine(deniedMessage); + _entities.System() + .PopupEntity(deniedMessage, frozen, frozen); return; } @@ -30,9 +41,9 @@ namespace Content.Server.Ghost mind = _entities.GetComponent(mindId); } - if (!EntitySystem.Get().OnGhostAttempt(mindId, true, true, mind)) + if (!_entities.System().OnGhostAttempt(mindId, true, true, mind)) { - shell.WriteLine("You can't ghost right now."); + shell.WriteLine(Loc.GetString("ghost-command-denied")); } } } diff --git a/Content.Shared/Administration/AdminFrozenComponent.cs b/Content.Shared/Administration/AdminFrozenComponent.cs index 164cf764c8..bfcf1db526 100644 --- a/Content.Shared/Administration/AdminFrozenComponent.cs +++ b/Content.Shared/Administration/AdminFrozenComponent.cs @@ -2,8 +2,13 @@ namespace Content.Shared.Administration; -[RegisterComponent, Access(typeof(AdminFrozenSystem))] -[NetworkedComponent] +[RegisterComponent, Access(typeof(SharedAdminFrozenSystem))] +[NetworkedComponent, AutoGenerateComponentState] public sealed partial class AdminFrozenComponent : Component { + /// + /// Whether the player is also muted. + /// + [DataField, AutoNetworkedField] + public bool Muted; } diff --git a/Content.Shared/Administration/AdminFrozenSystem.cs b/Content.Shared/Administration/SharedAdminFrozenSystem.cs similarity index 78% rename from Content.Shared/Administration/AdminFrozenSystem.cs rename to Content.Shared/Administration/SharedAdminFrozenSystem.cs index 4ec9600b0b..2fa22e0005 100644 --- a/Content.Shared/Administration/AdminFrozenSystem.cs +++ b/Content.Shared/Administration/SharedAdminFrozenSystem.cs @@ -1,15 +1,17 @@ using Content.Shared.ActionBlocker; +using Content.Shared.Emoting; using Content.Shared.Interaction.Events; using Content.Shared.Item; using Content.Shared.Movement.Events; using Content.Shared.Movement.Pulling.Components; using Content.Shared.Movement.Pulling.Events; using Content.Shared.Movement.Pulling.Systems; +using Content.Shared.Speech; using Content.Shared.Throwing; namespace Content.Shared.Administration; -public sealed class AdminFrozenSystem : EntitySystem +public abstract class SharedAdminFrozenSystem : EntitySystem { [Dependency] private readonly ActionBlockerSystem _blocker = default!; [Dependency] private readonly PullingSystem _pulling = default!; @@ -28,6 +30,16 @@ public sealed class AdminFrozenSystem : EntitySystem SubscribeLocalEvent(OnPullAttempt); SubscribeLocalEvent(OnAttempt); SubscribeLocalEvent(OnAttempt); + SubscribeLocalEvent(OnEmoteAttempt); + SubscribeLocalEvent(OnSpeakAttempt); + } + + private void OnSpeakAttempt(EntityUid uid, AdminFrozenComponent component, SpeakAttemptEvent args) + { + if (!component.Muted) + return; + + args.Cancel(); } private void OnAttempt(EntityUid uid, AdminFrozenComponent component, CancellableEntityEventArgs args) @@ -62,4 +74,10 @@ public sealed class AdminFrozenSystem : EntitySystem { _blocker.UpdateCanMove(uid); } + + private void OnEmoteAttempt(EntityUid uid, AdminFrozenComponent component, EmoteAttemptEvent args) + { + if (component.Muted) + args.Cancel(); + } } diff --git a/Resources/Locale/en-US/administration/admin-verbs.ftl b/Resources/Locale/en-US/administration/admin-verbs.ftl index 03f92f7c42..16715087ee 100644 --- a/Resources/Locale/en-US/administration/admin-verbs.ftl +++ b/Resources/Locale/en-US/administration/admin-verbs.ftl @@ -6,6 +6,7 @@ admin-verbs-admin-logs-entity = Entity Logs admin-verbs-teleport-to = Teleport To admin-verbs-teleport-here = Teleport Here admin-verbs-freeze = Freeze +admin-verbs-freeze-and-mute = Freeze And Mute admin-verbs-unfreeze = Unfreeze admin-verbs-erase = Erase admin-verbs-erase-description = Removes the player from the round and crew manifest and deletes their chat messages. diff --git a/Resources/Locale/en-US/chat/commands/ghost-command.ftl b/Resources/Locale/en-US/chat/commands/ghost-command.ftl new file mode 100644 index 0000000000..08e78d34ce --- /dev/null +++ b/Resources/Locale/en-US/chat/commands/ghost-command.ftl @@ -0,0 +1,5 @@ +ghost-command-description = Give up on life and become a ghost. +ghost-command-help-text = The ghost command turns you into a ghost and makes the character you played permanently catatonic. + Please note that you cannot return to your character's body after ghosting. +ghost-command-no-session = You have no session, you can't ghost. +ghost-command-denied = You cannot ghost right now. diff --git a/Resources/Locale/en-US/chat/commands/suicide-command.ftl b/Resources/Locale/en-US/chat/commands/suicide-command.ftl index 6748aa630c..36e861169b 100644 --- a/Resources/Locale/en-US/chat/commands/suicide-command.ftl +++ b/Resources/Locale/en-US/chat/commands/suicide-command.ftl @@ -6,3 +6,5 @@ suicide-command-help-text = The suicide command gives you a quick way out of a r suicide-command-default-text-others = {$name} is attempting to bite their own tongue! suicide-command-default-text-self = You attempt to bite your own tongue! suicide-command-already-dead = You can't suicide. You're dead. +suicide-command-no-mind = You have no mind! +suicide-command-denied = You cannot suicide right now. From 17e0a7f56c4791b7d8443240826db811aafd2c13 Mon Sep 17 00:00:00 2001 From: PJBot Date: Sun, 12 May 2024 14:36:37 +0000 Subject: [PATCH 100/111] Automatic changelog update --- Resources/Changelog/Admin.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Resources/Changelog/Admin.yml b/Resources/Changelog/Admin.yml index f5d74cf9b6..a534a83ebf 100644 --- a/Resources/Changelog/Admin.yml +++ b/Resources/Changelog/Admin.yml @@ -201,5 +201,17 @@ Entries: id: 26 time: '2024-05-02T06:23:23.0000000+00:00' url: https://github.com/space-wizards/space-station-14/pull/24945 +- author: pissdemon + changes: + - message: Players frozen by admins can no longer use the "ghost" or "suicide" console + commands. + type: Tweak + - message: Added a "Freeze And Mute" admin verb. In addition to acting like Freeze, + it will mute the targeted player, which prevents them from speaking or emoting + until unfrozen. It can also be used on already frozen but not yet muted players. + type: Add + id: 27 + time: '2024-05-12T14:35:30.0000000+00:00' + url: https://github.com/space-wizards/space-station-14/pull/27813 Name: Admin Order: 1 From ed7075942d827100408429cd0e1bc4d9bbacfc5d Mon Sep 17 00:00:00 2001 From: DrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com> Date: Sun, 12 May 2024 07:36:46 -0700 Subject: [PATCH 101/111] Add live templates for networked data field, networked component and auto state component (#27906) * Add live templates for networked data field, networked component and auto state component * Fix field access * Fix readonly --- SpaceStation14.sln.DotSettings | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/SpaceStation14.sln.DotSettings b/SpaceStation14.sln.DotSettings index 0decb9a11b..800617c0fd 100644 --- a/SpaceStation14.sln.DotSettings +++ b/SpaceStation14.sln.DotSettings @@ -228,6 +228,32 @@ public sealed partial class $CLASS$ : IPrototype { public string ID { get; } = default!; } SS14 + True + True + Networked Auto State Component + True + 0 + True + True + 2.0 + InCSharpFile + nscomp + True + [RegisterComponent, Robust.Shared.GameStates.NetworkedComponent, AutoGenerateComponentState] +[Access(typeof($ACCESS$))] + True + True + Networked Component + True + 0 + True + True + 2.0 + InCSharpFile + ncomp + True + [RegisterComponent, Robust.Shared.GameStates.NetworkedComponent] +[Access(typeof($ACCESS$))] True True IoC [Dependency] @@ -465,6 +491,21 @@ public abstract class $CLASS$ : EntitySystem { } } SS14 + True + True + Automatically Networked Data Field + True + 1 + True + 0 + True + True + 2.0 + InCSharpTypeMember + nfield + True + [DataField, AutoNetworkedField] +public $TYPE$ $NAME$; True True cs From c8b55e5e449fc4f43206c3a6a5a84ef53023cd18 Mon Sep 17 00:00:00 2001 From: nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com> Date: Sun, 12 May 2024 15:07:54 +0000 Subject: [PATCH 102/111] Record deletion (#27883) * Allow for Station Records interface for aghosts to delete records * Fix record consoles not working when there are more than 2 crew members. HOW DID NOONE NOTICE THIS SOONER??? * Stop being unconventional --- .../StationRecords/GeneralRecord.xaml | 13 +++++ .../StationRecords/GeneralRecord.xaml.cs | 33 ++++++++++++ ...lStationRecordConsoleBoundUserInterface.cs | 1 + .../GeneralStationRecordConsoleWindow.xaml | 2 +- .../GeneralStationRecordConsoleWindow.xaml.cs | 51 +++---------------- .../GeneralStationRecordConsoleComponent.cs | 6 +++ .../GeneralStationRecordConsoleSystem.cs | 20 ++++++-- .../StationRecords/GeneralRecordsUi.cs | 23 +++++++-- .../general-station-records.ftl | 1 + .../Entities/Mobs/Player/admin_ghost.yml | 1 + 10 files changed, 100 insertions(+), 51 deletions(-) create mode 100644 Content.Client/StationRecords/GeneralRecord.xaml create mode 100644 Content.Client/StationRecords/GeneralRecord.xaml.cs diff --git a/Content.Client/StationRecords/GeneralRecord.xaml b/Content.Client/StationRecords/GeneralRecord.xaml new file mode 100644 index 0000000000..add688c3f3 --- /dev/null +++ b/Content.Client/StationRecords/GeneralRecord.xaml @@ -0,0 +1,13 @@ + + + [DataField] public StationRecordsFilter? Filter; + + /// + /// Whether this Records Console is able to delete entries. + /// + [DataField] + public bool CanDeleteEntries; } diff --git a/Content.Server/StationRecords/Systems/GeneralStationRecordConsoleSystem.cs b/Content.Server/StationRecords/Systems/GeneralStationRecordConsoleSystem.cs index a5202285d9..87246ab675 100644 --- a/Content.Server/StationRecords/Systems/GeneralStationRecordConsoleSystem.cs +++ b/Content.Server/StationRecords/Systems/GeneralStationRecordConsoleSystem.cs @@ -23,9 +23,22 @@ public sealed class GeneralStationRecordConsoleSystem : EntitySystem subs.Event(UpdateUserInterface); subs.Event(OnKeySelected); subs.Event(OnFiltersChanged); + subs.Event(OnRecordDelete); }); } + private void OnRecordDelete(Entity ent, ref DeleteStationRecord args) + { + if (!ent.Comp.CanDeleteEntries) + return; + + var owning = _station.GetOwningStation(ent.Owner); + + if (owning != null) + _stationRecords.RemoveRecord(new StationRecordKey(args.Id, owning.Value)); + UpdateUserInterface(ent); // Apparently an event does not get raised for this. + } + private void UpdateUserInterface(Entity ent, ref T args) { UpdateUserInterface(ent); @@ -68,8 +81,9 @@ public sealed class GeneralStationRecordConsoleSystem : EntitySystem case 0: _ui.SetUiState(uid, GeneralStationRecordConsoleKey.Key, new GeneralStationRecordConsoleState()); return; - case 1: - console.ActiveKey = listing.Keys.First(); + default: + if (console.ActiveKey == null) + console.ActiveKey = listing.Keys.First(); break; } @@ -79,7 +93,7 @@ public sealed class GeneralStationRecordConsoleSystem : EntitySystem var key = new StationRecordKey(id, owningStation.Value); _stationRecords.TryGetRecord(key, out var record, stationRecords); - GeneralStationRecordConsoleState newState = new(id, record, listing, console.Filter); + GeneralStationRecordConsoleState newState = new(id, record, listing, console.Filter, ent.Comp.CanDeleteEntries); _ui.SetUiState(uid, GeneralStationRecordConsoleKey.Key, newState); } } diff --git a/Content.Shared/StationRecords/GeneralRecordsUi.cs b/Content.Shared/StationRecords/GeneralRecordsUi.cs index 860454efde..2105c53df2 100644 --- a/Content.Shared/StationRecords/GeneralRecordsUi.cs +++ b/Content.Shared/StationRecords/GeneralRecordsUi.cs @@ -37,17 +37,22 @@ public sealed class GeneralStationRecordConsoleState : BoundUserInterfaceState public readonly GeneralStationRecord? Record; public readonly Dictionary? RecordListing; public readonly StationRecordsFilter? Filter; + public readonly bool CanDeleteEntries; - public GeneralStationRecordConsoleState(uint? key, GeneralStationRecord? record, - Dictionary? recordListing, StationRecordsFilter? newFilter) + public GeneralStationRecordConsoleState(uint? key, + GeneralStationRecord? record, + Dictionary? recordListing, + StationRecordsFilter? newFilter, + bool canDeleteEntries) { SelectedKey = key; Record = record; RecordListing = recordListing; Filter = newFilter; + CanDeleteEntries = canDeleteEntries; } - public GeneralStationRecordConsoleState() : this(null, null, null, null) + public GeneralStationRecordConsoleState() : this(null, null, null, null, false) { } @@ -69,3 +74,15 @@ public sealed class SelectStationRecord : BoundUserInterfaceMessage SelectedKey = selectedKey; } } + + +[Serializable, NetSerializable] +public sealed class DeleteStationRecord : BoundUserInterfaceMessage +{ + public DeleteStationRecord(uint id) + { + Id = id; + } + + public readonly uint Id; +} diff --git a/Resources/Locale/en-US/station-records/general-station-records.ftl b/Resources/Locale/en-US/station-records/general-station-records.ftl index e36bfac7cb..4516a547f4 100644 --- a/Resources/Locale/en-US/station-records/general-station-records.ftl +++ b/Resources/Locale/en-US/station-records/general-station-records.ftl @@ -16,3 +16,4 @@ general-station-record-prints-filter = Fingerprints general-station-record-dna-filter = DNA general-station-record-console-search-records = Search general-station-record-console-reset-filters = Reset +general-station-record-console-delete = Delete diff --git a/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml b/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml index 38092e3aa7..8171ec0053 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml @@ -70,6 +70,7 @@ - type: CargoOrderConsole - type: CrewMonitoringConsole - type: GeneralStationRecordConsole + canDeleteEntries: true - type: DeviceNetwork deviceNetId: Wireless receiveFrequencyId: CrewMonitor From cfee7e3fdceccf4808d49ce305ed105e62766491 Mon Sep 17 00:00:00 2001 From: PJBot Date: Sun, 12 May 2024 15:09:00 +0000 Subject: [PATCH 103/111] Automatic changelog update --- Resources/Changelog/Admin.yml | 9 +++++++++ Resources/Changelog/Changelog.yml | 14 +++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Resources/Changelog/Admin.yml b/Resources/Changelog/Admin.yml index a534a83ebf..5129de7563 100644 --- a/Resources/Changelog/Admin.yml +++ b/Resources/Changelog/Admin.yml @@ -213,5 +213,14 @@ Entries: id: 27 time: '2024-05-12T14:35:30.0000000+00:00' url: https://github.com/space-wizards/space-station-14/pull/27813 +- author: nikthechampiongr + changes: + - message: Admins are now able to remove station records through the records console + interface on their aghost. This will remove the record from the manifest and + criminal records as well. + type: Add + id: 28 + time: '2024-05-12T15:07:54.0000000+00:00' + url: https://github.com/space-wizards/space-station-14/pull/27883 Name: Admin Order: 1 diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index c5e4d32fa2..ae93e07f82 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,11 +1,4 @@ Entries: -- author: Nairodian - changes: - - message: Welding masks can now be made in the Autolathe. - type: Add - id: 6087 - time: '2024-03-04T22:36:06.0000000+00:00' - url: https://github.com/space-wizards/space-station-14/pull/25842 - author: Lawdog changes: - message: Changed the max volume of shot glasses from 7u to 5u to better represent @@ -3870,3 +3863,10 @@ id: 6586 time: '2024-05-11T23:18:21.0000000+00:00' url: https://github.com/space-wizards/space-station-14/pull/27576 +- author: nikthechampiongr + changes: + - message: Fixed records consoles sometimes failing to show crew records. + type: Fix + id: 6587 + time: '2024-05-12T15:07:54.0000000+00:00' + url: https://github.com/space-wizards/space-station-14/pull/27883 From 9c3dab0be3fa2ecc66a21b471e5e78be8fcf43d0 Mon Sep 17 00:00:00 2001 From: ShadowCommander Date: Sun, 12 May 2024 15:14:35 -0700 Subject: [PATCH 104/111] Fix borg UI regenerating every tick (#27956) * Fix UI elements being recreated when they didn't need to be * Fix up comparison --- .../Silicons/Borgs/BorgMenu.xaml.cs | 19 ++++++++++++++++- .../Laws/Ui/SiliconLawBoundUserInterface.cs | 21 ++++++++++++++++++- .../Silicons/Laws/SiliconLawPrototype.cs | 7 +++++++ 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/Content.Client/Silicons/Borgs/BorgMenu.xaml.cs b/Content.Client/Silicons/Borgs/BorgMenu.xaml.cs index 046d8e299f..474a83b453 100644 --- a/Content.Client/Silicons/Borgs/BorgMenu.xaml.cs +++ b/Content.Client/Silicons/Borgs/BorgMenu.xaml.cs @@ -25,6 +25,7 @@ public sealed partial class BorgMenu : FancyWindow public readonly EntityUid Entity; public float AccumulatedTime; private string _lastValidName; + private List _modules = new(); public BorgMenu(EntityUid entity) { @@ -114,7 +115,23 @@ public sealed partial class BorgMenu : FancyWindow ("actual", _chassis.ModuleCount), ("max", _chassis.MaxModules)); + if (_chassis.ModuleContainer.Count == _modules.Count) + { + var isSame = true; + foreach (var module in _chassis.ModuleContainer.ContainedEntities) + { + if (_modules.Contains(module)) + continue; + isSame = false; + break; + } + + if (isSame) + return; + } + ModuleContainer.Children.Clear(); + _modules.Clear(); foreach (var module in _chassis.ModuleContainer.ContainedEntities) { var control = new BorgModuleControl(module, _entity); @@ -123,6 +140,7 @@ public sealed partial class BorgMenu : FancyWindow RemoveModuleButtonPressed?.Invoke(module); }; ModuleContainer.AddChild(control); + _modules.Add(module); } } @@ -162,4 +180,3 @@ public sealed partial class BorgMenu : FancyWindow NameChanged?.Invoke(_lastValidName); } } - diff --git a/Content.Client/Silicons/Laws/Ui/SiliconLawBoundUserInterface.cs b/Content.Client/Silicons/Laws/Ui/SiliconLawBoundUserInterface.cs index 2aee0a38c0..d150735fa1 100644 --- a/Content.Client/Silicons/Laws/Ui/SiliconLawBoundUserInterface.cs +++ b/Content.Client/Silicons/Laws/Ui/SiliconLawBoundUserInterface.cs @@ -1,6 +1,7 @@ +using System.Linq; +using Content.Shared.Silicons.Laws; using Content.Shared.Silicons.Laws.Components; using JetBrains.Annotations; -using Robust.Client.GameObjects; namespace Content.Client.Silicons.Laws.Ui; @@ -10,6 +11,7 @@ public sealed class SiliconLawBoundUserInterface : BoundUserInterface [ViewVariables] private SiliconLawMenu? _menu; private EntityUid _owner; + private List? _laws; public SiliconLawBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { @@ -41,6 +43,23 @@ public sealed class SiliconLawBoundUserInterface : BoundUserInterface if (state is not SiliconLawBuiState msg) return; + if (_laws != null && _laws.Count == msg.Laws.Count) + { + var isSame = true; + foreach (var law in msg.Laws) + { + if (_laws.Contains(law)) + continue; + isSame = false; + break; + } + + if (isSame) + return; + } + + _laws = msg.Laws.ToList(); + _menu?.Update(_owner, msg); } } diff --git a/Content.Shared/Silicons/Laws/SiliconLawPrototype.cs b/Content.Shared/Silicons/Laws/SiliconLawPrototype.cs index 5e5df448b3..d10b86c241 100644 --- a/Content.Shared/Silicons/Laws/SiliconLawPrototype.cs +++ b/Content.Shared/Silicons/Laws/SiliconLawPrototype.cs @@ -39,6 +39,13 @@ public partial class SiliconLaw : IComparable return Order.CompareTo(other.Order); } + public bool Equals(SiliconLaw other) + { + return LawString == other.LawString + && Order == other.Order + && LawIdentifierOverride == other.LawIdentifierOverride; + } + /// /// Return a shallow clone of this law. /// From c325ca8566f1032f24be7140e9bf94f04d740200 Mon Sep 17 00:00:00 2001 From: PJBot Date: Sun, 12 May 2024 22:15:41 +0000 Subject: [PATCH 105/111] Automatic changelog update --- Resources/Changelog/Changelog.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index ae93e07f82..90888f0788 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,12 +1,4 @@ Entries: -- author: Lawdog - changes: - - message: Changed the max volume of shot glasses from 7u to 5u to better represent - drinking shots in real life - type: Tweak - id: 6088 - time: '2024-03-04T23:51:12.0000000+00:00' - url: https://github.com/space-wizards/space-station-14/pull/25847 - author: deltanedas changes: - message: Rehydrated mobs (carp) now keep their forensics data from their cube/plushie @@ -3870,3 +3862,11 @@ id: 6587 time: '2024-05-12T15:07:54.0000000+00:00' url: https://github.com/space-wizards/space-station-14/pull/27883 +- author: ShadowCommander + changes: + - message: Fixed cyborg laws window and other UIs breaking when the built in light + was on. + type: Fix + id: 6588 + time: '2024-05-12T22:14:35.0000000+00:00' + url: https://github.com/space-wizards/space-station-14/pull/27956 From d6e2cc0a8b1d93ffdfa184a694183ea7c8b7a1e4 Mon Sep 17 00:00:00 2001 From: Kara Date: Sun, 12 May 2024 17:03:07 -0700 Subject: [PATCH 106/111] Open slot storage keybind can now also close the UI (#27962) --- .../Storage/EntitySystems/SharedStorageSystem.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs b/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs index 8ad588baab..4f0b760345 100644 --- a/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs +++ b/Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs @@ -1433,15 +1433,15 @@ public abstract class SharedStorageSystem : EntitySystem private void HandleOpenBackpack(ICommonSession? session) { - HandleOpenSlotUI(session, "back"); + HandleToggleSlotUI(session, "back"); } private void HandleOpenBelt(ICommonSession? session) { - HandleOpenSlotUI(session, "belt"); + HandleToggleSlotUI(session, "belt"); } - private void HandleOpenSlotUI(ICommonSession? session, string slot) + private void HandleToggleSlotUI(ICommonSession? session, string slot) { if (session is not { } playerSession) return; @@ -1455,7 +1455,14 @@ public abstract class SharedStorageSystem : EntitySystem if (!ActionBlocker.CanInteract(playerEnt, storageEnt)) return; - OpenStorageUI(storageEnt.Value, playerEnt); + if (!_ui.IsUiOpen(storageEnt.Value, StorageComponent.StorageUiKey.Key, playerEnt)) + { + OpenStorageUI(storageEnt.Value, playerEnt); + } + else + { + _ui.CloseUi(storageEnt.Value, StorageComponent.StorageUiKey.Key, playerEnt); + } } protected void ClearCantFillReasons() From efc430f651192fe0d6e2b7a076eb1ed2ed59192f Mon Sep 17 00:00:00 2001 From: PJBot Date: Mon, 13 May 2024 00:04:13 +0000 Subject: [PATCH 107/111] Automatic changelog update --- Resources/Changelog/Changelog.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index 90888f0788..a979fa6f89 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -1,12 +1,4 @@ Entries: -- author: deltanedas - changes: - - message: Rehydrated mobs (carp) now keep their forensics data from their cube/plushie - form. - type: Tweak - id: 6089 - time: '2024-03-05T03:13:50.0000000+00:00' - url: https://github.com/space-wizards/space-station-14/pull/25148 - author: Brandon-Huu changes: - message: Removed the ability for command or any antag-safe role to be initial @@ -3870,3 +3862,11 @@ id: 6588 time: '2024-05-12T22:14:35.0000000+00:00' url: https://github.com/space-wizards/space-station-14/pull/27956 +- author: mirrorcult + changes: + - message: The open slot storage keybinds (V, shift+V) now close the window if it's + already opened + type: Tweak + id: 6589 + time: '2024-05-13T00:03:07.0000000+00:00' + url: https://github.com/space-wizards/space-station-14/pull/27962 From 993eef1e7c22b2b79e528967ef5bb669f50236b1 Mon Sep 17 00:00:00 2001 From: Kara Date: Sun, 12 May 2024 17:34:52 -0700 Subject: [PATCH 108/111] Resolve `'EntitySystem.Get()' is obsolete` in content (#27936) * PROJECT 0 WARNINGS: Resolve `'EntitySystem.Get()' is obsolete` in content * pass entman * dog ass test * webeditor --- Content.Client/Decals/ToggleDecalCommand.cs | 4 +++- .../Decals/UI/DecalPlacerWindow.xaml.cs | 3 ++- .../Systems/NetworkConfiguratorSystem.cs | 4 +++- Content.Client/NodeContainer/NodeVisCommand.cs | 8 ++++++-- .../Tests/Commands/RestartRoundTest.cs | 4 ++-- Content.Server/Administration/Commands/DSay.cs | 4 +++- .../Administration/Commands/ReadyAll.cs | 4 +++- .../Administration/Commands/ShuttleCommands.cs | 10 +++++++--- .../Commands/ThrowScoreboardCommand.cs | 4 +++- .../Administration/Logs/AdminLogsEui.cs | 3 ++- .../Administration/UI/SpawnExplosionEui.cs | 2 +- Content.Server/Alert/Commands/ClearAlert.cs | 6 ++++-- Content.Server/Alert/Commands/ShowAlert.cs | 6 ++++-- .../Atmos/Commands/ListGasesCommand.cs | 4 +++- .../Atmos/Commands/ShowAtmosCommand.cs | 4 +++- .../Atmos/Components/AtmosPlaqueComponent.cs | 2 +- .../Atmos/Monitor/Systems/AirAlarmModes.cs | 4 ++-- .../Piping/Components/AtmosPipeColorComponent.cs | 2 +- Content.Server/Chat/Commands/LOOCCommand.cs | 4 +++- Content.Server/Chat/Commands/SuicideCommand.cs | 16 ++++++++++------ .../Chemistry/EntitySystems/VaporSystem.cs | 2 +- .../ReactionEffects/ExplosionReactionEffect.cs | 3 ++- .../ReagentEffectConditions/HasTagCondition.cs | 2 +- .../ReagentEffects/ChemCleanBloodstream.cs | 2 +- .../ReagentEffects/ExtinguishReaction.cs | 2 +- .../Chemistry/ReagentEffects/Ignite.cs | 2 +- .../ReagentEffects/ModifyBleedAmount.cs | 2 +- .../Chemistry/ReagentEffects/ModifyBloodLevel.cs | 2 +- .../ReagentEffects/MovespeedModifier.cs | 2 +- .../Chemistry/ReagentEffects/Oxygenate.cs | 2 +- .../Chemistry/ReagentEffects/Paralyze.cs | 2 +- .../Chemistry/ReagentEffects/SatiateThirst.cs | 2 +- .../ReagentEffects/WashCreamPieReaction.cs | 2 +- .../TileReactions/CleanDecalsReaction.cs | 15 ++++++++------- .../Chemistry/TileReactions/CleanTileReaction.cs | 12 +++++++----- .../TileReactions/CreateEntityTileReaction.cs | 12 ++++++------ .../TileReactions/ExtinguishTileReaction.cs | 7 +++++-- .../TileReactions/FlammableTileReaction.cs | 7 +++++-- .../Chemistry/TileReactions/PryTileReaction.cs | 7 +++++-- .../SpillIfPuddlePresentTileReaction.cs | 7 +++++-- .../Chemistry/TileReactions/SpillTileReaction.cs | 7 ++++--- .../Thresholds/Behaviors/EjectVendorItems.cs | 2 +- .../Thresholds/Behaviors/OpenBehavior.cs | 2 +- .../Thresholds/Behaviors/SpillBehavior.cs | 4 ++-- .../Fluids/EntitySystems/PuddleSystem.cs | 2 +- .../Fluids/EntitySystems/SmokeSystem.cs | 2 +- .../GameTicking/Commands/DelayStartCommand.cs | 4 +++- .../GameTicking/Commands/EndRoundCommand.cs | 4 +++- .../GameTicking/Commands/ForcePresetCommand.cs | 4 +++- .../GameTicking/Commands/GoLobbyCommand.cs | 4 +++- .../GameTicking/Commands/ObserveCommand.cs | 4 +++- .../GameTicking/Commands/RestartRoundCommand.cs | 10 +++++++--- .../GameTicking/Commands/StartRoundCommand.cs | 4 +++- .../GameTicking/Commands/ToggleReadyCommand.cs | 4 +++- .../Ghost/Roles/Components/GhostRoleComponent.cs | 6 +++--- Content.Server/Ghost/Roles/GhostRoleSystem.cs | 4 +++- Content.Server/Ghost/Roles/UI/GhostRolesEui.cs | 2 +- .../Maps/Conditions/HolidayMapCondition.cs | 2 +- Content.Server/NodeContainer/Nodes/PipeNode.cs | 6 +++--- .../Power/Commands/PowerStatCommand.cs | 4 +++- Content.Server/Power/PowerWireAction.cs | 2 +- .../Sandbox/Commands/ColorNetworkCommand.cs | 2 +- .../Chemistry/Reaction/ITileReaction.cs | 5 ++++- .../Chemistry/Reagent/ReagentPrototype.cs | 4 ++-- .../Shared/Alert/ServerAlertsComponentTests.cs | 10 +++++----- 65 files changed, 186 insertions(+), 110 deletions(-) diff --git a/Content.Client/Decals/ToggleDecalCommand.cs b/Content.Client/Decals/ToggleDecalCommand.cs index 9f0851f080..025ed1299d 100644 --- a/Content.Client/Decals/ToggleDecalCommand.cs +++ b/Content.Client/Decals/ToggleDecalCommand.cs @@ -5,11 +5,13 @@ namespace Content.Client.Decals; public sealed class ToggleDecalCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "toggledecals"; public string Description => "Toggles decaloverlay"; public string Help => $"{Command}"; public void Execute(IConsoleShell shell, string argStr, string[] args) { - EntitySystem.Get().ToggleOverlay(); + _e.System().ToggleOverlay(); } } diff --git a/Content.Client/Decals/UI/DecalPlacerWindow.xaml.cs b/Content.Client/Decals/UI/DecalPlacerWindow.xaml.cs index 1be1751080..21b816515a 100644 --- a/Content.Client/Decals/UI/DecalPlacerWindow.xaml.cs +++ b/Content.Client/Decals/UI/DecalPlacerWindow.xaml.cs @@ -16,6 +16,7 @@ namespace Content.Client.Decals.UI; public sealed partial class DecalPlacerWindow : DefaultWindow { [Dependency] private readonly IPrototypeManager _prototype = default!; + [Dependency] private readonly IEntityManager _e = default!; private readonly DecalPlacementSystem _decalPlacementSystem; @@ -39,7 +40,7 @@ public sealed partial class DecalPlacerWindow : DefaultWindow RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); - _decalPlacementSystem = EntitySystem.Get(); + _decalPlacementSystem = _e.System(); // This needs to be done in C# so we can have custom stuff passed in the constructor // and thus have a proper step size diff --git a/Content.Client/NetworkConfigurator/Systems/NetworkConfiguratorSystem.cs b/Content.Client/NetworkConfigurator/Systems/NetworkConfiguratorSystem.cs index 2fd4f29655..2d561ba5f2 100644 --- a/Content.Client/NetworkConfigurator/Systems/NetworkConfiguratorSystem.cs +++ b/Content.Client/NetworkConfigurator/Systems/NetworkConfiguratorSystem.cs @@ -139,11 +139,13 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem public sealed class ClearAllNetworkLinkOverlays : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "clearnetworklinkoverlays"; public string Description => "Clear all network link overlays."; public string Help => Command; public void Execute(IConsoleShell shell, string argStr, string[] args) { - IoCManager.Resolve().System().ClearAllOverlays(); + _e.System().ClearAllOverlays(); } } diff --git a/Content.Client/NodeContainer/NodeVisCommand.cs b/Content.Client/NodeContainer/NodeVisCommand.cs index c6a95fce5b..249c0d9427 100644 --- a/Content.Client/NodeContainer/NodeVisCommand.cs +++ b/Content.Client/NodeContainer/NodeVisCommand.cs @@ -8,6 +8,8 @@ namespace Content.Client.NodeContainer { public sealed class NodeVisCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "nodevis"; public string Description => "Toggles node group visualization"; public string Help => ""; @@ -21,20 +23,22 @@ namespace Content.Client.NodeContainer return; } - var sys = EntitySystem.Get(); + var sys = _e.System(); sys.SetVisEnabled(!sys.VisEnabled); } } public sealed class NodeVisFilterCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "nodevisfilter"; public string Description => "Toggles showing a specific group on nodevis"; public string Help => "Usage: nodevis [filter]\nOmit filter to list currently masked-off"; public void Execute(IConsoleShell shell, string argStr, string[] args) { - var sys = EntitySystem.Get(); + var sys = _e.System(); if (args.Length == 0) { diff --git a/Content.IntegrationTests/Tests/Commands/RestartRoundTest.cs b/Content.IntegrationTests/Tests/Commands/RestartRoundTest.cs index 74d014b772..ff24ec0968 100644 --- a/Content.IntegrationTests/Tests/Commands/RestartRoundTest.cs +++ b/Content.IntegrationTests/Tests/Commands/RestartRoundTest.cs @@ -3,6 +3,7 @@ using Content.Server.GameTicking.Commands; using Content.Shared.CCVar; using Robust.Shared.Configuration; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Timing; namespace Content.IntegrationTests.Tests.Commands @@ -40,8 +41,7 @@ namespace Content.IntegrationTests.Tests.Commands tickBeforeRestart = entityManager.CurrentTick; - var command = new RestartRoundNowCommand(); - command.Execute(null, string.Empty, Array.Empty()); + gameTicker.RestartRound(); if (lobbyEnabled) { diff --git a/Content.Server/Administration/Commands/DSay.cs b/Content.Server/Administration/Commands/DSay.cs index 61b47d7856..8682614b5f 100644 --- a/Content.Server/Administration/Commands/DSay.cs +++ b/Content.Server/Administration/Commands/DSay.cs @@ -7,6 +7,8 @@ namespace Content.Server.Administration.Commands [AdminCommand(AdminFlags.Admin)] sealed class DSay : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "dsay"; public string Description => Loc.GetString("dsay-command-description"); @@ -32,7 +34,7 @@ namespace Content.Server.Administration.Commands if (string.IsNullOrEmpty(message)) return; - var chat = EntitySystem.Get(); + var chat = _e.System(); chat.TrySendInGameOOCMessage(entity, message, InGameOOCChatType.Dead, false, shell, player); } } diff --git a/Content.Server/Administration/Commands/ReadyAll.cs b/Content.Server/Administration/Commands/ReadyAll.cs index d55ef09660..530ba0e89c 100644 --- a/Content.Server/Administration/Commands/ReadyAll.cs +++ b/Content.Server/Administration/Commands/ReadyAll.cs @@ -8,6 +8,8 @@ namespace Content.Server.Administration.Commands [AdminCommand(AdminFlags.Round)] public sealed class ReadyAll : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "readyall"; public string Description => "Readies up all players in the lobby, except for observers."; public string Help => $"{Command} | ̣{Command} "; @@ -20,7 +22,7 @@ namespace Content.Server.Administration.Commands ready = bool.Parse(args[0]); } - var gameTicker = EntitySystem.Get(); + var gameTicker = _e.System(); if (gameTicker.RunLevel != GameRunLevel.PreRoundLobby) diff --git a/Content.Server/Administration/Commands/ShuttleCommands.cs b/Content.Server/Administration/Commands/ShuttleCommands.cs index 5b0d39fd15..ea0f891360 100644 --- a/Content.Server/Administration/Commands/ShuttleCommands.cs +++ b/Content.Server/Administration/Commands/ShuttleCommands.cs @@ -8,6 +8,8 @@ namespace Content.Server.Administration.Commands [AdminCommand(AdminFlags.Round)] public sealed class CallShuttleCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "callshuttle"; public string Description => Loc.GetString("call-shuttle-command-description"); public string Help => Loc.GetString("call-shuttle-command-help-text", ("command",Command)); @@ -19,7 +21,7 @@ namespace Content.Server.Administration.Commands // ReSharper disable once ConvertIfStatementToSwitchStatement if (args.Length == 1 && TimeSpan.TryParseExact(args[0], ContentLocalizationManager.TimeSpanMinutesFormats, loc.DefaultCulture, out var timeSpan)) { - EntitySystem.Get().RequestRoundEnd(timeSpan, shell.Player?.AttachedEntity, false); + _e.System().RequestRoundEnd(timeSpan, shell.Player?.AttachedEntity, false); } else if (args.Length == 1) { @@ -27,7 +29,7 @@ namespace Content.Server.Administration.Commands } else { - EntitySystem.Get().RequestRoundEnd(shell.Player?.AttachedEntity, false); + _e.System().RequestRoundEnd(shell.Player?.AttachedEntity, false); } } } @@ -35,13 +37,15 @@ namespace Content.Server.Administration.Commands [AdminCommand(AdminFlags.Round)] public sealed class RecallShuttleCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "recallshuttle"; public string Description => Loc.GetString("recall-shuttle-command-description"); public string Help => Loc.GetString("recall-shuttle-command-help-text", ("command",Command)); public void Execute(IConsoleShell shell, string argStr, string[] args) { - EntitySystem.Get().CancelRoundEndCountdown(shell.Player?.AttachedEntity, false); + _e.System().CancelRoundEndCountdown(shell.Player?.AttachedEntity, false); } } } diff --git a/Content.Server/Administration/Commands/ThrowScoreboardCommand.cs b/Content.Server/Administration/Commands/ThrowScoreboardCommand.cs index ed4ec5a515..e66efe809a 100644 --- a/Content.Server/Administration/Commands/ThrowScoreboardCommand.cs +++ b/Content.Server/Administration/Commands/ThrowScoreboardCommand.cs @@ -7,6 +7,8 @@ namespace Content.Server.Administration.Commands; [AdminCommand(AdminFlags.VarEdit)] public sealed class ThrowScoreboardCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "throwscoreboard"; public string Description => Loc.GetString("throw-scoreboard-command-description"); @@ -20,6 +22,6 @@ public sealed class ThrowScoreboardCommand : IConsoleCommand shell.WriteLine(Help); return; } - EntitySystem.Get().ShowRoundEndScoreboard(); + _e.System().ShowRoundEndScoreboard(); } } diff --git a/Content.Server/Administration/Logs/AdminLogsEui.cs b/Content.Server/Administration/Logs/AdminLogsEui.cs index 8bd870b2c7..e98a3b0ff2 100644 --- a/Content.Server/Administration/Logs/AdminLogsEui.cs +++ b/Content.Server/Administration/Logs/AdminLogsEui.cs @@ -23,6 +23,7 @@ public sealed class AdminLogsEui : BaseEui [Dependency] private readonly IAdminManager _adminManager = default!; [Dependency] private readonly ILogManager _logManager = default!; [Dependency] private readonly IConfigurationManager _configuration = default!; + [Dependency] private readonly IEntityManager _e = default!; private readonly ISawmill _sawmill; @@ -51,7 +52,7 @@ public sealed class AdminLogsEui : BaseEui }; } - private int CurrentRoundId => EntitySystem.Get().RoundId; + private int CurrentRoundId => _e.System().RoundId; public override async void Opened() { diff --git a/Content.Server/Administration/UI/SpawnExplosionEui.cs b/Content.Server/Administration/UI/SpawnExplosionEui.cs index a3729b1454..001ce1efee 100644 --- a/Content.Server/Administration/UI/SpawnExplosionEui.cs +++ b/Content.Server/Administration/UI/SpawnExplosionEui.cs @@ -31,7 +31,7 @@ public sealed class SpawnExplosionEui : BaseEui if (request.TotalIntensity <= 0 || request.IntensitySlope <= 0) return; - var explosion = EntitySystem.Get().GenerateExplosionPreview(request); + var explosion = _explosionSystem.GenerateExplosionPreview(request); if (explosion == null) { diff --git a/Content.Server/Alert/Commands/ClearAlert.cs b/Content.Server/Alert/Commands/ClearAlert.cs index 1759612702..73a6ca52c7 100644 --- a/Content.Server/Alert/Commands/ClearAlert.cs +++ b/Content.Server/Alert/Commands/ClearAlert.cs @@ -9,6 +9,8 @@ namespace Content.Server.Alert.Commands [AdminCommand(AdminFlags.Debug)] public sealed class ClearAlert : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "clearalert"; public string Description => "Clears an alert for a player, defaulting to current player"; public string Help => "clearalert "; @@ -30,14 +32,14 @@ namespace Content.Server.Alert.Commands if (!CommandUtils.TryGetAttachedEntityByUsernameOrId(shell, target, player, out attachedEntity)) return; } - if (!IoCManager.Resolve().TryGetComponent(attachedEntity, out AlertsComponent? alertsComponent)) + if (!_e.TryGetComponent(attachedEntity, out AlertsComponent? alertsComponent)) { shell.WriteLine("user has no alerts component"); return; } var alertType = args[0]; - var alertsSystem = EntitySystem.Get(); + var alertsSystem = _e.System(); if (!alertsSystem.TryGet(Enum.Parse(alertType), out var alert)) { shell.WriteLine("unrecognized alertType " + alertType); diff --git a/Content.Server/Alert/Commands/ShowAlert.cs b/Content.Server/Alert/Commands/ShowAlert.cs index 11901e9af0..f37ab23f2f 100644 --- a/Content.Server/Alert/Commands/ShowAlert.cs +++ b/Content.Server/Alert/Commands/ShowAlert.cs @@ -9,6 +9,8 @@ namespace Content.Server.Alert.Commands [AdminCommand(AdminFlags.Debug)] public sealed class ShowAlert : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "showalert"; public string Description => "Shows an alert for a player, defaulting to current player"; public string Help => "showalert "; @@ -30,7 +32,7 @@ namespace Content.Server.Alert.Commands if (!CommandUtils.TryGetAttachedEntityByUsernameOrId(shell, target, player, out attachedEntity)) return; } - if (!IoCManager.Resolve().TryGetComponent(attachedEntity, out AlertsComponent? alertsComponent)) + if (!_e.TryGetComponent(attachedEntity, out AlertsComponent? alertsComponent)) { shell.WriteLine("user has no alerts component"); return; @@ -38,7 +40,7 @@ namespace Content.Server.Alert.Commands var alertType = args[0]; var severity = args[1]; - var alertsSystem = EntitySystem.Get(); + var alertsSystem = _e.System(); if (!alertsSystem.TryGet(Enum.Parse(alertType), out var alert)) { shell.WriteLine("unrecognized alertType " + alertType); diff --git a/Content.Server/Atmos/Commands/ListGasesCommand.cs b/Content.Server/Atmos/Commands/ListGasesCommand.cs index ab792fcf81..81acc2b3b5 100644 --- a/Content.Server/Atmos/Commands/ListGasesCommand.cs +++ b/Content.Server/Atmos/Commands/ListGasesCommand.cs @@ -8,13 +8,15 @@ namespace Content.Server.Atmos.Commands [AdminCommand(AdminFlags.Debug)] public sealed class ListGasesCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "listgases"; public string Description => "Prints a list of gases and their indices."; public string Help => "listgases"; public void Execute(IConsoleShell shell, string argStr, string[] args) { - var atmosSystem = EntitySystem.Get(); + var atmosSystem = _e.System(); foreach (var gasPrototype in atmosSystem.Gases) { diff --git a/Content.Server/Atmos/Commands/ShowAtmosCommand.cs b/Content.Server/Atmos/Commands/ShowAtmosCommand.cs index 263ef947d0..89b9c846ec 100644 --- a/Content.Server/Atmos/Commands/ShowAtmosCommand.cs +++ b/Content.Server/Atmos/Commands/ShowAtmosCommand.cs @@ -8,6 +8,8 @@ namespace Content.Server.Atmos.Commands [AdminCommand(AdminFlags.Debug)] public sealed class ShowAtmos : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "showatmos"; public string Description => "Toggles seeing atmos debug overlay."; public string Help => $"Usage: {Command}"; @@ -21,7 +23,7 @@ namespace Content.Server.Atmos.Commands return; } - var atmosDebug = EntitySystem.Get(); + var atmosDebug = _e.System(); var enabled = atmosDebug.ToggleObserver(player); shell.WriteLine(enabled diff --git a/Content.Server/Atmos/Components/AtmosPlaqueComponent.cs b/Content.Server/Atmos/Components/AtmosPlaqueComponent.cs index d86cbe1d2f..3332d227e4 100644 --- a/Content.Server/Atmos/Components/AtmosPlaqueComponent.cs +++ b/Content.Server/Atmos/Components/AtmosPlaqueComponent.cs @@ -14,7 +14,7 @@ namespace Content.Server.Atmos.Components set { Type = value; - EntitySystem.Get().UpdateSign(Owner, this); + IoCManager.Resolve().System().UpdateSign(Owner, this); } } } diff --git a/Content.Server/Atmos/Monitor/Systems/AirAlarmModes.cs b/Content.Server/Atmos/Monitor/Systems/AirAlarmModes.cs index d794be0d56..f979f4b860 100644 --- a/Content.Server/Atmos/Monitor/Systems/AirAlarmModes.cs +++ b/Content.Server/Atmos/Monitor/Systems/AirAlarmModes.cs @@ -90,8 +90,8 @@ public abstract class AirAlarmModeExecutor : IAirAlarmMode { IoCManager.InjectDependencies(this); - DeviceNetworkSystem = EntitySystem.Get(); - AirAlarmSystem = EntitySystem.Get(); + DeviceNetworkSystem = EntityManager.System(); + AirAlarmSystem = EntityManager.System(); } } diff --git a/Content.Server/Atmos/Piping/Components/AtmosPipeColorComponent.cs b/Content.Server/Atmos/Piping/Components/AtmosPipeColorComponent.cs index 455d125e44..5b05668ad5 100644 --- a/Content.Server/Atmos/Piping/Components/AtmosPipeColorComponent.cs +++ b/Content.Server/Atmos/Piping/Components/AtmosPipeColorComponent.cs @@ -13,7 +13,7 @@ namespace Content.Server.Atmos.Piping.Components public Color ColorVV { get => Color; - set => EntitySystem.Get().SetColor(Owner, this, value); + set => IoCManager.Resolve().System().SetColor(Owner, this, value); } } } diff --git a/Content.Server/Chat/Commands/LOOCCommand.cs b/Content.Server/Chat/Commands/LOOCCommand.cs index 9e16193fc3..059d25df27 100644 --- a/Content.Server/Chat/Commands/LOOCCommand.cs +++ b/Content.Server/Chat/Commands/LOOCCommand.cs @@ -8,6 +8,8 @@ namespace Content.Server.Chat.Commands [AnyCommand] internal sealed class LOOCCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "looc"; public string Description => "Send Local Out Of Character chat messages."; public string Help => "looc "; @@ -33,7 +35,7 @@ namespace Content.Server.Chat.Commands if (string.IsNullOrEmpty(message)) return; - EntitySystem.Get().TrySendInGameOOCMessage(entity, message, InGameOOCChatType.Looc, false, shell, player); + _e.System().TrySendInGameOOCMessage(entity, message, InGameOOCChatType.Looc, false, shell, player); } } } diff --git a/Content.Server/Chat/Commands/SuicideCommand.cs b/Content.Server/Chat/Commands/SuicideCommand.cs index 0c541b48b7..0db03fec79 100644 --- a/Content.Server/Chat/Commands/SuicideCommand.cs +++ b/Content.Server/Chat/Commands/SuicideCommand.cs @@ -10,6 +10,8 @@ namespace Content.Server.Chat.Commands [AnyCommand] internal sealed class SuicideCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "suicide"; public string Description => Loc.GetString("suicide-command-description"); @@ -27,8 +29,8 @@ namespace Content.Server.Chat.Commands if (player.Status != SessionStatus.InGame || player.AttachedEntity == null) return; - var entityManager = IoCManager.Resolve(); - var minds = entityManager.System(); + var minds = _e.System(); + // This check also proves mind not-null for at the end when the mob is ghosted. if (!minds.TryGetMind(player, out var mindId, out var mind) || mind.OwnedEntity is not { Valid: true } victim) @@ -37,17 +39,19 @@ namespace Content.Server.Chat.Commands return; } - if (entityManager.HasComponent(victim)) + + var gameTicker = _e.System(); + var suicideSystem = _e.System(); + + if (_e.HasComponent(victim)) { var deniedMessage = Loc.GetString("suicide-command-denied"); shell.WriteLine(deniedMessage); - entityManager.System() + _e.System() .PopupEntity(deniedMessage, victim, victim); return; } - var gameTicker = entityManager.System(); - var suicideSystem = entityManager.System(); if (suicideSystem.Suicide(victim)) { // Prevent the player from returning to the body. diff --git a/Content.Server/Chemistry/EntitySystems/VaporSystem.cs b/Content.Server/Chemistry/EntitySystems/VaporSystem.cs index 1415b6cad3..8e12670ca6 100644 --- a/Content.Server/Chemistry/EntitySystems/VaporSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/VaporSystem.cs @@ -122,7 +122,7 @@ namespace Content.Server.Chemistry.EntitySystems var reagent = _protoManager.Index(reagentQuantity.Reagent.Prototype); var reaction = - reagent.ReactionTile(tile, (reagentQuantity.Quantity / vapor.TransferAmount) * 0.25f); + reagent.ReactionTile(tile, (reagentQuantity.Quantity / vapor.TransferAmount) * 0.25f, EntityManager); if (reaction > reagentQuantity.Quantity) { diff --git a/Content.Server/Chemistry/ReactionEffects/ExplosionReactionEffect.cs b/Content.Server/Chemistry/ReactionEffects/ExplosionReactionEffect.cs index 8a558a3ffd..2771f79c3a 100644 --- a/Content.Server/Chemistry/ReactionEffects/ExplosionReactionEffect.cs +++ b/Content.Server/Chemistry/ReactionEffects/ExplosionReactionEffect.cs @@ -61,7 +61,8 @@ namespace Content.Server.Chemistry.ReactionEffects { var intensity = MathF.Min((float) args.Quantity * IntensityPerUnit, MaxTotalIntensity); - EntitySystem.Get().QueueExplosion( + args.EntityManager.System() + .QueueExplosion( args.SolutionEntity, ExplosionType, intensity, diff --git a/Content.Server/Chemistry/ReagentEffectConditions/HasTagCondition.cs b/Content.Server/Chemistry/ReagentEffectConditions/HasTagCondition.cs index 52d4d00eb3..d185c7e0a7 100644 --- a/Content.Server/Chemistry/ReagentEffectConditions/HasTagCondition.cs +++ b/Content.Server/Chemistry/ReagentEffectConditions/HasTagCondition.cs @@ -18,7 +18,7 @@ public sealed partial class HasTag : ReagentEffectCondition public override bool Condition(ReagentEffectArgs args) { if (args.EntityManager.TryGetComponent(args.SolutionEntity, out var tag)) - return EntitySystem.Get().HasTag(tag, Tag) ^ Invert; + return args.EntityManager.System().HasTag(tag, Tag) ^ Invert; return false; } diff --git a/Content.Server/Chemistry/ReagentEffects/ChemCleanBloodstream.cs b/Content.Server/Chemistry/ReagentEffects/ChemCleanBloodstream.cs index 402b30a069..ace73c84f3 100644 --- a/Content.Server/Chemistry/ReagentEffects/ChemCleanBloodstream.cs +++ b/Content.Server/Chemistry/ReagentEffects/ChemCleanBloodstream.cs @@ -26,7 +26,7 @@ namespace Content.Server.Chemistry.ReactionEffects cleanseRate *= args.Scale; - var bloodstreamSys = EntitySystem.Get(); + var bloodstreamSys = args.EntityManager.System(); bloodstreamSys.FlushChemicals(args.SolutionEntity, args.Reagent.ID, cleanseRate); } } diff --git a/Content.Server/Chemistry/ReagentEffects/ExtinguishReaction.cs b/Content.Server/Chemistry/ReagentEffects/ExtinguishReaction.cs index e902908998..69aaf5cdcd 100644 --- a/Content.Server/Chemistry/ReagentEffects/ExtinguishReaction.cs +++ b/Content.Server/Chemistry/ReagentEffects/ExtinguishReaction.cs @@ -16,7 +16,7 @@ namespace Content.Server.Chemistry.ReagentEffects { if (!args.EntityManager.TryGetComponent(args.SolutionEntity, out FlammableComponent? flammable)) return; - var flammableSystem = EntitySystem.Get(); + var flammableSystem = args.EntityManager.System(); flammableSystem.Extinguish(args.SolutionEntity, flammable); flammableSystem.AdjustFireStacks(args.SolutionEntity, -1.5f * (float) args.Quantity, flammable); } diff --git a/Content.Server/Chemistry/ReagentEffects/Ignite.cs b/Content.Server/Chemistry/ReagentEffects/Ignite.cs index 1fc90f63e3..6c5d47711f 100644 --- a/Content.Server/Chemistry/ReagentEffects/Ignite.cs +++ b/Content.Server/Chemistry/ReagentEffects/Ignite.cs @@ -19,7 +19,7 @@ public sealed partial class Ignite : ReagentEffect public override void Effect(ReagentEffectArgs args) { - var flamSys = EntitySystem.Get(); + var flamSys = args.EntityManager.System(); flamSys.Ignite(args.SolutionEntity, args.OrganEntity ?? args.SolutionEntity); } } diff --git a/Content.Server/Chemistry/ReagentEffects/ModifyBleedAmount.cs b/Content.Server/Chemistry/ReagentEffects/ModifyBleedAmount.cs index 7b966ea478..ecd9c86255 100644 --- a/Content.Server/Chemistry/ReagentEffects/ModifyBleedAmount.cs +++ b/Content.Server/Chemistry/ReagentEffects/ModifyBleedAmount.cs @@ -21,7 +21,7 @@ public sealed partial class ModifyBleedAmount : ReagentEffect { if (args.EntityManager.TryGetComponent(args.SolutionEntity, out var blood)) { - var sys = EntitySystem.Get(); + var sys = args.EntityManager.System(); var amt = Scaled ? Amount * args.Quantity.Float() : Amount; amt *= args.Scale; diff --git a/Content.Server/Chemistry/ReagentEffects/ModifyBloodLevel.cs b/Content.Server/Chemistry/ReagentEffects/ModifyBloodLevel.cs index 748aa71083..b136ff9bb8 100644 --- a/Content.Server/Chemistry/ReagentEffects/ModifyBloodLevel.cs +++ b/Content.Server/Chemistry/ReagentEffects/ModifyBloodLevel.cs @@ -22,7 +22,7 @@ public sealed partial class ModifyBloodLevel : ReagentEffect { if (args.EntityManager.TryGetComponent(args.SolutionEntity, out var blood)) { - var sys = EntitySystem.Get(); + var sys = args.EntityManager.System(); var amt = Scaled ? Amount * args.Quantity : Amount; amt *= args.Scale; diff --git a/Content.Server/Chemistry/ReagentEffects/MovespeedModifier.cs b/Content.Server/Chemistry/ReagentEffects/MovespeedModifier.cs index 0301742c5a..e538a011f6 100644 --- a/Content.Server/Chemistry/ReagentEffects/MovespeedModifier.cs +++ b/Content.Server/Chemistry/ReagentEffects/MovespeedModifier.cs @@ -59,7 +59,7 @@ namespace Content.Server.Chemistry.ReagentEffects IncreaseTimer(status, statusLifetime); if (modified) - EntitySystem.Get().RefreshMovementSpeedModifiers(args.SolutionEntity); + args.EntityManager.System().RefreshMovementSpeedModifiers(args.SolutionEntity); } public void IncreaseTimer(MovespeedModifierMetabolismComponent status, float time) diff --git a/Content.Server/Chemistry/ReagentEffects/Oxygenate.cs b/Content.Server/Chemistry/ReagentEffects/Oxygenate.cs index 34a2454139..6c5ab155e4 100644 --- a/Content.Server/Chemistry/ReagentEffects/Oxygenate.cs +++ b/Content.Server/Chemistry/ReagentEffects/Oxygenate.cs @@ -18,7 +18,7 @@ public sealed partial class Oxygenate : ReagentEffect { if (args.EntityManager.TryGetComponent(args.SolutionEntity, out var resp)) { - var respSys = EntitySystem.Get(); + var respSys = args.EntityManager.System(); respSys.UpdateSaturation(args.SolutionEntity, args.Quantity.Float() * Factor, resp); } } diff --git a/Content.Server/Chemistry/ReagentEffects/Paralyze.cs b/Content.Server/Chemistry/ReagentEffects/Paralyze.cs index 077d1abf2c..d5d913f37d 100644 --- a/Content.Server/Chemistry/ReagentEffects/Paralyze.cs +++ b/Content.Server/Chemistry/ReagentEffects/Paralyze.cs @@ -23,7 +23,7 @@ public sealed partial class Paralyze : ReagentEffect var paralyzeTime = ParalyzeTime; paralyzeTime *= args.Scale; - EntitySystem.Get().TryParalyze(args.SolutionEntity, TimeSpan.FromSeconds(paralyzeTime), Refresh); + args.EntityManager.System().TryParalyze(args.SolutionEntity, TimeSpan.FromSeconds(paralyzeTime), Refresh); } } diff --git a/Content.Server/Chemistry/ReagentEffects/SatiateThirst.cs b/Content.Server/Chemistry/ReagentEffects/SatiateThirst.cs index 1208e74367..8813813c24 100644 --- a/Content.Server/Chemistry/ReagentEffects/SatiateThirst.cs +++ b/Content.Server/Chemistry/ReagentEffects/SatiateThirst.cs @@ -23,7 +23,7 @@ namespace Content.Server.Chemistry.ReagentEffects { var uid = args.SolutionEntity; if (args.EntityManager.TryGetComponent(uid, out ThirstComponent? thirst)) - EntitySystem.Get().ModifyThirst(uid, thirst, HydrationFactor); + args.EntityManager.System().ModifyThirst(uid, thirst, HydrationFactor); } protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) diff --git a/Content.Server/Chemistry/ReagentEffects/WashCreamPieReaction.cs b/Content.Server/Chemistry/ReagentEffects/WashCreamPieReaction.cs index 9bf6792eca..a71a42c25f 100644 --- a/Content.Server/Chemistry/ReagentEffects/WashCreamPieReaction.cs +++ b/Content.Server/Chemistry/ReagentEffects/WashCreamPieReaction.cs @@ -16,7 +16,7 @@ namespace Content.Server.Chemistry.ReagentEffects { if (!args.EntityManager.TryGetComponent(args.SolutionEntity, out CreamPiedComponent? creamPied)) return; - EntitySystem.Get().SetCreamPied(args.SolutionEntity, creamPied, false); + args.EntityManager.System().SetCreamPied(args.SolutionEntity, creamPied, false); } } } diff --git a/Content.Server/Chemistry/TileReactions/CleanDecalsReaction.cs b/Content.Server/Chemistry/TileReactions/CleanDecalsReaction.cs index a20f54728e..6958dabb81 100644 --- a/Content.Server/Chemistry/TileReactions/CleanDecalsReaction.cs +++ b/Content.Server/Chemistry/TileReactions/CleanDecalsReaction.cs @@ -21,19 +21,20 @@ public sealed partial class CleanDecalsReaction : ITileReaction [DataField] public FixedPoint2 CleanCost { get; private set; } = FixedPoint2.New(0.25f); - public FixedPoint2 TileReact(TileRef tile, ReagentPrototype reagent, FixedPoint2 reactVolume) + public FixedPoint2 TileReact(TileRef tile, + ReagentPrototype reagent, + FixedPoint2 reactVolume, + IEntityManager entityManager) { - var entMan = IoCManager.Resolve(); - if (reactVolume <= CleanCost || - !entMan.TryGetComponent(tile.GridUid, out var grid) || - !entMan.TryGetComponent(tile.GridUid, out var decalGrid)) + !entityManager.TryGetComponent(tile.GridUid, out var grid) || + !entityManager.TryGetComponent(tile.GridUid, out var decalGrid)) { return FixedPoint2.Zero; } - var lookupSystem = entMan.System(); - var decalSystem = entMan.System(); + var lookupSystem = entityManager.System(); + var decalSystem = entityManager.System(); // Very generous hitbox. var decals = decalSystem .GetDecalsIntersecting(tile.GridUid, lookupSystem.GetLocalBounds(tile, grid.TileSize).Enlarged(0.5f).Translated(new Vector2(-0.5f, -0.5f))); diff --git a/Content.Server/Chemistry/TileReactions/CleanTileReaction.cs b/Content.Server/Chemistry/TileReactions/CleanTileReaction.cs index 3f5ae63c36..08f77de72d 100644 --- a/Content.Server/Chemistry/TileReactions/CleanTileReaction.cs +++ b/Content.Server/Chemistry/TileReactions/CleanTileReaction.cs @@ -31,12 +31,14 @@ public sealed partial class CleanTileReaction : ITileReaction [DataField("reagent", customTypeSerializer: typeof(PrototypeIdSerializer))] public string ReplacementReagent = "Water"; - FixedPoint2 ITileReaction.TileReact(TileRef tile, ReagentPrototype reagent, FixedPoint2 reactVolume) + FixedPoint2 ITileReaction.TileReact(TileRef tile, + ReagentPrototype reagent, + FixedPoint2 reactVolume, + IEntityManager entityManager) { - var entMan = IoCManager.Resolve(); - var entities = entMan.System().GetLocalEntitiesIntersecting(tile, 0f).ToArray(); - var puddleQuery = entMan.GetEntityQuery(); - var solutionContainerSystem = entMan.System(); + var entities = entityManager.System().GetLocalEntitiesIntersecting(tile, 0f).ToArray(); + var puddleQuery = entityManager.GetEntityQuery(); + var solutionContainerSystem = entityManager.System(); // Multiply as the amount we can actually purge is higher than the react amount. var purgeAmount = reactVolume / CleanAmountMultiplier; diff --git a/Content.Server/Chemistry/TileReactions/CreateEntityTileReaction.cs b/Content.Server/Chemistry/TileReactions/CreateEntityTileReaction.cs index 9cb1ba201d..29f9275bdf 100644 --- a/Content.Server/Chemistry/TileReactions/CreateEntityTileReaction.cs +++ b/Content.Server/Chemistry/TileReactions/CreateEntityTileReaction.cs @@ -35,13 +35,13 @@ public sealed partial class CreateEntityTileReaction : ITileReaction [DataField] public float RandomOffsetMax = 0.0f; - public FixedPoint2 TileReact(TileRef tile, ReagentPrototype reagent, FixedPoint2 reactVolume) + public FixedPoint2 TileReact(TileRef tile, + ReagentPrototype reagent, + FixedPoint2 reactVolume, + IEntityManager entityManager) { if (reactVolume >= Usage) { - // TODO probably pass this in args like reagenteffects do. - var entMan = IoCManager.Resolve(); - if (Whitelist != null) { int acc = 0; @@ -59,9 +59,9 @@ public sealed partial class CreateEntityTileReaction : ITileReaction var xoffs = random.NextFloat(-RandomOffsetMax, RandomOffsetMax); var yoffs = random.NextFloat(-RandomOffsetMax, RandomOffsetMax); - var center = entMan.System().GetTileCenter(tile); + var center = entityManager.System().GetTileCenter(tile); var pos = center.Offset(new Vector2(xoffs, yoffs)); - entMan.SpawnEntity(Entity, pos); + entityManager.SpawnEntity(Entity, pos); return Usage; } diff --git a/Content.Server/Chemistry/TileReactions/ExtinguishTileReaction.cs b/Content.Server/Chemistry/TileReactions/ExtinguishTileReaction.cs index 312b88bd34..198f650ac1 100644 --- a/Content.Server/Chemistry/TileReactions/ExtinguishTileReaction.cs +++ b/Content.Server/Chemistry/TileReactions/ExtinguishTileReaction.cs @@ -14,12 +14,15 @@ namespace Content.Server.Chemistry.TileReactions { [DataField("coolingTemperature")] private float _coolingTemperature = 2f; - public FixedPoint2 TileReact(TileRef tile, ReagentPrototype reagent, FixedPoint2 reactVolume) + public FixedPoint2 TileReact(TileRef tile, + ReagentPrototype reagent, + FixedPoint2 reactVolume, + IEntityManager entityManager) { if (reactVolume <= FixedPoint2.Zero || tile.Tile.IsEmpty) return FixedPoint2.Zero; - var atmosphereSystem = EntitySystem.Get(); + var atmosphereSystem = entityManager.System(); var environment = atmosphereSystem.GetTileMixture(tile.GridUid, null, tile.GridIndices, true); diff --git a/Content.Server/Chemistry/TileReactions/FlammableTileReaction.cs b/Content.Server/Chemistry/TileReactions/FlammableTileReaction.cs index a694bf6019..b13b70d3d5 100644 --- a/Content.Server/Chemistry/TileReactions/FlammableTileReaction.cs +++ b/Content.Server/Chemistry/TileReactions/FlammableTileReaction.cs @@ -13,12 +13,15 @@ namespace Content.Server.Chemistry.TileReactions { [DataField("temperatureMultiplier")] private float _temperatureMultiplier = 1.15f; - public FixedPoint2 TileReact(TileRef tile, ReagentPrototype reagent, FixedPoint2 reactVolume) + public FixedPoint2 TileReact(TileRef tile, + ReagentPrototype reagent, + FixedPoint2 reactVolume, + IEntityManager entityManager) { if (reactVolume <= FixedPoint2.Zero || tile.Tile.IsEmpty) return FixedPoint2.Zero; - var atmosphereSystem = EntitySystem.Get(); + var atmosphereSystem = entityManager.System(); var environment = atmosphereSystem.GetTileMixture(tile.GridUid, null, tile.GridIndices, true); if (environment == null || !atmosphereSystem.IsHotspotActive(tile.GridUid, tile.GridIndices)) diff --git a/Content.Server/Chemistry/TileReactions/PryTileReaction.cs b/Content.Server/Chemistry/TileReactions/PryTileReaction.cs index 39e95df5f7..c10b031720 100644 --- a/Content.Server/Chemistry/TileReactions/PryTileReaction.cs +++ b/Content.Server/Chemistry/TileReactions/PryTileReaction.cs @@ -12,9 +12,12 @@ namespace Content.Server.Chemistry.TileReactions; [DataDefinition] public sealed partial class PryTileReaction : ITileReaction { - public FixedPoint2 TileReact(TileRef tile, ReagentPrototype reagent, FixedPoint2 reactVolume) + public FixedPoint2 TileReact(TileRef tile, + ReagentPrototype reagent, + FixedPoint2 reactVolume, + IEntityManager entityManager) { - var sys = IoCManager.Resolve().System(); + var sys = entityManager.System(); sys.PryTile(tile); return reactVolume; } diff --git a/Content.Server/Chemistry/TileReactions/SpillIfPuddlePresentTileReaction.cs b/Content.Server/Chemistry/TileReactions/SpillIfPuddlePresentTileReaction.cs index 82ede720cd..6b46b89495 100644 --- a/Content.Server/Chemistry/TileReactions/SpillIfPuddlePresentTileReaction.cs +++ b/Content.Server/Chemistry/TileReactions/SpillIfPuddlePresentTileReaction.cs @@ -12,9 +12,12 @@ namespace Content.Server.Chemistry.TileReactions [DataDefinition] public sealed partial class SpillIfPuddlePresentTileReaction : ITileReaction { - public FixedPoint2 TileReact(TileRef tile, ReagentPrototype reagent, FixedPoint2 reactVolume) + public FixedPoint2 TileReact(TileRef tile, + ReagentPrototype reagent, + FixedPoint2 reactVolume, + IEntityManager entityManager) { - var spillSystem = EntitySystem.Get(); + var spillSystem = entityManager.System(); if (reactVolume < 5 || !spillSystem.TryGetPuddle(tile, out _)) return FixedPoint2.Zero; diff --git a/Content.Server/Chemistry/TileReactions/SpillTileReaction.cs b/Content.Server/Chemistry/TileReactions/SpillTileReaction.cs index 8f8b0626a2..fadc7147c9 100644 --- a/Content.Server/Chemistry/TileReactions/SpillTileReaction.cs +++ b/Content.Server/Chemistry/TileReactions/SpillTileReaction.cs @@ -26,13 +26,14 @@ namespace Content.Server.Chemistry.TileReactions /// [DataField("superSlippery")] private bool _superSlippery; - public FixedPoint2 TileReact(TileRef tile, ReagentPrototype reagent, FixedPoint2 reactVolume) + public FixedPoint2 TileReact(TileRef tile, + ReagentPrototype reagent, + FixedPoint2 reactVolume, + IEntityManager entityManager) { if (reactVolume < 5) return FixedPoint2.Zero; - var entityManager = IoCManager.Resolve(); - if (entityManager.EntitySysManager.GetEntitySystem() .TrySpillAt(tile, new Solution(reagent.ID, reactVolume), out var puddleUid, false, false)) { diff --git a/Content.Server/Destructible/Thresholds/Behaviors/EjectVendorItems.cs b/Content.Server/Destructible/Thresholds/Behaviors/EjectVendorItems.cs index 2ffd9a8f9f..a5212dfe85 100644 --- a/Content.Server/Destructible/Thresholds/Behaviors/EjectVendorItems.cs +++ b/Content.Server/Destructible/Thresholds/Behaviors/EjectVendorItems.cs @@ -29,7 +29,7 @@ namespace Content.Server.Destructible.Thresholds.Behaviors !system.EntityManager.TryGetComponent(owner, out var xform)) return; - var vendingMachineSystem = EntitySystem.Get(); + var vendingMachineSystem = system.EntityManager.System(); var inventory = vendingMachineSystem.GetAvailableInventory(owner, vendingcomp); if (inventory.Count <= 0) return; diff --git a/Content.Server/Destructible/Thresholds/Behaviors/OpenBehavior.cs b/Content.Server/Destructible/Thresholds/Behaviors/OpenBehavior.cs index 7ab1fe11b0..dffcac6d96 100644 --- a/Content.Server/Destructible/Thresholds/Behaviors/OpenBehavior.cs +++ b/Content.Server/Destructible/Thresholds/Behaviors/OpenBehavior.cs @@ -11,7 +11,7 @@ public sealed partial class OpenBehavior : IThresholdBehavior { public void Execute(EntityUid uid, DestructibleSystem system, EntityUid? cause = null) { - var openable = EntitySystem.Get(); + var openable = system.EntityManager.System(); openable.TryOpen(uid); } } diff --git a/Content.Server/Destructible/Thresholds/Behaviors/SpillBehavior.cs b/Content.Server/Destructible/Thresholds/Behaviors/SpillBehavior.cs index 38564380c0..5826a3871d 100644 --- a/Content.Server/Destructible/Thresholds/Behaviors/SpillBehavior.cs +++ b/Content.Server/Destructible/Thresholds/Behaviors/SpillBehavior.cs @@ -22,8 +22,8 @@ namespace Content.Server.Destructible.Thresholds.Behaviors /// public void Execute(EntityUid owner, DestructibleSystem system, EntityUid? cause = null) { - var solutionContainerSystem = EntitySystem.Get(); - var spillableSystem = EntitySystem.Get(); + var solutionContainerSystem = system.EntityManager.System(); + var spillableSystem = system.EntityManager.System(); var coordinates = system.EntityManager.GetComponent(owner).Coordinates; diff --git a/Content.Server/Fluids/EntitySystems/PuddleSystem.cs b/Content.Server/Fluids/EntitySystems/PuddleSystem.cs index 923210cc73..a232ed8c0e 100644 --- a/Content.Server/Fluids/EntitySystems/PuddleSystem.cs +++ b/Content.Server/Fluids/EntitySystems/PuddleSystem.cs @@ -712,7 +712,7 @@ public sealed partial class PuddleSystem : SharedPuddleSystem { var (reagent, quantity) = solution.Contents[i]; var proto = _prototypeManager.Index(reagent.Prototype); - var removed = proto.ReactionTile(tileRef, quantity); + var removed = proto.ReactionTile(tileRef, quantity, EntityManager); if (removed <= FixedPoint2.Zero) continue; diff --git a/Content.Server/Fluids/EntitySystems/SmokeSystem.cs b/Content.Server/Fluids/EntitySystems/SmokeSystem.cs index ae170842a0..9638dabf28 100644 --- a/Content.Server/Fluids/EntitySystems/SmokeSystem.cs +++ b/Content.Server/Fluids/EntitySystems/SmokeSystem.cs @@ -315,7 +315,7 @@ public sealed class SmokeSystem : EntitySystem continue; var reagent = _prototype.Index(reagentQuantity.Reagent.Prototype); - reagent.ReactionTile(tile, reagentQuantity.Quantity); + reagent.ReactionTile(tile, reagentQuantity.Quantity, EntityManager); } } diff --git a/Content.Server/GameTicking/Commands/DelayStartCommand.cs b/Content.Server/GameTicking/Commands/DelayStartCommand.cs index 6f57f561d8..6e101d93a3 100644 --- a/Content.Server/GameTicking/Commands/DelayStartCommand.cs +++ b/Content.Server/GameTicking/Commands/DelayStartCommand.cs @@ -7,13 +7,15 @@ namespace Content.Server.GameTicking.Commands [AdminCommand(AdminFlags.Round)] sealed class DelayStartCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "delaystart"; public string Description => "Delays the round start."; public string Help => $"Usage: {Command} \nPauses/Resumes the countdown if no argument is provided."; public void Execute(IConsoleShell shell, string argStr, string[] args) { - var ticker = EntitySystem.Get(); + var ticker = _e.System(); if (ticker.RunLevel != GameRunLevel.PreRoundLobby) { shell.WriteLine("This can only be executed while the game is in the pre-round lobby."); diff --git a/Content.Server/GameTicking/Commands/EndRoundCommand.cs b/Content.Server/GameTicking/Commands/EndRoundCommand.cs index 972fa9561a..c6a8ddbf53 100644 --- a/Content.Server/GameTicking/Commands/EndRoundCommand.cs +++ b/Content.Server/GameTicking/Commands/EndRoundCommand.cs @@ -7,13 +7,15 @@ namespace Content.Server.GameTicking.Commands [AdminCommand(AdminFlags.Round)] sealed class EndRoundCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "endround"; public string Description => "Ends the round and moves the server to PostRound."; public string Help => String.Empty; public void Execute(IConsoleShell shell, string argStr, string[] args) { - var ticker = EntitySystem.Get(); + var ticker = _e.System(); if (ticker.RunLevel != GameRunLevel.InRound) { diff --git a/Content.Server/GameTicking/Commands/ForcePresetCommand.cs b/Content.Server/GameTicking/Commands/ForcePresetCommand.cs index 1041fed6ec..5ef72f59b3 100644 --- a/Content.Server/GameTicking/Commands/ForcePresetCommand.cs +++ b/Content.Server/GameTicking/Commands/ForcePresetCommand.cs @@ -10,13 +10,15 @@ namespace Content.Server.GameTicking.Commands [AdminCommand(AdminFlags.Round)] sealed class ForcePresetCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "forcepreset"; public string Description => "Forces a specific game preset to start for the current lobby."; public string Help => $"Usage: {Command} "; public void Execute(IConsoleShell shell, string argStr, string[] args) { - var ticker = EntitySystem.Get(); + var ticker = _e.System(); if (ticker.RunLevel != GameRunLevel.PreRoundLobby) { shell.WriteLine("This can only be executed while the game is in the pre-round lobby."); diff --git a/Content.Server/GameTicking/Commands/GoLobbyCommand.cs b/Content.Server/GameTicking/Commands/GoLobbyCommand.cs index 4932dbe0bf..b5984d260d 100644 --- a/Content.Server/GameTicking/Commands/GoLobbyCommand.cs +++ b/Content.Server/GameTicking/Commands/GoLobbyCommand.cs @@ -10,6 +10,8 @@ namespace Content.Server.GameTicking.Commands [AdminCommand(AdminFlags.Round)] public sealed class GoLobbyCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "golobby"; public string Description => "Enables the lobby and restarts the round."; public string Help => $"Usage: {Command} / {Command} "; @@ -18,7 +20,7 @@ namespace Content.Server.GameTicking.Commands GamePresetPrototype? preset = null; var presetName = string.Join(" ", args); - var ticker = EntitySystem.Get(); + var ticker = _e.System(); if (args.Length > 0) { diff --git a/Content.Server/GameTicking/Commands/ObserveCommand.cs b/Content.Server/GameTicking/Commands/ObserveCommand.cs index 747e54e28b..16c2c3261d 100644 --- a/Content.Server/GameTicking/Commands/ObserveCommand.cs +++ b/Content.Server/GameTicking/Commands/ObserveCommand.cs @@ -7,6 +7,8 @@ namespace Content.Server.GameTicking.Commands [AnyCommand] sealed class ObserveCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "observe"; public string Description => ""; public string Help => ""; @@ -18,7 +20,7 @@ namespace Content.Server.GameTicking.Commands return; } - var ticker = EntitySystem.Get(); + var ticker = _e.System(); if (ticker.RunLevel == GameRunLevel.PreRoundLobby) { diff --git a/Content.Server/GameTicking/Commands/RestartRoundCommand.cs b/Content.Server/GameTicking/Commands/RestartRoundCommand.cs index 36c0ba981c..e4ea3fa53c 100644 --- a/Content.Server/GameTicking/Commands/RestartRoundCommand.cs +++ b/Content.Server/GameTicking/Commands/RestartRoundCommand.cs @@ -8,13 +8,15 @@ namespace Content.Server.GameTicking.Commands [AdminCommand(AdminFlags.Round)] public sealed class RestartRoundCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "restartround"; public string Description => "Ends the current round and starts the countdown for the next lobby."; public string Help => string.Empty; public void Execute(IConsoleShell shell, string argStr, string[] args) { - var ticker = EntitySystem.Get(); + var ticker = _e.System(); if (ticker.RunLevel != GameRunLevel.InRound) { @@ -22,20 +24,22 @@ namespace Content.Server.GameTicking.Commands return; } - EntitySystem.Get().EndRound(); + _e.System().EndRound(); } } [AdminCommand(AdminFlags.Round)] public sealed class RestartRoundNowCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "restartroundnow"; public string Description => "Moves the server from PostRound to a new PreRoundLobby."; public string Help => String.Empty; public void Execute(IConsoleShell shell, string argStr, string[] args) { - EntitySystem.Get().RestartRound(); + _e.System().RestartRound(); } } } diff --git a/Content.Server/GameTicking/Commands/StartRoundCommand.cs b/Content.Server/GameTicking/Commands/StartRoundCommand.cs index 1652a14120..432cdd23e3 100644 --- a/Content.Server/GameTicking/Commands/StartRoundCommand.cs +++ b/Content.Server/GameTicking/Commands/StartRoundCommand.cs @@ -7,13 +7,15 @@ namespace Content.Server.GameTicking.Commands [AdminCommand(AdminFlags.Round)] sealed class StartRoundCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "startround"; public string Description => "Ends PreRoundLobby state and starts the round."; public string Help => String.Empty; public void Execute(IConsoleShell shell, string argStr, string[] args) { - var ticker = EntitySystem.Get(); + var ticker = _e.System(); if (ticker.RunLevel != GameRunLevel.PreRoundLobby) { diff --git a/Content.Server/GameTicking/Commands/ToggleReadyCommand.cs b/Content.Server/GameTicking/Commands/ToggleReadyCommand.cs index df418c27ee..34b504acbc 100644 --- a/Content.Server/GameTicking/Commands/ToggleReadyCommand.cs +++ b/Content.Server/GameTicking/Commands/ToggleReadyCommand.cs @@ -6,6 +6,8 @@ namespace Content.Server.GameTicking.Commands [AnyCommand] sealed class ToggleReadyCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "toggleready"; public string Description => ""; public string Help => ""; @@ -23,7 +25,7 @@ namespace Content.Server.GameTicking.Commands return; } - var ticker = EntitySystem.Get(); + var ticker = _e.System(); ticker.ToggleReady(player, bool.Parse(args[0])); } } diff --git a/Content.Server/Ghost/Roles/Components/GhostRoleComponent.cs b/Content.Server/Ghost/Roles/Components/GhostRoleComponent.cs index ccd460a9cf..86026b230b 100644 --- a/Content.Server/Ghost/Roles/Components/GhostRoleComponent.cs +++ b/Content.Server/Ghost/Roles/Components/GhostRoleComponent.cs @@ -40,7 +40,7 @@ namespace Content.Server.Ghost.Roles.Components set { _roleName = value; - EntitySystem.Get().UpdateAllEui(); + IoCManager.Resolve().System().UpdateAllEui(); } } @@ -52,7 +52,7 @@ namespace Content.Server.Ghost.Roles.Components set { _roleDescription = value; - EntitySystem.Get().UpdateAllEui(); + IoCManager.Resolve().System().UpdateAllEui(); } } @@ -64,7 +64,7 @@ namespace Content.Server.Ghost.Roles.Components set { _roleRules = value; - EntitySystem.Get().UpdateAllEui(); + IoCManager.Resolve().System().UpdateAllEui(); } } diff --git a/Content.Server/Ghost/Roles/GhostRoleSystem.cs b/Content.Server/Ghost/Roles/GhostRoleSystem.cs index c198b54b1b..b6627f1154 100644 --- a/Content.Server/Ghost/Roles/GhostRoleSystem.cs +++ b/Content.Server/Ghost/Roles/GhostRoleSystem.cs @@ -791,13 +791,15 @@ namespace Content.Server.Ghost.Roles [AnyCommand] public sealed class GhostRoles : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "ghostroles"; public string Description => "Opens the ghost role request window."; public string Help => $"{Command}"; public void Execute(IConsoleShell shell, string argStr, string[] args) { if (shell.Player != null) - EntitySystem.Get().OpenEui(shell.Player); + _e.System().OpenEui(shell.Player); else shell.WriteLine("You can only open the ghost roles UI on a client."); } diff --git a/Content.Server/Ghost/Roles/UI/GhostRolesEui.cs b/Content.Server/Ghost/Roles/UI/GhostRolesEui.cs index c1e39919a2..825691fe95 100644 --- a/Content.Server/Ghost/Roles/UI/GhostRolesEui.cs +++ b/Content.Server/Ghost/Roles/UI/GhostRolesEui.cs @@ -40,7 +40,7 @@ namespace Content.Server.Ghost.Roles.UI { base.Closed(); - EntitySystem.Get().CloseEui(Player); + _ghostRoleSystem.CloseEui(Player); } } } diff --git a/Content.Server/Maps/Conditions/HolidayMapCondition.cs b/Content.Server/Maps/Conditions/HolidayMapCondition.cs index 81ecfb356e..da971c78f3 100644 --- a/Content.Server/Maps/Conditions/HolidayMapCondition.cs +++ b/Content.Server/Maps/Conditions/HolidayMapCondition.cs @@ -10,7 +10,7 @@ public sealed partial class HolidayMapCondition : GameMapCondition public override bool Check(GameMapPrototype map) { - var holidaySystem = EntitySystem.Get(); + var holidaySystem = IoCManager.Resolve().System(); return Holidays.Any(holiday => holidaySystem.IsCurrentlyHoliday(holiday)) ^ Inverted; } diff --git a/Content.Server/NodeContainer/Nodes/PipeNode.cs b/Content.Server/NodeContainer/Nodes/PipeNode.cs index 14afa2f108..861f3eea98 100644 --- a/Content.Server/NodeContainer/Nodes/PipeNode.cs +++ b/Content.Server/NodeContainer/Nodes/PipeNode.cs @@ -37,7 +37,7 @@ namespace Content.Server.NodeContainer.Nodes _alwaysReachable.Add(pipeNode); if (NodeGroup != null) - EntitySystem.Get().QueueRemakeGroup((BaseNodeGroup) NodeGroup); + IoCManager.Resolve().System().QueueRemakeGroup((BaseNodeGroup) NodeGroup); } public void RemoveAlwaysReachable(PipeNode pipeNode) @@ -47,7 +47,7 @@ namespace Content.Server.NodeContainer.Nodes _alwaysReachable.Remove(pipeNode); if (NodeGroup != null) - EntitySystem.Get().QueueRemakeGroup((BaseNodeGroup) NodeGroup); + IoCManager.Resolve().System().QueueRemakeGroup((BaseNodeGroup) NodeGroup); } /// @@ -62,7 +62,7 @@ namespace Content.Server.NodeContainer.Nodes _connectionsEnabled = value; if (NodeGroup != null) - EntitySystem.Get().QueueRemakeGroup((BaseNodeGroup) NodeGroup); + IoCManager.Resolve().System().QueueRemakeGroup((BaseNodeGroup) NodeGroup); } } diff --git a/Content.Server/Power/Commands/PowerStatCommand.cs b/Content.Server/Power/Commands/PowerStatCommand.cs index 440e40437b..127050393a 100644 --- a/Content.Server/Power/Commands/PowerStatCommand.cs +++ b/Content.Server/Power/Commands/PowerStatCommand.cs @@ -8,13 +8,15 @@ namespace Content.Server.Power.Commands [AdminCommand(AdminFlags.Debug)] public sealed class PowerStatCommand : IConsoleCommand { + [Dependency] private readonly IEntityManager _e = default!; + public string Command => "powerstat"; public string Description => "Shows statistics for pow3r"; public string Help => "Usage: powerstat"; public void Execute(IConsoleShell shell, string argStr, string[] args) { - var stats = EntitySystem.Get().GetStatistics(); + var stats = _e.System().GetStatistics(); shell.WriteLine($"networks: {stats.CountNetworks}"); shell.WriteLine($"loads: {stats.CountLoads}"); diff --git a/Content.Server/Power/PowerWireAction.cs b/Content.Server/Power/PowerWireAction.cs index 785eac91db..ac34966036 100644 --- a/Content.Server/Power/PowerWireAction.cs +++ b/Content.Server/Power/PowerWireAction.cs @@ -159,7 +159,7 @@ public sealed partial class PowerWireAction : BaseWireAction { base.Initialize(); - _electrocutionSystem = EntitySystem.Get(); + _electrocutionSystem = EntityManager.System(); } // This should add a wire into the entity's state, whether it be diff --git a/Content.Server/Sandbox/Commands/ColorNetworkCommand.cs b/Content.Server/Sandbox/Commands/ColorNetworkCommand.cs index 6ce8edd1d8..d5dca64eaa 100644 --- a/Content.Server/Sandbox/Commands/ColorNetworkCommand.cs +++ b/Content.Server/Sandbox/Commands/ColorNetworkCommand.cs @@ -19,7 +19,7 @@ namespace Content.Server.Sandbox.Commands public void Execute(IConsoleShell shell, string argStr, string[] args) { - var sandboxManager = EntitySystem.Get(); + var sandboxManager = _entManager.System(); var adminManager = IoCManager.Resolve(); if (shell.IsClient && (!sandboxManager.IsSandboxEnabled && !adminManager.HasAdminFlag(shell.Player!, AdminFlags.Mapping))) { diff --git a/Content.Shared/Chemistry/Reaction/ITileReaction.cs b/Content.Shared/Chemistry/Reaction/ITileReaction.cs index 1f6a6bf307..af6cc34f48 100644 --- a/Content.Shared/Chemistry/Reaction/ITileReaction.cs +++ b/Content.Shared/Chemistry/Reaction/ITileReaction.cs @@ -6,6 +6,9 @@ namespace Content.Shared.Chemistry.Reaction { public interface ITileReaction { - FixedPoint2 TileReact(TileRef tile, ReagentPrototype reagent, FixedPoint2 reactVolume); + FixedPoint2 TileReact(TileRef tile, + ReagentPrototype reagent, + FixedPoint2 reactVolume, + IEntityManager entityManager); } } diff --git a/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs b/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs index df1b1aa20b..6095676b9e 100644 --- a/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs +++ b/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs @@ -142,7 +142,7 @@ namespace Content.Shared.Chemistry.Reagent [DataField] public SoundSpecifier FootstepSound = new SoundCollectionSpecifier("FootstepWater", AudioParams.Default.WithVolume(6)); - public FixedPoint2 ReactionTile(TileRef tile, FixedPoint2 reactVolume) + public FixedPoint2 ReactionTile(TileRef tile, FixedPoint2 reactVolume, IEntityManager entityManager) { var removed = FixedPoint2.Zero; @@ -151,7 +151,7 @@ namespace Content.Shared.Chemistry.Reagent foreach (var reaction in TileReactions) { - removed += reaction.TileReact(tile, this, reactVolume - removed); + removed += reaction.TileReact(tile, this, reactVolume - removed, entityManager); if (removed > reactVolume) throw new Exception("Removed more than we have!"); diff --git a/Content.Tests/Shared/Alert/ServerAlertsComponentTests.cs b/Content.Tests/Shared/Alert/ServerAlertsComponentTests.cs index 405c0ec89e..47ae3ef74a 100644 --- a/Content.Tests/Shared/Alert/ServerAlertsComponentTests.cs +++ b/Content.Tests/Shared/Alert/ServerAlertsComponentTests.cs @@ -49,10 +49,10 @@ namespace Content.Tests.Shared.Alert var alertsComponent = new AlertsComponent(); alertsComponent = IoCManager.InjectDependencies(alertsComponent); - Assert.That(EntitySystem.Get().TryGet(AlertType.LowPressure, out var lowpressure)); - Assert.That(EntitySystem.Get().TryGet(AlertType.HighPressure, out var highpressure)); + Assert.That(entManager.System().TryGet(AlertType.LowPressure, out var lowpressure)); + Assert.That(entManager.System().TryGet(AlertType.HighPressure, out var highpressure)); - EntitySystem.Get().ShowAlert(alertsComponent.Owner, AlertType.LowPressure, null, null); + entManager.System().ShowAlert(alertsComponent.Owner, AlertType.LowPressure, null, null); var getty = new ComponentGetState(); entManager.EventBus.RaiseComponentEvent(alertsComponent, getty); @@ -62,7 +62,7 @@ namespace Content.Tests.Shared.Alert Assert.That(alertState.Alerts.Count, Is.EqualTo(1)); Assert.That(alertState.Alerts.ContainsKey(lowpressure.AlertKey)); - EntitySystem.Get().ShowAlert(alertsComponent.Owner, AlertType.HighPressure, null, null); + entManager.System().ShowAlert(alertsComponent.Owner, AlertType.HighPressure, null, null); // Lazy entManager.EventBus.RaiseComponentEvent(alertsComponent, getty); @@ -70,7 +70,7 @@ namespace Content.Tests.Shared.Alert Assert.That(alertState.Alerts.Count, Is.EqualTo(1)); Assert.That(alertState.Alerts.ContainsKey(highpressure.AlertKey)); - EntitySystem.Get().ClearAlertCategory(alertsComponent.Owner, AlertCategory.Pressure); + entManager.System().ClearAlertCategory(alertsComponent.Owner, AlertCategory.Pressure); entManager.EventBus.RaiseComponentEvent(alertsComponent, getty); alertState = (AlertsComponent.AlertsComponent_AutoState) getty.State!; From 03af7fcdc1bc28b6eef46877b5eae1cde2c2cf2f Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Sun, 12 May 2024 21:07:52 -0400 Subject: [PATCH 109/111] fix weird behavior with storage HUD buttons (#27961) --- Content.Shared/Inventory/InventorySystem.Slots.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Shared/Inventory/InventorySystem.Slots.cs b/Content.Shared/Inventory/InventorySystem.Slots.cs index e0f2a69557..19831278b0 100644 --- a/Content.Shared/Inventory/InventorySystem.Slots.cs +++ b/Content.Shared/Inventory/InventorySystem.Slots.cs @@ -15,7 +15,7 @@ public partial class InventorySystem : EntitySystem private void InitializeSlots() { SubscribeLocalEvent(OnInit); - SubscribeNetworkEvent(OnOpenSlotStorage); + SubscribeAllEvent(OnOpenSlotStorage); _vvm.GetTypeHandler() .AddHandler(HandleViewVariablesSlots, ListViewVariablesSlots); From ce0a175c731bf205f59cb93dcb3a2268c4cedb24 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Mon, 13 May 2024 14:05:37 +1000 Subject: [PATCH 110/111] Implement Equals for ApcBoundInterfaceState (#27965) * Implement Equals for ApcBoundInterfaceState Saves a lot on bandwidth. Also made it round to the nearest 5. * Also this --- .../Power/EntitySystems/ApcSystem.cs | 7 ++++- Content.Shared/APC/SharedApc.cs | 29 ++++++++++++++++--- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/Content.Server/Power/EntitySystems/ApcSystem.cs b/Content.Server/Power/EntitySystems/ApcSystem.cs index 388f65ad2e..529d4d81d7 100644 --- a/Content.Server/Power/EntitySystems/ApcSystem.cs +++ b/Content.Server/Power/EntitySystems/ApcSystem.cs @@ -8,6 +8,7 @@ using Content.Shared.APC; using Content.Shared.Emag.Components; using Content.Shared.Emag.Systems; using Content.Shared.Popups; +using Content.Shared.Rounding; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; @@ -147,10 +148,14 @@ public sealed class ApcSystem : EntitySystem return; var battery = netBat.NetworkBattery; + const int ChargeAccuracy = 5; + + // TODO: Fix ContentHelpers or make a new one coz this is cooked. + var charge = ContentHelpers.RoundToNearestLevels(battery.CurrentStorage / battery.Capacity, 1.0, 100 / ChargeAccuracy) / 100f * ChargeAccuracy; var state = new ApcBoundInterfaceState(apc.MainBreakerEnabled, apc.HasAccess, (int) MathF.Ceiling(battery.CurrentSupply), apc.LastExternalState, - battery.CurrentStorage / battery.Capacity); + charge); _ui.SetUiState((uid, ui), ApcUiKey.Key, state); } diff --git a/Content.Shared/APC/SharedApc.cs b/Content.Shared/APC/SharedApc.cs index 16cd840b3a..bf9fdc9444 100644 --- a/Content.Shared/APC/SharedApc.cs +++ b/Content.Shared/APC/SharedApc.cs @@ -65,7 +65,7 @@ namespace Content.Shared.APC /// Bitmask for the full state for a given APC lock indicator. /// All = (Lock), - + /// /// The log 2 width in bits of the bitfields indicating the status of an APC lock indicator. /// Used for bit shifting operations (Mask for the state for indicator i is (All << (i << LogWidth))). @@ -175,7 +175,7 @@ namespace Content.Shared.APC } [Serializable, NetSerializable] - public sealed class ApcBoundInterfaceState : BoundUserInterfaceState + public sealed class ApcBoundInterfaceState : BoundUserInterfaceState, IEquatable { public readonly bool MainBreaker; public readonly bool HasAccess; @@ -191,6 +191,27 @@ namespace Content.Shared.APC ApcExternalPower = apcExternalPower; Charge = charge; } + + public bool Equals(ApcBoundInterfaceState? other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return MainBreaker == other.MainBreaker && + HasAccess == other.HasAccess && + Power == other.Power && + ApcExternalPower == other.ApcExternalPower && + MathHelper.CloseTo(Charge, other.Charge); + } + + public override bool Equals(object? obj) + { + return ReferenceEquals(this, obj) || obj is ApcBoundInterfaceState other && Equals(other); + } + + public override int GetHashCode() + { + return HashCode.Combine(MainBreaker, HasAccess, Power, (int) ApcExternalPower, Charge); + } } [Serializable, NetSerializable] @@ -198,7 +219,7 @@ namespace Content.Shared.APC { } - public enum ApcExternalPowerState + public enum ApcExternalPowerState : byte { None, Low, @@ -206,7 +227,7 @@ namespace Content.Shared.APC } [NetSerializable, Serializable] - public enum ApcUiKey + public enum ApcUiKey : byte { Key, } From 1f03111ff8affe1554a5fac4d1a49b1cccdf2fbb Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Mon, 13 May 2024 17:11:49 +1200 Subject: [PATCH 111/111] Change some `EntityQueryEnumerator` to `AllEntityQuery` (#27969) --- Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs | 4 ++-- Content.Server/Decals/DecalSystem.cs | 2 +- .../Disposal/Unit/EntitySystems/DisposalUnitSystem.cs | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs b/Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs index 89b9c52078..c714acb2f3 100644 --- a/Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs +++ b/Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs @@ -122,7 +122,7 @@ namespace Content.Server.Atmos.EntitySystems } // PVS was turned off, ensure data gets sent to all clients. - var query = EntityQueryEnumerator(); + var query = AllEntityQuery(); while (query.MoveNext(out var uid, out var grid, out var meta)) { grid.ForceTick = _gameTiming.CurTick; @@ -269,7 +269,7 @@ namespace Content.Server.Atmos.EntitySystems private void UpdateOverlayData() { // TODO parallelize? - var query = EntityQueryEnumerator(); + var query = AllEntityQuery(); while (query.MoveNext(out var uid, out var overlay, out var gam, out var meta)) { var changed = false; diff --git a/Content.Server/Decals/DecalSystem.cs b/Content.Server/Decals/DecalSystem.cs index c8e062ce6f..519f7a133e 100644 --- a/Content.Server/Decals/DecalSystem.cs +++ b/Content.Server/Decals/DecalSystem.cs @@ -89,7 +89,7 @@ namespace Content.Server.Decals playerData.Clear(); } - var query = EntityQueryEnumerator(); + var query = AllEntityQuery(); while (query.MoveNext(out var uid, out var grid, out var meta)) { grid.ForceTick = _timing.CurTick; diff --git a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs index 7f4ee87ee1..1f3b9703d4 100644 --- a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs +++ b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs @@ -209,10 +209,11 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem { base.Update(frameTime); - var query = EntityQueryEnumerator(); + var query = AllEntityQuery(); while (query.MoveNext(out var uid, out var unit, out var metadata)) { - Update(uid, unit, metadata, frameTime); + if (!metadata.EntityPaused) + Update(uid, unit, metadata, frameTime); } }