Files
tbd-station-14/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Clothing.cs
Fildrance 291ccfbe23 Spray nozzle can suck puddles into tank directly! (#30600)
* feat: now vacuum cleaner can suck solutions from floor

* refactor using AbsorbentSystem instead of separate vacuum cleaner

* refactor: remove unused vacuum cleaner files

* refactor: renamed ConnectedContainerComponent to SlotBasedConnectedContainerComponent (and system)

* fix: fix invalid comp name

* fix: no more spray nozzle messaging about water inside bottles etc.

* refactor: minor refactor in SlotBasedConnectedContainerSystem and adjustments after merge

* refactor: cleanups

* refactor: renaming

* refactor: update to use _puddleSystem.GetAbsorbentReagents

* refactor: changed interactions with SlotBasedConnectedContainerSystem into events

* refactor: new sound and action delay adjusted to sound (amount tweaked a bit accordingly, almost)

* refactor: added networking for SlotBasedConnectedContainerComponent

* fix attribution for vacuum-cleaner-fast.ogg

* trying to fix multi-license for mix sound file

* remove empty line

* refactor: remove trailing whitespace

* by ref struct, brother

---------

Co-authored-by: pa.pecherskij <pa.pecherskij@interfax.ru>
Co-authored-by: EmoGarbage404 <retron404@gmail.com>
2025-05-25 23:36:16 -04:00

35 lines
1.3 KiB
C#

using Content.Shared.Containers;
using Content.Shared.Weapons.Ranged.Components;
using Content.Shared.Weapons.Ranged.Events;
namespace Content.Shared.Weapons.Ranged.Systems;
public partial class SharedGunSystem
{
private void InitializeClothing()
{
SubscribeLocalEvent<ClothingSlotAmmoProviderComponent, TakeAmmoEvent>(OnClothingTakeAmmo);
SubscribeLocalEvent<ClothingSlotAmmoProviderComponent, GetAmmoCountEvent>(OnClothingAmmoCount);
}
private void OnClothingTakeAmmo(EntityUid uid, ClothingSlotAmmoProviderComponent component, TakeAmmoEvent args)
{
var getConnectedContainerEvent = new GetConnectedContainerEvent();
RaiseLocalEvent(uid, ref getConnectedContainerEvent);
if(!getConnectedContainerEvent.ContainerEntity.HasValue)
return;
RaiseLocalEvent(getConnectedContainerEvent.ContainerEntity.Value, args);
}
private void OnClothingAmmoCount(EntityUid uid, ClothingSlotAmmoProviderComponent component, ref GetAmmoCountEvent args)
{
var getConnectedContainerEvent = new GetConnectedContainerEvent();
RaiseLocalEvent(uid, ref getConnectedContainerEvent);
if (!getConnectedContainerEvent.ContainerEntity.HasValue)
return;
RaiseLocalEvent(getConnectedContainerEvent.ContainerEntity.Value, ref args);
}
}