* nasrano

* Add station budget & salary

* Initial balance

* Vending machine UI

* Pricing for vending machines

* Finish economy

* Eftpos

* Finish eftpos

* Put eftpos into lockers

* Vending machine prices

* Small fixes

* Fix atm UI

* Add atms to maps

* fix

* reset

* Add PDA program

* Maps again

---------

Co-authored-by: Mona Hmiza <>
Co-authored-by: rhailrake <49613070+rhailrake@users.noreply.github.com>
This commit is contained in:
Aviu00
2023-10-02 16:50:02 +09:00
committed by Aviu00
parent 707cdf3afa
commit 16c8b95da4
109 changed files with 2043 additions and 30 deletions

View File

@@ -105,7 +105,7 @@ public abstract partial class SharedVendingMachineSystem : EntitySystem
foreach (var (id, amount) in entries)
{
if (PrototypeManager.HasIndex<EntityPrototype>(id))
if (PrototypeManager.TryIndex<EntityPrototype>(id, out var proto)) // WD EDIT
{
if (inventory.TryGetValue(id, out var entry))
// Prevent a machine's stock from going over three times
@@ -115,9 +115,14 @@ public abstract partial class SharedVendingMachineSystem : EntitySystem
// all the items just to restock one empty slot without
// losing the rest of the restock.
entry.Amount = Math.Min(entry.Amount + amount, 3 * amount);
else
inventory.Add(id, new VendingMachineInventoryEntry(type, id, amount));
else // WD EDIT START
{
var price = GetEntryPrice(proto);
inventory.Add(id, new VendingMachineInventoryEntry(type, id, amount, price));
} // WD EDIT END
}
}
}
protected virtual int GetEntryPrice(EntityPrototype proto) { return 0; } // WD
}