From c5dd6c8b02abb6d83966898f703d53851a234665 Mon Sep 17 00:00:00 2001 From: E F R <602406+Efruit@users.noreply.github.com> Date: Sun, 24 Oct 2021 02:34:29 +0000 Subject: [PATCH] Server/Storage: allow specifying a radius for _areaInsert (#5001) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✨️ Pay no attention to the changes in trashbag.yml... they are merely an illusion... ✨️ t. 🧙‍♂️️ --- .../Components/ServerStorageComponent.cs | 4 +++- .../Objects/Specific/Janitorial/trashbag.yml | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Content.Server/Storage/Components/ServerStorageComponent.cs b/Content.Server/Storage/Components/ServerStorageComponent.cs index deb7e82f5c..d7869cce62 100644 --- a/Content.Server/Storage/Components/ServerStorageComponent.cs +++ b/Content.Server/Storage/Components/ServerStorageComponent.cs @@ -56,6 +56,8 @@ namespace Content.Server.Storage.Components [DataField("areaInsert")] private bool _areaInsert = false; // "Attacking" with the storage entity causes it to insert all nearby storables after a delay + [DataField("areaInsertRadius")] + private int _areaInsertRadius = 1; [DataField("whitelist")] private EntityWhitelist? _whitelist = null; @@ -510,7 +512,7 @@ namespace Content.Server.Storage.Components if (_areaInsert && (eventArgs.Target == null || !eventArgs.Target.HasComponent())) { var validStorables = new List(); - foreach (var entity in IoCManager.Resolve().GetEntitiesInRange(eventArgs.ClickLocation, 1)) + foreach (var entity in IoCManager.Resolve().GetEntitiesInRange(eventArgs.ClickLocation, _areaInsertRadius)) { if (entity.IsInContainer() || entity == eventArgs.User diff --git a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/trashbag.yml b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/trashbag.yml index 2e65461a29..bdd33ba0af 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Janitorial/trashbag.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Janitorial/trashbag.yml @@ -32,3 +32,22 @@ areaInsert: true storageSoundCollection: collection: trashBagRustle + +- type: entity + name: spell of all-consuming cleanliness + id: BagOfSummoningGarbage + parent: BaseItem + components: + - type: Sprite + sprite: Objects/Specific/Janitorial/trashbag.rsi + state: blue-icon-3 + - type: Item + sprite: Objects/Specific/Janitorial/trashbag.rsi + HeldPrefix: blue + - type: Storage + capacity: 125000 + quickInsert: true + areaInsert: true + areaInsertRadius: 1000 + storageSoundCollection: + collection: trashBagRustle