diff --git a/Content.Server/Electrocution/Components/ElectrifiedComponent.cs b/Content.Server/Electrocution/Components/ElectrifiedComponent.cs index 1c10308613..9e0da6d030 100644 --- a/Content.Server/Electrocution/Components/ElectrifiedComponent.cs +++ b/Content.Server/Electrocution/Components/ElectrifiedComponent.cs @@ -26,6 +26,9 @@ namespace Content.Server.Electrocution [DataField("onHandInteract")] public bool OnHandInteract { get; set; } = true; + [DataField("onInteractUsing")] + public bool OnInteractUsing { get; set; } = true; + [DataField("requirePower")] public bool RequirePower { get; } = true; diff --git a/Content.Server/Electrocution/ElectrocutionSystem.cs b/Content.Server/Electrocution/ElectrocutionSystem.cs index 8abce7202a..4e02c239f0 100644 --- a/Content.Server/Electrocution/ElectrocutionSystem.cs +++ b/Content.Server/Electrocution/ElectrocutionSystem.cs @@ -75,6 +75,7 @@ namespace Content.Server.Electrocution SubscribeLocalEvent(OnElectrifiedStartCollide); SubscribeLocalEvent(OnElectrifiedAttacked); SubscribeLocalEvent(OnElectrifiedHandInteract); + SubscribeLocalEvent(OnElectrifiedInteractUsing); SubscribeLocalEvent(OnRandomInsulationMapInit); UpdatesAfter.Add(typeof(PowerNetSystem)); @@ -142,6 +143,14 @@ namespace Content.Server.Electrocution TryDoElectrifiedAct(uid, args.User.Uid, electrified); } + private void OnElectrifiedInteractUsing(EntityUid uid, ElectrifiedComponent electrified, InteractUsingEvent args) + { + if (!electrified.OnInteractUsing) + return; + + TryDoElectrifiedAct(uid, args.User.Uid, electrified); + } + public bool TryDoElectrifiedAct(EntityUid uid, EntityUid targetUid, ElectrifiedComponent? electrified = null, NodeContainerComponent? nodeContainer = null,