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>
This commit is contained in:
27
Content.Server/Radiation/Systems/RadiationSystem.cs
Normal file
27
Content.Server/Radiation/Systems/RadiationSystem.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user