* - 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.
45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
using Content.Server.Stack;
|
|
using Content.Shared.Stacks;
|
|
using Content.Shared.Weapons.Ranged.Components;
|
|
using Content.Shared.Weapons.Ranged.Events;
|
|
using Robust.Shared.Map;
|
|
|
|
namespace Content.Server.Weapons.Ranged.Systems;
|
|
|
|
public sealed partial class GunSystem
|
|
{
|
|
[Dependency] private readonly StackSystem _stack = default!;
|
|
|
|
protected override void Cycle(EntityUid uid, BallisticAmmoProviderComponent component, MapCoordinates coordinates)
|
|
{
|
|
EntityUid? ent = null;
|
|
|
|
// TODO: Combine with TakeAmmo
|
|
if (component.Entities.Count > 0)
|
|
{
|
|
var existing = component.Entities[^1];
|
|
component.Entities.RemoveAt(component.Entities.Count - 1);
|
|
|
|
Containers.Remove(existing, component.Container);
|
|
EnsureShootable(existing);
|
|
}
|
|
else if (component.UnspawnedCount > 0)
|
|
{
|
|
component.UnspawnedCount--;
|
|
ent = Spawn(component.Proto, coordinates);
|
|
EnsureShootable(ent.Value);
|
|
}
|
|
|
|
if (ent != null)
|
|
EjectCartridge(ent.Value);
|
|
|
|
var cycledEvent = new GunCycledEvent();
|
|
RaiseLocalEvent(uid, ref cycledEvent);
|
|
}
|
|
|
|
protected override EntityUid GetStackEntity(EntityUid uid, StackComponent stack) // WD
|
|
{
|
|
return _stack.Split(uid, 1, Transform(uid).Coordinates, stack) ?? uid;
|
|
}
|
|
}
|