* - balance: Chainsaw can only be crafted using advanced saw.
* - balance: Tweak some melee weapon damage and sizes.
* - balance: Tweak stun baton.
* - balance: No flash heavy attack.
* - balance: Tweak modifier sets.
* - tweak: Stunprod and snatcherprod tweaks.
* - tweak: Auto cycle tweaks.
* - balance: Nerf flamethrower.
* - tweak: Remove old stunprod construction.
* - balance: Tweak shotgun ammo.
* - tweak: Cartridge ejecting tweaks.
* - fix: Fix stunprod held prefix.
* Revert "Makes external & shuttle airlocks bump-openable (#22706)"
This reverts commit 6a73aed6d5.
* - balance: Tweak modifier sets once again.
* - balance: Tweak IED timer.
* - tweak: Chemical explosions can't create vacuum.
57 lines
1.5 KiB
C#
57 lines
1.5 KiB
C#
using System.Linq;
|
|
using Content.Shared.Damage.Events;
|
|
using Content.Shared.Hands.Components;
|
|
using Content.Shared.Hands.EntitySystems;
|
|
using Content.Shared.Item.ItemToggle;
|
|
|
|
namespace Content.Server._White.Stunprod;
|
|
|
|
public sealed class SnatcherprodSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly SharedHandsSystem _hands = default!;
|
|
[Dependency] private readonly SharedItemToggleSystem _itemToggle = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<SnatcherprodComponent, StaminaMeleeHitEvent>(OnHit);
|
|
}
|
|
|
|
|
|
private void OnHit(EntityUid uid, SnatcherprodComponent component, StaminaMeleeHitEvent args)
|
|
{
|
|
if (!_itemToggle.IsActivated(uid) || args.HitList.Count == 0)
|
|
return;
|
|
|
|
var entity = args.HitList.First().Entity;
|
|
|
|
if (entity == uid || !TryComp(entity, out HandsComponent? hands))
|
|
return;
|
|
|
|
EntityUid? heldEntity = null;
|
|
|
|
if (hands.ActiveHandEntity != null)
|
|
heldEntity = hands.ActiveHandEntity;
|
|
else
|
|
{
|
|
foreach (var hand in hands.Hands)
|
|
{
|
|
if (hand.Value.HeldEntity == null)
|
|
continue;
|
|
|
|
heldEntity = hand.Value.HeldEntity;
|
|
break;
|
|
}
|
|
|
|
if (heldEntity == null)
|
|
return;
|
|
}
|
|
|
|
if (!_hands.TryDrop(entity, heldEntity.Value, null, false, false, handsComp: hands))
|
|
return;
|
|
|
|
_hands.PickupOrDrop(args.User, heldEntity.Value, false);
|
|
}
|
|
}
|