diff --git a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs index 3f4f49cf6c..aef21ac2c4 100644 --- a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs +++ b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs @@ -20,6 +20,8 @@ using Content.Server.DoAfter; using Content.Server.Humanoid; using Content.Server.Mind.Components; using Content.Server.Stack; +using Content.Shared.Interaction.Events; +using Content.Shared.Popups; using Robust.Shared.Player; using Robust.Shared.Random; using Robust.Shared.Configuration; @@ -36,6 +38,7 @@ namespace Content.Server.Medical.BiomassReclaimer [Dependency] private readonly SharedJitteringSystem _jitteringSystem = default!; [Dependency] private readonly SharedAudioSystem _sharedAudioSystem = default!; [Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!; + [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly SpillableSystem _spillableSystem = default!; [Dependency] private readonly ThrowingSystem _throwing = default!; [Dependency] private readonly IRobustRandom _robustRandom = default!; @@ -90,10 +93,27 @@ namespace Content.Server.Medical.BiomassReclaimer SubscribeLocalEvent(OnAfterInteractUsing); SubscribeLocalEvent(OnClimbedOn); SubscribeLocalEvent(OnRefreshParts); + SubscribeLocalEvent(OnSuicide); SubscribeLocalEvent(OnReclaimSuccessful); SubscribeLocalEvent(OnReclaimCancelled); } + private void OnSuicide(EntityUid uid, BiomassReclaimerComponent component, SuicideEvent args) + { + if (args.Handled) + return; + + if (HasComp(uid)) + return; + + if (TryComp(uid, out var power) && !power.Powered) + return; + + _popup.PopupEntity(Loc.GetString("biomass-reclaimer-suicide-others", ("victim", args.Victim)), uid, Filter.Pvs(uid), PopupType.LargeCaution); + StartProcessing(args.Victim, component); + args.SetHandled(SuicideKind.Blunt); + } + private void OnInit(EntityUid uid, ActiveBiomassReclaimerComponent component, ComponentInit args) { _jitteringSystem.AddJitter(uid, -10, 100); diff --git a/Resources/Locale/en-US/medical/components/biomass-reclaimer-component.ftl b/Resources/Locale/en-US/medical/components/biomass-reclaimer-component.ftl new file mode 100644 index 0000000000..31dad3cb7f --- /dev/null +++ b/Resources/Locale/en-US/medical/components/biomass-reclaimer-component.ftl @@ -0,0 +1 @@ +biomass-reclaimer-suicide-others = {CAPITALIZE(THE($victim))} threw themselves into the biomass reclaimer! \ No newline at end of file