ninja 2 electric boogaloo (#15534)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -31,6 +31,11 @@ public sealed class EmpSystem : SharedEmpSystem
|
||||
{
|
||||
foreach (var uid in _lookup.GetEntitiesInRange(coordinates, range))
|
||||
{
|
||||
var attemptEv = new EmpAttemptEvent();
|
||||
RaiseLocalEvent(uid, attemptEv);
|
||||
if (attemptEv.Cancelled)
|
||||
continue;
|
||||
|
||||
var ev = new EmpPulseEvent(energyConsumption, false, false);
|
||||
RaiseLocalEvent(uid, ref ev);
|
||||
if (ev.Affected)
|
||||
@@ -100,6 +105,13 @@ public sealed class EmpSystem : SharedEmpSystem
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raised on an entity before <see cref="EmpPulseEvent"/>. Cancel this to prevent the emp event being raised.
|
||||
/// </summary>
|
||||
public sealed partial class EmpAttemptEvent : CancellableEntityEventArgs
|
||||
{
|
||||
}
|
||||
|
||||
[ByRefEvent]
|
||||
public record struct EmpPulseEvent(float EnergyConsumption, bool Affected, bool Disabled);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user