multi-handed item component (#12523)
* multi-handed item component * pretty fucking obvious missed portion of this * holy shit was i on crack wtf was that code * DEWIT RIGHT
This commit is contained in:
23
Content.Server/Item/MultiHandedItemSystem.cs
Normal file
23
Content.Server/Item/MultiHandedItemSystem.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Content.Server.Hands.Systems;
|
||||
using Content.Shared.Hands;
|
||||
using Content.Shared.Item;
|
||||
|
||||
namespace Content.Server.Item;
|
||||
|
||||
public sealed class MultiHandedItemSystem : SharedMultiHandedItemSystem
|
||||
{
|
||||
[Dependency] private readonly HandVirtualItemSystem _virtualItem = default!;
|
||||
|
||||
protected override void OnEquipped(EntityUid uid, MultiHandedItemComponent component, GotEquippedHandEvent args)
|
||||
{
|
||||
for (var i = 0; i < component.HandsNeeded - 1; i++)
|
||||
{
|
||||
_virtualItem.TrySpawnVirtualItemInHand(uid, args.User);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnUnequipped(EntityUid uid, MultiHandedItemComponent component, GotUnequippedHandEvent args)
|
||||
{
|
||||
_virtualItem.DeleteInHandsMatching(args.User, uid);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user