fish-station/Content.Server/Weapons/Ranged/Systems/GunSystem.AutoFire.cs
Rinary 42f9ac0dbd
Ребаланс Мехов (#482)
* Initial commit

* mechs has reflect

* all mechs has powercagehigh

* mechs can only powered by power cages

* powercages on protolathes

* magboots on mechs

* fire cost upped x2

* battery on guns has 200 energy by basic, adds ion gun

* mecha x-ray gun add

* mecha vindictor here

* added amlg 90

* added uvm31

* localization

* burst fire on Ultra

* fix vindictor no desc

* mech has prying

* add scale 1.08

* add scale 1.08 to combat mechs

* Mechs has collision

* buff chain sword

* upd

* some fixes

* fix weapon charging

* Fix UVM-31 "Drake" Sound and Proto particle

* Fix Mech collision, mechs can't stop peoples any more(some thing issues creates if collision is on)

* AMLG90 Has bigger damage

* Stunner uses hos stun spread

---------

Co-authored-by: SlamBamActionman <slambamactionman@gmail.com>
2024-10-10 20:11:43 +03:00

42 lines
1.3 KiB
C#

using Content.Shared.Damage;
using Content.Shared.Weapons.Ranged.Components;
using Robust.Shared.Map;
namespace Content.Server.Weapons.Ranged.Systems;
public sealed partial class GunSystem
{
public override void Update(float frameTime)
{
base.Update(frameTime);
/*
* On server because client doesn't want to predict other's guns.
*/
// Automatic firing without stopping if the AutoShootGunComponent component is exist and enabled
var query = EntityQueryEnumerator<GunComponent>();
while (query.MoveNext(out var uid, out var gun))
{
if (gun.NextFire > Timing.CurTime)
continue;
if (TryComp(uid, out AutoShootGunComponent? autoShoot))
{
if (!autoShoot.Enabled)
continue;
AttemptShoot(uid, gun);
}
else if (gun.BurstActivated)
{
var parent = _transform.GetParentUid(uid);
if (HasComp<DamageableComponent>(parent))
AttemptShoot(parent, uid, gun, gun.ShootCoordinates ?? new EntityCoordinates(uid, gun.DefaultDirection));
else
AttemptShoot(uid, gun);
}
}
}
}