Files
Bubberstation/code/modules/modular_computers/file_system/programs/restock_tracker.dm
SkyratBot d899ab0404 [MIRROR] Mild QOL updates to vending machine-cargo interactions. (#28282)
* Mild QOL updates to vending machine-cargo interactions. (#83933)

## About The Pull Request

This Pull makes a few minor improvements to the features I added with
vendor cargo (#81582).
Changes are as follows:

* Vending machines, when restocked with a refill pack and while
containing a number of credits, will play a cash register sound to alert
you that there's a payout associated with the action.
* The Vending Restock app now works on all modular computer platforms,
as opposed to just laptops and tablets.
* This is actually hilarious because I even made a screen icon for
modular consoles, and it's just been unused ever since merge.
* The "cargochat" cargo modular console now has the vendor refill app
pre-installed.
* Vending machines, when determining their missing inventory during the
associated station trait, now adds from 1-5 credits per missing item, up
from 0-1. The original number was far too low to feel like a strong
incentive based on feedback I'd received, and while still lower than
providing a flat percentage of the missing item specifically (we ran
some numbers on this a few months back), it should at least incentivize
players to keep the station better stocked during regular rounds.

Also, the UI now shows a difference between if all vending machines are
stocked or not.

![image](https://github.com/tgstation/tgstation/assets/41715314/7ea762a6-25d0-4119-87cc-91c1691ba01d)

## Why It's Good For The Game

Most of these are just interfacing and ease of use improvements, as
having the app pre-installed in a place where players can actually make
some use of it's contents should help to improve it's versatility with
regards to the restocking app.

Audio feedback is always good.

In terms of the balance tweak on the stored value on vending machines,
basically it's a way to better incentivize it as an option on the
station and to better encourage players to do these kinds of minor
upkeep tasks for the crew.

## Changelog

🆑
qol: Vending machines now give audio feedback when you restock a vending
refill and get a payout.
qol: The Restock tracker NTOS app for tracking vending machine contents
now works on all consoles, and comes pre-installed on the cargochat
cargo computers.
balance: Vending machines now offer a bit more credits when missing
contents at the start of a round after getting restocked.
/🆑

---------

Co-authored-by: Jacquerel <hnevard@ gmail.com>
Co-authored-by: Jeremiah <42397676+jlsnow301@ users.noreply.github.com>

* Mild QOL updates to vending machine-cargo interactions.

---------

Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: Jacquerel <hnevard@ gmail.com>
Co-authored-by: Jeremiah <42397676+jlsnow301@ users.noreply.github.com>
2024-06-20 16:15:00 +05:30

32 lines
1.1 KiB
Plaintext

/datum/computer_file/program/restock_tracker
filename = "restockapp"
filedesc = "NT Restock Tracker"
downloader_category = PROGRAM_CATEGORY_SUPPLY
program_open_overlay = "restock"
extended_desc = "Nanotrasen IoT network listing all the vending machines found on station, and how well stocked they are each. Profitable!"
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET
can_run_on_flags = PROGRAM_ALL
size = 4
program_icon = "cash-register"
tgui_id = "NtosRestock"
/datum/computer_file/program/restock_tracker/ui_data()
var/list/data = list()
var/list/vending_list = list()
var/id_increment = 1
for(var/obj/machinery/vending/vendor as anything in GLOB.vending_machines_to_restock)
var/stock = vendor.total_loaded_stock()
var/max_stock = vendor.total_max_stock()
if((max_stock == 0 || (stock >= max_stock)) && vendor.credits_contained == 0)
continue
vending_list += list(list(
"name" = vendor.name,
"location" = get_area_name(vendor),
"credits" = vendor.credits_contained,
"percentage" = (stock / max_stock) * 100,
"id" = id_increment,
))
id_increment++
data["vending_list"] = vending_list
return data