Files
space-station-14/Content.Server/Power/EntitySystems/PowerConsumerBatteryChargerSystem.cs
T
Samuka 7f15e77954 Xenoborg extractor (#42796)
* verb category

* voltage toggle comp

* move stuff

* add simple prototype

* implement verb action

* switch expression

* fixed the node not updating

* charge the battery

* fixed battery not charging

* spawn on battery level system

* finally works

* swap commentary position

* can only anchor the extractor on the station

* popup message for trying to anchor outside of station

* default placement for unanchored version

* ops

* fix body type

* commentary

* update visuals of power consumer

* add custom sprite

* fix light layer not changing

* xenoborg circuit

* fix xenoborg circuit

* add tag

* add hand to hold xenoborg circuits

* move to material

* add xenoborg circuit material

* add recipe to mothership core

* add a hand to hold circuits to the mothership core

* to not confuse

* update

* ops

* another ops

* update mothership

* update guidebook

* update values

* more info

* fix stack

* can store xenoborg circuits

* description

* also update description

* circuit -> crytal

* not modified from anything

* update description

* Revert "update mothership"

This reverts commit 84974c56afadac2a99ed2a166244a668d83fff48.

* update empty label

* small update to sprite

* not necessary code

* remove empty line

* color

* make it explode when destroyed

* change values

* update sprite

* update sprite

* make it eletrified

* flavor text

* simplify to only use charge

* subscribe to event

* new line

* remove popup

* no need for the setter

* no longer networked

* feedback popups

* Minor tweaks

* better to understand

* better now?

---------

Co-authored-by: beck-thompson <beck314159@hotmail.com>
2026-02-28 00:55:09 +00:00

23 lines
792 B
C#

using Content.Server.Power.Components;
using Content.Shared.Power.Components;
namespace Content.Server.Power.EntitySystems;
public sealed class PowerConsumerBatteryChargerSystem : EntitySystem
{
[Dependency] private readonly BatterySystem _battery = default!;
public override void Update(float frameTime)
{
var query = EntityQueryEnumerator<PowerConsumerBatteryChargerComponent, PowerConsumerComponent, BatteryComponent, TransformComponent>();
while (query.MoveNext(out var entity, out _, out var powerConsumerComp, out var battery, out var transform))
{
if (!transform.Anchored)
continue;
_battery.ChangeCharge((entity, battery), powerConsumerComp.NetworkLoad.ReceivingPower * frameTime);
}
}
}