From d899ab0404dd6fbb407fca01043b6d1220b474ee Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 20 Jun 2024 12:45:00 +0200 Subject: [PATCH] [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 :cl: 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. /:cl: --------- Co-authored-by: Jacquerel 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 Co-authored-by: Jeremiah <42397676+jlsnow301@ users.noreply.github.com> --- .../computers/machinery/console_presets.dm | 1 + .../file_system/programs/restock_tracker.dm | 2 +- code/modules/vending/_vending.dm | 3 ++- tgui/packages/tgui/interfaces/RestockTracker.jsx | 10 ++++++++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/code/modules/modular_computers/computers/machinery/console_presets.dm b/code/modules/modular_computers/computers/machinery/console_presets.dm index 0ec80da4bbb..ad87960603c 100644 --- a/code/modules/modular_computers/computers/machinery/console_presets.dm +++ b/code/modules/modular_computers/computers/machinery/console_presets.dm @@ -137,6 +137,7 @@ starting_programs += /datum/computer_file/program/bounty_board starting_programs += /datum/computer_file/program/budgetorders starting_programs += /datum/computer_file/program/shipping + starting_programs += /datum/computer_file/program/restock_tracker /obj/machinery/modular_computer/preset/cargochat/cargo/setup_starting_software() var/datum/computer_file/program/chatclient/chatprogram = cpu.find_file_by_name("ntnrc_client") diff --git a/code/modules/modular_computers/file_system/programs/restock_tracker.dm b/code/modules/modular_computers/file_system/programs/restock_tracker.dm index 46462c0c6b5..8f2174ce97b 100644 --- a/code/modules/modular_computers/file_system/programs/restock_tracker.dm +++ b/code/modules/modular_computers/file_system/programs/restock_tracker.dm @@ -5,7 +5,7 @@ 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_LAPTOP | PROGRAM_PDA + can_run_on_flags = PROGRAM_ALL size = 4 program_icon = "cash-register" tgui_id = "NtosRestock" diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 96dd1a7b3f9..68c593a4805 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -271,7 +271,7 @@ GLOBAL_LIST_EMPTY(vending_machines_to_restock) */ var/max_amount = rand(CEILING(product_record.amount * 0.5, 1), product_record.amount) product_record.amount = rand(0, max_amount) - credits_contained += rand(0, 1) //randomly add a few credits to the machine to make it look like it's been used, proportional to the amount missing. + credits_contained += rand(1, 5) //randomly add a few credits to the machine to make it look like it's been used, proportional to the amount missing. if(tiltable && prob(6)) // 1 in 17 chance to start tilted (as an additional hint to the station trait behind it) INVOKE_ASYNC(src, PROC_REF(tilt), loc) credits_contained = 0 // If it's tilted, it's been looted, so no credits for you. @@ -1652,6 +1652,7 @@ GLOBAL_LIST_EMPTY(vending_machines_to_restock) return var/credits_to_remove = min(CREDITS_DUMP_THRESHOLD, round(credits_contained)) var/obj/item/holochip/holochip = new(loc, credits_to_remove) + playsound(src, 'sound/effects/cashregister.ogg', 40, TRUE) credits_contained = max(0, credits_contained - credits_to_remove) SSblackbox.record_feedback("amount", "vending machine looted", holochip.credits) diff --git a/tgui/packages/tgui/interfaces/RestockTracker.jsx b/tgui/packages/tgui/interfaces/RestockTracker.jsx index 7df606adffc..ab6f1d012ed 100644 --- a/tgui/packages/tgui/interfaces/RestockTracker.jsx +++ b/tgui/packages/tgui/interfaces/RestockTracker.jsx @@ -81,7 +81,17 @@ export const RestockTracker = (props) => { ))} + {vending_list.length === 0 && } ); }; + +export const RestockTrackerFull = (props) => { + const { data } = useBackend(); + return ( +
+ All vending machines stocked! +
+ ); +};