-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
) * Arcargo: Vendor Cargo and Vending Machine Update (#81582) Another one. ## About The Pull Request This pull request originally had a design doc that @Fikou and I worked on, but that was never really polished up for publishing quality so I'll forgo it for now and be as descript as possible here. ### Core changes - This pull request adds a new NTOS app to the game, the restock tracker. The restock tracker shows a comprehensive list of vending machines across the station, as long as there is a need for that vending machine to get restocked. - This has also been pre-installed into the cargo data disks. (`/obj/item/computer_disk/quartermaster`) - Vending machines now store a total of 20% of the cost of any purchase made within themselves into a small pool of cash. This only applies to premium and normal purchases, not to contraband, as they're technically not sanctioned by the company. - The restock tracker app will also track which vending machines have the most credits stored internally inside them. - By refilling a vending machine, the stored credits within are paid out to any crewmember who goes and restocks the station, while also paying out *half that amount to the cargo budget*, serving as a basic but otherwise easy tertiary money making method on the same level of complexity as doing bounties, with the added benefit of actually helping to assist the station for jobs like... assistant. ![image](https://github.com/tgstation/tgstation/assets/41715314/59cee2d9-7e60-4733-8a76-d88fe5b8c3f2) ### Break Stuff - Anyway, when you try and smash a vending machine open with a melee weapon of choice, it can now pay out 50 credits at a time as a way to make money at zero risk to yourself. - ~~Except for the horrible risk to yourself.~~ ![image](https://github.com/tgstation/tgstation/assets/41715314/23208bf0-8484-40b9-b753-0ffdb57d770f) ### Cargo Specific Changes - Restock units may now be sold for a small profit as well, to incentivize cargo to keep the station stocked further. - The `STATION_TRAIT_VENDING_SHORTAGE` trait will now add a small amount of existing credits into the vending machines on station, to incentivize cargo to fix the issue during the round and not just push for an early shuttle call. Or, more accurately, provide the crew with a money making scheme to engage better with the station trait as it stands. ### This also refactors behavior on vending machines - This pull request also finally changes it so that vending machines now use the payment component, which as a consequence allows for the following improvements: * Vending machines may now pull from physical credits on your person, not just requiring you to have money on your ID card. * Vending machines may also use credits being pulled by the player interacting with the vending machine, allowing for handless mobs to be able to purchase items from a vending machine. * Finally makes the "use-for-everything buying things component" used by the most utilized component of the in-game economy, to reduce the quantity of unique implementations of purchasing things in the code. - Existing vending specific checks are retained on before handing off behavior to the payment component, for behavior such as purchasing cigarettes/alcohol under the age of 18/21. Notes: - Vending machines will lose their internal credits stored when deconstructed, as a security measure. - Vending machines will now show the total amount of credits that a mob has on their person, combining physical credits as well as credits held in their ID card to accurately portray their total wealth across the mob in question. ## Why It's Good For The Game First off, this is largely an excuse to move vending machine behavior over to the payment component for the purposes to less code copy-paste, and to try and make the implementation more wide-spread. Second, this implements a new tertiary economy method to the game, in the same design space as bounties, which serve as common methods of making money without necessarily being specific to their job in question, with the primary goal of providing small amounts of work to the crew and a basic interaction with the economy system. Additionally, it gives cargo more things they can do to assist the station, and a way to know which parts of the station need support as a result. It improves the interaction between the vending shortage station trait as well, making it a challenge with depth as opposed to a more oppressive round change that players would rather reroll the game over. Additionally, this makes a few price tweaks to vending restock modules as well to help incentivize buying some of the more minor restock kits, and a few select bumps on restocks that cover wide enough territory to necessitate fewer restocks. * Arcargo: Vendor Cargo and Vending Machine Update --------- Co-authored-by: NovaBot <[email protected]> Co-authored-by: ArcaneMusic <[email protected]>
- Loading branch information
1 parent
cc03394
commit bfc5fd3
Showing
20 changed files
with
257 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
code/modules/modular_computers/file_system/programs/restock_tracker.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/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_LAPTOP | PROGRAM_PDA | ||
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 |
Oops, something went wrong.