Files
tbd-station-14/Content.Server/Radiation/Systems/RadiationSystem.cs
Alex Evgrashin 4aa45dc695 Remove IRadiationAct (#7757)
* Move radiation collector to ECS

* Damagable system

* Remove IRadiationAct

* Add small helper field

* Update Content.Server/Radiation/Systems/RadiationSystem.cs

Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>

* Delete comment

* Fixed total rads

Co-authored-by: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
2022-04-28 22:36:25 +10:00

28 lines
786 B
C#

using Content.Shared.Radiation.Events;
using Robust.Shared.Map;
namespace Content.Server.Radiation.Systems;
public sealed class RadiationSystem : EntitySystem
{
[Dependency] private readonly EntityLookupSystem _lookup = default!;
public void IrradiateRange(MapCoordinates coordinates, float range, float radsPerSecond, float time)
{
var lookUp = _lookup.GetEntitiesInRange(coordinates, range);
foreach (var uid in lookUp)
{
if (Deleted(uid))
continue;
IrradiateEntity(uid, radsPerSecond, time);
}
}
public void IrradiateEntity(EntityUid uid, float radsPerSecond, float time)
{
var msg = new OnIrradiatedEvent(time, radsPerSecond);
RaiseLocalEvent(uid, msg);
}
}