-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into borg-censorship
- Loading branch information
Showing
12 changed files
with
103 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
Content.Server/DeltaV/Tesla/TeslaEnergyBallSystem.PassiveDrain.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Content.Server.Tesla.Components; | ||
using Robust.Shared.Timing; | ||
|
||
namespace Content.Server.Tesla.EntitySystems; | ||
|
||
/// <summary> | ||
/// Manages the passive energy drain for the Tesla. | ||
/// </summary> | ||
public sealed partial class TeslaEnergyBallSystem | ||
{ | ||
[Dependency] private readonly IGameTiming _timing = default!; | ||
|
||
private static readonly TimeSpan UpdateInterval = TimeSpan.FromSeconds(1); | ||
|
||
public override void Update(float frameTime) | ||
{ | ||
var curTime = _timing.CurTime; | ||
var query = EntityQueryEnumerator<TeslaEnergyBallComponent>(); | ||
|
||
while (query.MoveNext(out var uid, out var component)) | ||
{ | ||
if (curTime < component.NextUpdateTime) | ||
continue; | ||
|
||
component.NextUpdateTime = curTime + UpdateInterval; | ||
AdjustEnergy(uid, component, -component.PassiveEnergyDrainRate); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters