Neuro control implant (#253)

* - add: Neuro control implanter.

* - tweak: Less beanbag stamina damage.

* - tweak: No heat damage.
This commit is contained in:
Aviu00
2024-03-30 21:02:10 +09:00
committed by GitHub
parent 034a18b1d0
commit a2a5459a07
12 changed files with 111 additions and 5 deletions

View File

@@ -0,0 +1,11 @@
using Content.Shared.Tag;
using Robust.Shared.GameStates;
namespace Content.Shared._White.Implants.NeuroControl;
[RegisterComponent, NetworkedComponent]
public sealed partial class NeuroControlComponent : Component
{
[ValidatePrototypeId<TagPrototype>]
public const string NeuroControlTag = "NeuroControl";
}

View File

@@ -0,0 +1,28 @@
using Content.Shared.Damage.Systems;
using Content.Shared.Electrocution;
using Content.Shared.StatusEffect;
namespace Content.Shared._White.Implants.NeuroControl;
public sealed class NeuroControlSystem : EntitySystem
{
[Dependency] private readonly SharedElectrocutionSystem _electrocution = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<NeuroControlComponent, BeforeStaminaDamageEvent>(BeforeStaminaDamage);
}
private void BeforeStaminaDamage(Entity<NeuroControlComponent> 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);
}
}