Remove hands component reference (#15197)
This commit is contained in:
@@ -48,7 +48,7 @@ public sealed class DoAfterSystem : SharedDoAfterSystem
|
|||||||
var time = GameTiming.CurTime;
|
var time = GameTiming.CurTime;
|
||||||
var comp = Comp<DoAfterComponent>(playerEntity.Value);
|
var comp = Comp<DoAfterComponent>(playerEntity.Value);
|
||||||
var xformQuery = GetEntityQuery<TransformComponent>();
|
var xformQuery = GetEntityQuery<TransformComponent>();
|
||||||
var handsQuery = GetEntityQuery<SharedHandsComponent>();
|
var handsQuery = GetEntityQuery<HandsComponent>();
|
||||||
Update(playerEntity.Value, active, comp, time, xformQuery, handsQuery);
|
Update(playerEntity.Value, active, comp, time, xformQuery, handsQuery);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
using Content.Client.Hands.Systems;
|
|
||||||
using Content.Client.Hands.UI;
|
|
||||||
using Content.Shared.Hands.Components;
|
|
||||||
|
|
||||||
namespace Content.Client.Hands
|
|
||||||
{
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedHandsComponent))]
|
|
||||||
[Access(typeof(HandsSystem))]
|
|
||||||
public sealed class HandsComponent : SharedHandsComponent
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Whether or not to add in-hand sprites for held items. Some entities (e.g., drones) don't want these.
|
|
||||||
/// </summary>
|
|
||||||
[DataField("showInHands")]
|
|
||||||
public bool ShowInHands = true;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Data about the current sprite layers that the hand is contributing to the owner entity. Used for sprite in-hands.
|
|
||||||
/// </summary>
|
|
||||||
public readonly Dictionary<HandLocation, HashSet<string>> RevealedLayers = new();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Content.Client.Animations;
|
using Content.Client.Animations;
|
||||||
using Content.Client.Examine;
|
using Content.Client.Examine;
|
||||||
using Content.Client.Strip;
|
using Content.Client.Strip;
|
||||||
using Content.Client.Verbs;
|
using Content.Client.Verbs.UI;
|
||||||
using Content.Shared.Hands;
|
using Content.Shared.Hands;
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Hands.EntitySystems;
|
using Content.Shared.Hands.EntitySystems;
|
||||||
@@ -9,13 +10,11 @@ using Content.Shared.Item;
|
|||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Client.Player;
|
using Robust.Client.Player;
|
||||||
|
using Robust.Client.UserInterface;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using Content.Client.Verbs.UI;
|
|
||||||
using Robust.Client.UserInterface;
|
|
||||||
|
|
||||||
namespace Content.Client.Hands.Systems
|
namespace Content.Client.Hands.Systems
|
||||||
{
|
{
|
||||||
@@ -44,8 +43,8 @@ namespace Content.Client.Hands.Systems
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<SharedHandsComponent, EntRemovedFromContainerMessage>(HandleItemRemoved);
|
SubscribeLocalEvent<HandsComponent, EntRemovedFromContainerMessage>(HandleItemRemoved);
|
||||||
SubscribeLocalEvent<SharedHandsComponent, EntInsertedIntoContainerMessage>(HandleItemAdded);
|
SubscribeLocalEvent<HandsComponent, EntInsertedIntoContainerMessage>(HandleItemAdded);
|
||||||
|
|
||||||
SubscribeLocalEvent<HandsComponent, PlayerAttachedEvent>(HandlePlayerAttached);
|
SubscribeLocalEvent<HandsComponent, PlayerAttachedEvent>(HandlePlayerAttached);
|
||||||
SubscribeLocalEvent<HandsComponent, PlayerDetachedEvent>(HandlePlayerDetached);
|
SubscribeLocalEvent<HandsComponent, PlayerDetachedEvent>(HandlePlayerDetached);
|
||||||
@@ -142,7 +141,7 @@ namespace Content.Client.Hands.Systems
|
|||||||
OnPlayerHandsAdded?.Invoke(hands);
|
OnPlayerHandsAdded?.Invoke(hands);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DoDrop(EntityUid uid, Hand hand, bool doDropInteraction = true, SharedHandsComponent? hands = null)
|
public override void DoDrop(EntityUid uid, Hand hand, bool doDropInteraction = true, HandsComponent? hands = null)
|
||||||
{
|
{
|
||||||
base.DoDrop(uid, hand, doDropInteraction, hands);
|
base.DoDrop(uid, hand, doDropInteraction, hands);
|
||||||
|
|
||||||
@@ -252,7 +251,7 @@ namespace Content.Client.Hands.Systems
|
|||||||
|
|
||||||
#region visuals
|
#region visuals
|
||||||
|
|
||||||
private void HandleItemAdded(EntityUid uid, SharedHandsComponent handComp, ContainerModifiedMessage args)
|
private void HandleItemAdded(EntityUid uid, HandsComponent handComp, ContainerModifiedMessage args)
|
||||||
{
|
{
|
||||||
if (!handComp.Hands.TryGetValue(args.Container.ID, out var hand))
|
if (!handComp.Hands.TryGetValue(args.Container.ID, out var hand))
|
||||||
return;
|
return;
|
||||||
@@ -268,7 +267,7 @@ namespace Content.Client.Hands.Systems
|
|||||||
OnPlayerHandBlocked?.Invoke(hand.Name);
|
OnPlayerHandBlocked?.Invoke(hand.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleItemRemoved(EntityUid uid, SharedHandsComponent handComp, ContainerModifiedMessage args)
|
private void HandleItemRemoved(EntityUid uid, HandsComponent handComp, ContainerModifiedMessage args)
|
||||||
{
|
{
|
||||||
if (!handComp.Hands.TryGetValue(args.Container.ID, out var hand))
|
if (!handComp.Hands.TryGetValue(args.Container.ID, out var hand))
|
||||||
return;
|
return;
|
||||||
@@ -393,12 +392,12 @@ namespace Content.Client.Hands.Systems
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void AddHand(EntityUid uid, Hand newHand, SharedHandsComponent? handsComp = null)
|
private void AddHand(EntityUid uid, Hand newHand, HandsComponent? handsComp = null)
|
||||||
{
|
{
|
||||||
AddHand(uid, newHand.Name, newHand.Location, handsComp);
|
AddHand(uid, newHand.Name, newHand.Location, handsComp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AddHand(EntityUid uid, string handName, HandLocation handLocation, SharedHandsComponent? handsComp = null)
|
public override void AddHand(EntityUid uid, string handName, HandLocation handLocation, HandsComponent? handsComp = null)
|
||||||
{
|
{
|
||||||
base.AddHand(uid, handName, handLocation, handsComp);
|
base.AddHand(uid, handName, handLocation, handsComp);
|
||||||
|
|
||||||
@@ -411,7 +410,7 @@ namespace Content.Client.Hands.Systems
|
|||||||
if (handsComp.ActiveHand == null)
|
if (handsComp.ActiveHand == null)
|
||||||
SetActiveHand(uid, handsComp.Hands[handName], handsComp);
|
SetActiveHand(uid, handsComp.Hands[handName], handsComp);
|
||||||
}
|
}
|
||||||
public override void RemoveHand(EntityUid uid, string handName, SharedHandsComponent? handsComp = null)
|
public override void RemoveHand(EntityUid uid, string handName, HandsComponent? handsComp = null)
|
||||||
{
|
{
|
||||||
if (uid == _playerManager.LocalPlayer?.ControlledEntity && handsComp != null &&
|
if (uid == _playerManager.LocalPlayer?.ControlledEntity && handsComp != null &&
|
||||||
handsComp.Hands.ContainsKey(handName) && uid ==
|
handsComp.Hands.ContainsKey(handName) && uid ==
|
||||||
@@ -423,7 +422,7 @@ namespace Content.Client.Hands.Systems
|
|||||||
base.RemoveHand(uid, handName, handsComp);
|
base.RemoveHand(uid, handName, handsComp);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnHandActivated(SharedHandsComponent? handsComponent)
|
private void OnHandActivated(HandsComponent? handsComponent)
|
||||||
{
|
{
|
||||||
if (handsComponent == null)
|
if (handsComponent == null)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ using Content.Client.Clothing;
|
|||||||
using Content.Client.Examine;
|
using Content.Client.Examine;
|
||||||
using Content.Client.Storage;
|
using Content.Client.Storage;
|
||||||
using Content.Client.UserInterface.Controls;
|
using Content.Client.UserInterface.Controls;
|
||||||
using Content.Client.Verbs;
|
|
||||||
using Content.Client.Verbs.UI;
|
using Content.Client.Verbs.UI;
|
||||||
using Content.Shared.Clothing.Components;
|
using Content.Shared.Clothing.Components;
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
@@ -234,7 +233,7 @@ namespace Content.Client.Inventory
|
|||||||
|
|
||||||
// TODO hud refactor This should also live in a UI Controller
|
// TODO hud refactor This should also live in a UI Controller
|
||||||
private void HoverInSlotButton(EntityUid uid, string slot, SlotControl control,
|
private void HoverInSlotButton(EntityUid uid, string slot, SlotControl control,
|
||||||
InventoryComponent? inventoryComponent = null, SharedHandsComponent? hands = null)
|
InventoryComponent? inventoryComponent = null, HandsComponent? hands = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref inventoryComponent))
|
if (!Resolve(uid, ref inventoryComponent))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Client.Cuffs;
|
|
||||||
using Content.Client.Examine;
|
using Content.Client.Examine;
|
||||||
using Content.Client.Hands;
|
|
||||||
using Content.Client.Strip;
|
using Content.Client.Strip;
|
||||||
using Content.Client.Stylesheets;
|
using Content.Client.Stylesheets;
|
||||||
using Content.Client.UserInterface.Controls;
|
using Content.Client.UserInterface.Controls;
|
||||||
using Content.Client.UserInterface.Systems.Hands.Controls;
|
using Content.Client.UserInterface.Systems.Hands.Controls;
|
||||||
using Content.Client.Verbs;
|
|
||||||
using Content.Client.Verbs.UI;
|
using Content.Client.Verbs.UI;
|
||||||
using Content.Shared.Cuffs;
|
using Content.Shared.Cuffs;
|
||||||
using Content.Shared.Cuffs.Components;
|
using Content.Shared.Cuffs.Components;
|
||||||
@@ -16,7 +13,6 @@ using Content.Shared.IdentityManagement;
|
|||||||
using Content.Shared.Input;
|
using Content.Shared.Input;
|
||||||
using Content.Shared.Inventory;
|
using Content.Shared.Inventory;
|
||||||
using Content.Shared.Strip.Components;
|
using Content.Shared.Strip.Components;
|
||||||
using Content.Shared.Verbs;
|
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
@@ -24,7 +20,6 @@ using Robust.Client.UserInterface.Controls;
|
|||||||
using Robust.Shared.Input;
|
using Robust.Shared.Input;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Utility;
|
|
||||||
using static Content.Client.Inventory.ClientInventorySystem;
|
using static Content.Client.Inventory.ClientInventorySystem;
|
||||||
using static Robust.Client.UserInterface.Control;
|
using static Robust.Client.UserInterface.Control;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Content.Client.Gameplay;
|
using Content.Client.Gameplay;
|
||||||
using Content.Client.Hands;
|
|
||||||
using Content.Client.Hands.Systems;
|
using Content.Client.Hands.Systems;
|
||||||
using Content.Client.UserInterface.Controls;
|
using Content.Client.UserInterface.Controls;
|
||||||
using Content.Client.UserInterface.Systems.Hands.Controls;
|
using Content.Client.UserInterface.Systems.Hands.Controls;
|
||||||
@@ -8,6 +7,7 @@ using Content.Shared.Cooldown;
|
|||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Input;
|
using Content.Shared.Input;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
|
using Robust.Client.Player;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
using Robust.Client.UserInterface.Controllers;
|
using Robust.Client.UserInterface.Controllers;
|
||||||
using Robust.Shared.Input;
|
using Robust.Shared.Input;
|
||||||
@@ -19,6 +19,7 @@ namespace Content.Client.UserInterface.Systems.Hands;
|
|||||||
public sealed class HandsUIController : UIController, IOnStateEntered<GameplayState>, IOnSystemChanged<HandsSystem>
|
public sealed class HandsUIController : UIController, IOnStateEntered<GameplayState>, IOnSystemChanged<HandsSystem>
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IEntityManager _entities = default!;
|
[Dependency] private readonly IEntityManager _entities = default!;
|
||||||
|
[Dependency] private readonly IPlayerManager _player = default!;
|
||||||
|
|
||||||
[UISystemDependency] private readonly HandsSystem _handsSystem = default!;
|
[UISystemDependency] private readonly HandsSystem _handsSystem = default!;
|
||||||
|
|
||||||
@@ -246,7 +247,8 @@ public sealed class HandsUIController : UIController, IOnStateEntered<GameplaySt
|
|||||||
|
|
||||||
if (HandsGui != null &&
|
if (HandsGui != null &&
|
||||||
_playerHandsComponent != null &&
|
_playerHandsComponent != null &&
|
||||||
_playerHandsComponent.Hands.TryGetValue(handName, out var hand))
|
_player.LocalPlayer?.ControlledEntity is { } playerEntity &&
|
||||||
|
_handsSystem.TryGetHand(playerEntity, handName, out var hand, _playerHandsComponent))
|
||||||
{
|
{
|
||||||
HandsGui.UpdatePanelEntity(hand.HeldEntity);
|
HandsGui.UpdatePanelEntity(hand.HeldEntity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using Content.Client.Gameplay;
|
using Content.Client.Gameplay;
|
||||||
using Content.Client.Hands;
|
|
||||||
using Content.Client.Hands.Systems;
|
using Content.Client.Hands.Systems;
|
||||||
using Content.Client.Inventory;
|
using Content.Client.Inventory;
|
||||||
using Content.Client.Storage;
|
using Content.Client.Storage;
|
||||||
using Content.Client.UserInterface.Controls;
|
using Content.Client.UserInterface.Controls;
|
||||||
using Content.Client.UserInterface.Systems.Inventory.Controls;
|
using Content.Client.UserInterface.Systems.Inventory.Controls;
|
||||||
using Content.Client.UserInterface.Systems.Inventory.Windows;
|
using Content.Client.UserInterface.Systems.Inventory.Windows;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Input;
|
using Content.Shared.Input;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
|
|||||||
@@ -1,19 +1,17 @@
|
|||||||
using Content.Client.CombatMode;
|
using Content.Client.CombatMode;
|
||||||
using Content.Client.Gameplay;
|
using Content.Client.Gameplay;
|
||||||
using Content.Client.Hands;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Mobs.Components;
|
using Content.Shared.Mobs.Components;
|
||||||
|
using Content.Shared.StatusEffect;
|
||||||
using Content.Shared.Weapons.Melee;
|
using Content.Shared.Weapons.Melee;
|
||||||
using Content.Shared.Weapons.Melee.Events;
|
using Content.Shared.Weapons.Melee.Events;
|
||||||
using Content.Shared.StatusEffect;
|
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
using Robust.Client.Graphics;
|
using Robust.Client.Graphics;
|
||||||
using Robust.Client.Input;
|
using Robust.Client.Input;
|
||||||
using Robust.Client.Player;
|
using Robust.Client.Player;
|
||||||
using Robust.Client.ResourceManagement;
|
|
||||||
using Robust.Client.State;
|
using Robust.Client.State;
|
||||||
using Robust.Shared.Input;
|
using Robust.Shared.Input;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Player;
|
|
||||||
using Robust.Shared.Players;
|
using Robust.Shared.Players;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Content.Server.Body.Systems;
|
using Content.Server.Body.Systems;
|
||||||
using Content.Server.Buckle.Systems;
|
using Content.Server.Buckle.Systems;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Shared.ActionBlocker;
|
using Content.Shared.ActionBlocker;
|
||||||
using Content.Shared.Body.Components;
|
using Content.Shared.Body.Components;
|
||||||
using Content.Shared.Body.Part;
|
using Content.Shared.Body.Part;
|
||||||
using Content.Shared.Buckle.Components;
|
using Content.Shared.Buckle.Components;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Hands.EntitySystems;
|
using Content.Shared.Hands.EntitySystems;
|
||||||
using Content.Shared.Standing;
|
using Content.Shared.Standing;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Content.Server.Cuffs;
|
using Content.Server.Cuffs;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Shared.Body.Components;
|
using Content.Shared.Body.Components;
|
||||||
using Content.Shared.Cuffs.Components;
|
using Content.Shared.Cuffs.Components;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using Robust.Server.Console;
|
using Robust.Server.Console;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#nullable enable annotations
|
#nullable enable annotations
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Interaction;
|
using Content.Server.Interaction;
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Hands.EntitySystems;
|
using Content.Shared.Hands.EntitySystems;
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.Administration.Logs;
|
using Content.Server.Administration.Logs;
|
||||||
using Content.Server.AME.Components;
|
using Content.Server.AME.Components;
|
||||||
using Content.Server.Power.Components;
|
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
|
using Content.Server.Power.Components;
|
||||||
using Content.Server.Tools;
|
using Content.Server.Tools;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
|
using JetBrains.Annotations;
|
||||||
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using JetBrains.Annotations;
|
|
||||||
|
|
||||||
namespace Content.Server.AME
|
namespace Content.Server.AME
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using Content.Server.Administration.UI;
|
using Content.Server.Administration.UI;
|
||||||
using Content.Server.EUI;
|
using Content.Server.EUI;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Hands.Systems;
|
using Content.Server.Hands.Systems;
|
||||||
using Content.Server.Preferences.Managers;
|
using Content.Server.Preferences.Managers;
|
||||||
using Content.Shared.Administration;
|
using Content.Shared.Administration;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Inventory;
|
using Content.Shared.Inventory;
|
||||||
using Content.Shared.PDA;
|
using Content.Shared.PDA;
|
||||||
using Content.Shared.Preferences;
|
using Content.Shared.Preferences;
|
||||||
@@ -12,7 +12,6 @@ using Robust.Server.GameObjects;
|
|||||||
using Robust.Server.Player;
|
using Robust.Server.Player;
|
||||||
using Robust.Shared.Console;
|
using Robust.Shared.Console;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using InventoryComponent = Content.Shared.Inventory.InventoryComponent;
|
|
||||||
|
|
||||||
namespace Content.Server.Administration.Commands
|
namespace Content.Server.Administration.Commands
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,11 +5,8 @@ using Content.Server.Administration.Components;
|
|||||||
using Content.Server.Atmos;
|
using Content.Server.Atmos;
|
||||||
using Content.Server.Atmos.Components;
|
using Content.Server.Atmos.Components;
|
||||||
using Content.Server.Cargo.Components;
|
using Content.Server.Cargo.Components;
|
||||||
using Content.Server.Cargo.Systems;
|
|
||||||
using Content.Server.Damage.Components;
|
using Content.Server.Damage.Components;
|
||||||
using Content.Server.Doors.Components;
|
|
||||||
using Content.Server.Doors.Systems;
|
using Content.Server.Doors.Systems;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Hands.Systems;
|
using Content.Server.Hands.Systems;
|
||||||
using Content.Server.Power.Components;
|
using Content.Server.Power.Components;
|
||||||
using Content.Server.Stack;
|
using Content.Server.Stack;
|
||||||
@@ -21,10 +18,10 @@ using Content.Shared.Access.Systems;
|
|||||||
using Content.Shared.Administration;
|
using Content.Shared.Administration;
|
||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
using Content.Shared.Construction.Components;
|
using Content.Shared.Construction.Components;
|
||||||
using Content.Shared.Containers.ItemSlots;
|
|
||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
using Content.Shared.Doors.Components;
|
using Content.Shared.Doors.Components;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Inventory;
|
using Content.Shared.Inventory;
|
||||||
using Content.Shared.PDA;
|
using Content.Shared.PDA;
|
||||||
using Content.Shared.Stacks;
|
using Content.Shared.Stacks;
|
||||||
@@ -36,7 +33,6 @@ using Robust.Shared.Map;
|
|||||||
using Robust.Shared.Map.Components;
|
using Robust.Shared.Map.Components;
|
||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Physics.Components;
|
using Robust.Shared.Physics.Components;
|
||||||
using Robust.Shared.Prototypes;
|
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Server.Administration.Systems;
|
namespace Content.Server.Administration.Systems;
|
||||||
|
|||||||
@@ -1,29 +1,29 @@
|
|||||||
using Content.Server.Atmos;
|
using Content.Server.Atmos;
|
||||||
using Content.Server.Atmos.EntitySystems;
|
using Content.Server.Atmos.EntitySystems;
|
||||||
using Content.Server.Botany.Components;
|
using Content.Server.Botany.Components;
|
||||||
using Content.Server.Popups;
|
|
||||||
using Content.Server.Chemistry.EntitySystems;
|
using Content.Server.Chemistry.EntitySystems;
|
||||||
|
using Content.Server.Coordinates.Helpers;
|
||||||
using Content.Server.Fluids.Components;
|
using Content.Server.Fluids.Components;
|
||||||
using Content.Server.Ghost.Roles.Components;
|
using Content.Server.Ghost.Roles.Components;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Kitchen.Components;
|
using Content.Server.Kitchen.Components;
|
||||||
using Content.Shared.Interaction;
|
using Content.Server.Popups;
|
||||||
using Content.Shared.Examine;
|
|
||||||
using Content.Shared.Tag;
|
|
||||||
using Content.Shared.FixedPoint;
|
|
||||||
using Content.Shared.Botany;
|
using Content.Shared.Botany;
|
||||||
using Content.Shared.Chemistry.Components;
|
using Content.Shared.Chemistry.Components;
|
||||||
using Content.Shared.Chemistry.Reagent;
|
using Content.Shared.Chemistry.Reagent;
|
||||||
|
using Content.Shared.Examine;
|
||||||
|
using Content.Shared.FixedPoint;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Content.Shared.Random.Helpers;
|
using Content.Shared.Random.Helpers;
|
||||||
|
using Content.Shared.Tag;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Player;
|
|
||||||
using Robust.Shared.Timing;
|
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Content.Server.Coordinates.Helpers;
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
namespace Content.Server.Botany.Systems
|
namespace Content.Server.Botany.Systems
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ public sealed partial class BuckleSystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!HasComp<SharedHandsComponent>(user))
|
if (!HasComp<HandsComponent>(user))
|
||||||
{
|
{
|
||||||
_popups.PopupEntity(Loc.GetString("buckle-component-no-hands-message"), user, user);
|
_popups.PopupEntity(Loc.GetString("buckle-component-no-hands-message"), user, user);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using Content.Server.Administration.Logs;
|
using Content.Server.Administration.Logs;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
using Content.Shared.Damage.Prototypes;
|
using Content.Shared.Damage.Prototypes;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Interaction.Events;
|
using Content.Shared.Interaction.Events;
|
||||||
using Content.Shared.Item;
|
using Content.Shared.Item;
|
||||||
using Content.Shared.Mobs.Components;
|
using Content.Shared.Mobs.Components;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Hands.Systems;
|
using Content.Server.Hands.Systems;
|
||||||
using Content.Shared.Construction;
|
using Content.Shared.Construction;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Server.Containers;
|
using Robust.Server.Containers;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Hands.Systems;
|
using Content.Server.Hands.Systems;
|
||||||
using Content.Shared.Construction;
|
using Content.Shared.Construction;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Server.Containers;
|
using Robust.Server.Containers;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Content.Server.Construction.Components;
|
using Content.Server.Construction.Components;
|
||||||
using Content.Server.DoAfter;
|
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Storage.Components;
|
using Content.Server.Storage.Components;
|
||||||
using Content.Shared.ActionBlocker;
|
using Content.Shared.ActionBlocker;
|
||||||
using Content.Shared.Construction;
|
using Content.Shared.Construction;
|
||||||
@@ -12,11 +10,11 @@ using Content.Shared.Construction.Steps;
|
|||||||
using Content.Shared.Coordinates;
|
using Content.Shared.Coordinates;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
using Content.Shared.DoAfter;
|
using Content.Shared.DoAfter;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Hands.EntitySystems;
|
using Content.Shared.Hands.EntitySystems;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Inventory;
|
using Content.Shared.Inventory;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.Player;
|
|
||||||
using Robust.Shared.Players;
|
using Robust.Shared.Players;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
using Content.Server.Disease.Components;
|
using Content.Server.Disease.Components;
|
||||||
using Content.Shared.Disease;
|
|
||||||
using Content.Shared.Interaction;
|
|
||||||
using Content.Shared.Inventory;
|
|
||||||
using Content.Shared.Examine;
|
|
||||||
using Content.Server.Popups;
|
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Nutrition.EntitySystems;
|
using Content.Server.Nutrition.EntitySystems;
|
||||||
using Content.Server.Paper;
|
using Content.Server.Paper;
|
||||||
|
using Content.Server.Popups;
|
||||||
using Content.Server.Power.Components;
|
using Content.Server.Power.Components;
|
||||||
using Content.Server.Power.EntitySystems;
|
using Content.Server.Power.EntitySystems;
|
||||||
using Robust.Shared.Random;
|
|
||||||
using Robust.Shared.Player;
|
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Utility;
|
|
||||||
using Content.Shared.Tools.Components;
|
|
||||||
using Content.Server.Station.Systems;
|
using Content.Server.Station.Systems;
|
||||||
|
using Content.Shared.Disease;
|
||||||
using Content.Shared.DoAfter;
|
using Content.Shared.DoAfter;
|
||||||
|
using Content.Shared.Examine;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
|
using Content.Shared.Interaction;
|
||||||
|
using Content.Shared.Inventory;
|
||||||
using Content.Shared.Swab;
|
using Content.Shared.Swab;
|
||||||
|
using Content.Shared.Tools.Components;
|
||||||
|
using Robust.Shared.Audio;
|
||||||
|
using Robust.Shared.Player;
|
||||||
|
using Robust.Shared.Random;
|
||||||
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Server.Disease
|
namespace Content.Server.Disease
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using Content.Server.Construction.Completions;
|
using Content.Server.Construction.Completions;
|
||||||
using Content.Server.Disposal.Tube.Components;
|
using Content.Server.Disposal.Tube.Components;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
using Content.Server.UserInterface;
|
using Content.Server.UserInterface;
|
||||||
using Content.Shared.Destructible;
|
using Content.Shared.Destructible;
|
||||||
using Content.Shared.Disposal.Components;
|
using Content.Shared.Disposal.Components;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Movement.Events;
|
using Content.Shared.Movement.Events;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using Content.Server.Administration.Logs;
|
|||||||
using Content.Server.Atmos.EntitySystems;
|
using Content.Server.Atmos.EntitySystems;
|
||||||
using Content.Server.Disposal.Tube.Components;
|
using Content.Server.Disposal.Tube.Components;
|
||||||
using Content.Server.Disposal.Unit.Components;
|
using Content.Server.Disposal.Unit.Components;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
using Content.Server.Power.Components;
|
using Content.Server.Power.Components;
|
||||||
using Content.Server.Power.EntitySystems;
|
using Content.Server.Power.EntitySystems;
|
||||||
@@ -27,9 +26,9 @@ using Content.Shared.Throwing;
|
|||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
|
using Robust.Shared.Map.Components;
|
||||||
using Robust.Shared.Physics.Components;
|
using Robust.Shared.Physics.Components;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Robust.Shared.Map.Components;
|
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Server.Disposal.Unit.EntitySystems
|
namespace Content.Server.Disposal.Unit.EntitySystems
|
||||||
@@ -469,7 +468,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
|||||||
if (!Resolve(unitId, ref unit))
|
if (!Resolve(unitId, ref unit))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (userId.HasValue && !HasComp<SharedHandsComponent>(userId) && toInsertId != userId) // Mobs like mouse can Jump inside even with no hands
|
if (userId.HasValue && !HasComp<HandsComponent>(userId) && toInsertId != userId) // Mobs like mouse can Jump inside even with no hands
|
||||||
{
|
{
|
||||||
_popupSystem.PopupEntity(Loc.GetString("disposal-unit-no-hands"), userId.Value, userId.Value, PopupType.SmallCaution);
|
_popupSystem.PopupEntity(Loc.GetString("disposal-unit-no-hands"), userId.Value, userId.Value, PopupType.SmallCaution);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Content.Server.Chat.Systems;
|
using Content.Server.Chat.Systems;
|
||||||
using Content.Server.Emoting.Components;
|
using Content.Server.Emoting.Components;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Shared.Chat.Prototypes;
|
using Content.Shared.Chat.Prototypes;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
namespace Content.Server.Emoting.Systems;
|
namespace Content.Server.Emoting.Systems;
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.Atmos.EntitySystems;
|
using Content.Server.Atmos.EntitySystems;
|
||||||
using Content.Server.Chat.Managers;
|
using Content.Server.Chat.Managers;
|
||||||
using Content.Server.GameTicking.Rules.Configurations;
|
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.PDA;
|
using Content.Server.PDA;
|
||||||
using Content.Server.Players;
|
using Content.Server.Players;
|
||||||
using Content.Server.Spawners.Components;
|
using Content.Server.Spawners.Components;
|
||||||
@@ -13,7 +11,7 @@ using Content.Server.TraitorDeathMatch.Components;
|
|||||||
using Content.Shared.CCVar;
|
using Content.Shared.CCVar;
|
||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
using Content.Shared.Damage.Prototypes;
|
using Content.Shared.Damage.Prototypes;
|
||||||
using Content.Shared.FixedPoint;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Inventory;
|
using Content.Shared.Inventory;
|
||||||
using Content.Shared.Mobs.Components;
|
using Content.Shared.Mobs.Components;
|
||||||
using Content.Shared.Mobs.Systems;
|
using Content.Shared.Mobs.Systems;
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
using Content.Shared.Hands.Components;
|
|
||||||
|
|
||||||
namespace Content.Server.Hands.Components;
|
|
||||||
|
|
||||||
[RegisterComponent]
|
|
||||||
[ComponentReference(typeof(SharedHandsComponent))]
|
|
||||||
public sealed class HandsComponent : SharedHandsComponent
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
using Content.Server.Pulling;
|
using Content.Server.Pulling;
|
||||||
using Content.Server.Stack;
|
using Content.Server.Stack;
|
||||||
@@ -110,7 +109,7 @@ namespace Content.Server.Hands.Systems
|
|||||||
RaiseNetworkEvent(new PickupAnimationEvent(item, initialPosition, finalPosition), filter);
|
RaiseNetworkEvent(new PickupAnimationEvent(item, initialPosition, finalPosition), filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleEntityRemoved(EntityUid uid, SharedHandsComponent component, EntRemovedFromContainerMessage args)
|
private void HandleEntityRemoved(EntityUid uid, HandsComponent component, EntRemovedFromContainerMessage args)
|
||||||
{
|
{
|
||||||
if (!Deleted(args.Entity) && TryComp(args.Entity, out HandVirtualItemComponent? @virtual))
|
if (!Deleted(args.Entity) && TryComp(args.Entity, out HandVirtualItemComponent? @virtual))
|
||||||
_virtualSystem.Delete(@virtual, uid);
|
_virtualSystem.Delete(@virtual, uid);
|
||||||
@@ -186,7 +185,7 @@ namespace Content.Server.Hands.Systems
|
|||||||
if (playerSession.AttachedEntity is not {Valid: true} player ||
|
if (playerSession.AttachedEntity is not {Valid: true} player ||
|
||||||
!Exists(player) ||
|
!Exists(player) ||
|
||||||
player.IsInContainer() ||
|
player.IsInContainer() ||
|
||||||
!TryComp(player, out SharedHandsComponent? hands) ||
|
!TryComp(player, out HandsComponent? hands) ||
|
||||||
hands.ActiveHandEntity is not EntityUid throwEnt ||
|
hands.ActiveHandEntity is not EntityUid throwEnt ||
|
||||||
!_actionBlockerSystem.CanThrow(player, throwEnt))
|
!_actionBlockerSystem.CanThrow(player, throwEnt))
|
||||||
return false;
|
return false;
|
||||||
@@ -248,7 +247,7 @@ namespace Content.Server.Hands.Systems
|
|||||||
if (!_actionBlockerSystem.CanInteract(plyEnt, null))
|
if (!_actionBlockerSystem.CanInteract(plyEnt, null))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!TryComp<SharedHandsComponent>(plyEnt, out var hands) || hands.ActiveHand == null)
|
if (!TryComp<HandsComponent>(plyEnt, out var hands) || hands.ActiveHand == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!_inventorySystem.TryGetSlotEntity(plyEnt, equipmentSlot, out var slotEntity) ||
|
if (!_inventorySystem.TryGetSlotEntity(plyEnt, equipmentSlot, out var slotEntity) ||
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using Content.Server.Body.Components;
|
using Content.Server.Body.Components;
|
||||||
using Content.Server.Body.Systems;
|
using Content.Server.Body.Systems;
|
||||||
using Content.Server.Chemistry.EntitySystems;
|
using Content.Server.Chemistry.EntitySystems;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Nutrition.Components;
|
using Content.Server.Nutrition.Components;
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
using Content.Shared.Administration.Logs;
|
using Content.Shared.Administration.Logs;
|
||||||
@@ -11,6 +10,7 @@ using Content.Shared.Chemistry.Reagent;
|
|||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
using Content.Shared.DoAfter;
|
using Content.Shared.DoAfter;
|
||||||
using Content.Shared.FixedPoint;
|
using Content.Shared.FixedPoint;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Hands.EntitySystems;
|
using Content.Shared.Hands.EntitySystems;
|
||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using Content.Server.Chemistry.Components.SolutionManager;
|
using Content.Server.Chemistry.Components.SolutionManager;
|
||||||
using Content.Server.Chemistry.EntitySystems;
|
using Content.Server.Chemistry.EntitySystems;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Nutrition.Components;
|
using Content.Server.Nutrition.Components;
|
||||||
using Content.Shared.Chemistry.Components;
|
using Content.Shared.Chemistry.Components;
|
||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
using Content.Server.Power.Components;
|
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Administration.Logs;
|
using Content.Server.Administration.Logs;
|
||||||
|
using Content.Server.Administration.Managers;
|
||||||
|
using Content.Server.Power.Components;
|
||||||
|
using Content.Shared.Administration;
|
||||||
|
using Content.Shared.Database;
|
||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Power;
|
using Content.Shared.Power;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Content.Shared.Database;
|
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Content.Server.Administration.Managers;
|
|
||||||
using Content.Shared.Administration;
|
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Server.Power.EntitySystems
|
namespace Content.Server.Power.EntitySystems
|
||||||
|
|||||||
@@ -1,16 +1,15 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.GameTicking;
|
using Content.Server.GameTicking;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Shared.Access;
|
using Content.Shared.Access;
|
||||||
using Content.Shared.Access.Components;
|
using Content.Shared.Access.Components;
|
||||||
using Content.Shared.Access.Systems;
|
using Content.Shared.Access.Systems;
|
||||||
using Content.Shared.Containers.ItemSlots;
|
using Content.Shared.Containers.ItemSlots;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Hands.EntitySystems;
|
using Content.Shared.Hands.EntitySystems;
|
||||||
using Content.Shared.Inventory;
|
using Content.Shared.Inventory;
|
||||||
using Content.Shared.PDA;
|
using Content.Shared.PDA;
|
||||||
using Content.Shared.Sandbox;
|
using Content.Shared.Sandbox;
|
||||||
using Robust.Server.Console;
|
using Robust.Server.Console;
|
||||||
using Robust.Server.GameObjects;
|
|
||||||
using Robust.Server.Placement;
|
using Robust.Server.Placement;
|
||||||
using Robust.Server.Player;
|
using Robust.Server.Player;
|
||||||
using Robust.Shared.Enums;
|
using Robust.Shared.Enums;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public sealed class StandingStateSystem : EntitySystem
|
|||||||
var fellEvent = new FellDownEvent(uid);
|
var fellEvent = new FellDownEvent(uid);
|
||||||
RaiseLocalEvent(uid, fellEvent, false);
|
RaiseLocalEvent(uid, fellEvent, false);
|
||||||
|
|
||||||
if (!TryComp(uid, out SharedHandsComponent? handsComp))
|
if (!TryComp(uid, out HandsComponent? handsComp))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var worldRotation = EntityManager.GetComponent<TransformComponent>(uid).WorldRotation.ToVec();
|
var worldRotation = EntityManager.GetComponent<TransformComponent>(uid).WorldRotation.ToVec();
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
using Content.Server.Access.Systems;
|
using Content.Server.Access.Systems;
|
||||||
using Content.Server.DetailExaminable;
|
using Content.Server.DetailExaminable;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Hands.Systems;
|
using Content.Server.Hands.Systems;
|
||||||
using Content.Server.Humanoid;
|
using Content.Server.Humanoid;
|
||||||
using Content.Server.IdentityManagement;
|
using Content.Server.IdentityManagement;
|
||||||
|
using Content.Server.Mind.Commands;
|
||||||
using Content.Server.PDA;
|
using Content.Server.PDA;
|
||||||
using Content.Server.Roles;
|
using Content.Server.Roles;
|
||||||
using Content.Server.Station.Components;
|
using Content.Server.Station.Components;
|
||||||
using Content.Server.Mind.Commands;
|
|
||||||
using Content.Shared.Access.Systems;
|
using Content.Shared.Access.Systems;
|
||||||
using Content.Shared.CCVar;
|
using Content.Shared.CCVar;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Humanoid;
|
using Content.Shared.Humanoid;
|
||||||
using Content.Shared.Humanoid.Prototypes;
|
using Content.Shared.Humanoid.Prototypes;
|
||||||
using Content.Shared.Inventory;
|
using Content.Shared.Inventory;
|
||||||
@@ -25,7 +25,6 @@ using Robust.Shared.Prototypes;
|
|||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
|
|
||||||
namespace Content.Server.Station.Systems;
|
namespace Content.Server.Station.Systems;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace Content.Server.Storage.EntitySystems
|
|||||||
/// <returns>True if item was hidden inside stash</returns>
|
/// <returns>True if item was hidden inside stash</returns>
|
||||||
public bool TryHideItem(EntityUid uid, EntityUid userUid, EntityUid itemToHideUid,
|
public bool TryHideItem(EntityUid uid, EntityUid userUid, EntityUid itemToHideUid,
|
||||||
SecretStashComponent? component = null, ItemComponent? item = null,
|
SecretStashComponent? component = null, ItemComponent? item = null,
|
||||||
MetaDataComponent? itemMeta = null, SharedHandsComponent? hands = null)
|
MetaDataComponent? itemMeta = null, HandsComponent? hands = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref component))
|
if (!Resolve(uid, ref component))
|
||||||
return false;
|
return false;
|
||||||
@@ -94,7 +94,7 @@ namespace Content.Server.Storage.EntitySystems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>True if user received item</returns>
|
/// <returns>True if user received item</returns>
|
||||||
public bool TryGetItem(EntityUid uid, EntityUid userUid, SecretStashComponent? component = null,
|
public bool TryGetItem(EntityUid uid, EntityUid userUid, SecretStashComponent? component = null,
|
||||||
SharedHandsComponent? hands = null)
|
HandsComponent? hands = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref component))
|
if (!Resolve(uid, ref component))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,39 +1,39 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.Hands.Components;
|
using Content.Server.Administration.Managers;
|
||||||
|
using Content.Server.Ghost.Components;
|
||||||
|
using Content.Server.Interaction;
|
||||||
|
using Content.Server.Popups;
|
||||||
using Content.Server.Storage.Components;
|
using Content.Server.Storage.Components;
|
||||||
|
using Content.Shared.ActionBlocker;
|
||||||
|
using Content.Shared.Administration;
|
||||||
|
using Content.Shared.CombatMode;
|
||||||
|
using Content.Shared.Containers.ItemSlots;
|
||||||
|
using Content.Shared.Destructible;
|
||||||
|
using Content.Shared.DoAfter;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
|
using Content.Shared.Hands.EntitySystems;
|
||||||
|
using Content.Shared.Implants.Components;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
|
using Content.Shared.Item;
|
||||||
|
using Content.Shared.Lock;
|
||||||
|
using Content.Shared.Placeable;
|
||||||
|
using Content.Shared.Stacks;
|
||||||
using Content.Shared.Storage;
|
using Content.Shared.Storage;
|
||||||
|
using Content.Shared.Storage.Components;
|
||||||
using Content.Shared.Timing;
|
using Content.Shared.Timing;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
|
using Robust.Server.Containers;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.Player;
|
using Robust.Server.Player;
|
||||||
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
|
using Robust.Shared.Map;
|
||||||
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
using Content.Server.Interaction;
|
|
||||||
using Content.Shared.Hands.EntitySystems;
|
|
||||||
using Content.Shared.Item;
|
|
||||||
using Content.Shared.Placeable;
|
|
||||||
using Content.Shared.Stacks;
|
|
||||||
using Content.Shared.Storage.Components;
|
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Map;
|
|
||||||
using Robust.Shared.Player;
|
|
||||||
using Robust.Server.Containers;
|
|
||||||
using Content.Server.Popups;
|
|
||||||
using Content.Shared.Destructible;
|
|
||||||
using static Content.Shared.Storage.SharedStorageComponent;
|
using static Content.Shared.Storage.SharedStorageComponent;
|
||||||
using Content.Shared.ActionBlocker;
|
|
||||||
using Content.Shared.CombatMode;
|
|
||||||
using Content.Shared.Containers.ItemSlots;
|
|
||||||
using Content.Shared.DoAfter;
|
|
||||||
using Content.Shared.Implants.Components;
|
|
||||||
using Content.Shared.Lock;
|
|
||||||
using Content.Server.Ghost.Components;
|
|
||||||
using Content.Server.Administration.Managers;
|
|
||||||
using Content.Shared.Administration;
|
|
||||||
|
|
||||||
namespace Content.Server.Storage.EntitySystems
|
namespace Content.Server.Storage.EntitySystems
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,24 +1,23 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.Ensnaring;
|
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Shared.CombatMode;
|
|
||||||
using Content.Shared.Hands.Components;
|
|
||||||
using Content.Shared.Hands.EntitySystems;
|
|
||||||
using Content.Shared.IdentityManagement;
|
|
||||||
using Content.Shared.Interaction.Events;
|
|
||||||
using Content.Shared.Inventory;
|
|
||||||
using Content.Shared.Popups;
|
|
||||||
using Content.Shared.Strip.Components;
|
|
||||||
using Content.Shared.Verbs;
|
|
||||||
using Robust.Server.GameObjects;
|
|
||||||
using Content.Server.Administration.Logs;
|
using Content.Server.Administration.Logs;
|
||||||
|
using Content.Server.Ensnaring;
|
||||||
|
using Content.Shared.CombatMode;
|
||||||
using Content.Shared.Cuffs;
|
using Content.Shared.Cuffs;
|
||||||
using Content.Shared.Cuffs.Components;
|
using Content.Shared.Cuffs.Components;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
using Content.Shared.DoAfter;
|
using Content.Shared.DoAfter;
|
||||||
using Content.Shared.Ensnaring.Components;
|
using Content.Shared.Ensnaring.Components;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
|
using Content.Shared.Hands.EntitySystems;
|
||||||
|
using Content.Shared.IdentityManagement;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
|
using Content.Shared.Interaction.Events;
|
||||||
|
using Content.Shared.Inventory;
|
||||||
|
using Content.Shared.Popups;
|
||||||
using Content.Shared.Strip;
|
using Content.Shared.Strip;
|
||||||
|
using Content.Shared.Strip.Components;
|
||||||
|
using Content.Shared.Verbs;
|
||||||
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Server.Strip
|
namespace Content.Server.Strip
|
||||||
@@ -89,8 +88,7 @@ namespace Content.Server.Strip
|
|||||||
|
|
||||||
private void StripHand(EntityUid target, EntityUid user, string handId, StrippableComponent component, HandsComponent userHands)
|
private void StripHand(EntityUid target, EntityUid user, string handId, StrippableComponent component, HandsComponent userHands)
|
||||||
{
|
{
|
||||||
if (!TryComp<HandsComponent>(target, out var targetHands)
|
if (!_handsSystem.TryGetHand(target, handId, out var hand))
|
||||||
|| !targetHands.Hands.TryGetValue(handId, out var hand))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// is the target a handcuff?
|
// is the target a handcuff?
|
||||||
@@ -274,7 +272,7 @@ namespace Content.Server.Strip
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hands.Hands.TryGetValue(handName, out var hand)
|
if (!_handsSystem.TryGetHand(target, handName, out var hand, hands)
|
||||||
|| !_handsSystem.CanPickupToHand(target, userHands.ActiveHandEntity.Value, hand, checkActionBlocker: false, hands))
|
|| !_handsSystem.CanPickupToHand(target, userHands.ActiveHandEntity.Value, hand, checkActionBlocker: false, hands))
|
||||||
{
|
{
|
||||||
_popup.PopupCursor(Loc.GetString("strippable-component-cannot-put-message",("owner", target)), user);
|
_popup.PopupCursor(Loc.GetString("strippable-component-cannot-put-message",("owner", target)), user);
|
||||||
@@ -397,7 +395,7 @@ namespace Content.Server.Strip
|
|||||||
|
|
||||||
bool Check()
|
bool Check()
|
||||||
{
|
{
|
||||||
if (!hands.Hands.TryGetValue(handName, out var hand) || hand.HeldEntity != item)
|
if (!_handsSystem.TryGetHand(target, handName, out var hand, hands) || hand.HeldEntity != item)
|
||||||
{
|
{
|
||||||
_popup.PopupCursor(Loc.GetString("strippable-component-item-slot-free-message",("owner", target)), user);
|
_popup.PopupCursor(Loc.GetString("strippable-component-item-slot-free-message",("owner", target)), user);
|
||||||
return false;
|
return false;
|
||||||
@@ -432,7 +430,7 @@ namespace Content.Server.Strip
|
|||||||
DuplicateCondition = DuplicateConditions.SameTool
|
DuplicateCondition = DuplicateConditions.SameTool
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Check() && hands.Hands.TryGetValue(handName, out var handSlot) && handSlot.HeldEntity != null)
|
if (Check() && _handsSystem.TryGetHand(target, handName, out var handSlot, hands) && handSlot.HeldEntity != null)
|
||||||
{
|
{
|
||||||
_popup.PopupEntity(
|
_popup.PopupEntity(
|
||||||
Loc.GetString("strippable-component-alert-owner",
|
Loc.GetString("strippable-component-alert-owner",
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
|
using Content.Shared.Destructible;
|
||||||
using Content.Shared.Interaction.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Shared.Hands.EntitySystems;
|
using Content.Shared.Hands.EntitySystems;
|
||||||
|
using Content.Shared.Interaction.Components;
|
||||||
using Content.Shared.Storage;
|
using Content.Shared.Storage;
|
||||||
using Content.Shared.Tag;
|
using Content.Shared.Tag;
|
||||||
using Content.Shared.Destructible;
|
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
|
|
||||||
namespace Content.Server.Tools.Innate
|
namespace Content.Server.Tools.Innate
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace Content.Server.UserInterface
|
|||||||
if (!comp.RequireHands)
|
if (!comp.RequireHands)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!TryComp(ev.Sender.AttachedEntity, out SharedHandsComponent? hands) || hands.Hands.Count == 0)
|
if (!TryComp(ev.Sender.AttachedEntity, out HandsComponent? hands) || hands.Hands.Count == 0)
|
||||||
ev.Cancel();
|
ev.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ namespace Content.Server.UserInterface
|
|||||||
if (!_blockerSystem.CanInteract(user, aui.Owner) && (!aui.AllowSpectator || !HasComp<GhostComponent>(user)))
|
if (!_blockerSystem.CanInteract(user, aui.Owner) && (!aui.AllowSpectator || !HasComp<GhostComponent>(user)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (aui.RequireHands && !HasComp<SharedHandsComponent>(user))
|
if (aui.RequireHands && !HasComp<HandsComponent>(user))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!EntityManager.TryGetComponent(user, out ActorComponent? actor)) return false;
|
if (!EntityManager.TryGetComponent(user, out ActorComponent? actor)) return false;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using System.Linq;
|
||||||
using Content.Server.Administration.Managers;
|
using Content.Server.Administration.Managers;
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
using Content.Shared.Administration;
|
using Content.Shared.Administration;
|
||||||
@@ -6,8 +7,6 @@ using Content.Shared.Database;
|
|||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Robust.Server.Player;
|
using Robust.Server.Player;
|
||||||
using Robust.Shared.Player;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Content.Server.Verbs
|
namespace Content.Server.Verbs
|
||||||
{
|
{
|
||||||
@@ -91,7 +90,7 @@ namespace Content.Server.Verbs
|
|||||||
{
|
{
|
||||||
// first get the held item. again.
|
// first get the held item. again.
|
||||||
EntityUid? holding = null;
|
EntityUid? holding = null;
|
||||||
if (TryComp(user, out SharedHandsComponent? hands) &&
|
if (TryComp(user, out HandsComponent? hands) &&
|
||||||
hands.ActiveHandEntity is EntityUid heldEntity)
|
hands.ActiveHandEntity is EntityUid heldEntity)
|
||||||
{
|
{
|
||||||
holding = heldEntity;
|
holding = heldEntity;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.Actions.Events;
|
using Content.Server.Actions.Events;
|
||||||
using Content.Server.Administration.Components;
|
|
||||||
using Content.Server.Body.Components;
|
using Content.Server.Body.Components;
|
||||||
using Content.Server.Body.Systems;
|
using Content.Server.Body.Systems;
|
||||||
using Content.Server.Chemistry.Components;
|
using Content.Server.Chemistry.Components;
|
||||||
@@ -9,18 +8,18 @@ using Content.Server.CombatMode;
|
|||||||
using Content.Server.CombatMode.Disarm;
|
using Content.Server.CombatMode.Disarm;
|
||||||
using Content.Server.Contests;
|
using Content.Server.Contests;
|
||||||
using Content.Server.Examine;
|
using Content.Server.Examine;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Movement.Systems;
|
using Content.Server.Movement.Systems;
|
||||||
using Content.Shared.Administration.Components;
|
using Content.Shared.Administration.Components;
|
||||||
using Content.Shared.CombatMode;
|
using Content.Shared.CombatMode;
|
||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
using Content.Shared.FixedPoint;
|
using Content.Shared.FixedPoint;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
|
using Content.Shared.StatusEffect;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Content.Shared.Weapons.Melee;
|
using Content.Shared.Weapons.Melee;
|
||||||
using Content.Shared.Weapons.Melee.Events;
|
using Content.Shared.Weapons.Melee.Events;
|
||||||
using Content.Shared.StatusEffect;
|
|
||||||
using Robust.Server.Player;
|
using Robust.Server.Player;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Content.Server.Hands.Components;
|
using Content.Server.Actions.Events;
|
||||||
using Content.Server.Hands.Systems;
|
using Content.Server.Hands.Systems;
|
||||||
using Content.Server.Wieldable.Components;
|
using Content.Server.Wieldable.Components;
|
||||||
|
using Content.Shared.DoAfter;
|
||||||
using Content.Shared.Hands;
|
using Content.Shared.Hands;
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Hands.EntitySystems;
|
using Content.Shared.Hands.EntitySystems;
|
||||||
@@ -8,12 +9,9 @@ using Content.Shared.Interaction.Events;
|
|||||||
using Content.Shared.Item;
|
using Content.Shared.Item;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Robust.Shared.Player;
|
|
||||||
using Content.Server.Actions.Events;
|
|
||||||
using Content.Shared.DoAfter;
|
|
||||||
using Content.Shared.Weapons.Melee.Events;
|
using Content.Shared.Weapons.Melee.Events;
|
||||||
using Content.Shared.Wieldable;
|
using Content.Shared.Wieldable;
|
||||||
|
using Robust.Shared.Player;
|
||||||
|
|
||||||
namespace Content.Server.Wieldable
|
namespace Content.Server.Wieldable
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ using System.Diagnostics.CodeAnalysis;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Content.Server.Administration.Logs;
|
using Content.Server.Administration.Logs;
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Power.Components;
|
using Content.Server.Power.Components;
|
||||||
using Content.Shared.DoAfter;
|
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
|
using Content.Shared.DoAfter;
|
||||||
using Content.Shared.GameTicking;
|
using Content.Shared.GameTicking;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Content.Shared.Tools;
|
using Content.Shared.Tools;
|
||||||
|
|||||||
@@ -1,37 +1,37 @@
|
|||||||
using Content.Shared.Damage;
|
|
||||||
using Content.Shared.Hands.EntitySystems;
|
|
||||||
using Content.Server.Disease.Components;
|
|
||||||
using Content.Server.Body.Components;
|
|
||||||
using Content.Server.Atmos.Components;
|
using Content.Server.Atmos.Components;
|
||||||
|
using Content.Server.Atmos.Miasma;
|
||||||
|
using Content.Server.Body.Components;
|
||||||
|
using Content.Server.Body.Systems;
|
||||||
|
using Content.Server.Chat;
|
||||||
|
using Content.Server.Chat.Managers;
|
||||||
|
using Content.Server.Chat.Systems;
|
||||||
|
using Content.Server.CombatMode;
|
||||||
|
using Content.Server.Disease.Components;
|
||||||
|
using Content.Server.Ghost.Roles.Components;
|
||||||
|
using Content.Server.Humanoid;
|
||||||
|
using Content.Server.IdentityManagement;
|
||||||
|
using Content.Server.Inventory;
|
||||||
|
using Content.Server.Mind.Commands;
|
||||||
|
using Content.Server.Mind.Components;
|
||||||
using Content.Server.Nutrition.Components;
|
using Content.Server.Nutrition.Components;
|
||||||
using Content.Server.Popups;
|
using Content.Server.Popups;
|
||||||
using Content.Server.Speech.Components;
|
using Content.Server.Speech.Components;
|
||||||
using Content.Server.Body.Systems;
|
|
||||||
using Content.Server.CombatMode;
|
|
||||||
using Content.Server.Inventory;
|
|
||||||
using Content.Server.Mind.Components;
|
|
||||||
using Content.Server.Chat.Managers;
|
|
||||||
using Content.Server.Ghost.Roles.Components;
|
|
||||||
using Content.Server.Hands.Components;
|
|
||||||
using Content.Server.Mind.Commands;
|
|
||||||
using Content.Server.Temperature.Components;
|
using Content.Server.Temperature.Components;
|
||||||
using Content.Shared.Movement.Components;
|
|
||||||
using Robust.Shared.Prototypes;
|
|
||||||
using Content.Shared.Roles;
|
|
||||||
using Content.Server.Traitor;
|
using Content.Server.Traitor;
|
||||||
using Content.Shared.Zombies;
|
using Content.Shared.Damage;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Server.Atmos.Miasma;
|
using Content.Shared.Hands.EntitySystems;
|
||||||
using Content.Server.Humanoid;
|
|
||||||
using Content.Server.IdentityManagement;
|
|
||||||
using Content.Shared.Humanoid;
|
using Content.Shared.Humanoid;
|
||||||
using Content.Shared.Mobs;
|
using Content.Shared.Mobs;
|
||||||
using Content.Shared.Mobs.Components;
|
using Content.Shared.Mobs.Components;
|
||||||
|
using Content.Shared.Movement.Components;
|
||||||
using Content.Shared.Movement.Systems;
|
using Content.Shared.Movement.Systems;
|
||||||
using Content.Shared.Weapons.Melee;
|
|
||||||
using Content.Server.Chat;
|
|
||||||
using Content.Server.Chat.Systems;
|
|
||||||
using Content.Shared.Nutrition.Components;
|
using Content.Shared.Nutrition.Components;
|
||||||
|
using Content.Shared.Popups;
|
||||||
|
using Content.Shared.Roles;
|
||||||
|
using Content.Shared.Weapons.Melee;
|
||||||
|
using Content.Shared.Zombies;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
|
|
||||||
namespace Content.Server.Zombies
|
namespace Content.Server.Zombies
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ using Content.Shared.Access.Components;
|
|||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Inventory;
|
using Content.Shared.Inventory;
|
||||||
using Content.Shared.PDA;
|
using Content.Shared.PDA;
|
||||||
using Robust.Shared.GameStates;
|
|
||||||
|
|
||||||
namespace Content.Shared.Access.Systems;
|
namespace Content.Shared.Access.Systems;
|
||||||
|
|
||||||
@@ -18,7 +17,7 @@ public abstract class SharedIdCardSystem : EntitySystem
|
|||||||
public bool TryFindIdCard(EntityUid uid, [NotNullWhen(true)] out IdCardComponent? idCard)
|
public bool TryFindIdCard(EntityUid uid, [NotNullWhen(true)] out IdCardComponent? idCard)
|
||||||
{
|
{
|
||||||
// check held item?
|
// check held item?
|
||||||
if (EntityManager.TryGetComponent(uid, out SharedHandsComponent? hands) &&
|
if (EntityManager.TryGetComponent(uid, out HandsComponent? hands) &&
|
||||||
hands.ActiveHandEntity is EntityUid heldItem &&
|
hands.ActiveHandEntity is EntityUid heldItem &&
|
||||||
TryGetIdCard(heldItem, out idCard))
|
TryGetIdCard(heldItem, out idCard))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ using Content.Shared.Popups;
|
|||||||
using Content.Shared.Toggleable;
|
using Content.Shared.Toggleable;
|
||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Physics.Components;
|
using Robust.Shared.Physics.Components;
|
||||||
using Robust.Shared.Physics.Dynamics;
|
|
||||||
using Robust.Shared.Physics.Systems;
|
using Robust.Shared.Physics.Systems;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
@@ -85,7 +84,7 @@ public sealed partial class BlockingSystem : EntitySystem
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var blockQuery = GetEntityQuery<BlockingComponent>();
|
var blockQuery = GetEntityQuery<BlockingComponent>();
|
||||||
var handQuery = GetEntityQuery<SharedHandsComponent>();
|
var handQuery = GetEntityQuery<HandsComponent>();
|
||||||
|
|
||||||
if (!handQuery.TryGetComponent(args.Performer, out var hands))
|
if (!handQuery.TryGetComponent(args.Performer, out var hands))
|
||||||
return;
|
return;
|
||||||
@@ -265,7 +264,7 @@ public sealed partial class BlockingSystem : EntitySystem
|
|||||||
StopBlocking(uid, component, user);
|
StopBlocking(uid, component, user);
|
||||||
|
|
||||||
var userQuery = GetEntityQuery<BlockingUserComponent>();
|
var userQuery = GetEntityQuery<BlockingUserComponent>();
|
||||||
var handQuery = GetEntityQuery<SharedHandsComponent>();
|
var handQuery = GetEntityQuery<HandsComponent>();
|
||||||
|
|
||||||
if (!handQuery.TryGetComponent(user, out var hands))
|
if (!handQuery.TryGetComponent(user, out var hands))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Content.Shared.ActionBlocker;
|
using Content.Shared.ActionBlocker;
|
||||||
|
using Content.Shared.Administration.Logs;
|
||||||
|
using Content.Shared.Database;
|
||||||
using Content.Shared.Destructible;
|
using Content.Shared.Destructible;
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Hands.EntitySystems;
|
using Content.Shared.Hands.EntitySystems;
|
||||||
@@ -8,13 +11,9 @@ using Content.Shared.Popups;
|
|||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Player;
|
|
||||||
using Robust.Shared.Utility;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using Content.Shared.Administration.Logs;
|
|
||||||
using Content.Shared.Database;
|
|
||||||
using Robust.Shared.Network;
|
using Robust.Shared.Network;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Shared.Containers.ItemSlots
|
namespace Content.Shared.Containers.ItemSlots
|
||||||
{
|
{
|
||||||
@@ -193,7 +192,7 @@ namespace Content.Shared.Containers.ItemSlots
|
|||||||
if (args.Handled)
|
if (args.Handled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!EntityManager.TryGetComponent(args.User, out SharedHandsComponent? hands))
|
if (!EntityManager.TryGetComponent(args.User, out HandsComponent? hands))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (var slot in itemSlots.Slots.Values)
|
foreach (var slot in itemSlots.Slots.Values)
|
||||||
@@ -296,7 +295,7 @@ namespace Content.Shared.Containers.ItemSlots
|
|||||||
/// Does not check action blockers.
|
/// Does not check action blockers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>False if failed to insert item</returns>
|
/// <returns>False if failed to insert item</returns>
|
||||||
public bool TryInsertFromHand(EntityUid uid, ItemSlot slot, EntityUid user, SharedHandsComponent? hands = null)
|
public bool TryInsertFromHand(EntityUid uid, ItemSlot slot, EntityUid user, HandsComponent? hands = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(user, ref hands, false))
|
if (!Resolve(user, ref hands, false))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ namespace Content.Shared.Cuffs
|
|||||||
|
|
||||||
public void UpdateCuffState(EntityUid uid, CuffableComponent component)
|
public void UpdateCuffState(EntityUid uid, CuffableComponent component)
|
||||||
{
|
{
|
||||||
var canInteract = TryComp(uid, out SharedHandsComponent? hands) && hands.Hands.Count > component.CuffedHandCount;
|
var canInteract = TryComp(uid, out HandsComponent? hands) && hands.Hands.Count > component.CuffedHandCount;
|
||||||
|
|
||||||
if (canInteract == component.CanStillInteract)
|
if (canInteract == component.CanStillInteract)
|
||||||
return;
|
return;
|
||||||
@@ -344,7 +344,7 @@ namespace Content.Shared.Cuffs
|
|||||||
}
|
}
|
||||||
|
|
||||||
var dirty = false;
|
var dirty = false;
|
||||||
var handCount = CompOrNull<SharedHandsComponent>(owner)?.Count ?? 0;
|
var handCount = CompOrNull<HandsComponent>(owner)?.Count ?? 0;
|
||||||
|
|
||||||
while (cuffable.CuffedHandCount > handCount && cuffable.CuffedHandCount > 0)
|
while (cuffable.CuffedHandCount > handCount && cuffable.CuffedHandCount > 0)
|
||||||
{
|
{
|
||||||
@@ -374,7 +374,7 @@ namespace Content.Shared.Cuffs
|
|||||||
// TODO we probably don't just want to use the generic virtual-item entity, and instead
|
// TODO we probably don't just want to use the generic virtual-item entity, and instead
|
||||||
// want to add our own item, so that use-in-hand triggers an uncuff attempt and the like.
|
// want to add our own item, so that use-in-hand triggers an uncuff attempt and the like.
|
||||||
|
|
||||||
if (!TryComp<SharedHandsComponent>(uid, out var handsComponent))
|
if (!TryComp<HandsComponent>(uid, out var handsComponent))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var freeHands = 0;
|
var freeHands = 0;
|
||||||
@@ -427,7 +427,7 @@ namespace Content.Shared.Cuffs
|
|||||||
if (!Resolve(handcuff, ref handcuffComponent) || !Resolve(target, ref cuffable, false))
|
if (!Resolve(handcuff, ref handcuffComponent) || !Resolve(target, ref cuffable, false))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!TryComp<SharedHandsComponent?>(target, out var hands))
|
if (!TryComp<HandsComponent?>(target, out var hands))
|
||||||
{
|
{
|
||||||
if (_net.IsServer)
|
if (_net.IsServer)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
|
|||||||
|
|
||||||
var time = GameTiming.CurTime;
|
var time = GameTiming.CurTime;
|
||||||
var xformQuery = GetEntityQuery<TransformComponent>();
|
var xformQuery = GetEntityQuery<TransformComponent>();
|
||||||
var handsQuery = GetEntityQuery<SharedHandsComponent>();
|
var handsQuery = GetEntityQuery<HandsComponent>();
|
||||||
|
|
||||||
var enumerator = EntityQueryEnumerator<ActiveDoAfterComponent, DoAfterComponent>();
|
var enumerator = EntityQueryEnumerator<ActiveDoAfterComponent, DoAfterComponent>();
|
||||||
while (enumerator.MoveNext(out var uid, out var active, out var comp))
|
while (enumerator.MoveNext(out var uid, out var active, out var comp))
|
||||||
@@ -28,7 +28,7 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
|
|||||||
DoAfterComponent comp,
|
DoAfterComponent comp,
|
||||||
TimeSpan time,
|
TimeSpan time,
|
||||||
EntityQuery<TransformComponent> xformQuery,
|
EntityQuery<TransformComponent> xformQuery,
|
||||||
EntityQuery<SharedHandsComponent> handsQuery)
|
EntityQuery<HandsComponent> handsQuery)
|
||||||
{
|
{
|
||||||
var dirty = false;
|
var dirty = false;
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
|
|||||||
|
|
||||||
private bool ShouldCancel(DoAfter doAfter,
|
private bool ShouldCancel(DoAfter doAfter,
|
||||||
EntityQuery<TransformComponent> xformQuery,
|
EntityQuery<TransformComponent> xformQuery,
|
||||||
EntityQuery<SharedHandsComponent> handsQuery)
|
EntityQuery<HandsComponent> handsQuery)
|
||||||
{
|
{
|
||||||
var args = doAfter.Args;
|
var args = doAfter.Args;
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
|
|||||||
// (or if there is no item there we need to keep it free).
|
// (or if there is no item there we need to keep it free).
|
||||||
if (args.NeedHand && args.BreakOnHandChange)
|
if (args.NeedHand && args.BreakOnHandChange)
|
||||||
{
|
{
|
||||||
if (!TryComp(args.User, out SharedHandsComponent? handsComponent))
|
if (!TryComp(args.User, out HandsComponent? handsComponent))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
doAfter.InitialHand = handsComponent.ActiveHand?.Name;
|
doAfter.InitialHand = handsComponent.ActiveHand?.Name;
|
||||||
@@ -211,7 +211,7 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Inital checks
|
// Inital checks
|
||||||
if (ShouldCancel(doAfter, GetEntityQuery<TransformComponent>(), GetEntityQuery<SharedHandsComponent>()))
|
if (ShouldCancel(doAfter, GetEntityQuery<TransformComponent>(), GetEntityQuery<HandsComponent>()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (args.AttemptFrequency == AttemptFrequency.StartAndEnd && !TryAttemptEvent(doAfter))
|
if (args.AttemptFrequency == AttemptFrequency.StartAndEnd && !TryAttemptEvent(doAfter))
|
||||||
|
|||||||
@@ -1,23 +1,20 @@
|
|||||||
|
using System.Linq;
|
||||||
using Content.Shared.Access.Components;
|
using Content.Shared.Access.Components;
|
||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
|
using Content.Shared.DoAfter;
|
||||||
using Content.Shared.Doors.Components;
|
using Content.Shared.Doors.Components;
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Stunnable;
|
using Content.Shared.Stunnable;
|
||||||
|
using Content.Shared.Tag;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Physics.Dynamics;
|
|
||||||
using Robust.Shared.Timing;
|
|
||||||
using System.Linq;
|
|
||||||
using Content.Shared.DoAfter;
|
|
||||||
using Content.Shared.Tag;
|
|
||||||
using Content.Shared.Tools.Components;
|
|
||||||
using Content.Shared.Verbs;
|
|
||||||
using Robust.Shared.Physics.Components;
|
using Robust.Shared.Physics.Components;
|
||||||
using Robust.Shared.Physics.Events;
|
using Robust.Shared.Physics.Events;
|
||||||
using Robust.Shared.Physics.Systems;
|
using Robust.Shared.Physics.Systems;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
namespace Content.Shared.Doors.Systems;
|
namespace Content.Shared.Doors.Systems;
|
||||||
|
|
||||||
@@ -285,7 +282,7 @@ public abstract class SharedDoorSystem : EntitySystem
|
|||||||
// component, but no actual hands!? What!? Is this the sound of them head-butting the door to get it to open??
|
// component, but no actual hands!? What!? Is this the sound of them head-butting the door to get it to open??
|
||||||
// I'm 99% sure something is wrong here, but I kind of want to keep it this way.
|
// I'm 99% sure something is wrong here, but I kind of want to keep it this way.
|
||||||
|
|
||||||
if (user != null && TryComp(user.Value, out SharedHandsComponent? hands) && hands.Hands.Count == 0)
|
if (user != null && TryComp(user.Value, out HandsComponent? hands) && hands.Hands.Count == 0)
|
||||||
PlaySound(uid, door.TryOpenDoorSound, AudioParams.Default.WithVolume(-2), user, predicted);
|
PlaySound(uid, door.TryOpenDoorSound, AudioParams.Default.WithVolume(-2), user, predicted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,23 +12,23 @@ public static class HandHelpers
|
|||||||
/// Returns true if any hand is free. This is a LinQ method, not a property, so
|
/// Returns true if any hand is free. This is a LinQ method, not a property, so
|
||||||
/// cache it instead of accessing this multiple times.
|
/// cache it instead of accessing this multiple times.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool IsAnyHandFree(this SharedHandsComponent component) => component.Hands.Values.Any(hand => hand.IsEmpty);
|
public static bool IsAnyHandFree(this HandsComponent component) => component.Hands.Values.Any(hand => hand.IsEmpty);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the number of hands that are not currently holding anything. This is a LinQ method, not a property, so
|
/// Get the number of hands that are not currently holding anything. This is a LinQ method, not a property, so
|
||||||
/// cache it instead of accessing this multiple times.
|
/// cache it instead of accessing this multiple times.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static int CountFreeHands(this SharedHandsComponent component) => component.Hands.Values.Count(hand => hand.IsEmpty);
|
public static int CountFreeHands(this HandsComponent component) => component.Hands.Values.Count(hand => hand.IsEmpty);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get a list of hands that are currently holding nothing. This is a LinQ method, not a property, so cache
|
/// Get a list of hands that are currently holding nothing. This is a LinQ method, not a property, so cache
|
||||||
/// it instead of accessing this multiple times.
|
/// it instead of accessing this multiple times.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static IEnumerable<Hand> GetFreeHands(this SharedHandsComponent component) => component.Hands.Values.Where(hand => !hand.IsEmpty);
|
public static IEnumerable<Hand> GetFreeHands(this HandsComponent component) => component.Hands.Values.Where(hand => !hand.IsEmpty);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get a list of hands that are currently holding nothing. This is a LinQ method, not a property, so cache
|
/// Get a list of hands that are currently holding nothing. This is a LinQ method, not a property, so cache
|
||||||
/// it instead of accessing this multiple times.
|
/// it instead of accessing this multiple times.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static IEnumerable<string> GetFreeHandNames(this SharedHandsComponent component) => GetFreeHands(component).Select(hand => hand.Name);
|
public static IEnumerable<string> GetFreeHandNames(this HandsComponent component) => GetFreeHands(component).Select(hand => hand.Name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
|
using Content.Shared.Hands.EntitySystems;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
namespace Content.Shared.Hands.Components;
|
namespace Content.Shared.Hands.Components;
|
||||||
|
|
||||||
[NetworkedComponent]
|
[RegisterComponent, NetworkedComponent]
|
||||||
public abstract class SharedHandsComponent : Component
|
[Access(typeof(SharedHandsSystem))]
|
||||||
|
public sealed class HandsComponent : Component
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The currently active hand.
|
/// The currently active hand.
|
||||||
@@ -42,6 +44,19 @@ public abstract class SharedHandsComponent : Component
|
|||||||
[DataField("throwRange")]
|
[DataField("throwRange")]
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
public float ThrowRange { get; set; } = 8f;
|
public float ThrowRange { get; set; } = 8f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether or not to add in-hand sprites for held items. Some entities (e.g., drones) don't want these.
|
||||||
|
/// Used by the client.
|
||||||
|
/// </summary>
|
||||||
|
[DataField("showInHands")]
|
||||||
|
public bool ShowInHands = true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data about the current sprite layers that the hand is contributing to the owner entity. Used for sprite in-hands.
|
||||||
|
/// Used by the client.
|
||||||
|
/// </summary>
|
||||||
|
public readonly Dictionary<HandLocation, HashSet<string>> RevealedLayers = new();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
@@ -80,7 +95,7 @@ public sealed class HandsComponentState : ComponentState
|
|||||||
public readonly List<string> HandNames;
|
public readonly List<string> HandNames;
|
||||||
public readonly string? ActiveHand;
|
public readonly string? ActiveHand;
|
||||||
|
|
||||||
public HandsComponentState(SharedHandsComponent handComp)
|
public HandsComponentState(HandsComponent handComp)
|
||||||
{
|
{
|
||||||
Hands = new(handComp.Hands.Values);
|
Hands = new(handComp.Hands.Values);
|
||||||
HandNames = handComp.SortedHands;
|
HandNames = handComp.SortedHands;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
using Content.Shared.Hands.Components;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
|
|
||||||
namespace Content.Shared.Hands.EntitySystems;
|
namespace Content.Shared.Hands.EntitySystems;
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ namespace Content.Shared.Hands.EntitySystems;
|
|||||||
|
|
||||||
public abstract partial class SharedHandsSystem : EntitySystem
|
public abstract partial class SharedHandsSystem : EntitySystem
|
||||||
{
|
{
|
||||||
public bool TrySelect(EntityUid uid, EntityUid? entity, SharedHandsComponent? handsComp = null)
|
public bool TrySelect(EntityUid uid, EntityUid? entity, HandsComponent? handsComp = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp, false))
|
if (!Resolve(uid, ref handsComp, false))
|
||||||
return false;
|
return false;
|
||||||
@@ -20,7 +20,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TrySelect<TComponent>(EntityUid uid, [NotNullWhen(true)] out TComponent? component, SharedHandsComponent? handsComp = null) where TComponent : Component
|
public bool TrySelect<TComponent>(EntityUid uid, [NotNullWhen(true)] out TComponent? component, HandsComponent? handsComp = null) where TComponent : Component
|
||||||
{
|
{
|
||||||
component = null;
|
component = null;
|
||||||
if (!Resolve(uid, ref handsComp, false))
|
if (!Resolve(uid, ref handsComp, false))
|
||||||
@@ -35,5 +35,5 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TrySelectEmptyHand(EntityUid uid, SharedHandsComponent? handsComp = null) => TrySelect(uid, null, handsComp);
|
public bool TrySelectEmptyHand(EntityUid uid, HandsComponent? handsComp = null) => TrySelect(uid, null, handsComp);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attempts to drop the item in the currently active hand.
|
/// Attempts to drop the item in the currently active hand.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool TryDrop(EntityUid uid, EntityCoordinates? targetDropLocation = null, bool checkActionBlocker = true, bool doDropInteraction = true, SharedHandsComponent? handsComp = null)
|
public bool TryDrop(EntityUid uid, EntityCoordinates? targetDropLocation = null, bool checkActionBlocker = true, bool doDropInteraction = true, HandsComponent? handsComp = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp))
|
if (!Resolve(uid, ref handsComp))
|
||||||
return false;
|
return false;
|
||||||
@@ -41,7 +41,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Drops an item at the target location.
|
/// Drops an item at the target location.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool TryDrop(EntityUid uid, EntityUid entity, EntityCoordinates? targetDropLocation = null, bool checkActionBlocker = true, bool doDropInteraction = true, SharedHandsComponent? handsComp = null)
|
public bool TryDrop(EntityUid uid, EntityUid entity, EntityCoordinates? targetDropLocation = null, bool checkActionBlocker = true, bool doDropInteraction = true, HandsComponent? handsComp = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp))
|
if (!Resolve(uid, ref handsComp))
|
||||||
return false;
|
return false;
|
||||||
@@ -55,7 +55,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Drops a hands contents at the target location.
|
/// Drops a hands contents at the target location.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool TryDrop(EntityUid uid, Hand hand, EntityCoordinates? targetDropLocation = null, bool checkActionBlocker = true, bool doDropInteraction = true, SharedHandsComponent? handsComp = null)
|
public bool TryDrop(EntityUid uid, Hand hand, EntityCoordinates? targetDropLocation = null, bool checkActionBlocker = true, bool doDropInteraction = true, HandsComponent? handsComp = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp))
|
if (!Resolve(uid, ref handsComp))
|
||||||
return false;
|
return false;
|
||||||
@@ -90,7 +90,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attempts to move a held item from a hand into a container that is not another hand, without dropping it on the floor in-between.
|
/// Attempts to move a held item from a hand into a container that is not another hand, without dropping it on the floor in-between.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool TryDropIntoContainer(EntityUid uid, EntityUid entity, IContainer targetContainer, bool checkActionBlocker = true, SharedHandsComponent? handsComp = null)
|
public bool TryDropIntoContainer(EntityUid uid, EntityUid entity, IContainer targetContainer, bool checkActionBlocker = true, HandsComponent? handsComp = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp))
|
if (!Resolve(uid, ref handsComp))
|
||||||
return false;
|
return false;
|
||||||
@@ -133,7 +133,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Removes the contents of a hand from its container. Assumes that the removal is allowed. In general, you should not be calling this directly.
|
/// Removes the contents of a hand from its container. Assumes that the removal is allowed. In general, you should not be calling this directly.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void DoDrop(EntityUid uid, Hand hand, bool doDropInteraction = true, SharedHandsComponent? handsComp = null)
|
public virtual void DoDrop(EntityUid uid, Hand hand, bool doDropInteraction = true, HandsComponent? handsComp = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp))
|
if (!Resolve(uid, ref handsComp))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
SubscribeAllEvent<RequestMoveHandItemEvent>(HandleMoveItemFromHand);
|
SubscribeAllEvent<RequestMoveHandItemEvent>(HandleMoveItemFromHand);
|
||||||
SubscribeAllEvent<RequestHandAltInteractEvent>(HandleHandAltInteract);
|
SubscribeAllEvent<RequestHandAltInteractEvent>(HandleHandAltInteract);
|
||||||
|
|
||||||
SubscribeLocalEvent<SharedHandsComponent, ExaminedEvent>(HandleExamined);
|
SubscribeLocalEvent<HandsComponent, ExaminedEvent>(HandleExamined);
|
||||||
|
|
||||||
CommandBinds.Builder
|
CommandBinds.Builder
|
||||||
.Bind(ContentKeyFunctions.UseItemInHand, InputCmdHandler.FromDelegate(HandleUseItem, handle: false, outsidePrediction: false))
|
.Bind(ContentKeyFunctions.UseItemInHand, InputCmdHandler.FromDelegate(HandleUseItem, handle: false, outsidePrediction: false))
|
||||||
@@ -74,7 +74,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
|
|
||||||
private void SwapHandsPressed(ICommonSession? session)
|
private void SwapHandsPressed(ICommonSession? session)
|
||||||
{
|
{
|
||||||
if (!TryComp(session?.AttachedEntity, out SharedHandsComponent? component))
|
if (!TryComp(session?.AttachedEntity, out HandsComponent? component))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!_actionBlocker.CanInteract(session.AttachedEntity.Value, null))
|
if (!_actionBlocker.CanInteract(session.AttachedEntity.Value, null))
|
||||||
@@ -91,7 +91,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
|
|
||||||
private bool DropPressed(ICommonSession? session, EntityCoordinates coords, EntityUid uid)
|
private bool DropPressed(ICommonSession? session, EntityCoordinates coords, EntityUid uid)
|
||||||
{
|
{
|
||||||
if (TryComp(session?.AttachedEntity, out SharedHandsComponent? hands) && hands.ActiveHand != null)
|
if (TryComp(session?.AttachedEntity, out HandsComponent? hands) && hands.ActiveHand != null)
|
||||||
TryDrop(session.AttachedEntity!.Value, hands.ActiveHand, coords, handsComp: hands);
|
TryDrop(session.AttachedEntity!.Value, hands.ActiveHand, coords, handsComp: hands);
|
||||||
|
|
||||||
// always send to server.
|
// always send to server.
|
||||||
@@ -99,7 +99,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public bool TryActivateItemInHand(EntityUid uid, SharedHandsComponent? handsComp = null, string? handName = null)
|
public bool TryActivateItemInHand(EntityUid uid, HandsComponent? handsComp = null, string? handName = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp, false))
|
if (!Resolve(uid, ref handsComp, false))
|
||||||
return false;
|
return false;
|
||||||
@@ -114,7 +114,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
return _interactionSystem.InteractionActivate(uid, held);
|
return _interactionSystem.InteractionActivate(uid, held);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryInteractHandWithActiveHand(EntityUid uid, string handName, SharedHandsComponent? handsComp = null)
|
public bool TryInteractHandWithActiveHand(EntityUid uid, string handName, HandsComponent? handsComp = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp, false))
|
if (!Resolve(uid, ref handsComp, false))
|
||||||
return false;
|
return false;
|
||||||
@@ -132,7 +132,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryUseItemInHand(EntityUid uid, bool altInteract = false, SharedHandsComponent? handsComp = null, string? handName = null)
|
public bool TryUseItemInHand(EntityUid uid, bool altInteract = false, HandsComponent? handsComp = null, string? handName = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp, false))
|
if (!Resolve(uid, ref handsComp, false))
|
||||||
return false;
|
return false;
|
||||||
@@ -153,7 +153,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Moves an entity from one hand to the active hand.
|
/// Moves an entity from one hand to the active hand.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool TryMoveHeldEntityToActiveHand(EntityUid uid, string handName, bool checkActionBlocker = true, SharedHandsComponent? handsComp = null)
|
public bool TryMoveHeldEntityToActiveHand(EntityUid uid, string handName, bool checkActionBlocker = true, HandsComponent? handsComp = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp))
|
if (!Resolve(uid, ref handsComp))
|
||||||
return false;
|
return false;
|
||||||
@@ -178,7 +178,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Actually shows all items/clothing/etc.
|
//TODO: Actually shows all items/clothing/etc.
|
||||||
private void HandleExamined(EntityUid uid, SharedHandsComponent handsComp, ExaminedEvent args)
|
private void HandleExamined(EntityUid uid, HandsComponent handsComp, ExaminedEvent args)
|
||||||
{
|
{
|
||||||
foreach (var inhand in EnumerateHeld(uid, handsComp))
|
foreach (var inhand in EnumerateHeld(uid, handsComp))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
bool checkActionBlocker = true,
|
bool checkActionBlocker = true,
|
||||||
bool animateUser = false,
|
bool animateUser = false,
|
||||||
bool animate = true,
|
bool animate = true,
|
||||||
SharedHandsComponent? handsComp = null,
|
HandsComponent? handsComp = null,
|
||||||
ItemComponent? item = null)
|
ItemComponent? item = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp, false))
|
if (!Resolve(uid, ref handsComp, false))
|
||||||
@@ -54,7 +54,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
bool checkActionBlocker = true,
|
bool checkActionBlocker = true,
|
||||||
bool animateUser = false,
|
bool animateUser = false,
|
||||||
bool animate = true,
|
bool animate = true,
|
||||||
SharedHandsComponent? handsComp = null,
|
HandsComponent? handsComp = null,
|
||||||
ItemComponent? item = null)
|
ItemComponent? item = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp, false))
|
if (!Resolve(uid, ref handsComp, false))
|
||||||
@@ -73,7 +73,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
bool checkActionBlocker = true,
|
bool checkActionBlocker = true,
|
||||||
bool animateUser = false,
|
bool animateUser = false,
|
||||||
bool animate = true,
|
bool animate = true,
|
||||||
SharedHandsComponent? handsComp = null,
|
HandsComponent? handsComp = null,
|
||||||
ItemComponent? item = null)
|
ItemComponent? item = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp, false))
|
if (!Resolve(uid, ref handsComp, false))
|
||||||
@@ -104,7 +104,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanPickupAnyHand(EntityUid uid, EntityUid entity, bool checkActionBlocker = true, SharedHandsComponent? handsComp = null, ItemComponent? item = null)
|
public bool CanPickupAnyHand(EntityUid uid, EntityUid entity, bool checkActionBlocker = true, HandsComponent? handsComp = null, ItemComponent? item = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp, false))
|
if (!Resolve(uid, ref handsComp, false))
|
||||||
return false;
|
return false;
|
||||||
@@ -118,7 +118,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks whether a given item will fit into a specific user's hand. Unless otherwise specified, this will also check the general CanPickup action blocker.
|
/// Checks whether a given item will fit into a specific user's hand. Unless otherwise specified, this will also check the general CanPickup action blocker.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool CanPickupToHand(EntityUid uid, EntityUid entity, Hand hand, bool checkActionBlocker = true, SharedHandsComponent? handsComp = null, ItemComponent? item = null)
|
public bool CanPickupToHand(EntityUid uid, EntityUid entity, Hand hand, bool checkActionBlocker = true, HandsComponent? handsComp = null, ItemComponent? item = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp, false))
|
if (!Resolve(uid, ref handsComp, false))
|
||||||
return false;
|
return false;
|
||||||
@@ -149,7 +149,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
bool checkActionBlocker = true,
|
bool checkActionBlocker = true,
|
||||||
bool animateUser = false,
|
bool animateUser = false,
|
||||||
bool animate = true,
|
bool animate = true,
|
||||||
SharedHandsComponent? handsComp = null,
|
HandsComponent? handsComp = null,
|
||||||
ItemComponent? item = null)
|
ItemComponent? item = null)
|
||||||
{
|
{
|
||||||
if (uid == null
|
if (uid == null
|
||||||
@@ -166,7 +166,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Puts an entity into the player's hand, assumes that the insertion is allowed. In general, you should not be calling this function directly.
|
/// Puts an entity into the player's hand, assumes that the insertion is allowed. In general, you should not be calling this function directly.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void DoPickup(EntityUid uid, Hand hand, EntityUid entity, SharedHandsComponent? hands = null)
|
public virtual void DoPickup(EntityUid uid, Hand hand, EntityUid entity, HandsComponent? hands = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref hands))
|
if (!Resolve(uid, ref hands))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
|
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
|
||||||
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
|
||||||
|
|
||||||
protected event Action<SharedHandsComponent?>? OnHandSetActive;
|
protected event Action<HandsComponent?>? OnHandSetActive;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -31,7 +31,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
CommandBinds.Unregister<SharedHandsSystem>();
|
CommandBinds.Unregister<SharedHandsSystem>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void AddHand(EntityUid uid, string handName, HandLocation handLocation, SharedHandsComponent? handsComp = null)
|
public virtual void AddHand(EntityUid uid, string handName, HandLocation handLocation, HandsComponent? handsComp = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp, false))
|
if (!Resolve(uid, ref handsComp, false))
|
||||||
return;
|
return;
|
||||||
@@ -53,7 +53,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
Dirty(handsComp);
|
Dirty(handsComp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void RemoveHand(EntityUid uid, string handName, SharedHandsComponent? handsComp = null)
|
public virtual void RemoveHand(EntityUid uid, string handName, HandsComponent? handsComp = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp, false))
|
if (!Resolve(uid, ref handsComp, false))
|
||||||
return;
|
return;
|
||||||
@@ -83,7 +83,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get any empty hand. Prioritizes the currently active hand.
|
/// Get any empty hand. Prioritizes the currently active hand.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool TryGetEmptyHand(EntityUid uid, [NotNullWhen(true)] out Hand? emptyHand, SharedHandsComponent? handComp = null)
|
public bool TryGetEmptyHand(EntityUid uid, [NotNullWhen(true)] out Hand? emptyHand, HandsComponent? handComp = null)
|
||||||
{
|
{
|
||||||
emptyHand = null;
|
emptyHand = null;
|
||||||
if (!Resolve(uid, ref handComp, false))
|
if (!Resolve(uid, ref handComp, false))
|
||||||
@@ -104,7 +104,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enumerate over hands, starting with the currently active hand.
|
/// Enumerate over hands, starting with the currently active hand.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<Hand> EnumerateHands(EntityUid uid, SharedHandsComponent? handsComp = null)
|
public IEnumerable<Hand> EnumerateHands(EntityUid uid, HandsComponent? handsComp = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp, false))
|
if (!Resolve(uid, ref handsComp, false))
|
||||||
yield break;
|
yield break;
|
||||||
@@ -122,7 +122,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enumerate over held items, starting with the item in the currently active hand (if there is one).
|
/// Enumerate over held items, starting with the item in the currently active hand (if there is one).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<EntityUid> EnumerateHeld(EntityUid uid, SharedHandsComponent? handsComp = null)
|
public IEnumerable<EntityUid> EnumerateHeld(EntityUid uid, HandsComponent? handsComp = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handsComp, false))
|
if (!Resolve(uid, ref handsComp, false))
|
||||||
yield break;
|
yield break;
|
||||||
@@ -145,7 +145,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>True if the active hand was set to a NEW value. Setting it to the same value returns false and does
|
/// <returns>True if the active hand was set to a NEW value. Setting it to the same value returns false and does
|
||||||
/// not trigger interactions.</returns>
|
/// not trigger interactions.</returns>
|
||||||
public virtual bool TrySetActiveHand(EntityUid uid, string? name, SharedHandsComponent? handComp = null)
|
public virtual bool TrySetActiveHand(EntityUid uid, string? name, HandsComponent? handComp = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handComp))
|
if (!Resolve(uid, ref handComp))
|
||||||
return false;
|
return false;
|
||||||
@@ -164,7 +164,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>True if the active hand was set to a NEW value. Setting it to the same value returns false and does
|
/// <returns>True if the active hand was set to a NEW value. Setting it to the same value returns false and does
|
||||||
/// not trigger interactions.</returns>
|
/// not trigger interactions.</returns>
|
||||||
public bool SetActiveHand(EntityUid uid, Hand? hand, SharedHandsComponent? handComp = null)
|
public bool SetActiveHand(EntityUid uid, Hand? hand, HandsComponent? handComp = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(uid, ref handComp))
|
if (!Resolve(uid, ref handComp))
|
||||||
return false;
|
return false;
|
||||||
@@ -190,7 +190,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsHolding(EntityUid uid, EntityUid? entity, [NotNullWhen(true)] out Hand? inHand, SharedHandsComponent? handsComp = null)
|
public bool IsHolding(EntityUid uid, EntityUid? entity, [NotNullWhen(true)] out Hand? inHand, HandsComponent? handsComp = null)
|
||||||
{
|
{
|
||||||
inHand = null;
|
inHand = null;
|
||||||
if (!Resolve(uid, ref handsComp, false))
|
if (!Resolve(uid, ref handsComp, false))
|
||||||
@@ -207,4 +207,15 @@ public abstract partial class SharedHandsSystem : EntitySystem
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool TryGetHand(EntityUid handsUid, string handId, [NotNullWhen(true)] out Hand? hand,
|
||||||
|
HandsComponent? hands = null)
|
||||||
|
{
|
||||||
|
hand = null;
|
||||||
|
|
||||||
|
if (!Resolve(handsUid, ref hands))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return hands.Hands.TryGetValue(handId, out hand);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ using Robust.Shared.Map;
|
|||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Physics.Components;
|
using Robust.Shared.Physics.Components;
|
||||||
using Robust.Shared.Physics.Systems;
|
using Robust.Shared.Physics.Systems;
|
||||||
using Robust.Shared.Player;
|
|
||||||
using Robust.Shared.Players;
|
using Robust.Shared.Players;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
@@ -284,7 +283,7 @@ namespace Content.Shared.Interaction
|
|||||||
: !checkAccess || InRangeUnobstructed(user, target.Value); // permits interactions with wall mounted entities
|
: !checkAccess || InRangeUnobstructed(user, target.Value); // permits interactions with wall mounted entities
|
||||||
|
|
||||||
// Does the user have hands?
|
// Does the user have hands?
|
||||||
if (!TryComp(user, out SharedHandsComponent? hands) || hands.ActiveHand == null)
|
if (!TryComp(user, out HandsComponent? hands) || hands.ActiveHand == null)
|
||||||
{
|
{
|
||||||
var ev = new InteractNoHandEvent(user, target, coordinates);
|
var ev = new InteractNoHandEvent(user, target, coordinates);
|
||||||
RaiseLocalEvent(user, ev);
|
RaiseLocalEvent(user, ev);
|
||||||
@@ -877,7 +876,7 @@ namespace Content.Shared.Interaction
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Does the user have hands?
|
// Does the user have hands?
|
||||||
if (!HasComp<SharedHandsComponent>(user))
|
if (!HasComp<HandsComponent>(user))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var activateMsg = new ActivateInWorldEvent(user, used);
|
var activateMsg = new ActivateInWorldEvent(user, used);
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Content.Shared.ActionBlocker;
|
|
||||||
using Content.Shared.Clothing.Components;
|
using Content.Shared.Clothing.Components;
|
||||||
using Content.Shared.Hands;
|
using Content.Shared.Hands;
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
@@ -41,7 +40,7 @@ public abstract partial class InventorySystem
|
|||||||
protected void QuickEquip(EntityUid uid, ClothingComponent component, UseInHandEvent args)
|
protected void QuickEquip(EntityUid uid, ClothingComponent component, UseInHandEvent args)
|
||||||
{
|
{
|
||||||
if (!TryComp(args.User, out InventoryComponent? inv)
|
if (!TryComp(args.User, out InventoryComponent? inv)
|
||||||
|| !TryComp(args.User, out SharedHandsComponent? hands)
|
|| !TryComp(args.User, out HandsComponent? hands)
|
||||||
|| !_prototypeManager.TryIndex<InventoryTemplatePrototype>(inv.TemplateId, out var prototype))
|
|| !_prototypeManager.TryIndex<InventoryTemplatePrototype>(inv.TemplateId, out var prototype))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -108,7 +107,7 @@ public abstract partial class InventorySystem
|
|||||||
if (eventArgs.SenderSession.AttachedEntity is not { Valid: true } actor)
|
if (eventArgs.SenderSession.AttachedEntity is not { Valid: true } actor)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!TryComp(actor, out InventoryComponent? inventory) || !TryComp<SharedHandsComponent>(actor, out var hands))
|
if (!TryComp(actor, out InventoryComponent? inventory) || !TryComp<HandsComponent>(actor, out var hands))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var held = hands.ActiveHandEntity;
|
var held = hands.ActiveHandEntity;
|
||||||
@@ -245,7 +244,7 @@ public abstract partial class InventorySystem
|
|||||||
return actor != target &&
|
return actor != target &&
|
||||||
HasComp<StrippableComponent>(target) &&
|
HasComp<StrippableComponent>(target) &&
|
||||||
HasComp<StrippingComponent>(actor) &&
|
HasComp<StrippingComponent>(actor) &&
|
||||||
HasComp<SharedHandsComponent>(actor);
|
HasComp<HandsComponent>(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanEquip(EntityUid uid, EntityUid itemUid, string slot, [NotNullWhen(false)] out string? reason,
|
public bool CanEquip(EntityUid uid, EntityUid itemUid, string slot, [NotNullWhen(false)] out string? reason,
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ using Content.Shared.Hands;
|
|||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Hands.EntitySystems;
|
using Content.Shared.Hands.EntitySystems;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Robust.Shared.Player;
|
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
namespace Content.Shared.Item;
|
namespace Content.Shared.Item;
|
||||||
@@ -27,7 +26,7 @@ public abstract class SharedMultiHandedItemSystem : EntitySystem
|
|||||||
|
|
||||||
private void OnAttemptPickup(EntityUid uid, MultiHandedItemComponent component, GettingPickedUpAttemptEvent args)
|
private void OnAttemptPickup(EntityUid uid, MultiHandedItemComponent component, GettingPickedUpAttemptEvent args)
|
||||||
{
|
{
|
||||||
if (TryComp<SharedHandsComponent>(args.User, out var hands) && hands.CountFreeHands() >= component.HandsNeeded)
|
if (TryComp<HandsComponent>(args.User, out var hands) && hands.CountFreeHands() >= component.HandsNeeded)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
args.Cancel();
|
args.Cancel();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Content.Shared.Emag.Systems;
|
|
||||||
using Content.Shared.Access.Components;
|
using Content.Shared.Access.Components;
|
||||||
using Content.Shared.Access.Systems;
|
using Content.Shared.Access.Systems;
|
||||||
|
using Content.Shared.Emag.Systems;
|
||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
@@ -192,7 +192,7 @@ public sealed class LockSystem : EntitySystem
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool CanToggleLock(EntityUid uid, EntityUid user, bool quiet = true)
|
public bool CanToggleLock(EntityUid uid, EntityUid user, bool quiet = true)
|
||||||
{
|
{
|
||||||
if (!HasComp<SharedHandsComponent>(user))
|
if (!HasComp<HandsComponent>(user))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var ev = new LockToggleAttemptEvent(user, quiet);
|
var ev = new LockToggleAttemptEvent(user, quiet);
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ public abstract class SharedMechSystem : EntitySystem
|
|||||||
if (!Resolve(uid, ref component))
|
if (!Resolve(uid, ref component))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return IsEmpty(component) && _actionBlocker.CanMove(toInsert) && HasComp<SharedHandsComponent>(toInsert);
|
return IsEmpty(component) && _actionBlocker.CanMove(toInsert) && HasComp<HandsComponent>(toInsert);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ namespace Content.Shared.Stacks
|
|||||||
EntityUid item,
|
EntityUid item,
|
||||||
EntityUid user,
|
EntityUid user,
|
||||||
StackComponent? itemStack = null,
|
StackComponent? itemStack = null,
|
||||||
SharedHandsComponent? hands = null)
|
HandsComponent? hands = null)
|
||||||
{
|
{
|
||||||
if (!Resolve(user, ref hands, false))
|
if (!Resolve(user, ref hands, false))
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
using Content.Shared.Audio;
|
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
|
using Content.Shared.Physics;
|
||||||
using Content.Shared.Rotation;
|
using Content.Shared.Rotation;
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Player;
|
|
||||||
using Robust.Shared.Timing;
|
|
||||||
using Robust.Shared.Physics;
|
|
||||||
using Content.Shared.Physics;
|
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Network;
|
|
||||||
using Robust.Shared.Physics.Systems;
|
using Robust.Shared.Physics.Systems;
|
||||||
|
using Robust.Shared.Serialization;
|
||||||
|
|
||||||
namespace Content.Shared.Standing
|
namespace Content.Shared.Standing
|
||||||
{
|
{
|
||||||
@@ -53,7 +49,7 @@ namespace Content.Shared.Standing
|
|||||||
public bool Down(EntityUid uid, bool playSound = true, bool dropHeldItems = true,
|
public bool Down(EntityUid uid, bool playSound = true, bool dropHeldItems = true,
|
||||||
StandingStateComponent? standingState = null,
|
StandingStateComponent? standingState = null,
|
||||||
AppearanceComponent? appearance = null,
|
AppearanceComponent? appearance = null,
|
||||||
SharedHandsComponent? hands = null)
|
HandsComponent? hands = null)
|
||||||
{
|
{
|
||||||
// TODO: This should actually log missing comps...
|
// TODO: This should actually log missing comps...
|
||||||
if (!Resolve(uid, ref standingState, false))
|
if (!Resolve(uid, ref standingState, false))
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem
|
|||||||
|
|
||||||
private void OnRelayMovement(EntityUid uid, SharedEntityStorageComponent component, ref ContainerRelayMovementEntityEvent args)
|
private void OnRelayMovement(EntityUid uid, SharedEntityStorageComponent component, ref ContainerRelayMovementEntityEvent args)
|
||||||
{
|
{
|
||||||
if (!HasComp<SharedHandsComponent>(args.Entity))
|
if (!HasComp<HandsComponent>(args.Entity))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_timing.CurTime < component.LastInternalOpenAttempt + SharedEntityStorageComponent.InternalOpenAttemptDelay)
|
if (_timing.CurTime < component.LastInternalOpenAttempt + SharedEntityStorageComponent.InternalOpenAttemptDelay)
|
||||||
@@ -311,7 +311,7 @@ public abstract class SharedEntityStorageSystem : EntitySystem
|
|||||||
if (!Resolve(target, ref component))
|
if (!Resolve(target, ref component))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!HasComp<SharedHandsComponent>(user))
|
if (!HasComp<HandsComponent>(user))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (component.IsWeldedShut)
|
if (component.IsWeldedShut)
|
||||||
|
|||||||
@@ -43,14 +43,14 @@ public abstract class SharedStrippableSystem : EntitySystem
|
|||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
args.CanDrop |= uid == args.User &&
|
args.CanDrop |= uid == args.User &&
|
||||||
HasComp<StrippableComponent>(args.Dragged) &&
|
HasComp<StrippableComponent>(args.Dragged) &&
|
||||||
HasComp<SharedHandsComponent>(args.User);
|
HasComp<HandsComponent>(args.User);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCanDrop(EntityUid uid, StrippableComponent component, ref CanDropDraggedEvent args)
|
private void OnCanDrop(EntityUid uid, StrippableComponent component, ref CanDropDraggedEvent args)
|
||||||
{
|
{
|
||||||
args.CanDrop |= args.Target == args.User &&
|
args.CanDrop |= args.Target == args.User &&
|
||||||
HasComp<StrippingComponent>(args.User) &&
|
HasComp<StrippingComponent>(args.User) &&
|
||||||
HasComp<SharedHandsComponent>(args.User);
|
HasComp<HandsComponent>(args.User);
|
||||||
|
|
||||||
if (args.CanDrop)
|
if (args.CanDrop)
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Content.Shared.ActionBlocker;
|
using Content.Shared.ActionBlocker;
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
@@ -6,9 +7,7 @@ using Content.Shared.Tabletop.Events;
|
|||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Network;
|
using Robust.Shared.Network;
|
||||||
using Robust.Shared.Players;
|
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
|
|
||||||
namespace Content.Shared.Tabletop
|
namespace Content.Shared.Tabletop
|
||||||
{
|
{
|
||||||
@@ -114,7 +113,7 @@ namespace Content.Shared.Tabletop
|
|||||||
// CanSeeTable checks interaction action blockers. So no need to check them here.
|
// CanSeeTable checks interaction action blockers. So no need to check them here.
|
||||||
// If this ever changes, so that ghosts can spectate games, then the check needs to be moved here.
|
// If this ever changes, so that ghosts can spectate games, then the check needs to be moved here.
|
||||||
|
|
||||||
return TryComp(playerEntity, out SharedHandsComponent? hands) && hands.Hands.Count > 0;
|
return TryComp(playerEntity, out HandsComponent? hands) && hands.Hands.Count > 0;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using System.Linq;
|
||||||
using Content.Shared.Administration.Logs;
|
using Content.Shared.Administration.Logs;
|
||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
@@ -6,9 +7,6 @@ using Content.Shared.Physics.Pull;
|
|||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Physics.Dynamics;
|
|
||||||
using System.Linq;
|
|
||||||
using Content.Shared.Sound.Components;
|
|
||||||
using Robust.Shared.Physics.Components;
|
using Robust.Shared.Physics.Components;
|
||||||
using Robust.Shared.Physics.Events;
|
using Robust.Shared.Physics.Events;
|
||||||
using Robust.Shared.Physics.Systems;
|
using Robust.Shared.Physics.Systems;
|
||||||
@@ -129,7 +127,7 @@ namespace Content.Shared.Throwing
|
|||||||
|
|
||||||
// Unfortunately we can't check for hands containers as they have specific names.
|
// Unfortunately we can't check for hands containers as they have specific names.
|
||||||
if (uid.TryGetContainerMan(out var containerManager) &&
|
if (uid.TryGetContainerMan(out var containerManager) &&
|
||||||
EntityManager.HasComponent<SharedHandsComponent>(containerManager.Owner))
|
EntityManager.HasComponent<HandsComponent>(containerManager.Owner))
|
||||||
{
|
{
|
||||||
EntityManager.RemoveComponent(landing, thrownItem);
|
EntityManager.RemoveComponent(landing, thrownItem);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ namespace Content.Shared.Verbs
|
|||||||
var canInteract = force || _actionBlockerSystem.CanInteract(user, target);
|
var canInteract = force || _actionBlockerSystem.CanInteract(user, target);
|
||||||
|
|
||||||
EntityUid? @using = null;
|
EntityUid? @using = null;
|
||||||
if (TryComp(user, out SharedHandsComponent? hands) && (force || _actionBlockerSystem.CanUseHeldEntity(user)))
|
if (TryComp(user, out HandsComponent? hands) && (force || _actionBlockerSystem.CanUseHeldEntity(user)))
|
||||||
{
|
{
|
||||||
@using = hands.ActiveHandEntity;
|
@using = hands.ActiveHandEntity;
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ namespace Content.Shared.Verbs
|
|||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// This may be null if the user has no hands.
|
/// This may be null if the user has no hands.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public readonly SharedHandsComponent? Hands;
|
public readonly HandsComponent? Hands;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The entity currently being held by the active hand.
|
/// The entity currently being held by the active hand.
|
||||||
@@ -123,7 +123,7 @@ namespace Content.Shared.Verbs
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public readonly EntityUid? Using;
|
public readonly EntityUid? Using;
|
||||||
|
|
||||||
public GetVerbsEvent(EntityUid user, EntityUid target, EntityUid? @using, SharedHandsComponent? hands, bool canInteract, bool canAccess)
|
public GetVerbsEvent(EntityUid user, EntityUid target, EntityUid? @using, HandsComponent? hands, bool canInteract, bool canAccess)
|
||||||
{
|
{
|
||||||
User = user;
|
User = user;
|
||||||
Target = target;
|
Target = target;
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Use inhands entity if we got one.
|
// Use inhands entity if we got one.
|
||||||
if (EntityManager.TryGetComponent(entity, out SharedHandsComponent? hands) &&
|
if (EntityManager.TryGetComponent(entity, out HandsComponent? hands) &&
|
||||||
hands.ActiveHandEntity is { } held)
|
hands.ActiveHandEntity is { } held)
|
||||||
{
|
{
|
||||||
if (EntityManager.TryGetComponent(held, out melee))
|
if (EntityManager.TryGetComponent(held, out melee))
|
||||||
|
|||||||
@@ -10,18 +10,18 @@ using Content.Shared.Hands.Components;
|
|||||||
using Content.Shared.Interaction.Events;
|
using Content.Shared.Interaction.Events;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Content.Shared.Projectiles;
|
using Content.Shared.Projectiles;
|
||||||
|
using Content.Shared.Tag;
|
||||||
using Content.Shared.Throwing;
|
using Content.Shared.Throwing;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
using Content.Shared.Weapons.Ranged.Components;
|
using Content.Shared.Weapons.Ranged.Components;
|
||||||
using Content.Shared.Weapons.Ranged.Events;
|
using Content.Shared.Weapons.Ranged.Events;
|
||||||
using Content.Shared.Tag;
|
|
||||||
using Robust.Shared.Audio;
|
using Robust.Shared.Audio;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameStates;
|
using Robust.Shared.GameStates;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Network;
|
using Robust.Shared.Network;
|
||||||
using Robust.Shared.Physics.Systems;
|
|
||||||
using Robust.Shared.Physics.Components;
|
using Robust.Shared.Physics.Components;
|
||||||
|
using Robust.Shared.Physics.Systems;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
@@ -191,7 +191,7 @@ public abstract partial class SharedGunSystem : EntitySystem
|
|||||||
if (!_combatMode.IsInCombatMode(entity))
|
if (!_combatMode.IsInCombatMode(entity))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (EntityManager.TryGetComponent(entity, out SharedHandsComponent? hands) &&
|
if (EntityManager.TryGetComponent(entity, out HandsComponent? hands) &&
|
||||||
hands.ActiveHandEntity is { } held &&
|
hands.ActiveHandEntity is { } held &&
|
||||||
TryComp(held, out GunComponent? gun))
|
TryComp(held, out GunComponent? gun))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
using Content.Shared.Audio;
|
|
||||||
using Content.Shared.Popups;
|
|
||||||
using Robust.Shared.Random;
|
|
||||||
using Robust.Shared.Physics.Systems;
|
|
||||||
using Content.Shared.Hands.Components;
|
|
||||||
using Robust.Shared.GameStates;
|
|
||||||
using Content.Shared.Weapons.Ranged.Events;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using Content.Shared.Audio;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
|
using Content.Shared.Popups;
|
||||||
using Content.Shared.Projectiles;
|
using Content.Shared.Projectiles;
|
||||||
|
using Content.Shared.Weapons.Ranged.Events;
|
||||||
|
using Robust.Shared.GameStates;
|
||||||
|
using Robust.Shared.Physics.Systems;
|
||||||
|
using Robust.Shared.Random;
|
||||||
|
|
||||||
namespace Content.Shared.Weapons.Reflect;
|
namespace Content.Shared.Weapons.Reflect;
|
||||||
|
|
||||||
@@ -24,8 +24,8 @@ public abstract class SharedReflectSystem : EntitySystem
|
|||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
SubscribeLocalEvent<SharedHandsComponent, ProjectileReflectAttemptEvent>(OnHandReflectProjectile);
|
SubscribeLocalEvent<HandsComponent, ProjectileReflectAttemptEvent>(OnHandReflectProjectile);
|
||||||
SubscribeLocalEvent<SharedHandsComponent, HitScanReflectAttemptEvent>(OnHandsReflectHitscan);
|
SubscribeLocalEvent<HandsComponent, HitScanReflectAttemptEvent>(OnHandsReflectHitscan);
|
||||||
|
|
||||||
SubscribeLocalEvent<ReflectComponent, ComponentHandleState>(OnHandleState);
|
SubscribeLocalEvent<ReflectComponent, ComponentHandleState>(OnHandleState);
|
||||||
SubscribeLocalEvent<ReflectComponent, ComponentGetState>(OnGetState);
|
SubscribeLocalEvent<ReflectComponent, ComponentGetState>(OnGetState);
|
||||||
@@ -45,7 +45,7 @@ public abstract class SharedReflectSystem : EntitySystem
|
|||||||
args.State = new ReflectComponentState(component.Enabled, component.EnergeticChance, component.KineticChance, component.Spread);
|
args.State = new ReflectComponentState(component.Enabled, component.EnergeticChance, component.KineticChance, component.Spread);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnHandReflectProjectile(EntityUid uid, SharedHandsComponent hands, ref ProjectileReflectAttemptEvent args)
|
private void OnHandReflectProjectile(EntityUid uid, HandsComponent hands, ref ProjectileReflectAttemptEvent args)
|
||||||
{
|
{
|
||||||
if (args.Cancelled)
|
if (args.Cancelled)
|
||||||
return;
|
return;
|
||||||
@@ -78,7 +78,7 @@ public abstract class SharedReflectSystem : EntitySystem
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnHandsReflectHitscan(EntityUid uid, SharedHandsComponent hands, ref HitScanReflectAttemptEvent args)
|
private void OnHandsReflectHitscan(EntityUid uid, HandsComponent hands, ref HitScanReflectAttemptEvent args)
|
||||||
{
|
{
|
||||||
if (args.Reflected)
|
if (args.Reflected)
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user