Files
OldThink/Content.Shared/_White/Implants/NeuroControl/NeuroStabilizationSystem.cs
Aviu00 9a72a48c4b Fixes mostly (#292)
* - fix: Fix animals standing.

* - fix: Stuff drop from hands on stun or death even if lying.

* - tweak: Tentacle gun no longer stuns.

* - fix: Space cleaner now evaporates.

* - remove: No crew monitor objective.

* - fix: Fix time beacon.

* - tweak: Revert neuro implant buff.

* - tweak: Nerf dagger.

* - fix: Fix void adaptation not working.
2024-04-23 16:20:16 +03:00

29 lines
945 B
C#

using Content.Shared.Damage.Systems;
using Content.Shared.Electrocution;
using Content.Shared.StatusEffect;
namespace Content.Shared._White.Implants.NeuroControl;
public sealed class NeuroStabilizationSystem : EntitySystem
{
[Dependency] private readonly SharedElectrocutionSystem _electrocution = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<NeuroStabilizationComponent, BeforeStaminaDamageEvent>(BeforeStaminaDamage);
}
private void BeforeStaminaDamage(Entity<NeuroStabilizationComponent> ent, ref BeforeStaminaDamageEvent args)
{
args.Cancelled = true;
Electrocute(ent, (int) MathF.Round(args.Value * 2f / 3f));
}
public void Electrocute(EntityUid uid, int damage, StatusEffectsComponent? status = null)
{
_electrocution.TryDoElectrocution(uid, null, damage, TimeSpan.FromSeconds(1), false, 0.5f, status, true);
}
}