Pow3r: stage 1 (#4208)

Co-authored-by: 20kdc <asdd2808@gmail.com>
This commit is contained in:
Pieter-Jan Briers
2021-07-04 18:11:52 +02:00
committed by GitHub
parent ea60a81fdf
commit 103bc19508
212 changed files with 8584 additions and 4426 deletions

View File

@@ -1,9 +1,7 @@
#nullable enable
using System;
using Content.Server.Battery.Components;
using Content.Server.Power.Components;
using Content.Shared.Interaction;
using Content.Shared.Notification;
using Content.Shared.Notification.Managers;
using Content.Shared.Radiation;
using Content.Shared.Singularity.Components;
@@ -37,7 +35,6 @@ namespace Content.Server.Singularity.Components
}
[ComponentDependency] private readonly BatteryComponent? _batteryComponent = default!;
[ComponentDependency] private readonly BatteryDischargerComponent? _batteryDischargerComponent = default!;
bool IInteractHand.InteractHand(InteractHandEventArgs eventArgs)
{
@@ -74,12 +71,6 @@ namespace Content.Server.Singularity.Components
if (_batteryComponent != null)
{
_batteryComponent!.CurrentCharge += frameTime * radiation.RadsPerSecond * 3000f;
if (_batteryDischargerComponent != null)
{
// The battery discharger is controlled like this to ensure it won't drain the entire battery in a single tick.
// If that occurs then the battery discharger ends up shutting down.
_batteryDischargerComponent!.ActiveSupplyRate = (int) Math.Max(1, _batteryComponent!.CurrentCharge);
}
}
}