biomass reclaimer suicide (#11649)

* biomass reclaimer suicide

* Update BiomassReclaimerSystem.cs
This commit is contained in:
Nemanja
2022-10-04 07:08:46 -04:00
committed by GitHub
parent 7131b4fba0
commit b903c3a33f
2 changed files with 21 additions and 0 deletions

View File

@@ -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<BiomassReclaimerComponent, AfterInteractUsingEvent>(OnAfterInteractUsing);
SubscribeLocalEvent<BiomassReclaimerComponent, ClimbedOnEvent>(OnClimbedOn);
SubscribeLocalEvent<BiomassReclaimerComponent, RefreshPartsEvent>(OnRefreshParts);
SubscribeLocalEvent<BiomassReclaimerComponent, SuicideEvent>(OnSuicide);
SubscribeLocalEvent<ReclaimSuccessfulEvent>(OnReclaimSuccessful);
SubscribeLocalEvent<ReclaimCancelledEvent>(OnReclaimCancelled);
}
private void OnSuicide(EntityUid uid, BiomassReclaimerComponent component, SuicideEvent args)
{
if (args.Handled)
return;
if (HasComp<ActiveBiomassReclaimerComponent>(uid))
return;
if (TryComp<ApcPowerReceiverComponent>(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);

View File

@@ -0,0 +1 @@
biomass-reclaimer-suicide-others = {CAPITALIZE(THE($victim))} threw themselves into the biomass reclaimer!