25 lines
779 B
C#
25 lines
779 B
C#
using Content.Server.Power.EntitySystems;
|
|
using Content.Server.Research.Components;
|
|
using Content.Shared.Research.Components;
|
|
|
|
namespace Content.Server.Research.Systems;
|
|
|
|
public sealed partial class ResearchSystem
|
|
{
|
|
private void InitializeSource()
|
|
{
|
|
SubscribeLocalEvent<ResearchPointSourceComponent, ResearchServerGetPointsPerSecondEvent>(OnGetPointsPerSecond);
|
|
}
|
|
|
|
private void OnGetPointsPerSecond(Entity<ResearchPointSourceComponent> source, ref ResearchServerGetPointsPerSecondEvent args)
|
|
{
|
|
if (CanProduce(source))
|
|
args.Points += source.Comp.PointsPerSecond;
|
|
}
|
|
|
|
public bool CanProduce(Entity<ResearchPointSourceComponent> source)
|
|
{
|
|
return source.Comp.Active && this.IsPowered(source, EntityManager);
|
|
}
|
|
}
|