Electrocution. (#4958)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
This commit is contained in:
committed by
GitHub
parent
66a3d5bf29
commit
ed3bf94a3b
@@ -4,6 +4,7 @@ using Content.Server.Items;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Slippery;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Electrocution;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
@@ -20,6 +21,7 @@ namespace Content.Server.Inventory
|
||||
SubscribeLocalEvent<InventoryComponent, HighPressureEvent>(OnHighPressureEvent);
|
||||
SubscribeLocalEvent<InventoryComponent, LowPressureEvent>(OnLowPressureEvent);
|
||||
SubscribeLocalEvent<InventoryComponent, DamageModifyEvent>(OnDamageModify);
|
||||
SubscribeLocalEvent<InventoryComponent, ElectrocutionAttemptEvent>(OnElectrocutionAttempt);
|
||||
SubscribeLocalEvent<InventoryComponent, SlipAttemptEvent>(OnSlipAttemptEvent);
|
||||
}
|
||||
|
||||
@@ -51,6 +53,14 @@ namespace Content.Server.Inventory
|
||||
RelayPressureEvent(component, args);
|
||||
}
|
||||
|
||||
private void OnElectrocutionAttempt(EntityUid uid, InventoryComponent component, ElectrocutionAttemptEvent args)
|
||||
{
|
||||
foreach (var equipped in component.GetAllHeldItems())
|
||||
{
|
||||
RaiseLocalEvent(equipped.Uid, args, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDamageModify(EntityUid uid, InventoryComponent component, DamageModifyEvent args)
|
||||
{
|
||||
foreach (var equipped in component.GetAllHeldItems())
|
||||
|
||||
Reference in New Issue
Block a user