salvage points shop (#2510)

* add conscription bag

* add gar mesons

* remove salvage vendor restock

* add code for shop vendors

* make salvage vendor a shop vendor

* ui fixes

* :trollface:

* update locker and vendor inventory

* add mining hardsuit for 3k

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2024-12-27 03:06:17 +00:00
committed by tommy
parent 1c2f200762
commit f42c2ae11b
24 changed files with 855 additions and 26 deletions

View File

@@ -0,0 +1,47 @@
using Content.Server.Advertise.EntitySystems;
using Content.Shared.Advertise.Components;
using Content.Shared.DeltaV.VendingMachines;
namespace Content.Server.DeltaV.VendingMachines;
public sealed class ShopVendorSystem : SharedShopVendorSystem
{
[Dependency] private readonly SpeakOnUIClosedSystem _speakOnUIClosed = default!;
public override void Update(float frameTime)
{
base.Update(frameTime);
var query = EntityQueryEnumerator<ShopVendorComponent, TransformComponent>();
var now = Timing.CurTime;
while (query.MoveNext(out var uid, out var comp, out var xform))
{
var ent = (uid, comp);
var dirty = false;
if (comp.Ejecting is {} ejecting && now > comp.NextEject)
{
Spawn(ejecting, xform.Coordinates);
comp.Ejecting = null;
dirty = true;
}
if (comp.Denying && now > comp.NextDeny)
{
comp.Denying = false;
dirty = true;
}
if (dirty)
{
Dirty(uid, comp);
UpdateVisuals(ent);
}
}
}
protected override void AfterPurchase(Entity<ShopVendorComponent> ent)
{
if (TryComp<SpeakOnUIClosedComponent>(ent, out var speak))
_speakOnUIClosed.TrySetFlag((ent.Owner, speak));
}
}