Skip to content

Commit

Permalink
holy fucking shitcode
Browse files Browse the repository at this point in the history
  • Loading branch information
MilonPL committed Sep 23, 2024
1 parent 31db37e commit 1af011f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Content.Server/Electrocution/ElectrocutionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly InventorySystem _inventory = default!;
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly EntityLookupSystem _entityLookup = default!;
[Dependency] private readonly MeleeWeaponSystem _meleeWeapon = default!;
Expand Down Expand Up @@ -186,7 +187,18 @@ private void OnLightAttacked(EntityUid uid, PoweredLightComponent component, Att
if (_meleeWeapon.GetDamage(args.Used, args.User).Empty)
return;

DoCommonElectrocution(args.User, uid, component.UnarmedHitShock, component.UnarmedHitStun, false);
var siemens = 1f;

// Check for insualted component on the entity triggering the action or on the gloves
if (TryComp<InsulatedComponent>(args.User, out var insulation) ||
(TryComp<InventoryComponent>(args.User, out var inventory) &&
_inventory.TryGetSlotEntity(args.User, "gloves", out var gloves, inventory) &&
TryComp<InsulatedComponent>(gloves, out insulation)))
{
siemens = insulation.Coefficient;
}

DoCommonElectrocution(args.User, uid, component.UnarmedHitShock, component.UnarmedHitStun, false, siemens);
}

private void OnElectrifiedInteractUsing(EntityUid uid, ElectrifiedComponent electrified, InteractUsingEvent args)
Expand Down

0 comments on commit 1af011f

Please sign in to comment.