* 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>
28 lines
786 B
C#
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);
|
|
}
|
|
}
|