mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-21 15:38:52 +03:00
* add: neuro stabilizer implant * Stabilization\ * AI rewiew * fix: translation --------- Co-authored-by: Remuchi <72476615+Remuchi@users.noreply.github.com>
29 lines
908 B
C#
29 lines
908 B
C#
using Content.Shared.Electrocution;
|
|
using Content.Shared.Damage.Systems;
|
|
|
|
namespace Content.Shared._White.Implants.NeuroStabilization;
|
|
|
|
public sealed class NeuroStabilizationSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly SharedElectrocutionSystem _electrocution = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<NeuroStabilizationComponent, BeforeStaminaDamageEvent>(BeforeStaminaDamage);
|
|
}
|
|
|
|
private void BeforeStaminaDamage(EntityUid uid, NeuroStabilizationComponent component, ref BeforeStaminaDamageEvent args)
|
|
{
|
|
args.Cancelled = true;
|
|
|
|
if (!component.Electrocution)
|
|
return;
|
|
|
|
var damage = (int) MathF.Round(args.Value * component.DamageModifier);
|
|
_electrocution.TryDoElectrocution(uid, null, damage, component.TimeElectrocution,
|
|
false, 0.5f, null, true);
|
|
}
|
|
}
|