From dd72c1e3f021cea23465bd663138f4d5aeee5b9f Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Fri, 3 Jul 2020 14:54:45 +0200 Subject: [PATCH 01/25] Fix being able to buckle through a locker and reality collapsing --- .../Inventory/CloseStorageOperator.cs | 1 + .../Inventory/OpenStorageOperator.cs | 1 + .../Containers/TargetAccessibleCon.cs | 1 + .../States/Clothing/NearbyClothingState.cs | 1 + .../Inventory/LastOpenedStorageState.cs | 1 + .../States/Nutrition/NearbyDrinkState.cs | 1 + .../States/Nutrition/NearbyFoodState.cs | 1 + .../Explosion/FlashExplosiveComponent.cs | 1 + .../Items/Storage/EntityStorageComponent.cs | 49 +++++++++---------- .../Components/Mobs/BuckleComponent.cs | 20 +++++++- .../Components/Strap/StrapComponent.cs | 20 ++++---- 11 files changed, 60 insertions(+), 37 deletions(-) diff --git a/Content.Server/AI/Operators/Inventory/CloseStorageOperator.cs b/Content.Server/AI/Operators/Inventory/CloseStorageOperator.cs index 193b45077e..7822411274 100644 --- a/Content.Server/AI/Operators/Inventory/CloseStorageOperator.cs +++ b/Content.Server/AI/Operators/Inventory/CloseStorageOperator.cs @@ -1,6 +1,7 @@ using Content.Server.AI.Utility; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.GameObjects.Components; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems; using Content.Server.Utility; using Robust.Shared.Interfaces.GameObjects; diff --git a/Content.Server/AI/Operators/Inventory/OpenStorageOperator.cs b/Content.Server/AI/Operators/Inventory/OpenStorageOperator.cs index c7c21ae3f2..f90046ea45 100644 --- a/Content.Server/AI/Operators/Inventory/OpenStorageOperator.cs +++ b/Content.Server/AI/Operators/Inventory/OpenStorageOperator.cs @@ -1,6 +1,7 @@ using Content.Server.AI.Utility; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.GameObjects.Components; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems; using Content.Server.Utility; using Content.Shared.GameObjects.EntitySystems; diff --git a/Content.Server/AI/Utility/Considerations/Containers/TargetAccessibleCon.cs b/Content.Server/AI/Utility/Considerations/Containers/TargetAccessibleCon.cs index 4265db6abd..f502fddb00 100644 --- a/Content.Server/AI/Utility/Considerations/Containers/TargetAccessibleCon.cs +++ b/Content.Server/AI/Utility/Considerations/Containers/TargetAccessibleCon.cs @@ -3,6 +3,7 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.GameObjects; using Content.Server.GameObjects.Components; +using Content.Server.GameObjects.Components.Items.Storage; using Robust.Shared.Containers; namespace Content.Server.AI.Utility.Considerations.Containers diff --git a/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs b/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs index 83a54abee1..4d231273fa 100644 --- a/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs +++ b/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using Content.Server.AI.Utils; using Content.Server.GameObjects; using Content.Server.GameObjects.Components; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Movement; using JetBrains.Annotations; using Robust.Shared.Containers; diff --git a/Content.Server/AI/WorldState/States/Inventory/LastOpenedStorageState.cs b/Content.Server/AI/WorldState/States/Inventory/LastOpenedStorageState.cs index 636cb8ea63..973faf3115 100644 --- a/Content.Server/AI/WorldState/States/Inventory/LastOpenedStorageState.cs +++ b/Content.Server/AI/WorldState/States/Inventory/LastOpenedStorageState.cs @@ -1,4 +1,5 @@ using Content.Server.GameObjects.Components; +using Content.Server.GameObjects.Components.Items.Storage; using Robust.Shared.Interfaces.GameObjects; using Logger = Robust.Shared.Log.Logger; diff --git a/Content.Server/AI/WorldState/States/Nutrition/NearbyDrinkState.cs b/Content.Server/AI/WorldState/States/Nutrition/NearbyDrinkState.cs index bfee177d69..a2be3e46f2 100644 --- a/Content.Server/AI/WorldState/States/Nutrition/NearbyDrinkState.cs +++ b/Content.Server/AI/WorldState/States/Nutrition/NearbyDrinkState.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using Content.Server.AI.Utils; using Content.Server.GameObjects.Components; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Movement; using Content.Server.GameObjects.Components.Nutrition; using JetBrains.Annotations; diff --git a/Content.Server/AI/WorldState/States/Nutrition/NearbyFoodState.cs b/Content.Server/AI/WorldState/States/Nutrition/NearbyFoodState.cs index e33bca5a0c..168f9c0897 100644 --- a/Content.Server/AI/WorldState/States/Nutrition/NearbyFoodState.cs +++ b/Content.Server/AI/WorldState/States/Nutrition/NearbyFoodState.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using Content.Server.AI.Utils; using Content.Server.GameObjects.Components; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Movement; using Content.Server.GameObjects.Components.Nutrition; using JetBrains.Annotations; diff --git a/Content.Server/GameObjects/Components/Explosion/FlashExplosiveComponent.cs b/Content.Server/GameObjects/Components/Explosion/FlashExplosiveComponent.cs index 02789749bf..f2538c200a 100644 --- a/Content.Server/GameObjects/Components/Explosion/FlashExplosiveComponent.cs +++ b/Content.Server/GameObjects/Components/Explosion/FlashExplosiveComponent.cs @@ -1,3 +1,4 @@ +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Weapon; using Content.Server.GameObjects.EntitySystems; using Robust.Server.GameObjects.EntitySystems; diff --git a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs index 6eae6bf66f..ac784f7e52 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs @@ -1,8 +1,6 @@ using System; using System.Linq; using Content.Server.GameObjects.Components.Interactable; -using Content.Server.GameObjects.Components.Items.Storage; -using Content.Server.GameObjects.Components.Sound; using Content.Server.GameObjects.EntitySystems; using Content.Shared.GameObjects; using Content.Shared.GameObjects.Components.Interactable; @@ -25,12 +23,12 @@ using Robust.Shared.Maths; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; -namespace Content.Server.GameObjects.Components +namespace Content.Server.GameObjects.Components.Items.Storage { [RegisterComponent] [ComponentReference(typeof(IActivate))] [ComponentReference(typeof(IStorageComponent))] - public class EntityStorageComponent : Component, IActivate, IStorageComponent, IInteractUsing, IDestroyAct + public class EntityStorageComponent : Component, IActivate, IStorageComponent, IInteractUsing, IDestroyAct, IActionBlocker { public override string Name => "EntityStorage"; @@ -40,13 +38,13 @@ namespace Content.Server.GameObjects.Components private TimeSpan _lastInternalOpenAttempt; [ViewVariables] - private int StorageCapacityMax; + private int _storageCapacityMax; [ViewVariables] - private bool IsCollidableWhenOpen; + private bool _isCollidableWhenOpen; [ViewVariables] - private Container Contents; + private Container _contents; [ViewVariables] - private IEntityQuery entityQuery; + private IEntityQuery _entityQuery; private bool _showContents; private bool _open; private bool _isWeldedShut; @@ -63,7 +61,7 @@ namespace Content.Server.GameObjects.Components set { _showContents = value; - Contents.ShowContents = _showContents; + _contents.ShowContents = _showContents; } } @@ -96,10 +94,10 @@ namespace Content.Server.GameObjects.Components public override void Initialize() { base.Initialize(); - Contents = ContainerManagerComponent.Ensure(nameof(EntityStorageComponent), Owner); - entityQuery = new IntersectingEntityQuery(Owner); + _contents = ContainerManagerComponent.Ensure(nameof(EntityStorageComponent), Owner); + _entityQuery = new IntersectingEntityQuery(Owner); - Contents.ShowContents = _showContents; + _contents.ShowContents = _showContents; if (Owner.TryGetComponent(out var placeableSurfaceComponent)) { @@ -112,8 +110,8 @@ namespace Content.Server.GameObjects.Components { base.ExposeData(serializer); - serializer.DataField(ref StorageCapacityMax, "Capacity", 30); - serializer.DataField(ref IsCollidableWhenOpen, "IsCollidableWhenOpen", false); + serializer.DataField(ref _storageCapacityMax, "Capacity", 30); + serializer.DataField(ref _isCollidableWhenOpen, "IsCollidableWhenOpen", false); serializer.DataField(ref _showContents, "showContents", false); serializer.DataField(ref _open, "open", false); serializer.DataField(this, a => a.IsWeldedShut, "IsWeldedShut", false); @@ -146,7 +144,7 @@ namespace Content.Server.GameObjects.Components private void CloseStorage() { Open = false; - var entities = Owner.EntityManager.GetEntities(entityQuery); + var entities = Owner.EntityManager.GetEntities(_entityQuery); var count = 0; foreach (var entity in entities) { @@ -163,7 +161,7 @@ namespace Content.Server.GameObjects.Components continue; } count++; - if (count >= StorageCapacityMax) + if (count >= _storageCapacityMax) { break; } @@ -180,12 +178,11 @@ namespace Content.Server.GameObjects.Components EmptyContents(); ModifyComponents(); EntitySystem.Get().PlayFromEntity("/Audio/machines/closetopen.ogg", Owner); - } private void ModifyComponents() { - if (!IsCollidableWhenOpen && Owner.TryGetComponent(out var collidableComponent)) + if (!_isCollidableWhenOpen && Owner.TryGetComponent(out var collidableComponent)) { var physShape = collidableComponent.PhysicsShapes[0]; if (Open) @@ -242,7 +239,7 @@ namespace Content.Server.GameObjects.Components entity.Transform.WorldPosition += new Vector2(0, collidableComponent.WorldAABB.Top - entityCollidableComponent.WorldAABB.Top); } } - if (Contents.CanInsert(entity)) + if (_contents.CanInsert(entity)) { // Because Insert sets the local position to (0,0), and we want to keep the contents spread out, // we re-apply the world position after inserting. @@ -255,7 +252,7 @@ namespace Content.Server.GameObjects.Components { worldPos = entity.Transform.WorldPosition; } - Contents.Insert(entity); + _contents.Insert(entity); entity.Transform.WorldPosition = worldPos; if (entityCollidableComponent != null) { @@ -268,9 +265,9 @@ namespace Content.Server.GameObjects.Components private void EmptyContents() { - foreach (var contained in Contents.ContainedEntities.ToArray()) + foreach (var contained in _contents.ContainedEntities.ToArray()) { - if(Contents.Remove(contained)) + if(_contents.Remove(contained)) { if (contained.TryGetComponent(out var entityCollidableComponent)) { @@ -317,7 +314,7 @@ namespace Content.Server.GameObjects.Components /// public bool Remove(IEntity entity) { - return Contents.CanRemove(entity); + return _contents.CanRemove(entity); } /// @@ -330,7 +327,7 @@ namespace Content.Server.GameObjects.Components return true; } - return Contents.Insert(entity); + return _contents.Insert(entity); } /// @@ -341,12 +338,12 @@ namespace Content.Server.GameObjects.Components return true; } - if (Contents.ContainedEntities.Count >= StorageCapacityMax) + if (_contents.ContainedEntities.Count >= _storageCapacityMax) { return false; } - return Contents.CanInsert(entity); + return _contents.CanInsert(entity); } [Verb] diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs index 493a21e320..efd7bd76e9 100644 --- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs @@ -9,6 +9,7 @@ using Content.Shared.GameObjects.Components.Strap; using Content.Shared.GameObjects.EntitySystems; using JetBrains.Annotations; using Robust.Server.GameObjects; +using Robust.Server.GameObjects.Components.Container; using Robust.Server.GameObjects.EntitySystems; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; @@ -59,6 +60,22 @@ namespace Content.Server.GameObjects.Components.Mobs } } + private bool IsContained() + { + var parent = Owner.Transform.Parent; + if (parent == null) + { + return false; + } + + if (parent.Owner.TryGetComponent(out ContainerManagerComponent container)) + { + return container.ContainsEntity(Owner); + } + + return false; + } + private bool TryBuckle(IEntity user, IEntity to) { if (user == null || user == to) @@ -76,7 +93,8 @@ namespace Content.Server.GameObjects.Components.Mobs var strapPosition = Owner.Transform.MapPosition; var range = SharedInteractionSystem.InteractionRange / 2; - if (!InteractionChecks.InRangeUnobstructed(user, strapPosition, range)) + if (!InteractionChecks.InRangeUnobstructed(user, strapPosition, range) || + IsContained()) { _notifyManager.PopupMessage(user, user, Loc.GetString("You can't reach there!")); diff --git a/Content.Server/GameObjects/Components/Strap/StrapComponent.cs b/Content.Server/GameObjects/Components/Strap/StrapComponent.cs index 9060193c1f..6a0a10c797 100644 --- a/Content.Server/GameObjects/Components/Strap/StrapComponent.cs +++ b/Content.Server/GameObjects/Components/Strap/StrapComponent.cs @@ -149,6 +149,16 @@ namespace Content.Server.GameObjects.Components.Strap OccupiedSize = 0; } + bool IInteractHand.InteractHand(InteractHandEventArgs eventArgs) + { + if (!eventArgs.User.TryGetComponent(out BuckleComponent buckle)) + { + return false; + } + + return buckle.ToggleBuckle(eventArgs.User, Owner); + } + [Verb] private sealed class StrapVerb : Verb { @@ -201,15 +211,5 @@ namespace Content.Server.GameObjects.Components.Strap buckle.ToggleBuckle(user, component.Owner); } } - - bool IInteractHand.InteractHand(InteractHandEventArgs eventArgs) - { - if (!eventArgs.User.TryGetComponent(out BuckleComponent buckle)) - { - return false; - } - - return buckle.ToggleBuckle(eventArgs.User, Owner); - } } } From 7f02d46cb4571c2c53e20b252be4c2ce30ef827f Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Fri, 3 Jul 2020 23:43:01 +0200 Subject: [PATCH 02/25] Replace IsContained with ContainerHelpers.IsInContainer --- .../Components/Mobs/BuckleComponent.cs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs index efd7bd76e9..e166b67583 100644 --- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs @@ -11,6 +11,7 @@ using JetBrains.Annotations; using Robust.Server.GameObjects; using Robust.Server.GameObjects.Components.Container; using Robust.Server.GameObjects.EntitySystems; +using Robust.Shared.Containers; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.IoC; @@ -60,22 +61,6 @@ namespace Content.Server.GameObjects.Components.Mobs } } - private bool IsContained() - { - var parent = Owner.Transform.Parent; - if (parent == null) - { - return false; - } - - if (parent.Owner.TryGetComponent(out ContainerManagerComponent container)) - { - return container.ContainsEntity(Owner); - } - - return false; - } - private bool TryBuckle(IEntity user, IEntity to) { if (user == null || user == to) @@ -94,7 +79,7 @@ namespace Content.Server.GameObjects.Components.Mobs var range = SharedInteractionSystem.InteractionRange / 2; if (!InteractionChecks.InRangeUnobstructed(user, strapPosition, range) || - IsContained()) + ContainerHelpers.IsInContainer(Owner)) { _notifyManager.PopupMessage(user, user, Loc.GetString("You can't reach there!")); From 81647d696e7695f843d49c998e9f818f5f37bdf4 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Fri, 3 Jul 2020 23:57:19 +0200 Subject: [PATCH 03/25] Disable interactions for entities in storage --- .../Operators/Inventory/PickupEntityOperator.cs | 1 + .../Inventory/UseItemInHandsOperator.cs | 1 + .../Clothing/ClothingInInventoryCon.cs | 1 + .../Considerations/Hands/TargetInOurHandsCon.cs | 1 + .../Inventory/CanPutTargetInHandsCon.cs | 1 + .../Inventory/TargetInOurInventoryCon.cs | 1 + .../Clothing/Gloves/EquipAnyGlovesExp.cs | 1 + .../Clothing/Gloves/PickUpAnyNearbyGlovesExp.cs | 1 + .../Clothing/Head/EquipAnyHeadExp.cs | 1 + .../Clothing/Head/PickUpAnyNearbyHeadExp.cs | 1 + .../OuterClothing/EquipAnyOuterClothingExp.cs | 1 + .../PickUpAnyNearbyOuterClothingExp.cs | 1 + .../Clothing/Shoes/EquipAnyShoesExp.cs | 1 + .../Clothing/Shoes/PickUpAnyNearbyShoesExp.cs | 1 + .../States/Clothing/NearbyClothingState.cs | 1 + Content.Server/Chat/ChatCommands.cs | 1 + .../Components/Access/AccessReaderComponent.cs | 1 + .../Components/Access/IdCardConsoleComponent.cs | 1 + .../Chemistry/ReagentDispenserComponent.cs | 1 + .../GUI/HumanInventoryControllerComponent.cs | 1 + .../Components/GUI/InventoryComponent.cs | 2 ++ .../Components/GUI/ServerHandsComponent.cs | 1 + .../Interactable/HandheldLightComponent.cs | 2 ++ .../Components/Interactable/WelderComponent.cs | 1 + .../Items/Clothing/ClothingComponent.cs | 7 ++++--- .../Items/Storage/EntityStorageComponent.cs | 11 +++++++++++ .../Items/Storage/InEntityStorageComponent.cs | 16 ++++++++++++++++ .../Components/Items/Storage/ItemComponent.cs | 2 +- .../Items/Storage/ServerStorageComponent.cs | 5 +---- .../Items/Storage/StoreableComponent.cs | 2 +- .../Components/Kitchen/MicrowaveComponent.cs | 1 + .../Components/Mobs/HeatResistanceComponent.cs | 1 + .../Components/Nutrition/FoodComponent.cs | 1 + .../Nutrition/FoodContainerComponent.cs | 1 + .../GameObjects/Components/PDA/PDAComponent.cs | 1 + .../Components/PottedPlantHideComponent.cs | 1 + .../PowerReceiverUsers/BaseCharger.cs | 1 + .../PowerReceiverUsers/PoweredLightComponent.cs | 1 + .../Weapon/Melee/StunbatonComponent.cs | 1 + .../Weapon/Ranged/Ammunition/AmmoBoxComponent.cs | 1 + .../Ranged/Ammunition/RangedMagazineComponent.cs | 1 + .../Ranged/Ammunition/SpeedLoaderComponent.cs | 1 + .../Barrels/ServerBatteryBarrelComponent.cs | 1 + .../Barrels/ServerMagazineBarrelComponent.cs | 1 + .../EntitySystems/ConstructionSystem.cs | 1 + .../GameObjects/EntitySystems/HandsSystem.cs | 1 + .../GameObjects/EntitySystems/MoverSystem.cs | 1 + .../GameObjects/EntitySystems/StorageSystem.cs | 1 + Content.Server/GameTicking/GameTicker.cs | 1 + .../Components/Items/IHandsComponent.cs | 1 + Content.Server/PDA/PDAUplinkManager.cs | 1 + 51 files changed, 81 insertions(+), 9 deletions(-) create mode 100644 Content.Server/GameObjects/Components/Items/Storage/InEntityStorageComponent.cs diff --git a/Content.Server/AI/Operators/Inventory/PickupEntityOperator.cs b/Content.Server/AI/Operators/Inventory/PickupEntityOperator.cs index ba0f40f78f..b9f5cbb772 100644 --- a/Content.Server/AI/Operators/Inventory/PickupEntityOperator.cs +++ b/Content.Server/AI/Operators/Inventory/PickupEntityOperator.cs @@ -1,4 +1,5 @@ using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems; using Content.Server.Utility; using Robust.Shared.Containers; diff --git a/Content.Server/AI/Operators/Inventory/UseItemInHandsOperator.cs b/Content.Server/AI/Operators/Inventory/UseItemInHandsOperator.cs index 3e4ed39de8..2ccc6e23ab 100644 --- a/Content.Server/AI/Operators/Inventory/UseItemInHandsOperator.cs +++ b/Content.Server/AI/Operators/Inventory/UseItemInHandsOperator.cs @@ -1,4 +1,5 @@ using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Storage; using Robust.Shared.Interfaces.GameObjects; namespace Content.Server.AI.Operators.Inventory diff --git a/Content.Server/AI/Utility/Considerations/Clothing/ClothingInInventoryCon.cs b/Content.Server/AI/Utility/Considerations/Clothing/ClothingInInventoryCon.cs index 7101e1ba1b..71c80adb89 100644 --- a/Content.Server/AI/Utility/Considerations/Clothing/ClothingInInventoryCon.cs +++ b/Content.Server/AI/Utility/Considerations/Clothing/ClothingInInventoryCon.cs @@ -2,6 +2,7 @@ using Content.Server.AI.Utility.Curves; using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Clothing; using Content.Shared.GameObjects.Components.Inventory; namespace Content.Server.AI.Utility.Considerations.Clothing diff --git a/Content.Server/AI/Utility/Considerations/Hands/TargetInOurHandsCon.cs b/Content.Server/AI/Utility/Considerations/Hands/TargetInOurHandsCon.cs index cda872a05b..9b291278bf 100644 --- a/Content.Server/AI/Utility/Considerations/Hands/TargetInOurHandsCon.cs +++ b/Content.Server/AI/Utility/Considerations/Hands/TargetInOurHandsCon.cs @@ -2,6 +2,7 @@ using Content.Server.AI.Utility.Curves; using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Storage; namespace Content.Server.AI.Utility.Considerations.Hands { diff --git a/Content.Server/AI/Utility/Considerations/Inventory/CanPutTargetInHandsCon.cs b/Content.Server/AI/Utility/Considerations/Inventory/CanPutTargetInHandsCon.cs index 646cba8506..e9a08b97e0 100644 --- a/Content.Server/AI/Utility/Considerations/Inventory/CanPutTargetInHandsCon.cs +++ b/Content.Server/AI/Utility/Considerations/Inventory/CanPutTargetInHandsCon.cs @@ -4,6 +4,7 @@ using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Hands; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Storage; namespace Content.Server.AI.Utility.Considerations.Inventory { diff --git a/Content.Server/AI/Utility/Considerations/Inventory/TargetInOurInventoryCon.cs b/Content.Server/AI/Utility/Considerations/Inventory/TargetInOurInventoryCon.cs index 1bd645df23..70e43b7032 100644 --- a/Content.Server/AI/Utility/Considerations/Inventory/TargetInOurInventoryCon.cs +++ b/Content.Server/AI/Utility/Considerations/Inventory/TargetInOurInventoryCon.cs @@ -3,6 +3,7 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Storage; namespace Content.Server.AI.Utility.Considerations.Inventory { diff --git a/Content.Server/AI/Utility/ExpandableActions/Clothing/Gloves/EquipAnyGlovesExp.cs b/Content.Server/AI/Utility/ExpandableActions/Clothing/Gloves/EquipAnyGlovesExp.cs index 700dff2f94..8389fb3521 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Clothing/Gloves/EquipAnyGlovesExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Clothing/Gloves/EquipAnyGlovesExp.cs @@ -6,6 +6,7 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Clothing; using Content.Server.GameObjects.Components.Movement; using Content.Shared.GameObjects.Components.Inventory; diff --git a/Content.Server/AI/Utility/ExpandableActions/Clothing/Gloves/PickUpAnyNearbyGlovesExp.cs b/Content.Server/AI/Utility/ExpandableActions/Clothing/Gloves/PickUpAnyNearbyGlovesExp.cs index 7b3f165e4a..a252bf977c 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Clothing/Gloves/PickUpAnyNearbyGlovesExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Clothing/Gloves/PickUpAnyNearbyGlovesExp.cs @@ -5,6 +5,7 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Clothing; using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Clothing; using Content.Shared.GameObjects.Components.Inventory; namespace Content.Server.AI.Utility.ExpandableActions.Clothing.Gloves diff --git a/Content.Server/AI/Utility/ExpandableActions/Clothing/Head/EquipAnyHeadExp.cs b/Content.Server/AI/Utility/ExpandableActions/Clothing/Head/EquipAnyHeadExp.cs index f885e7818a..de22dfd6e9 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Clothing/Head/EquipAnyHeadExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Clothing/Head/EquipAnyHeadExp.cs @@ -6,6 +6,7 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Clothing; using Content.Server.GameObjects.Components.Movement; using Content.Shared.GameObjects.Components.Inventory; diff --git a/Content.Server/AI/Utility/ExpandableActions/Clothing/Head/PickUpAnyNearbyHeadExp.cs b/Content.Server/AI/Utility/ExpandableActions/Clothing/Head/PickUpAnyNearbyHeadExp.cs index dfb2f6d2a9..ffa25ffaec 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Clothing/Head/PickUpAnyNearbyHeadExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Clothing/Head/PickUpAnyNearbyHeadExp.cs @@ -5,6 +5,7 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Clothing; using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Clothing; using Content.Shared.GameObjects.Components.Inventory; namespace Content.Server.AI.Utility.ExpandableActions.Clothing.Head diff --git a/Content.Server/AI/Utility/ExpandableActions/Clothing/OuterClothing/EquipAnyOuterClothingExp.cs b/Content.Server/AI/Utility/ExpandableActions/Clothing/OuterClothing/EquipAnyOuterClothingExp.cs index b7a7980974..aa58ac744e 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Clothing/OuterClothing/EquipAnyOuterClothingExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Clothing/OuterClothing/EquipAnyOuterClothingExp.cs @@ -5,6 +5,7 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Clothing; using Content.Shared.GameObjects.Components.Inventory; namespace Content.Server.AI.Utility.ExpandableActions.Clothing.OuterClothing diff --git a/Content.Server/AI/Utility/ExpandableActions/Clothing/OuterClothing/PickUpAnyNearbyOuterClothingExp.cs b/Content.Server/AI/Utility/ExpandableActions/Clothing/OuterClothing/PickUpAnyNearbyOuterClothingExp.cs index dd1d06c0c7..b0900c1459 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Clothing/OuterClothing/PickUpAnyNearbyOuterClothingExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Clothing/OuterClothing/PickUpAnyNearbyOuterClothingExp.cs @@ -5,6 +5,7 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Clothing; using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Clothing; using Content.Shared.GameObjects.Components.Inventory; namespace Content.Server.AI.Utility.ExpandableActions.Clothing.OuterClothing diff --git a/Content.Server/AI/Utility/ExpandableActions/Clothing/Shoes/EquipAnyShoesExp.cs b/Content.Server/AI/Utility/ExpandableActions/Clothing/Shoes/EquipAnyShoesExp.cs index 517fd735c0..bc6e263709 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Clothing/Shoes/EquipAnyShoesExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Clothing/Shoes/EquipAnyShoesExp.cs @@ -5,6 +5,7 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Clothing; using Content.Shared.GameObjects.Components.Inventory; namespace Content.Server.AI.Utility.ExpandableActions.Clothing.Shoes diff --git a/Content.Server/AI/Utility/ExpandableActions/Clothing/Shoes/PickUpAnyNearbyShoesExp.cs b/Content.Server/AI/Utility/ExpandableActions/Clothing/Shoes/PickUpAnyNearbyShoesExp.cs index 598d180808..d258738247 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Clothing/Shoes/PickUpAnyNearbyShoesExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Clothing/Shoes/PickUpAnyNearbyShoesExp.cs @@ -5,6 +5,7 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Clothing; using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Clothing; using Content.Shared.GameObjects.Components.Inventory; namespace Content.Server.AI.Utility.ExpandableActions.Clothing.Shoes diff --git a/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs b/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs index 4d231273fa..2152784703 100644 --- a/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs +++ b/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using Content.Server.AI.Utils; using Content.Server.GameObjects; using Content.Server.GameObjects.Components; +using Content.Server.GameObjects.Components.Items.Clothing; using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Movement; using JetBrains.Annotations; diff --git a/Content.Server/Chat/ChatCommands.cs b/Content.Server/Chat/ChatCommands.cs index 99a6d06963..d75c7cb0cc 100644 --- a/Content.Server/Chat/ChatCommands.cs +++ b/Content.Server/Chat/ChatCommands.cs @@ -11,6 +11,7 @@ using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Localization; using System.Linq; +using Content.Server.GameObjects.Components.Items.Storage; namespace Content.Server.Chat { diff --git a/Content.Server/GameObjects/Components/Access/AccessReaderComponent.cs b/Content.Server/GameObjects/Components/Access/AccessReaderComponent.cs index 2a1d18ac41..40aaf8ebd2 100644 --- a/Content.Server/GameObjects/Components/Access/AccessReaderComponent.cs +++ b/Content.Server/GameObjects/Components/Access/AccessReaderComponent.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.Interfaces; using Content.Server.Interfaces.GameObjects; using Content.Shared.GameObjects.Components.Inventory; diff --git a/Content.Server/GameObjects/Components/Access/IdCardConsoleComponent.cs b/Content.Server/GameObjects/Components/Access/IdCardConsoleComponent.cs index cad078d673..6d38382cad 100644 --- a/Content.Server/GameObjects/Components/Access/IdCardConsoleComponent.cs +++ b/Content.Server/GameObjects/Components/Access/IdCardConsoleComponent.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces; using Content.Server.Interfaces.GameObjects; diff --git a/Content.Server/GameObjects/Components/Chemistry/ReagentDispenserComponent.cs b/Content.Server/GameObjects/Components/Chemistry/ReagentDispenserComponent.cs index 099d8b20eb..a79cda3136 100644 --- a/Content.Server/GameObjects/Components/Chemistry/ReagentDispenserComponent.cs +++ b/Content.Server/GameObjects/Components/Chemistry/ReagentDispenserComponent.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Sound; using Content.Server.GameObjects.EntitySystems; using Content.Server.GameObjects.Components.Power; diff --git a/Content.Server/GameObjects/Components/GUI/HumanInventoryControllerComponent.cs b/Content.Server/GameObjects/Components/GUI/HumanInventoryControllerComponent.cs index d084fdf462..b06b085376 100644 --- a/Content.Server/GameObjects/Components/GUI/HumanInventoryControllerComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/HumanInventoryControllerComponent.cs @@ -1,3 +1,4 @@ +using Content.Server.GameObjects.Components.Items.Storage; using Robust.Server.GameObjects.Components.Container; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; diff --git a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs index fb9227697a..765c3aec4c 100644 --- a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs @@ -2,6 +2,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks.Dataflow; +using Content.Server.GameObjects.Components.Items.Clothing; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces; using Content.Shared.GameObjects; diff --git a/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs b/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs index 0b8a492592..d770088292 100644 --- a/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs @@ -4,6 +4,7 @@ using Robust.Shared.Utility; using System; using System.Collections.Generic; using System.Linq; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces.GameObjects; using Content.Shared.GameObjects; diff --git a/Content.Server/GameObjects/Components/Interactable/HandheldLightComponent.cs b/Content.Server/GameObjects/Components/Interactable/HandheldLightComponent.cs index 3348ab0593..f2f4f428a9 100644 --- a/Content.Server/GameObjects/Components/Interactable/HandheldLightComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/HandheldLightComponent.cs @@ -17,6 +17,8 @@ using Robust.Shared.Localization; using Robust.Shared.Utility; using Robust.Shared.ViewVariables; using System; +using Content.Server.GameObjects.Components.Items.Clothing; +using Content.Server.GameObjects.Components.Items.Storage; namespace Content.Server.GameObjects.Components.Interactable { diff --git a/Content.Server/GameObjects/Components/Interactable/WelderComponent.cs b/Content.Server/GameObjects/Components/Interactable/WelderComponent.cs index 03d2b85479..a820114876 100644 --- a/Content.Server/GameObjects/Components/Interactable/WelderComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/WelderComponent.cs @@ -1,6 +1,7 @@ using System; using System.Runtime.Remoting; using Content.Server.GameObjects.Components.Chemistry; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces; using Content.Server.Interfaces.Chat; diff --git a/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs b/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs index 1d5c187da4..54778eb200 100644 --- a/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs @@ -3,17 +3,18 @@ using Robust.Shared.Utility; using System; using System.Collections.Generic; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces; using Content.Shared.GameObjects; using Content.Shared.GameObjects.Components.Items; -using Robust.Shared.IoC; using Robust.Shared.GameObjects; +using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Serialization; using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines; -using Robust.Shared.Interfaces.GameObjects; -namespace Content.Server.GameObjects +namespace Content.Server.GameObjects.Components.Items.Clothing { [RegisterComponent] [ComponentReference(typeof(ItemComponent))] diff --git a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs index ac784f7e52..ad8eda759f 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs @@ -212,6 +212,11 @@ namespace Content.Server.GameObjects.Components.Items.Storage private bool AddToContents(IEntity entity) { + if (!entity.HasComponent()) + { + entity.AddComponent(); + } + var collidableComponent = Owner.GetComponent(); ICollidableComponent entityCollidableComponent; if (entity.TryGetComponent(out entityCollidableComponent)) @@ -273,6 +278,11 @@ namespace Content.Server.GameObjects.Components.Items.Storage { entityCollidableComponent.CanCollide = true; } + + if (contained.HasComponent()) + { + contained.RemoveComponent(); + } } } } @@ -407,6 +417,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage public void OnDestroy(DestructionEventArgs eventArgs) { + Open = true; EmptyContents(); } } diff --git a/Content.Server/GameObjects/Components/Items/Storage/InEntityStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/InEntityStorageComponent.cs new file mode 100644 index 0000000000..d63b8fa3b0 --- /dev/null +++ b/Content.Server/GameObjects/Components/Items/Storage/InEntityStorageComponent.cs @@ -0,0 +1,16 @@ +using Content.Shared.GameObjects.EntitySystems; +using Robust.Shared.GameObjects; + +namespace Content.Server.GameObjects.Components.Items.Storage +{ + [RegisterComponent] + public class InEntityStorageComponent : Component, IActionBlocker + { + public override string Name => "InEntityStorage"; + + public bool CanInteract() + { + return false; + } + } +} diff --git a/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs index 054a557938..794fe1b35f 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs @@ -17,7 +17,7 @@ using Robust.Shared.Maths; using Robust.Shared.Random; using Robust.Shared.Serialization; -namespace Content.Server.GameObjects +namespace Content.Server.GameObjects.Components.Items.Storage { [RegisterComponent] [ComponentReference(typeof(StoreableComponent))] diff --git a/Content.Server/GameObjects/Components/Items/Storage/ServerStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/ServerStorageComponent.cs index 6878efd0b0..f5794eebd1 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/ServerStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/ServerStorageComponent.cs @@ -1,11 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; -using Content.Server.GameObjects.Components; -using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces.GameObjects; -using Content.Server.Utility; using Content.Shared.GameObjects.Components.Storage; using Content.Shared.Interfaces; using Robust.Server.GameObjects; @@ -24,7 +21,7 @@ using Robust.Shared.Log; using Robust.Shared.Players; using Robust.Shared.Serialization; -namespace Content.Server.GameObjects +namespace Content.Server.GameObjects.Components.Items.Storage { /// /// Storage component for containing entities within this one, matches a UI on the client which shows stored entities diff --git a/Content.Server/GameObjects/Components/Items/Storage/StoreableComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/StoreableComponent.cs index 7f25245112..af7e559ea0 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/StoreableComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/StoreableComponent.cs @@ -1,7 +1,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.Serialization; -namespace Content.Server.GameObjects +namespace Content.Server.GameObjects.Components.Items.Storage { [RegisterComponent] public class StoreableComponent : Component diff --git a/Content.Server/GameObjects/Components/Kitchen/MicrowaveComponent.cs b/Content.Server/GameObjects/Components/Kitchen/MicrowaveComponent.cs index 8b83174754..719cfa813a 100644 --- a/Content.Server/GameObjects/Components/Kitchen/MicrowaveComponent.cs +++ b/Content.Server/GameObjects/Components/Kitchen/MicrowaveComponent.cs @@ -24,6 +24,7 @@ using Robust.Shared.Audio; using Content.Server.Interfaces.GameObjects; using Content.Server.Interfaces.Chat; using Content.Server.BodySystem; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Shared.BodySystem; using Robust.Shared.GameObjects.Systems; using Content.Server.GameObjects.Components.Power.ApcNetComponents; diff --git a/Content.Server/GameObjects/Components/Mobs/HeatResistanceComponent.cs b/Content.Server/GameObjects/Components/Mobs/HeatResistanceComponent.cs index 5e754e5e63..b34cac9050 100644 --- a/Content.Server/GameObjects/Components/Mobs/HeatResistanceComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/HeatResistanceComponent.cs @@ -2,6 +2,7 @@ using Content.Shared.GameObjects.Components.Inventory; using Robust.Shared.GameObjects; using CannyFastMath; +using Content.Server.GameObjects.Components.Items.Clothing; using Math = CannyFastMath.Math; using MathF = CannyFastMath.MathF; diff --git a/Content.Server/GameObjects/Components/Nutrition/FoodComponent.cs b/Content.Server/GameObjects/Components/Nutrition/FoodComponent.cs index ef13d79fb9..2c71cb0ca8 100644 --- a/Content.Server/GameObjects/Components/Nutrition/FoodComponent.cs +++ b/Content.Server/GameObjects/Components/Nutrition/FoodComponent.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Content.Server.GameObjects.Components.Chemistry; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Utensil; using Content.Server.GameObjects.EntitySystems; using Content.Server.Utility; diff --git a/Content.Server/GameObjects/Components/Nutrition/FoodContainerComponent.cs b/Content.Server/GameObjects/Components/Nutrition/FoodContainerComponent.cs index efddfcc04b..7891d77876 100644 --- a/Content.Server/GameObjects/Components/Nutrition/FoodContainerComponent.cs +++ b/Content.Server/GameObjects/Components/Nutrition/FoodContainerComponent.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems; using Content.Shared.GameObjects.Components.Nutrition; using Robust.Server.GameObjects; diff --git a/Content.Server/GameObjects/Components/PDA/PDAComponent.cs b/Content.Server/GameObjects/Components/PDA/PDAComponent.cs index 78328c9c94..bf0233776b 100644 --- a/Content.Server/GameObjects/Components/PDA/PDAComponent.cs +++ b/Content.Server/GameObjects/Components/PDA/PDAComponent.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using Content.Server.GameObjects.Components.Access; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces; using Content.Server.Interfaces.PDA; diff --git a/Content.Server/GameObjects/Components/PottedPlantHideComponent.cs b/Content.Server/GameObjects/Components/PottedPlantHideComponent.cs index 5093ac5b01..cde1b10a6d 100644 --- a/Content.Server/GameObjects/Components/PottedPlantHideComponent.cs +++ b/Content.Server/GameObjects/Components/PottedPlantHideComponent.cs @@ -1,3 +1,4 @@ +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces.GameObjects; using Content.Shared.Audio; diff --git a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/BaseCharger.cs b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/BaseCharger.cs index 7645f43d8d..63e223dbb5 100644 --- a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/BaseCharger.cs +++ b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/BaseCharger.cs @@ -1,4 +1,5 @@ using System; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Power.ApcNetComponents; using Content.Server.GameObjects.Components.Weapon.Ranged.Barrels; using Content.Server.GameObjects.EntitySystems; diff --git a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/PoweredLightComponent.cs b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/PoweredLightComponent.cs index 4cc6ecebd9..6a8df86157 100644 --- a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/PoweredLightComponent.cs +++ b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/PoweredLightComponent.cs @@ -1,4 +1,5 @@ using System; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Power.ApcNetComponents; using Content.Server.GameObjects.Components.Sound; using Content.Server.GameObjects.EntitySystems; diff --git a/Content.Server/GameObjects/Components/Weapon/Melee/StunbatonComponent.cs b/Content.Server/GameObjects/Components/Weapon/Melee/StunbatonComponent.cs index 15310511b9..29635e4a3d 100644 --- a/Content.Server/GameObjects/Components/Weapon/Melee/StunbatonComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Melee/StunbatonComponent.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Mobs; using Content.Server.GameObjects.Components.Power; using Content.Server.GameObjects.EntitySystems; diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/AmmoBoxComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/AmmoBoxComponent.cs index 9d7d6a869d..ba83be2675 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/AmmoBoxComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/AmmoBoxComponent.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Weapon.Ranged.Barrels; using Content.Server.GameObjects.EntitySystems; using Content.Shared.Audio; diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/RangedMagazineComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/RangedMagazineComponent.cs index 92393e4d31..132879d104 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/RangedMagazineComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/RangedMagazineComponent.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Weapon.Ranged.Barrels; using Content.Server.GameObjects.EntitySystems; using Content.Shared.Audio; diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/SpeedLoaderComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/SpeedLoaderComponent.cs index 89cceb6828..4a427ca172 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/SpeedLoaderComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Ammunition/SpeedLoaderComponent.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Weapon.Ranged.Barrels; using Content.Server.GameObjects.EntitySystems; using Content.Shared.GameObjects.Components.Weapons.Ranged.Barrels; diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Barrels/ServerBatteryBarrelComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Barrels/ServerBatteryBarrelComponent.cs index 60a2135eba..9ed5d5bd4e 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Barrels/ServerBatteryBarrelComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Barrels/ServerBatteryBarrelComponent.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Power; using Content.Server.GameObjects.Components.Projectiles; using Content.Server.GameObjects.Components.Sound; diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Barrels/ServerMagazineBarrelComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Barrels/ServerMagazineBarrelComponent.cs index f10aab172d..1fed59e10b 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Barrels/ServerMagazineBarrelComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Barrels/ServerMagazineBarrelComponent.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Weapon.Ranged.Ammunition; using Content.Server.GameObjects.EntitySystems; using Content.Shared.GameObjects; diff --git a/Content.Server/GameObjects/EntitySystems/ConstructionSystem.cs b/Content.Server/GameObjects/EntitySystems/ConstructionSystem.cs index 7e656d7cd1..2c5e40c328 100644 --- a/Content.Server/GameObjects/EntitySystems/ConstructionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/ConstructionSystem.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using Content.Server.GameObjects.Components.Construction; using Content.Server.GameObjects.Components.Interactable; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Stack; using Content.Server.Interfaces; using Content.Server.Utility; diff --git a/Content.Server/GameObjects/EntitySystems/HandsSystem.cs b/Content.Server/GameObjects/EntitySystems/HandsSystem.cs index a78c90043a..bb549de99d 100644 --- a/Content.Server/GameObjects/EntitySystems/HandsSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/HandsSystem.cs @@ -18,6 +18,7 @@ using Robust.Shared.Localization; using Robust.Shared.Map; using Robust.Shared.Players; using System; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Shared.GameObjects.EntitySystems; namespace Content.Server.GameObjects.EntitySystems diff --git a/Content.Server/GameObjects/EntitySystems/MoverSystem.cs b/Content.Server/GameObjects/EntitySystems/MoverSystem.cs index e1cdd9348f..a98b8258f6 100644 --- a/Content.Server/GameObjects/EntitySystems/MoverSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/MoverSystem.cs @@ -1,4 +1,5 @@ using Content.Server.GameObjects.Components; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Mobs; using Content.Server.GameObjects.Components.Movement; using Content.Server.GameObjects.Components.Sound; diff --git a/Content.Server/GameObjects/EntitySystems/StorageSystem.cs b/Content.Server/GameObjects/EntitySystems/StorageSystem.cs index 9a57e99fe9..29cff40f3d 100644 --- a/Content.Server/GameObjects/EntitySystems/StorageSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/StorageSystem.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Content.Server.GameObjects.Components.Items.Storage; using Robust.Server.GameObjects.EntitySystemMessages; using Robust.Server.Interfaces.Player; using Robust.Shared.GameObjects; diff --git a/Content.Server/GameTicking/GameTicker.cs b/Content.Server/GameTicking/GameTicker.cs index d5b4715572..c9b74a3cbd 100644 --- a/Content.Server/GameTicking/GameTicker.cs +++ b/Content.Server/GameTicking/GameTicker.cs @@ -5,6 +5,7 @@ using System.Threading; using System.Threading.Tasks; using Content.Server.GameObjects; using Content.Server.GameObjects.Components.Access; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Markers; using Content.Server.GameObjects.Components.Mobs; using Content.Server.GameObjects.Components.Observer; diff --git a/Content.Server/Interfaces/GameObjects/Components/Items/IHandsComponent.cs b/Content.Server/Interfaces/GameObjects/Components/Items/IHandsComponent.cs index 341106539f..60e2be172b 100644 --- a/Content.Server/Interfaces/GameObjects/Components/Items/IHandsComponent.cs +++ b/Content.Server/Interfaces/GameObjects/Components/Items/IHandsComponent.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Shared.GameObjects.EntitySystems; using Robust.Server.GameObjects.Components.Container; using Robust.Server.GameObjects.EntitySystemMessages; diff --git a/Content.Server/PDA/PDAUplinkManager.cs b/Content.Server/PDA/PDAUplinkManager.cs index 7e199ce153..6deda8e891 100644 --- a/Content.Server/PDA/PDAUplinkManager.cs +++ b/Content.Server/PDA/PDAUplinkManager.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Linq; using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Mobs; using Content.Server.Interfaces.PDA; using Content.Shared.GameObjects.Components.PDA; From b00d8310de81d21614f60c1f8619b7c43bad1c8d Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Fri, 3 Jul 2020 23:58:12 +0200 Subject: [PATCH 04/25] Remove free hand check from buckle --- .../GameObjects/Components/Mobs/BuckleComponent.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs index e166b67583..2e82254ad8 100644 --- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs @@ -93,13 +93,6 @@ namespace Content.Server.GameObjects.Components.Mobs return false; } - if (hands.GetActiveHand != null) - { - _notifyManager.PopupMessage(user, user, - Loc.GetString("Your hand isn't free!")); - return false; - } - if (Buckled) { _notifyManager.PopupMessage(Owner, user, From 45211a2f0b9a1f2163edcedaf0ccadbbdda01f98 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Sat, 4 Jul 2020 01:28:06 +0200 Subject: [PATCH 05/25] Fix a buckled entity's sprite being drawn over the chair when looking up --- .../Components/Mobs/BuckleComponent.cs | 21 +++++++++++++++++++ .../Components/Mobs/BuckleComponent.cs | 12 ++++++++++- .../Components/Mobs/SharedBuckleComponent.cs | 4 +++- Resources/Prototypes/Entities/Mobs/human.yml | 1 - 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/Content.Client/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Client/GameObjects/Components/Mobs/BuckleComponent.cs index e22b23c0d0..2442fd0d6d 100644 --- a/Content.Client/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Client/GameObjects/Components/Mobs/BuckleComponent.cs @@ -1,5 +1,7 @@ using Content.Shared.GameObjects.Components.Mobs; +using Robust.Client.GameObjects; using Robust.Shared.GameObjects; +using Robust.Shared.Maths; namespace Content.Client.GameObjects.Components.Mobs { @@ -7,6 +9,7 @@ namespace Content.Client.GameObjects.Components.Mobs public class BuckleComponent : SharedBuckleComponent { private bool _buckled; + private int? _originalDrawDepth; public override void HandleComponentState(ComponentState curState, ComponentState nextState) { @@ -16,6 +19,24 @@ namespace Content.Client.GameObjects.Components.Mobs } _buckled = buckle.Buckled; + + if (!Owner.TryGetComponent(out SpriteComponent ownerSprite)) + { + return; + } + + if (_buckled && buckle.DrawDepth.HasValue) + { + _originalDrawDepth ??= ownerSprite.DrawDepth; + ownerSprite.DrawDepth = buckle.DrawDepth.Value; + return; + } + + if (!_buckled && _originalDrawDepth.HasValue) + { + ownerSprite.DrawDepth = _originalDrawDepth.Value; + _originalDrawDepth = null; + } } protected override bool Buckled => _buckled; diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs index 2e82254ad8..2d54202acc 100644 --- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs @@ -14,6 +14,7 @@ using Robust.Server.GameObjects.EntitySystems; using Robust.Shared.Containers; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.Interfaces.Timing; using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Maths; @@ -286,7 +287,16 @@ namespace Content.Server.GameObjects.Components.Mobs public override ComponentState GetComponentState() { - return new BuckleComponentState(Buckled); + int? drawDepth = null; + + if (BuckledTo != null && + Owner.Transform.WorldRotation.GetCardinalDir() == Direction.North && + BuckledTo.Owner.TryGetComponent(out SpriteComponent strapSprite)) + { + drawDepth = strapSprite.DrawDepth - 1; + } + + return new BuckleComponentState(Buckled, drawDepth); } bool IInteractHand.InteractHand(InteractHandEventArgs eventArgs) diff --git a/Content.Shared/GameObjects/Components/Mobs/SharedBuckleComponent.cs b/Content.Shared/GameObjects/Components/Mobs/SharedBuckleComponent.cs index e475b01896..7cb6b760f7 100644 --- a/Content.Shared/GameObjects/Components/Mobs/SharedBuckleComponent.cs +++ b/Content.Shared/GameObjects/Components/Mobs/SharedBuckleComponent.cs @@ -31,12 +31,14 @@ namespace Content.Shared.GameObjects.Components.Mobs [Serializable, NetSerializable] protected sealed class BuckleComponentState : ComponentState { - public BuckleComponentState(bool buckled) : base(ContentNetIDs.BUCKLE) + public BuckleComponentState(bool buckled, int? drawDepth) : base(ContentNetIDs.BUCKLE) { Buckled = buckled; + DrawDepth = drawDepth; } public bool Buckled { get; } + public int? DrawDepth; } [Serializable, NetSerializable] diff --git a/Resources/Prototypes/Entities/Mobs/human.yml b/Resources/Prototypes/Entities/Mobs/human.yml index de07a0f463..222da62c39 100644 --- a/Resources/Prototypes/Entities/Mobs/human.yml +++ b/Resources/Prototypes/Entities/Mobs/human.yml @@ -254,4 +254,3 @@ - type: SpeciesVisualizer2D - type: HumanoidAppearance - \ No newline at end of file From 2691d34d5c75e1c15328a54b7005f4674983bd75 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Sat, 4 Jul 2020 13:44:32 +0200 Subject: [PATCH 06/25] Fix not standing up after getting off of a bed --- Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs index 2d54202acc..2deb09552c 100644 --- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs @@ -148,8 +148,6 @@ namespace Content.Server.GameObjects.Components.Mobs return false; } - BuckledTo = strap; - if (Owner.TryGetComponent(out AppearanceComponent appearance)) { appearance.SetData(BuckleVisuals.Buckled, true); @@ -176,6 +174,7 @@ namespace Content.Server.GameObjects.Components.Mobs break; } + BuckledTo = strap; BuckleStatus(); return true; From 0f16b9b8f17a181f7a965891cc7604363ff244fc Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Sat, 4 Jul 2020 13:51:14 +0200 Subject: [PATCH 07/25] Replace CanBeNull annotations with question marks --- .../Components/Mobs/BuckleComponent.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs index 2deb09552c..488e01fb79 100644 --- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs @@ -1,4 +1,5 @@ -using Content.Server.GameObjects.Components.Strap; +#nullable enable +using Content.Server.GameObjects.Components.Strap; using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces; using Content.Server.Mobs; @@ -7,14 +8,11 @@ using Content.Shared.GameObjects; using Content.Shared.GameObjects.Components.Mobs; using Content.Shared.GameObjects.Components.Strap; using Content.Shared.GameObjects.EntitySystems; -using JetBrains.Annotations; using Robust.Server.GameObjects; -using Robust.Server.GameObjects.Components.Container; using Robust.Server.GameObjects.EntitySystems; using Robust.Shared.Containers; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Interfaces.Timing; using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Maths; @@ -27,15 +25,15 @@ namespace Content.Server.GameObjects.Components.Mobs public class BuckleComponent : SharedBuckleComponent, IInteractHand { #pragma warning disable 649 - [Dependency] private readonly IEntitySystemManager _entitySystem; - [Dependency] private readonly IServerNotifyManager _notifyManager; + [Dependency] private readonly IEntitySystemManager _entitySystem = default!; + [Dependency] private readonly IServerNotifyManager _notifyManager = default!; #pragma warning restore 649 - [CanBeNull] private StrapComponent _buckledTo; + private StrapComponent? _buckledTo; private int _size; - [ViewVariables, CanBeNull] - public StrapComponent BuckledTo + [ViewVariables] + public StrapComponent? BuckledTo { get => _buckledTo; private set @@ -87,7 +85,7 @@ namespace Content.Server.GameObjects.Components.Mobs return false; } - if (!user.TryGetComponent(out HandsComponent hands)) + if (!user.HasComponent()) { _notifyManager.PopupMessage(user, user, Loc.GetString("You don't have hands!")); From 47118e83010f6e5dba8f7dab08bc956e3ebc6e3d Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Sat, 4 Jul 2020 14:10:37 +0200 Subject: [PATCH 08/25] Fix entering noclip when a locker is closed over a buckled entity and the chair is then deleted --- .../GameObjects/Components/Mobs/BuckleComponent.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs index 488e01fb79..7e1cae798a 100644 --- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs @@ -212,8 +212,12 @@ namespace Content.Server.GameObjects.Components.Mobs .PlayFromEntity(strap.UnbuckleSound, Owner); } - Owner.Transform.DetachParent(); - Owner.Transform.WorldRotation = BuckledTo.Owner.Transform.WorldRotation; + if (Owner.Transform.Parent == BuckledTo.Owner.Transform) + { + Owner.Transform.DetachParent(); + Owner.Transform.WorldRotation = BuckledTo.Owner.Transform.WorldRotation; + } + BuckledTo = null; if (Owner.TryGetComponent(out AppearanceComponent appearance)) @@ -268,12 +272,12 @@ namespace Content.Server.GameObjects.Components.Mobs base.Startup(); BuckleStatus(); } - public override void OnRemove() { base.OnRemove(); - if (BuckledTo != null && BuckledTo.Owner.TryGetComponent(out StrapComponent strap)) + if (BuckledTo != null && + BuckledTo.Owner.TryGetComponent(out StrapComponent strap)) { strap.Remove(this); } From abfe86be81fa86980681baf8e4f2c89c8dd79594 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Sat, 4 Jul 2020 14:14:39 +0200 Subject: [PATCH 09/25] Add customizable buckled status effect icon per strap --- .../GameObjects/Components/Mobs/BuckleComponent.cs | 2 +- .../GameObjects/Components/Strap/StrapComponent.cs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs index 7e1cae798a..5f41dc90b7 100644 --- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs @@ -55,7 +55,7 @@ namespace Content.Server.GameObjects.Components.Mobs { status.ChangeStatusEffectIcon(StatusEffect.Buckled, Buckled - ? "/Textures/Mob/UI/Buckle/buckled.png" + ? BuckledTo!.BuckledIcon : "/Textures/Mob/UI/Buckle/unbuckled.png"); } } diff --git a/Content.Server/GameObjects/Components/Strap/StrapComponent.cs b/Content.Server/GameObjects/Components/Strap/StrapComponent.cs index 6a0a10c797..32960ce041 100644 --- a/Content.Server/GameObjects/Components/Strap/StrapComponent.cs +++ b/Content.Server/GameObjects/Components/Strap/StrapComponent.cs @@ -20,6 +20,7 @@ namespace Content.Server.GameObjects.Components.Strap private StrapPosition _position; private string _buckleSound; private string _unbuckleSound; + private string _buckledIcon; private int _rotation; private int _size; @@ -53,6 +54,12 @@ namespace Content.Server.GameObjects.Components.Strap [ViewVariables] public string UnbuckleSound => _unbuckleSound; + /// + /// The icon to be displayed as a status when buckled + /// + [ViewVariables] + public string BuckledIcon => _buckledIcon; + /// /// The angle in degrees to rotate the player by when they get strapped /// @@ -123,6 +130,7 @@ namespace Content.Server.GameObjects.Components.Strap serializer.DataField(ref _position, "position", StrapPosition.None); serializer.DataField(ref _buckleSound, "buckleSound", "/Audio/effects/buckle.ogg"); serializer.DataField(ref _unbuckleSound, "unbuckleSound", "/Audio/effects/unbuckle.ogg"); + serializer.DataField(ref _buckledIcon, "buckledIcon", "/Textures/Mob/UI/Buckle/buckled.png"); serializer.DataField(ref _rotation, "rotation", 0); var defaultSize = 100; From 7cc5a3fb65f9017fbaa5140bbf210fce4748e63b Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Tue, 7 Jul 2020 00:23:41 +0200 Subject: [PATCH 10/25] Merge conflict fixes --- .../AI/Operators/Inventory/CloseStorageOperator.cs | 1 + .../AI/Operators/Inventory/OpenStorageOperator.cs | 3 ++- .../AI/Operators/Inventory/PickupEntityOperator.cs | 1 + .../Considerations/Clothing/ClothingInInventoryCon.cs | 1 - .../ExpandableActions/Clothing/Gloves/EquipAnyGlovesExp.cs | 1 - .../Clothing/Gloves/PickUpAnyNearbyGlovesExp.cs | 1 - .../ExpandableActions/Clothing/Head/EquipAnyHeadExp.cs | 3 --- .../Clothing/Head/PickUpAnyNearbyHeadExp.cs | 1 - .../Clothing/OuterClothing/EquipAnyOuterClothingExp.cs | 1 - .../OuterClothing/PickUpAnyNearbyOuterClothingExp.cs | 1 - .../ExpandableActions/Clothing/Shoes/EquipAnyShoesExp.cs | 1 - .../Clothing/Shoes/PickUpAnyNearbyShoesExp.cs | 1 - .../AI/WorldState/States/Clothing/NearbyClothingState.cs | 2 -- .../GameObjects/Components/GUI/InventoryComponent.cs | 1 + .../Components/Interactable/HandheldLightComponent.cs | 4 ---- .../GameObjects/Components/Interactable/WelderComponent.cs | 1 + .../Components/Items/Clothing/ClothingComponent.cs | 1 + .../Components/Items/Storage/EntityStorageComponent.cs | 1 + .../GameObjects/Components/Mobs/HeatResistanceComponent.cs | 6 +----- .../Components/Nutrition/FoodContainerComponent.cs | 1 + Content.Server/GameObjects/Components/PDA/PDAComponent.cs | 1 + .../GameObjects/Components/PottedPlantHideComponent.cs | 1 + Content.Server/GameObjects/EntitySystems/MoverSystem.cs | 1 + 23 files changed, 13 insertions(+), 23 deletions(-) diff --git a/Content.Server/AI/Operators/Inventory/CloseStorageOperator.cs b/Content.Server/AI/Operators/Inventory/CloseStorageOperator.cs index d70300e4a4..257489a3a2 100644 --- a/Content.Server/AI/Operators/Inventory/CloseStorageOperator.cs +++ b/Content.Server/AI/Operators/Inventory/CloseStorageOperator.cs @@ -1,6 +1,7 @@ using Content.Server.AI.Utility; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.GameObjects.Components; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Server.Utility; using Robust.Shared.Interfaces.GameObjects; diff --git a/Content.Server/AI/Operators/Inventory/OpenStorageOperator.cs b/Content.Server/AI/Operators/Inventory/OpenStorageOperator.cs index 54190e6e0b..cd6dacc616 100644 --- a/Content.Server/AI/Operators/Inventory/OpenStorageOperator.cs +++ b/Content.Server/AI/Operators/Inventory/OpenStorageOperator.cs @@ -1,6 +1,7 @@ using Content.Server.AI.Utility; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.GameObjects.Components; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Server.Utility; using Content.Shared.GameObjects.EntitySystems; @@ -29,7 +30,7 @@ namespace Content.Server.AI.Operators.Inventory { return Outcome.Success; } - + if (!InteractionChecks.InRangeUnobstructed(_owner, container.Owner.Transform.MapPosition, ignoredEnt: container.Owner)) { return Outcome.Failed; diff --git a/Content.Server/AI/Operators/Inventory/PickupEntityOperator.cs b/Content.Server/AI/Operators/Inventory/PickupEntityOperator.cs index 01255d9470..71ed2ed59d 100644 --- a/Content.Server/AI/Operators/Inventory/PickupEntityOperator.cs +++ b/Content.Server/AI/Operators/Inventory/PickupEntityOperator.cs @@ -1,4 +1,5 @@ using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems.Click; using Content.Server.Utility; using Robust.Shared.Containers; diff --git a/Content.Server/AI/Utility/Considerations/Clothing/ClothingInInventoryCon.cs b/Content.Server/AI/Utility/Considerations/Clothing/ClothingInInventoryCon.cs index 71c80adb89..7101e1ba1b 100644 --- a/Content.Server/AI/Utility/Considerations/Clothing/ClothingInInventoryCon.cs +++ b/Content.Server/AI/Utility/Considerations/Clothing/ClothingInInventoryCon.cs @@ -2,7 +2,6 @@ using Content.Server.AI.Utility.Curves; using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Clothing; using Content.Shared.GameObjects.Components.Inventory; namespace Content.Server.AI.Utility.Considerations.Clothing diff --git a/Content.Server/AI/Utility/ExpandableActions/Clothing/Gloves/EquipAnyGlovesExp.cs b/Content.Server/AI/Utility/ExpandableActions/Clothing/Gloves/EquipAnyGlovesExp.cs index 8389fb3521..700dff2f94 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Clothing/Gloves/EquipAnyGlovesExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Clothing/Gloves/EquipAnyGlovesExp.cs @@ -6,7 +6,6 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Clothing; using Content.Server.GameObjects.Components.Movement; using Content.Shared.GameObjects.Components.Inventory; diff --git a/Content.Server/AI/Utility/ExpandableActions/Clothing/Gloves/PickUpAnyNearbyGlovesExp.cs b/Content.Server/AI/Utility/ExpandableActions/Clothing/Gloves/PickUpAnyNearbyGlovesExp.cs index a252bf977c..7b3f165e4a 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Clothing/Gloves/PickUpAnyNearbyGlovesExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Clothing/Gloves/PickUpAnyNearbyGlovesExp.cs @@ -5,7 +5,6 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Clothing; using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Clothing; using Content.Shared.GameObjects.Components.Inventory; namespace Content.Server.AI.Utility.ExpandableActions.Clothing.Gloves diff --git a/Content.Server/AI/Utility/ExpandableActions/Clothing/Head/EquipAnyHeadExp.cs b/Content.Server/AI/Utility/ExpandableActions/Clothing/Head/EquipAnyHeadExp.cs index de22dfd6e9..1d71661dcf 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Clothing/Head/EquipAnyHeadExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Clothing/Head/EquipAnyHeadExp.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using Content.Server.AI.Utility.Actions; using Content.Server.AI.Utility.Actions.Clothing.Head; @@ -6,8 +5,6 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Clothing; -using Content.Server.GameObjects.Components.Movement; using Content.Shared.GameObjects.Components.Inventory; namespace Content.Server.AI.Utility.ExpandableActions.Clothing.Head diff --git a/Content.Server/AI/Utility/ExpandableActions/Clothing/Head/PickUpAnyNearbyHeadExp.cs b/Content.Server/AI/Utility/ExpandableActions/Clothing/Head/PickUpAnyNearbyHeadExp.cs index ffa25ffaec..dfb2f6d2a9 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Clothing/Head/PickUpAnyNearbyHeadExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Clothing/Head/PickUpAnyNearbyHeadExp.cs @@ -5,7 +5,6 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Clothing; using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Clothing; using Content.Shared.GameObjects.Components.Inventory; namespace Content.Server.AI.Utility.ExpandableActions.Clothing.Head diff --git a/Content.Server/AI/Utility/ExpandableActions/Clothing/OuterClothing/EquipAnyOuterClothingExp.cs b/Content.Server/AI/Utility/ExpandableActions/Clothing/OuterClothing/EquipAnyOuterClothingExp.cs index aa58ac744e..b7a7980974 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Clothing/OuterClothing/EquipAnyOuterClothingExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Clothing/OuterClothing/EquipAnyOuterClothingExp.cs @@ -5,7 +5,6 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Clothing; using Content.Shared.GameObjects.Components.Inventory; namespace Content.Server.AI.Utility.ExpandableActions.Clothing.OuterClothing diff --git a/Content.Server/AI/Utility/ExpandableActions/Clothing/OuterClothing/PickUpAnyNearbyOuterClothingExp.cs b/Content.Server/AI/Utility/ExpandableActions/Clothing/OuterClothing/PickUpAnyNearbyOuterClothingExp.cs index b0900c1459..dd1d06c0c7 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Clothing/OuterClothing/PickUpAnyNearbyOuterClothingExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Clothing/OuterClothing/PickUpAnyNearbyOuterClothingExp.cs @@ -5,7 +5,6 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Clothing; using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Clothing; using Content.Shared.GameObjects.Components.Inventory; namespace Content.Server.AI.Utility.ExpandableActions.Clothing.OuterClothing diff --git a/Content.Server/AI/Utility/ExpandableActions/Clothing/Shoes/EquipAnyShoesExp.cs b/Content.Server/AI/Utility/ExpandableActions/Clothing/Shoes/EquipAnyShoesExp.cs index bc6e263709..517fd735c0 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Clothing/Shoes/EquipAnyShoesExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Clothing/Shoes/EquipAnyShoesExp.cs @@ -5,7 +5,6 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Clothing; using Content.Shared.GameObjects.Components.Inventory; namespace Content.Server.AI.Utility.ExpandableActions.Clothing.Shoes diff --git a/Content.Server/AI/Utility/ExpandableActions/Clothing/Shoes/PickUpAnyNearbyShoesExp.cs b/Content.Server/AI/Utility/ExpandableActions/Clothing/Shoes/PickUpAnyNearbyShoesExp.cs index d258738247..598d180808 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Clothing/Shoes/PickUpAnyNearbyShoesExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Clothing/Shoes/PickUpAnyNearbyShoesExp.cs @@ -5,7 +5,6 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Clothing; using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Clothing; using Content.Shared.GameObjects.Components.Inventory; namespace Content.Server.AI.Utility.ExpandableActions.Clothing.Shoes diff --git a/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs b/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs index 2152784703..25e25afd4f 100644 --- a/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs +++ b/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs @@ -1,8 +1,6 @@ using System.Collections.Generic; using Content.Server.AI.Utils; using Content.Server.GameObjects; -using Content.Server.GameObjects.Components; -using Content.Server.GameObjects.Components.Items.Clothing; using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Movement; using JetBrains.Annotations; diff --git a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs index 6091c504dc..2bfc027402 100644 --- a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks.Dataflow; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems.Click; using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Server.Interfaces; diff --git a/Content.Server/GameObjects/Components/Interactable/HandheldLightComponent.cs b/Content.Server/GameObjects/Components/Interactable/HandheldLightComponent.cs index ca01e00419..1a8806afe0 100644 --- a/Content.Server/GameObjects/Components/Interactable/HandheldLightComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/HandheldLightComponent.cs @@ -1,8 +1,6 @@ using Content.Server.GameObjects.Components.Power; -using Content.Server.GameObjects.Components.Sound; using Content.Server.GameObjects.EntitySystems.Click; using Content.Server.Interfaces.GameObjects.Components.Interaction; -using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces.GameObjects; using Content.Shared.GameObjects; using Content.Shared.GameObjects.Components; @@ -19,8 +17,6 @@ using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Utility; using Robust.Shared.ViewVariables; -using System; -using Content.Server.GameObjects.Components.Items.Clothing; using Content.Server.GameObjects.Components.Items.Storage; namespace Content.Server.GameObjects.Components.Interactable diff --git a/Content.Server/GameObjects/Components/Interactable/WelderComponent.cs b/Content.Server/GameObjects/Components/Interactable/WelderComponent.cs index bf55f988fa..c89827e40a 100644 --- a/Content.Server/GameObjects/Components/Interactable/WelderComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/WelderComponent.cs @@ -1,6 +1,7 @@ using System; using System.Runtime.Remoting; using Content.Server.GameObjects.Components.Chemistry; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems.Click; using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Server.Interfaces; diff --git a/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs b/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs index 6bf0ae5822..36cde14d5a 100644 --- a/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs @@ -3,6 +3,7 @@ using Robust.Shared.Utility; using System; using System.Collections.Generic; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Server.Interfaces; using Content.Shared.GameObjects; diff --git a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs index ad8eda759f..5b2a7632ae 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs @@ -2,6 +2,7 @@ using System.Linq; using Content.Server.GameObjects.Components.Interactable; using Content.Server.GameObjects.EntitySystems; +using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Shared.GameObjects; using Content.Shared.GameObjects.Components.Interactable; using Content.Shared.GameObjects.Components.Storage; diff --git a/Content.Server/GameObjects/Components/Mobs/HeatResistanceComponent.cs b/Content.Server/GameObjects/Components/Mobs/HeatResistanceComponent.cs index b34cac9050..760aea0caf 100644 --- a/Content.Server/GameObjects/Components/Mobs/HeatResistanceComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/HeatResistanceComponent.cs @@ -1,10 +1,6 @@ -using System; -using Content.Shared.GameObjects.Components.Inventory; +using Content.Shared.GameObjects.Components.Inventory; using Robust.Shared.GameObjects; -using CannyFastMath; -using Content.Server.GameObjects.Components.Items.Clothing; using Math = CannyFastMath.Math; -using MathF = CannyFastMath.MathF; namespace Content.Server.GameObjects { diff --git a/Content.Server/GameObjects/Components/Nutrition/FoodContainerComponent.cs b/Content.Server/GameObjects/Components/Nutrition/FoodContainerComponent.cs index 572f1963c5..3c365de9ae 100644 --- a/Content.Server/GameObjects/Components/Nutrition/FoodContainerComponent.cs +++ b/Content.Server/GameObjects/Components/Nutrition/FoodContainerComponent.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Shared.GameObjects.Components.Nutrition; using Robust.Server.GameObjects; diff --git a/Content.Server/GameObjects/Components/PDA/PDAComponent.cs b/Content.Server/GameObjects/Components/PDA/PDAComponent.cs index eb7f1d1b68..ac4d82ebff 100644 --- a/Content.Server/GameObjects/Components/PDA/PDAComponent.cs +++ b/Content.Server/GameObjects/Components/PDA/PDAComponent.cs @@ -3,6 +3,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using Content.Server.GameObjects.Components.Access; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Server.Interfaces; using Content.Server.Interfaces.PDA; diff --git a/Content.Server/GameObjects/Components/PottedPlantHideComponent.cs b/Content.Server/GameObjects/Components/PottedPlantHideComponent.cs index 5de2091e62..67ec811a95 100644 --- a/Content.Server/GameObjects/Components/PottedPlantHideComponent.cs +++ b/Content.Server/GameObjects/Components/PottedPlantHideComponent.cs @@ -1,3 +1,4 @@ +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Server.Interfaces.GameObjects; using Content.Shared.Audio; diff --git a/Content.Server/GameObjects/EntitySystems/MoverSystem.cs b/Content.Server/GameObjects/EntitySystems/MoverSystem.cs index 626e86a18e..8b25e4e045 100644 --- a/Content.Server/GameObjects/EntitySystems/MoverSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/MoverSystem.cs @@ -1,5 +1,6 @@ using Content.Server.GameObjects; using Content.Server.GameObjects.Components; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Mobs; using Content.Server.GameObjects.Components.Movement; using Content.Server.GameObjects.Components.Sound; From 793f843ae82671166086997c103f91c8efdfc636 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Tue, 7 Jul 2020 00:33:57 +0200 Subject: [PATCH 11/25] Fixing these namespaces was a mistake --- .../AI/Operators/Inventory/PickupEntityOperator.cs | 2 +- .../AI/Operators/Inventory/UseItemInHandsOperator.cs | 2 +- .../AI/Utility/Considerations/Hands/TargetInOurHandsCon.cs | 2 +- .../Considerations/Inventory/CanPutTargetInHandsCon.cs | 3 +-- .../Considerations/Inventory/TargetInOurInventoryCon.cs | 3 +-- .../AI/WorldState/States/Clothing/NearbyClothingState.cs | 2 +- Content.Server/Chat/ChatCommands.cs | 2 +- .../Components/GUI/HumanInventoryControllerComponent.cs | 2 +- .../GameObjects/Components/GUI/InventoryComponent.cs | 4 +--- .../GameObjects/Components/GUI/ServerHandsComponent.cs | 4 +--- .../Components/Items/Clothing/ClothingComponent.cs | 1 + .../Components/Items/Storage/EntityStorageComponent.cs | 3 ++- .../GameObjects/Components/Items/Storage/ItemComponent.cs | 7 ++----- .../GameObjects/EntitySystems/ConstructionSystem.cs | 2 +- Content.Server/GameObjects/EntitySystems/HandsSystem.cs | 5 +---- Content.Server/GameTicking/GameTicker.cs | 5 +---- .../GameObjects/Components/Items/IHandsComponent.cs | 3 +-- Content.Server/PDA/PDAUplinkManager.cs | 2 +- 18 files changed, 20 insertions(+), 34 deletions(-) diff --git a/Content.Server/AI/Operators/Inventory/PickupEntityOperator.cs b/Content.Server/AI/Operators/Inventory/PickupEntityOperator.cs index 71ed2ed59d..a2998d4aaa 100644 --- a/Content.Server/AI/Operators/Inventory/PickupEntityOperator.cs +++ b/Content.Server/AI/Operators/Inventory/PickupEntityOperator.cs @@ -1,5 +1,5 @@ using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Storage; +using Content.Server.GameObjects.Components; using Content.Server.GameObjects.EntitySystems.Click; using Content.Server.Utility; using Robust.Shared.Containers; diff --git a/Content.Server/AI/Operators/Inventory/UseItemInHandsOperator.cs b/Content.Server/AI/Operators/Inventory/UseItemInHandsOperator.cs index f8af6d8970..aaaab852f0 100644 --- a/Content.Server/AI/Operators/Inventory/UseItemInHandsOperator.cs +++ b/Content.Server/AI/Operators/Inventory/UseItemInHandsOperator.cs @@ -1,5 +1,5 @@ using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Storage; +using Content.Server.GameObjects.Components; using Robust.Shared.Interfaces.GameObjects; namespace Content.Server.AI.Operators.Inventory diff --git a/Content.Server/AI/Utility/Considerations/Hands/TargetInOurHandsCon.cs b/Content.Server/AI/Utility/Considerations/Hands/TargetInOurHandsCon.cs index 9b291278bf..2d849717f1 100644 --- a/Content.Server/AI/Utility/Considerations/Hands/TargetInOurHandsCon.cs +++ b/Content.Server/AI/Utility/Considerations/Hands/TargetInOurHandsCon.cs @@ -2,7 +2,7 @@ using Content.Server.AI.Utility.Curves; using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Storage; +using Content.Server.GameObjects.Components; namespace Content.Server.AI.Utility.Considerations.Hands { diff --git a/Content.Server/AI/Utility/Considerations/Inventory/CanPutTargetInHandsCon.cs b/Content.Server/AI/Utility/Considerations/Inventory/CanPutTargetInHandsCon.cs index e9a08b97e0..581255786e 100644 --- a/Content.Server/AI/Utility/Considerations/Inventory/CanPutTargetInHandsCon.cs +++ b/Content.Server/AI/Utility/Considerations/Inventory/CanPutTargetInHandsCon.cs @@ -3,8 +3,7 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Hands; using Content.Server.AI.WorldState.States.Inventory; -using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Storage; +using Content.Server.GameObjects.Components; namespace Content.Server.AI.Utility.Considerations.Inventory { diff --git a/Content.Server/AI/Utility/Considerations/Inventory/TargetInOurInventoryCon.cs b/Content.Server/AI/Utility/Considerations/Inventory/TargetInOurInventoryCon.cs index 70e43b7032..10368f92a9 100644 --- a/Content.Server/AI/Utility/Considerations/Inventory/TargetInOurInventoryCon.cs +++ b/Content.Server/AI/Utility/Considerations/Inventory/TargetInOurInventoryCon.cs @@ -2,8 +2,7 @@ using Content.Server.AI.Utility.Curves; using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Inventory; -using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Storage; +using Content.Server.GameObjects.Components; namespace Content.Server.AI.Utility.Considerations.Inventory { diff --git a/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs b/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs index 25e25afd4f..83a54abee1 100644 --- a/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs +++ b/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using Content.Server.AI.Utils; using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Storage; +using Content.Server.GameObjects.Components; using Content.Server.GameObjects.Components.Movement; using JetBrains.Annotations; using Robust.Shared.Containers; diff --git a/Content.Server/Chat/ChatCommands.cs b/Content.Server/Chat/ChatCommands.cs index d75c7cb0cc..266c5ef994 100644 --- a/Content.Server/Chat/ChatCommands.cs +++ b/Content.Server/Chat/ChatCommands.cs @@ -11,7 +11,7 @@ using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Localization; using System.Linq; -using Content.Server.GameObjects.Components.Items.Storage; +using Content.Server.GameObjects.Components; namespace Content.Server.Chat { diff --git a/Content.Server/GameObjects/Components/GUI/HumanInventoryControllerComponent.cs b/Content.Server/GameObjects/Components/GUI/HumanInventoryControllerComponent.cs index b06b085376..0bfe3b1c04 100644 --- a/Content.Server/GameObjects/Components/GUI/HumanInventoryControllerComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/HumanInventoryControllerComponent.cs @@ -1,8 +1,8 @@ +using Content.Server.GameObjects.Components; using Content.Server.GameObjects.Components.Items.Storage; using Robust.Server.GameObjects.Components.Container; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Interfaces.Network; using Robust.Shared.Localization; using Robust.Shared.Timers; using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines; diff --git a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs index 2bfc027402..4c3b903490 100644 --- a/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/InventoryComponent.cs @@ -1,15 +1,13 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks.Dataflow; -using Content.Server.GameObjects.Components.Items.Storage; +using Content.Server.GameObjects.Components; using Content.Server.GameObjects.EntitySystems.Click; using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Server.Interfaces; using Content.Shared.GameObjects; using Content.Shared.GameObjects.EntitySystems; using Robust.Server.GameObjects.Components.Container; -using Robust.Server.Interfaces.Player; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects.Components; diff --git a/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs b/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs index 899db7551e..9082ef3b43 100644 --- a/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/ServerHandsComponent.cs @@ -4,10 +4,8 @@ using Robust.Shared.Utility; using System; using System.Collections.Generic; using System.Linq; -using Content.Server.GameObjects.Components.Items.Storage; -using Content.Server.GameObjects.EntitySystems; +using Content.Server.GameObjects.Components; using Content.Server.GameObjects.EntitySystems.Click; -using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Server.Interfaces.GameObjects; using Content.Shared.GameObjects; using Robust.Server.GameObjects; diff --git a/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs b/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs index 36cde14d5a..4c09463c65 100644 --- a/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Clothing/ClothingComponent.cs @@ -3,6 +3,7 @@ using Robust.Shared.Utility; using System; using System.Collections.Generic; +using Content.Server.GameObjects.Components; using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Server.Interfaces; diff --git a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs index 5b2a7632ae..4ffa93a7f1 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using Content.Server.GameObjects.Components.Interactable; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Shared.GameObjects; @@ -24,7 +25,7 @@ using Robust.Shared.Maths; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; -namespace Content.Server.GameObjects.Components.Items.Storage +namespace Content.Server.GameObjects.Components { [RegisterComponent] [ComponentReference(typeof(IActivate))] diff --git a/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs index e6b0501ece..a5d125dedf 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/ItemComponent.cs @@ -1,8 +1,5 @@ -using System; -using Content.Server.GameObjects.Components; -using Content.Server.GameObjects.Components.Destructible; +using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.Interfaces.GameObjects.Components.Interaction; -using Content.Server.GameObjects.EntitySystems; using Content.Server.Interfaces.GameObjects; using Content.Server.Throw; using Content.Server.Utility; @@ -21,7 +18,7 @@ using Robust.Shared.Maths; using Robust.Shared.Random; using Robust.Shared.Serialization; -namespace Content.Server.GameObjects.Components.Items.Storage +namespace Content.Server.GameObjects.Components { [RegisterComponent] [ComponentReference(typeof(StoreableComponent))] diff --git a/Content.Server/GameObjects/EntitySystems/ConstructionSystem.cs b/Content.Server/GameObjects/EntitySystems/ConstructionSystem.cs index d109b09588..ddf2d2aec8 100644 --- a/Content.Server/GameObjects/EntitySystems/ConstructionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/ConstructionSystem.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; +using Content.Server.GameObjects.Components; using Content.Server.GameObjects.Components.Construction; using Content.Server.GameObjects.Components.Interactable; -using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Stack; using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Server.Interfaces; diff --git a/Content.Server/GameObjects/EntitySystems/HandsSystem.cs b/Content.Server/GameObjects/EntitySystems/HandsSystem.cs index 7e8455fc7c..3dd7f4a63c 100644 --- a/Content.Server/GameObjects/EntitySystems/HandsSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/HandsSystem.cs @@ -1,7 +1,5 @@ using System.Linq; using Content.Server.GameObjects.Components.Stack; -using Content.Server.Interfaces; -using Content.Server.Interfaces.GameObjects; using Content.Server.Throw; using Content.Shared.GameObjects.Components.Inventory; using Content.Shared.Input; @@ -10,7 +8,6 @@ using Robust.Server.GameObjects.EntitySystemMessages; using Robust.Server.Interfaces.Player; using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Systems; -using Robust.Shared.Input; using Robust.Shared.Input.Binding; using Robust.Shared.Interfaces.Map; using Robust.Shared.IoC; @@ -18,9 +15,9 @@ using Robust.Shared.Localization; using Robust.Shared.Map; using Robust.Shared.Players; using System; -using Content.Server.GameObjects.Components.Items.Storage; using Content.Shared.GameObjects.EntitySystems; using Content.Server.GameObjects; +using Content.Server.GameObjects.Components; using Content.Server.GameObjects.EntitySystems.Click; namespace Content.Server.Interfaces.GameObjects.Components.Interaction diff --git a/Content.Server/GameTicking/GameTicker.cs b/Content.Server/GameTicking/GameTicker.cs index f260aeaa34..4373fd9e51 100644 --- a/Content.Server/GameTicking/GameTicker.cs +++ b/Content.Server/GameTicking/GameTicker.cs @@ -4,14 +4,13 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using Content.Server.GameObjects; +using Content.Server.GameObjects.Components; using Content.Server.GameObjects.Components.Access; -using Content.Server.GameObjects.Components.Items.Storage; using Content.Server.GameObjects.Components.Markers; using Content.Server.GameObjects.Components.Mobs; using Content.Server.GameObjects.Components.Observer; using Content.Server.GameObjects.Components.PDA; using Content.Server.Interfaces.GameObjects.Components.Interaction; -using Content.Server.GameObjects.EntitySystems; using Content.Server.GameObjects.EntitySystems.AI.Pathfinding; using Content.Server.GameTicking.GamePresets; using Content.Server.Interfaces; @@ -24,7 +23,6 @@ using Content.Shared; using Content.Shared.Chat; using Content.Shared.GameObjects.Components.PDA; using Content.Shared.Jobs; -using Content.Shared.Physics; using Content.Shared.Preferences; using Prometheus; using Robust.Server.Interfaces; @@ -35,7 +33,6 @@ using Robust.Server.ServerStatus; using Robust.Shared.Configuration; using Robust.Shared.Enums; using Robust.Shared.GameObjects; -using Robust.Shared.GameObjects.Components; using Robust.Shared.GameObjects.Systems; using Robust.Shared.Interfaces.Configuration; using Robust.Shared.Interfaces.GameObjects; diff --git a/Content.Server/Interfaces/GameObjects/Components/Items/IHandsComponent.cs b/Content.Server/Interfaces/GameObjects/Components/Items/IHandsComponent.cs index 60e2be172b..b335f50f7c 100644 --- a/Content.Server/Interfaces/GameObjects/Components/Items/IHandsComponent.cs +++ b/Content.Server/Interfaces/GameObjects/Components/Items/IHandsComponent.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; -using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Storage; +using Content.Server.GameObjects.Components; using Content.Shared.GameObjects.EntitySystems; using Robust.Server.GameObjects.Components.Container; using Robust.Server.GameObjects.EntitySystemMessages; diff --git a/Content.Server/PDA/PDAUplinkManager.cs b/Content.Server/PDA/PDAUplinkManager.cs index f148d46e4b..b627b92f67 100644 --- a/Content.Server/PDA/PDAUplinkManager.cs +++ b/Content.Server/PDA/PDAUplinkManager.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; using Content.Server.GameObjects; -using Content.Server.GameObjects.Components.Items.Storage; +using Content.Server.GameObjects.Components; using Content.Server.GameObjects.Components.Mobs; using Content.Server.Interfaces.PDA; using Content.Shared.GameObjects.Components.PDA; From e5d78152c8193b5e814ebe19187e55c5b9da040c Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Tue, 7 Jul 2020 00:35:38 +0200 Subject: [PATCH 12/25] Replace Has & Add with Ensure --- .../Components/Items/Storage/EntityStorageComponent.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs index 4ffa93a7f1..b83126759d 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs @@ -214,10 +214,7 @@ namespace Content.Server.GameObjects.Components private bool AddToContents(IEntity entity) { - if (!entity.HasComponent()) - { - entity.AddComponent(); - } + entity.EnsureComponent(); var collidableComponent = Owner.GetComponent(); ICollidableComponent entityCollidableComponent; From 0a292634be2c4c22a26dae08a85041e9a0c0206f Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Tue, 7 Jul 2020 00:49:14 +0200 Subject: [PATCH 13/25] Add Shutdown override to EntityStorageComponent --- .../Items/Storage/EntityStorageComponent.cs | 60 +++++++++++-------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs index b83126759d..4532d767ef 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs @@ -120,6 +120,16 @@ namespace Content.Server.GameObjects.Components serializer.DataField(this, a => a.CanWeldShut, "CanWeldShut", true); } + protected override void Shutdown() + { + base.Shutdown(); + + foreach (var entity in _contents.ContainedEntities) + { + entity.RemoveComponent(); + } + } + public virtual void Activate(ActivateEventArgs eventArgs) { ToggleOpen(eventArgs.User); @@ -355,6 +365,31 @@ namespace Content.Server.GameObjects.Components return _contents.CanInsert(entity); } + bool IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs) + { + + if (Open) + return false; + + if (!CanWeldShut) + return false; + + if (!eventArgs.Using.TryGetComponent(out WelderComponent tool)) + return false; + + if (!tool.UseTool(eventArgs.User, Owner, ToolQuality.Welding, 1f)) + return false; + + IsWeldedShut ^= true; + return true; + } + + void IDestroyAct.OnDestroy(DestructionEventArgs eventArgs) + { + Open = true; + EmptyContents(); + } + [Verb] private sealed class OpenToggleVerb : Verb { @@ -394,30 +429,5 @@ namespace Content.Server.GameObjects.Components data.Text = component.Open ? "Close" : "Open"; } - - public bool InteractUsing(InteractUsingEventArgs eventArgs) - { - - if (Open) - return false; - - if (!CanWeldShut) - return false; - - if (!eventArgs.Using.TryGetComponent(out WelderComponent tool)) - return false; - - if (!tool.UseTool(eventArgs.User, Owner, ToolQuality.Welding, 1f)) - return false; - - IsWeldedShut ^= true; - return true; - } - - public void OnDestroy(DestructionEventArgs eventArgs) - { - Open = true; - EmptyContents(); - } } } From 5901e6e45fbe90e36bd75fb800671179bf7614d4 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Tue, 7 Jul 2020 01:00:29 +0200 Subject: [PATCH 14/25] Replace InEntityStorageComponent with in container check --- .../Items/Storage/EntityStorageComponent.cs | 17 ----------------- .../Items/Storage/InEntityStorageComponent.cs | 16 ---------------- .../EntitySystems/Click/InteractionSystem.cs | 4 +++- 3 files changed, 3 insertions(+), 34 deletions(-) delete mode 100644 Content.Server/GameObjects/Components/Items/Storage/InEntityStorageComponent.cs diff --git a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs index 4532d767ef..e8ef6ddf89 100644 --- a/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs +++ b/Content.Server/GameObjects/Components/Items/Storage/EntityStorageComponent.cs @@ -120,16 +120,6 @@ namespace Content.Server.GameObjects.Components serializer.DataField(this, a => a.CanWeldShut, "CanWeldShut", true); } - protected override void Shutdown() - { - base.Shutdown(); - - foreach (var entity in _contents.ContainedEntities) - { - entity.RemoveComponent(); - } - } - public virtual void Activate(ActivateEventArgs eventArgs) { ToggleOpen(eventArgs.User); @@ -224,8 +214,6 @@ namespace Content.Server.GameObjects.Components private bool AddToContents(IEntity entity) { - entity.EnsureComponent(); - var collidableComponent = Owner.GetComponent(); ICollidableComponent entityCollidableComponent; if (entity.TryGetComponent(out entityCollidableComponent)) @@ -287,11 +275,6 @@ namespace Content.Server.GameObjects.Components { entityCollidableComponent.CanCollide = true; } - - if (contained.HasComponent()) - { - contained.RemoveComponent(); - } } } } diff --git a/Content.Server/GameObjects/Components/Items/Storage/InEntityStorageComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/InEntityStorageComponent.cs deleted file mode 100644 index d63b8fa3b0..0000000000 --- a/Content.Server/GameObjects/Components/Items/Storage/InEntityStorageComponent.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Content.Shared.GameObjects.EntitySystems; -using Robust.Shared.GameObjects; - -namespace Content.Server.GameObjects.Components.Items.Storage -{ - [RegisterComponent] - public class InEntityStorageComponent : Component, IActionBlocker - { - public override string Name => "InEntityStorage"; - - public bool CanInteract() - { - return false; - } - } -} diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index 15ec860880..10fbed594a 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -13,6 +13,7 @@ using JetBrains.Annotations; using Robust.Server.GameObjects; using Robust.Server.GameObjects.EntitySystems; using Robust.Server.Interfaces.Player; +using Robust.Shared.Containers; using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Components; using Robust.Shared.Input; @@ -261,7 +262,8 @@ namespace Content.Server.GameObjects.EntitySystems.Click } } - if (!ActionBlockerSystem.CanInteract(player)) + if (!ActionBlockerSystem.CanInteract(player) || + ContainerHelpers.IsInContainer(player)) { return; } From 2fd93091c7889c4206f4eaed06721944a6306cf4 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Tue, 7 Jul 2020 01:10:21 +0200 Subject: [PATCH 15/25] Allow interaction if targeting the containing entity --- .../GameObjects/EntitySystems/Click/InteractionSystem.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index 10fbed594a..355e74d16a 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -263,7 +263,8 @@ namespace Content.Server.GameObjects.EntitySystems.Click } if (!ActionBlockerSystem.CanInteract(player) || - ContainerHelpers.IsInContainer(player)) + ContainerHelpers.TryGetContainer(player, out var container) && + container.Owner != attacked) { return; } From e0f888344e28f265325c33392739d14a1959343f Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Tue, 7 Jul 2020 01:40:08 +0200 Subject: [PATCH 16/25] Add more interaction checks --- .../EntitySystems/Click/InteractionSystem.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index 355e74d16a..c5b6ff54e2 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -262,9 +262,17 @@ namespace Content.Server.GameObjects.EntitySystems.Click } } - if (!ActionBlockerSystem.CanInteract(player) || - ContainerHelpers.TryGetContainer(player, out var container) && - container.Owner != attacked) + if (!ActionBlockerSystem.CanInteract(player)) + { + return; + } + + // In a container where the attacked entity is not the container's owner and either the attacked entity is null, not contained or in a different container + if (ContainerHelpers.TryGetContainer(player, out var playerContainer) && + attacked != playerContainer.Owner && + (attacked == null || + !ContainerHelpers.TryGetContainer(attacked, out var attackedContainer) || + attackedContainer != playerContainer)) { return; } From da4b55814a78da1a5863e4510070a6c5a5fff1dc Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Wed, 8 Jul 2020 12:54:00 +0200 Subject: [PATCH 17/25] Fix halved buckle range not applying, add range property to strap --- .../Components/Mobs/BuckleComponent.cs | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs index 8b5eae4c9c..98f9da38f2 100644 --- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs @@ -29,8 +29,10 @@ namespace Content.Server.GameObjects.Components.Mobs [Dependency] private readonly IServerNotifyManager _notifyManager = default!; #pragma warning restore 649 - private StrapComponent? _buckledTo; private int _size; + private float _range; + + private StrapComponent? _buckledTo; [ViewVariables] public StrapComponent? BuckledTo @@ -74,10 +76,18 @@ namespace Content.Server.GameObjects.Components.Mobs return false; } - var strapPosition = Owner.Transform.MapPosition; - var range = SharedInteractionSystem.InteractionRange / 2; + if (!to.TryGetComponent(out StrapComponent strap)) + { + _notifyManager.PopupMessage(Owner, user, + Loc.GetString(Owner == user + ? "You can't buckle yourself there!" + : "You can't buckle {0:them} there!", Owner)); + return false; + } - if (!InteractionChecks.InRangeUnobstructed(user, strapPosition, range) || + var strapPosition = strap.Owner.Transform.MapPosition; + + if (!InteractionChecks.InRangeUnobstructed(user, strapPosition, _range) || ContainerHelpers.IsInContainer(Owner)) { _notifyManager.PopupMessage(user, user, @@ -101,15 +111,6 @@ namespace Content.Server.GameObjects.Components.Mobs return false; } - if (!to.TryGetComponent(out StrapComponent strap)) - { - _notifyManager.PopupMessage(Owner, user, - Loc.GetString(Owner == user - ? "You can't buckle yourself there!" - : "You can't buckle {0:them} there!", Owner)); - return false; - } - var parent = to.Transform.Parent; while (parent != null) { @@ -195,9 +196,8 @@ namespace Content.Server.GameObjects.Components.Mobs } var strapPosition = Owner.Transform.MapPosition; - var range = SharedInteractionSystem.InteractionRange / 2; - if (!InteractionChecks.InRangeUnobstructed(user, strapPosition, range)) + if (!InteractionChecks.InRangeUnobstructed(user, strapPosition, _range)) { _notifyManager.PopupMessage(user, user, Loc.GetString("You can't reach there!")); @@ -265,6 +265,7 @@ namespace Content.Server.GameObjects.Components.Mobs base.ExposeData(serializer); serializer.DataField(ref _size, "size", 100); + serializer.DataField(ref _range, "range", SharedInteractionSystem.InteractionRange / 2); } protected override void Startup() From 39b650da386eaa79db7dc569e3bcf7a0571b77a3 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Wed, 8 Jul 2020 13:01:08 +0200 Subject: [PATCH 18/25] Fix "You're already buckled in" not appearing if trying to buckle while already buckled --- .../GameObjects/Components/Mobs/BuckleComponent.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs index 98f9da38f2..c2e08e975a 100644 --- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs @@ -246,18 +246,12 @@ namespace Content.Server.GameObjects.Components.Mobs public bool ToggleBuckle(IEntity user, IEntity to) { - if (BuckledTo == null) - { - return TryBuckle(user, to); - } - else if (BuckledTo.Owner == to) + if (BuckledTo?.Owner == to) { return TryUnbuckle(user); } - else - { - return false; - } + + return TryBuckle(user, to); } public override void ExposeData(ObjectSerializer serializer) From f9a948ace37147c155a524f17273b0befccf3756 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Wed, 8 Jul 2020 13:02:38 +0200 Subject: [PATCH 19/25] Fix wrong buckle status effect icon texture path --- Content.Server/GameObjects/Components/Strap/StrapComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/GameObjects/Components/Strap/StrapComponent.cs b/Content.Server/GameObjects/Components/Strap/StrapComponent.cs index 1d50687e9c..c62c233b45 100644 --- a/Content.Server/GameObjects/Components/Strap/StrapComponent.cs +++ b/Content.Server/GameObjects/Components/Strap/StrapComponent.cs @@ -130,7 +130,7 @@ namespace Content.Server.GameObjects.Components.Strap serializer.DataField(ref _position, "position", StrapPosition.None); serializer.DataField(ref _buckleSound, "buckleSound", "/Audio/Effects/buckle.ogg"); serializer.DataField(ref _unbuckleSound, "unbuckleSound", "/Audio/Effects/unbuckle.ogg"); - serializer.DataField(ref _buckledIcon, "buckledIcon", "/Textures/Mob/UI/Buckle/buckled.png"); + serializer.DataField(ref _buckledIcon, "buckledIcon", "/Textures/Interface/StatusEffects/Buckle/buckled.png"); serializer.DataField(ref _rotation, "rotation", 0); var defaultSize = 100; From 770d4e72e7a19d7ce3f390b9f07a9467b7cf48a4 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Wed, 8 Jul 2020 13:22:14 +0200 Subject: [PATCH 20/25] Add 0.25 second delay to unbuckling after recently buckling and more summaries --- .../Components/Mobs/BuckleComponent.cs | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs index c2e08e975a..7a8bb272e9 100644 --- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs @@ -1,4 +1,5 @@ #nullable enable +using System; using Content.Server.GameObjects.Components.Strap; using Content.Server.Interfaces; using Content.Server.Interfaces.GameObjects.Components.Interaction; @@ -13,6 +14,7 @@ using Robust.Server.GameObjects.EntitySystems; using Robust.Shared.Containers; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.Interfaces.Timing; using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Maths; @@ -27,11 +29,30 @@ namespace Content.Server.GameObjects.Components.Mobs #pragma warning disable 649 [Dependency] private readonly IEntitySystemManager _entitySystem = default!; [Dependency] private readonly IServerNotifyManager _notifyManager = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; #pragma warning restore 649 + /// + /// The amount of space that this entity occupies in a . + /// private int _size; + + /// + /// The range from which this entity can buckle to a . + /// private float _range; + /// + /// The amount of time that must pass for this entity to + /// be able to unbuckle after recently buckling. + /// + private TimeSpan _unbuckleDelay; + + /// + /// The time that this entity buckled at. + /// + private TimeSpan _buckleTime; + private StrapComponent? _buckledTo; [ViewVariables] @@ -41,6 +62,7 @@ namespace Content.Server.GameObjects.Components.Mobs private set { _buckledTo = value; + _buckleTime = _gameTiming.CurTime; Dirty(); } } @@ -188,6 +210,11 @@ namespace Content.Server.GameObjects.Components.Mobs if (!force) { + if (_gameTiming.CurTime < _buckleTime + _unbuckleDelay) + { + return false; + } + if (!ActionBlockerSystem.CanInteract(user)) { _notifyManager.PopupMessage(user, user, @@ -199,7 +226,7 @@ namespace Content.Server.GameObjects.Components.Mobs if (!InteractionChecks.InRangeUnobstructed(user, strapPosition, _range)) { - _notifyManager.PopupMessage(user, user, + _notifyManager.PopupMessage(Owner, user, Loc.GetString("You can't reach there!")); return false; } @@ -260,6 +287,11 @@ namespace Content.Server.GameObjects.Components.Mobs serializer.DataField(ref _size, "size", 100); serializer.DataField(ref _range, "range", SharedInteractionSystem.InteractionRange / 2); + + var seconds = 0.25f; + serializer.DataField(ref seconds, "cooldown", 0.25f); + + _unbuckleDelay = TimeSpan.FromSeconds(seconds); } protected override void Startup() @@ -267,6 +299,7 @@ namespace Content.Server.GameObjects.Components.Mobs base.Startup(); BuckleStatus(); } + public override void OnRemove() { base.OnRemove(); @@ -278,6 +311,7 @@ namespace Content.Server.GameObjects.Components.Mobs } BuckledTo = null; + _buckleTime = default; BuckleStatus(); } From 8f9af88bb2c51c85ae9b0b200cccdf3c941425ff Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Wed, 8 Jul 2020 14:45:25 +0200 Subject: [PATCH 21/25] Add unbuckling the entity if put into a container --- .../Components/Mobs/BuckleComponent.cs | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs index 7a8bb272e9..71a7cf55c0 100644 --- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs @@ -10,6 +10,7 @@ using Content.Shared.GameObjects.Components.Mobs; using Content.Shared.GameObjects.Components.Strap; using Content.Shared.GameObjects.EntitySystems; using Robust.Server.GameObjects; +using Robust.Server.GameObjects.EntitySystemMessages; using Robust.Server.GameObjects.EntitySystems; using Robust.Shared.Containers; using Robust.Shared.GameObjects; @@ -27,9 +28,10 @@ namespace Content.Server.GameObjects.Components.Mobs public class BuckleComponent : SharedBuckleComponent, IInteractHand, IDragDrop { #pragma warning disable 649 + [Dependency] private readonly IEntityManager _entityManager = default!; [Dependency] private readonly IEntitySystemManager _entitySystem = default!; - [Dependency] private readonly IServerNotifyManager _notifyManager = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private readonly IServerNotifyManager _notifyManager = default!; #pragma warning restore 649 /// @@ -281,6 +283,16 @@ namespace Content.Server.GameObjects.Components.Mobs return TryBuckle(user, to); } + private void InsertIntoContainer(EntInsertedIntoContainerMessage message) + { + if (message.Entity != Owner) + { + return; + } + + TryUnbuckle(Owner, true); + } + public override void ExposeData(ObjectSerializer serializer) { base.ExposeData(serializer); @@ -294,6 +306,13 @@ namespace Content.Server.GameObjects.Components.Mobs _unbuckleDelay = TimeSpan.FromSeconds(seconds); } + public override void Initialize() + { + base.Initialize(); + + _entityManager.EventBus.SubscribeEvent(EventSource.Local, this, InsertIntoContainer); + } + protected override void Startup() { base.Startup(); @@ -304,6 +323,8 @@ namespace Content.Server.GameObjects.Components.Mobs { base.OnRemove(); + _entityManager.EventBus.UnsubscribeEvents(this); + if (BuckledTo != null && BuckledTo.Owner.TryGetComponent(out StrapComponent strap)) { From f5a9f91de40921cf8746c7194116135dfb024956 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Wed, 8 Jul 2020 15:30:48 +0200 Subject: [PATCH 22/25] Fix not staying buckled to a strap when both the buckled and the strap go into the same container --- .../Components/Mobs/BuckleComponent.cs | 79 +++++++++++++------ .../GameObjects/EntitySystems/BuckleSystem.cs | 34 ++++++++ 2 files changed, 90 insertions(+), 23 deletions(-) create mode 100644 Content.Server/GameObjects/EntitySystems/BuckleSystem.cs diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs index 71a7cf55c0..bc309a7240 100644 --- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs @@ -72,6 +72,8 @@ namespace Content.Server.GameObjects.Components.Mobs [ViewVariables] protected override bool Buckled => BuckledTo != null; + public bool ContainerChanged { get; private set; } + [ViewVariables] public int Size => _size; @@ -86,6 +88,30 @@ namespace Content.Server.GameObjects.Components.Mobs } } + private void ReAttach(StrapComponent strap) + { + var ownTransform = Owner.Transform; + var strapTransform = strap.Owner.Transform; + + ownTransform.GridPosition = strapTransform.GridPosition; + ownTransform.AttachParent(strapTransform); + + switch (strap.Position) + { + case StrapPosition.None: + ownTransform.WorldRotation = strapTransform.WorldRotation; + break; + case StrapPosition.Stand: + StandingStateHelper.Standing(Owner); + ownTransform.WorldRotation = strapTransform.WorldRotation; + break; + case StrapPosition.Down: + StandingStateHelper.Down(Owner); + ownTransform.WorldRotation = Angle.South; + break; + } + } + private bool TryBuckle(IEntity user, IEntity to) { if (user == null || user == to) @@ -176,26 +202,7 @@ namespace Content.Server.GameObjects.Components.Mobs appearance.SetData(BuckleVisuals.Buckled, true); } - var ownTransform = Owner.Transform; - var strapTransform = strap.Owner.Transform; - - ownTransform.GridPosition = strapTransform.GridPosition; - ownTransform.AttachParent(strapTransform); - - switch (strap.Position) - { - case StrapPosition.None: - ownTransform.WorldRotation = strapTransform.WorldRotation; - break; - case StrapPosition.Stand: - StandingStateHelper.Standing(Owner); - ownTransform.WorldRotation = strapTransform.WorldRotation; - break; - case StrapPosition.Down: - StandingStateHelper.Down(Owner); - ownTransform.WorldRotation = Angle.South; - break; - } + ReAttach(strap); BuckledTo = strap; BuckleStatus(); @@ -283,14 +290,38 @@ namespace Content.Server.GameObjects.Components.Mobs return TryBuckle(user, to); } - private void InsertIntoContainer(EntInsertedIntoContainerMessage message) + private void InsertIntoContainer(ContainerModifiedMessage message) { if (message.Entity != Owner) { return; } - TryUnbuckle(Owner, true); + ContainerChanged = true; + } + + public void Update() + { + if (!ContainerChanged || BuckledTo == null) + { + return; + } + + var contained = ContainerHelpers.TryGetContainer(Owner, out var ownContainer); + var strapContained = ContainerHelpers.TryGetContainer(BuckledTo.Owner, out var strapContainer); + + if (contained != strapContained || ownContainer != strapContainer) + { + TryUnbuckle(Owner, true); + return; + } + + if (!contained && !strapContained) + { + ReAttach(BuckledTo); + } + + ContainerChanged = false; } public override void ExposeData(ObjectSerializer serializer) @@ -311,6 +342,7 @@ namespace Content.Server.GameObjects.Components.Mobs base.Initialize(); _entityManager.EventBus.SubscribeEvent(EventSource.Local, this, InsertIntoContainer); + _entityManager.EventBus.SubscribeEvent(EventSource.Local, this, InsertIntoContainer); } protected override void Startup() @@ -331,7 +363,8 @@ namespace Content.Server.GameObjects.Components.Mobs strap.Remove(this); } - BuckledTo = null; + TryUnbuckle(Owner, true); + _buckleTime = default; BuckleStatus(); } diff --git a/Content.Server/GameObjects/EntitySystems/BuckleSystem.cs b/Content.Server/GameObjects/EntitySystems/BuckleSystem.cs new file mode 100644 index 0000000000..133e8eb652 --- /dev/null +++ b/Content.Server/GameObjects/EntitySystems/BuckleSystem.cs @@ -0,0 +1,34 @@ +using Content.Server.GameObjects.Components.Mobs; +using Content.Server.GameObjects.EntitySystems.Click; +using Robust.Server.GameObjects.EntitySystems; +using Robust.Shared.GameObjects; +using Robust.Shared.GameObjects.Systems; + +namespace Content.Server.GameObjects.EntitySystems +{ + public class BuckleSystem : EntitySystem + { + public override void Initialize() + { + base.Initialize(); + + EntityQuery = new TypeEntityQuery(typeof(BuckleComponent)); + + UpdatesAfter.Add(typeof(InteractionSystem)); + UpdatesAfter.Add(typeof(InputSystem)); + } + + public override void Update(float frameTime) + { + foreach (var entity in RelevantEntities) + { + if (!entity.TryGetComponent(out BuckleComponent buckle)) + { + continue; + } + + buckle.Update(); + } + } + } +} From fb51aecfbf648dcfa6a3bc19239598d8e16a9d86 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Wed, 8 Jul 2020 15:37:18 +0200 Subject: [PATCH 23/25] Clean up if check --- .../EntitySystems/Click/InteractionSystem.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index c5b6ff54e2..1e2d95ae3c 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -11,11 +11,9 @@ using Content.Shared.GameObjects.EntitySystems; using Content.Shared.Input; using JetBrains.Annotations; using Robust.Server.GameObjects; -using Robust.Server.GameObjects.EntitySystems; using Robust.Server.Interfaces.Player; using Robust.Shared.Containers; using Robust.Shared.GameObjects; -using Robust.Shared.GameObjects.Components; using Robust.Shared.Input; using Robust.Shared.Input.Binding; using Robust.Shared.Interfaces.GameObjects; @@ -267,14 +265,17 @@ namespace Content.Server.GameObjects.EntitySystems.Click return; } - // In a container where the attacked entity is not the container's owner and either the attacked entity is null, not contained or in a different container + // In a container where the attacked entity is not the container's owner if (ContainerHelpers.TryGetContainer(player, out var playerContainer) && - attacked != playerContainer.Owner && - (attacked == null || - !ContainerHelpers.TryGetContainer(attacked, out var attackedContainer) || - attackedContainer != playerContainer)) + attacked != playerContainer.Owner) { - return; + // Either the attacked entity is null, not contained or in a different container + if (attacked == null || + !ContainerHelpers.TryGetContainer(attacked, out var attackedContainer) || + attackedContainer != playerContainer) + { + return; + } } // TODO: Check if client should be able to see that object to click on it in the first place From 4ec733577f21aaa2ea5b1dee5d86332a33a6f1f0 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Wed, 8 Jul 2020 16:00:04 +0200 Subject: [PATCH 24/25] Fix "You can't reach there!" message being created twice --- .../GameObjects/Components/Mobs/BuckleComponent.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs index bc309a7240..82d9f809d4 100644 --- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs @@ -137,14 +137,17 @@ namespace Content.Server.GameObjects.Components.Mobs var strapPosition = strap.Owner.Transform.MapPosition; - if (!InteractionChecks.InRangeUnobstructed(user, strapPosition, _range) || - ContainerHelpers.IsInContainer(Owner)) + if (!InteractionChecks.InRangeUnobstructed(user, strapPosition, _range)) { - _notifyManager.PopupMessage(user, user, - Loc.GetString("You can't reach there!")); return false; } + if (ContainerHelpers.IsInContainer(Owner)) + { + _notifyManager.PopupMessage(strap.Owner, user, + Loc.GetString("You can't reach there!")); + } + if (!user.HasComponent()) { _notifyManager.PopupMessage(user, user, From 066af633237a4b5e40e982a942e200e91d9c1363 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Wed, 8 Jul 2020 16:10:46 +0200 Subject: [PATCH 25/25] Fix not being able to buckle into an entity that is in the same container as you --- .../GameObjects/Components/Mobs/BuckleComponent.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs index 82d9f809d4..e8733b095b 100644 --- a/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/BuckleComponent.cs @@ -142,10 +142,15 @@ namespace Content.Server.GameObjects.Components.Mobs return false; } - if (ContainerHelpers.IsInContainer(Owner)) + if (ContainerHelpers.TryGetContainer(Owner, out var ownerContainer)) { - _notifyManager.PopupMessage(strap.Owner, user, - Loc.GetString("You can't reach there!")); + if (!ContainerHelpers.TryGetContainer(strap.Owner, out var strapContainer) || + ownerContainer != strapContainer) + { + _notifyManager.PopupMessage(strap.Owner, user, + Loc.GetString("You can't reach there!")); + return false; + } } if (!user.HasComponent())