Files
Delta-v/Content.Server/_DV/PowerCell/PowerCellSearchSystem.cs
T
Kirus59andNemanja b6bc91ea9b BatteryWeaponPowerCell tweaks (#33500)
* BatteryWeaponPowerCell tweaks

* add update ammo ev & shuttle guns tweaks

* MilonPL requested changes

* revert changes in OnPowerCellChanged

* Add events to get charge info & change current charge

---------

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2025-05-18 15:45:17 +01:00

23 lines
681 B
C#

using Content.Server.Power.EntitySystems;
using Content.Server.PowerCell;
using Content.Shared.PowerCell.Components;
namespace Content.Server._DV.PowerCell;
public sealed class PowerCellSearchSystem : EntitySystem
{
[Dependency] private readonly PowerCellSystem _powerCell = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<PowerCellSlotComponent, SearchForBatteryEvent>(OnSearchForBattery);
}
private void OnSearchForBattery(Entity<PowerCellSlotComponent> ent, ref SearchForBatteryEvent args)
{
args.Handled = _powerCell.TryGetBatteryFromSlot(ent, out args.Uid, out args.Component);
}
}