adds interactusing to electrocution (#5693)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace Content.Server.Electrocution
|
||||
SubscribeLocalEvent<ElectrifiedComponent, StartCollideEvent>(OnElectrifiedStartCollide);
|
||||
SubscribeLocalEvent<ElectrifiedComponent, AttackedEvent>(OnElectrifiedAttacked);
|
||||
SubscribeLocalEvent<ElectrifiedComponent, InteractHandEvent>(OnElectrifiedHandInteract);
|
||||
SubscribeLocalEvent<ElectrifiedComponent, InteractUsingEvent>(OnElectrifiedInteractUsing);
|
||||
SubscribeLocalEvent<RandomInsulationComponent, MapInitEvent>(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,
|
||||
|
||||
Reference in New Issue
Block a user