This commit is contained in:
Rane
2022-02-17 21:43:24 -05:00
committed by GitHub
parent 94c56980cb
commit 8049a709e6
29 changed files with 323 additions and 8 deletions

View File

@@ -0,0 +1,32 @@
using Content.Shared.Emag.Components;
using Content.Shared.Emag.Systems;
namespace Content.Server.Emag
{
public sealed class EmagSystem : EntitySystem
{
public override void Update(float frameTime)
{
base.Update(frameTime);
foreach (var emag in EntityManager.EntityQuery<EmagComponent>())
{
if (emag.Charges == emag.MaxCharges)
{
emag.Accumulator = 0;
continue;
}
emag.Accumulator += frameTime;
if (emag.Accumulator < emag.RechargeTime)
{
continue;
}
emag.Accumulator -= emag.RechargeTime;
emag.Charges++;
}
}
}
}