Neuro control implant (#253)
* - add: Neuro control implanter. * - tweak: Less beanbag stamina damage. * - tweak: No heat damage.
This commit is contained in:
@@ -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";
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user