Inflatable Module (#35100)

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
This commit is contained in:
FungiFellow
2025-11-23 15:22:30 -06:00
committed by Vanessa
co-authored by ArtisticRoomba PJB3005
parent 75bc8e0c10
commit f9ac85552e
20 changed files with 199 additions and 51 deletions
@@ -0,0 +1,39 @@
using Content.Shared.Engineering.Components;
using Content.Shared.Interaction;
using Content.Shared.Popups;
using Content.Shared.Weapons.Melee.Balloon;
namespace Content.Shared.Engineering.Systems;
/// <summary>
/// Implements <see cref="InflatableSafeDisassemblyComponent"/>
/// </summary>
public sealed class InflatableSafeDisassemblySystem : EntitySystem
{
[Dependency] private readonly DisassembleOnAltVerbSystem _disassembleOnAltVerbSystem = null!;
[Dependency] private readonly SharedPopupSystem _popupSystem = null!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<InflatableSafeDisassemblyComponent, InteractUsingEvent>(InteractHandler);
}
private void InteractHandler(Entity<InflatableSafeDisassemblyComponent> ent, ref InteractUsingEvent args)
{
if (args.Handled)
return;
if (!HasComp<BalloonPopperComponent>(args.Used))
return;
_popupSystem.PopupPredicted(
Loc.GetString("inflatable-safe-disassembly", ("item", args.Used), ("target", ent.Owner)),
ent,
args.User);
_disassembleOnAltVerbSystem.StartDisassembly((ent, Comp<DisassembleOnAltVerbComponent>(ent)), args.User);
args.Handled = true;
}
}