ninja hotfixes (#20032)
* check that slot is power cell slot * add BatteryChangedEvent * use BatteryChangedEvent when enabling gloves and replacing battery * sort gloves dependencies * increase stun duration and cooldown * play sound when stunning people * remove dirty for non networked field * NinjaBatteryChangedEvent * real * fake --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Content.Server.Ninja.Events;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Server.Power.EntitySystems;
|
||||
using Content.Shared.DoAfter;
|
||||
@@ -24,6 +25,7 @@ public sealed class BatteryDrainerSystem : SharedBatteryDrainerSystem
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<BatteryDrainerComponent, BeforeInteractHandEvent>(OnBeforeInteractHand);
|
||||
SubscribeLocalEvent<BatteryDrainerComponent, NinjaBatteryChangedEvent>(OnBatteryChanged);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -56,6 +58,11 @@ public sealed class BatteryDrainerSystem : SharedBatteryDrainerSystem
|
||||
_doAfter.TryStartDoAfter(doAfterArgs);
|
||||
}
|
||||
|
||||
private void OnBatteryChanged(EntityUid uid, BatteryDrainerComponent comp, ref NinjaBatteryChangedEvent args)
|
||||
{
|
||||
SetBattery(uid, args.Battery, comp);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void OnDoAfterAttempt(EntityUid uid, BatteryDrainerComponent comp, DoAfterAttemptEvent<DrainDoAfterEvent> args)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user