mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 21:48:58 +03:00
* the definition of insanity * the definition of insanity * the definition of insanity * we have hullrot at home * maybe the real hullrot was the friends we made along the way * john hullrot * i am going to hullroooooot * it's hullrotver * we're so hullback * we're rotting the hull with this one * hullmerge * the hullrot is leaking * never gonna rot you up * hullfresh * john starsector * god i wish we had grid collision damage
28 lines
767 B
C#
28 lines
767 B
C#
using Content.Shared.Throwing;
|
|
using Content.Shared.Weapons.Ranged.Components;
|
|
using Content.Shared.Weapons.Ranged.Systems;
|
|
using Robust.Shared.Random;
|
|
|
|
namespace Content.Server.Weapons.Ranged.Systems;
|
|
|
|
public sealed class FireOnDropSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly SharedGunSystem _gun = default!;
|
|
[Dependency] private readonly IRobustRandom _random = default!;
|
|
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<GunComponent, ThrowDoHitEvent>(HandleLand);
|
|
}
|
|
|
|
|
|
private void HandleLand(EntityUid uid, GunComponent component, ref ThrowDoHitEvent args)
|
|
{
|
|
if (_random.Prob(component.FireOnDropChance))
|
|
_gun.AttemptShoot(uid, component); // WWDP EDIT
|
|
}
|
|
}
|