перенос общих файлов из папки White в _White

This commit is contained in:
Remuchi
2024-01-28 18:37:24 +07:00
parent 1e4ad59270
commit 3a08b81d53
370 changed files with 805 additions and 812 deletions

View File

@@ -0,0 +1,44 @@
using Content.Shared.Examine;
using Content.Shared.Weapons.Ranged.Components;
using Content.Shared.Weapons.Ranged.Events;
using Content.Shared._White.Flamethrower;
namespace Content.Shared.Weapons.Ranged.Systems;
public abstract partial class SharedGunSystem
{
protected virtual void InitializeGas()
{
SubscribeLocalEvent<GasAmmoProviderComponent, TakeAmmoEvent>(OnGasTakeAmmo);
SubscribeLocalEvent<GasAmmoProviderComponent, GetAmmoCountEvent>(OnGasAmmoCount);
SubscribeLocalEvent<GasAmmoProviderComponent, ExaminedEvent>(OnGasExamine);
}
private void OnGasExamine(EntityUid uid, GasAmmoProviderComponent component, ExaminedEvent args)
{
args.PushMarkup(Loc.GetString("comp-gas-tank-examine", ("pressure", MathF.Round(component.Pressure))));
}
private void OnGasAmmoCount(EntityUid uid, GasAmmoProviderComponent component, ref GetAmmoCountEvent args)
{
args.Count = component.Shots;
args.Capacity = component.Capacity;
}
private void OnGasTakeAmmo(EntityUid uid, GasAmmoProviderComponent component, TakeAmmoEvent args)
{
var shots = Math.Min(args.Shots, component.Shots);
if (shots == 0)
return;
for (var i = 0; i < shots; i++)
{
var ent = Spawn(component.Prototype, args.Coordinates);
InitShot(uid, component, ent);
args.Ammo.Add((ent, EnsureComp<AmmoComponent>(ent)));
}
}
protected virtual void InitShot(EntityUid uid, GasAmmoProviderComponent component, EntityUid shotUid) {}
}