make emagged marker component (fixed version of #13867) (#14096)

* The all-in-one hacking solution
The thinking man's lockpick
The iconic EMAG

* emagged medbay's stasis bed

* left med, emagged sec' apc

* went back to chem, emagged the dispenser

* emagged the fax while i was there

* had a donut while waiting for emag to charge

* i broke into the bridge then announced 'mandatory johnson inspection in medical'

* get system instead of dependency

* feedback

* net suggestion

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* use EnsureComp and import NetworkedComponent

---------

Co-authored-by: deltanedas <user@zenith>
Co-authored-by: deltanedas <deltanedas@laptop>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
deltanedas
2023-02-19 01:03:06 +00:00
committed by GitHub
parent 04a0faf478
commit 98b02b3d97
19 changed files with 65 additions and 84 deletions

View File

@@ -8,6 +8,7 @@ using Content.Server.Power.EntitySystems;
using Content.Server.Recycling.Components;
using Content.Shared.Audio;
using Content.Shared.Body.Components;
using Content.Shared.Emag.Components;
using Content.Shared.Emag.Systems;
using Content.Shared.Examine;
using Content.Shared.IdentityManagement;
@@ -131,7 +132,7 @@ namespace Content.Server.Recycling
// Can only recycle things that are tagged trash or recyclable... And also check the safety of the thing to recycle.
if (!_tags.HasAnyTag(entity, "Trash", "Recyclable") &&
(!TryComp(entity, out recyclable) || !recyclable.Safe && component.Safe))
(!TryComp(entity, out recyclable) || !recyclable.Safe && !HasComp<EmaggedComponent>(component.Owner)))
{
return;
}
@@ -162,7 +163,7 @@ namespace Content.Server.Recycling
private bool CanGib(RecyclerComponent component, EntityUid entity)
{
return HasComp<BodyComponent>(entity) && !component.Safe &&
return HasComp<BodyComponent>(entity) && HasComp<EmaggedComponent>(component.Owner) &&
this.IsPowered(component.Owner, EntityManager);
}
@@ -191,8 +192,7 @@ namespace Content.Server.Recycling
private void OnEmagged(EntityUid uid, RecyclerComponent component, ref GotEmaggedEvent args)
{
if (!component.Safe) return;
component.Safe = false;
// no fancy conditions
args.Handled = true;
}
}