Geiger counter (#12082)

This commit is contained in:
Alex Evgrashin
2022-12-07 02:56:52 +01:00
committed by GitHub
parent ae700781b4
commit 04db7d0fdd
32 changed files with 613 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
using Content.Shared.Radiation.Events;
using Content.Server.Radiation.Components;
using Content.Shared.Radiation.Events;
using Robust.Shared.Configuration;
using Robust.Shared.Map;
@@ -43,4 +44,19 @@ public sealed partial class RadiationSystem : EntitySystem
var msg = new OnIrradiatedEvent(time, radsPerSecond);
RaiseLocalEvent(uid, msg);
}
/// <summary>
/// Marks entity to receive/ignore radiation rays.
/// </summary>
public void SetCanReceive(EntityUid uid, bool canReceive)
{
if (canReceive)
{
EnsureComp<RadiationReceiverComponent>(uid);
}
else
{
RemComp<RadiationReceiverComponent>(uid);
}
}
}