Singulo eats unpowered containment gens (#8343)

This commit is contained in:
wrexbe
2022-05-26 17:35:19 -07:00
committed by GitHub
parent 821df271c4
commit 33c03fa0a0
3 changed files with 6 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
using System.Threading;
using Content.Shared.Singularity.Components;
using Timer = Robust.Shared.Timing.Timer;
namespace Content.Server.Singularity.Components
@@ -65,13 +66,9 @@ namespace Content.Server.Singularity.Components
Timer.SpawnRepeating(1000, () => { SharedEnergyPool--;}, _powerDecreaseCancellationTokenSource.Token);
}
public bool CanRepell(EntityUid toRepell)
public bool CanRepel(SharedSingularityComponent toRepel)
{
var powerNeeded = 1;
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<ServerSingularityComponent?>(toRepell, out var singularityComponent))
{
powerNeeded += 2*singularityComponent.Level;
}
var powerNeeded = 2 * toRepel.Level + 1;
return _sharedEnergyPool > powerNeeded;
}