From fd19f6d5a0ff4f7c52309df6ea07df3da0bc0181 Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Wed, 30 Nov 2022 22:29:28 -0500 Subject: [PATCH] The Mining vendor now works like the Chef produce console (has to go through Cargo) (#71023) ## About The Pull Request Now comes with a Hackmd: https://hackmd.io/ImTe5FLeTgmI7spTWKBaFQ?view In-game screenshots: ![image](https://user-images.githubusercontent.com/53777086/199602671-a604c6da-fec0-487d-b67e-eb0e4380e4d6.png) ![image](https://user-images.githubusercontent.com/53777086/199602695-8d7afb20-3b6c-467f-ac78-37de03dc20d2.png) ![image](https://user-images.githubusercontent.com/53777086/199725350-b01c4ddd-3fec-4288-a698-02daf91f787b.png) Removes the old Mining vendor console and all its bad code. Instead, the chef produce console was generalized and a NEW mining vendor is a subtype of it. If they try to Express this console, it will be 1.5x the mining points (compared to 2x for the Chef produce console atm), so it is technically possible, but it is still better to order it through Cargo. Different to the Kitchen crate, this one is a private order by the Shaft Miner, using mining points instead of Credits. Cargo CAN emitter it open, but I think that's an acceptable risk with all crates. As shown in the screenshot, Cargo will immediately know who ordered the items so knows who to call to pick it up when needed. This also means Shaft Miner's vendor is now categorized somewhat. I tried my best to make sense out of it but some items really don't make sense (laser pointer, soap...) I split the different sections of orderable items into different files for better management, and de-hardcoded it and its TGUI to make it easier for anyone who wants to add more to it. I also made the produce console use paths and added ways 'categories' to produce consoles, which indicates which sections you should and shouldn't be allowed to see. https://github.com/tgstation/tgstation/pull/71007 already did part of this but it isn't merged yet so :/ Free golems are mostly unaffected by this. Their console only works in express mode and doesn't increase the prices for it. The only downside is the cooldown. I still have some things to finish on this PR so it'll be left as draft until at least tomorrow. ## Why It's Good For The Game https://hackmd.io/ImTe5FLeTgmI7spTWKBaFQ?view 1. A large problem currently with Miners is that they don't interact with the station, this will at least help integrate them more into their own department, by making the cost of their equipment cheaper if they bother to actually go through Cargo for their gear. 2. It also means that a non functional Cargo would affect Shaft Miners too, and as they have access to the shuttle, maybe we can expect some Miners to pick up the slack if needed. 3. The old mining vendor was the ONLY vendor in the game that had infinite stock. It doesn't need a refill or anything like any other vendor, and every other vendor uses credits, mining points is just shaft miner credits. Why are they an exception? At least being ordered through the shuttle makes sense. 4. It opens the QM being able to see easier what Miners are doing, and prevents miners from hiding on Lavaland to do nothing but hunt fauna if they were meant to be demoted or something by the QM. Basically, gives the QM more control over the people working in their department. ## Changelog :cl: add: Shaft Miner's equipment vendor now orders their equipment through the Cargo shuttle, though you can spend 1.5x the points to express it, making it a Mining version of the Chef's produce console, with a weakened express tax. /:cl: --- .../RandomRuins/AnywhereRuins/golem_ship.dmm | 2 +- ..._underground_abandoned_plasma_facility.dmm | 2 +- .../map_files/Deltastation/DeltaStation2.dmm | 4 +- .../map_files/IceBoxStation/IceBoxStation.dmm | 10 +- _maps/map_files/KiloStation/KiloStation.dmm | 4 +- _maps/map_files/MetaStation/MetaStation.dmm | 4 +- _maps/map_files/Mining/Lavaland.dmm | 4 +- _maps/map_files/tramstation/tramstation.dmm | 4 +- code/__DEFINES/computers.dm | 10 + code/_globalvars/lists/objects.dm | 3 + code/controllers/subsystem/shuttle.dm | 5 +- code/game/machinery/computer/_computer.dm | 5 +- .../computer/chef_orders/chef_order.dm | 125 ------- .../computer/chef_orders/order_datum.dm | 341 ------------------ .../orders/order_computer/cook_order.dm | 21 ++ .../orders/order_computer/golem_order.dm | 13 + .../orders/order_computer/mining_order.dm | 199 ++++++++++ .../orders/order_computer/order_computer.dm | 176 +++++++++ .../order_items/cook/order_milk_eggs.dm | 106 ++++++ .../orders/order_items/cook/order_reagents.dm | 67 ++++ .../orders/order_items/cook/order_veggies.dm | 86 +++++ .../order_items/mining/order_consumables.dm | 43 +++ .../orders/order_items/mining/order_golem.dm | 35 ++ .../orders/order_items/mining/order_mining.dm | 105 ++++++ .../orders/order_items/mining/order_pka.dm | 42 +++ .../orders/order_items/mining/order_toys.dm | 31 ++ .../orders/order_items/order_datum.dm | 28 ++ .../effects/spawners/random/techstorage.dm | 2 +- .../circuitboards/computer_circuitboards.dm | 16 +- .../machines/machine_circuitboards.dm | 13 - code/game/objects/items/storage/backpack.dm | 18 + code/modules/cargo/order.dm | 15 +- code/modules/cargo/packs/_packs.dm | 16 + code/modules/mining/machine_vending.dm | 313 ---------------- code/modules/mining/mining_ltsrbt.dm | 103 ++++++ .../research/designs/machine_designs.dm | 2 +- code/modules/shuttle/supply.dm | 9 +- code/modules/unit_tests/orderable_items.dm | 16 +- tgstation.dme | 18 +- tgui/packages/tgui/interfaces/Cargo.js | 3 +- tgui/packages/tgui/interfaces/MiningVendor.js | 65 ---- .../tgui/interfaces/ProduceConsole.js | 104 +++--- .../Scripts/71023_order_consoles.txt | 2 + 43 files changed, 1245 insertions(+), 945 deletions(-) create mode 100644 code/__DEFINES/computers.dm delete mode 100644 code/game/machinery/computer/chef_orders/chef_order.dm delete mode 100644 code/game/machinery/computer/chef_orders/order_datum.dm create mode 100644 code/game/machinery/computer/orders/order_computer/cook_order.dm create mode 100644 code/game/machinery/computer/orders/order_computer/golem_order.dm create mode 100644 code/game/machinery/computer/orders/order_computer/mining_order.dm create mode 100644 code/game/machinery/computer/orders/order_computer/order_computer.dm create mode 100644 code/game/machinery/computer/orders/order_items/cook/order_milk_eggs.dm create mode 100644 code/game/machinery/computer/orders/order_items/cook/order_reagents.dm create mode 100644 code/game/machinery/computer/orders/order_items/cook/order_veggies.dm create mode 100644 code/game/machinery/computer/orders/order_items/mining/order_consumables.dm create mode 100644 code/game/machinery/computer/orders/order_items/mining/order_golem.dm create mode 100644 code/game/machinery/computer/orders/order_items/mining/order_mining.dm create mode 100644 code/game/machinery/computer/orders/order_items/mining/order_pka.dm create mode 100644 code/game/machinery/computer/orders/order_items/mining/order_toys.dm create mode 100644 code/game/machinery/computer/orders/order_items/order_datum.dm delete mode 100644 code/modules/mining/machine_vending.dm create mode 100644 code/modules/mining/mining_ltsrbt.dm delete mode 100644 tgui/packages/tgui/interfaces/MiningVendor.js create mode 100644 tools/UpdatePaths/Scripts/71023_order_consoles.txt diff --git a/_maps/RandomRuins/AnywhereRuins/golem_ship.dmm b/_maps/RandomRuins/AnywhereRuins/golem_ship.dmm index 77ba03604c9..783c1d4210e 100644 --- a/_maps/RandomRuins/AnywhereRuins/golem_ship.dmm +++ b/_maps/RandomRuins/AnywhereRuins/golem_ship.dmm @@ -75,7 +75,7 @@ /turf/open/floor/mineral/titanium/purple, /area/ruin/powered/golem_ship) "n" = ( -/obj/machinery/mineral/equipment_vendor/golem, +/obj/machinery/computer/order_console/mining/golem, /turf/open/floor/mineral/titanium/purple, /area/ruin/powered/golem_ship) "o" = ( diff --git a/_maps/RandomRuins/IceRuins/icemoon_underground_abandoned_plasma_facility.dmm b/_maps/RandomRuins/IceRuins/icemoon_underground_abandoned_plasma_facility.dmm index b33a5698196..1b32256316f 100644 --- a/_maps/RandomRuins/IceRuins/icemoon_underground_abandoned_plasma_facility.dmm +++ b/_maps/RandomRuins/IceRuins/icemoon_underground_abandoned_plasma_facility.dmm @@ -2670,7 +2670,7 @@ /turf/open/floor/plating/snowed/smoothed/icemoon, /area/icemoon/underground/explored) "QJ" = ( -/obj/machinery/mineral/equipment_vendor, +/obj/machinery/computer/order_console/mining, /obj/effect/decal/cleanable/dirt, /obj/machinery/light/small/broken/directional/west, /turf/open/floor/wood/large, diff --git a/_maps/map_files/Deltastation/DeltaStation2.dmm b/_maps/map_files/Deltastation/DeltaStation2.dmm index 91107830e2f..d806f0a88aa 100644 --- a/_maps/map_files/Deltastation/DeltaStation2.dmm +++ b/_maps/map_files/Deltastation/DeltaStation2.dmm @@ -62557,7 +62557,7 @@ /turf/open/floor/iron/dark, /area/station/engineering/atmos/hfr_room) "pnq" = ( -/obj/machinery/computer/chef_order, +/obj/machinery/computer/order_console/cook, /obj/effect/turf_decal/bot, /obj/effect/turf_decal/tile/neutral/anticorner/contrasted{ dir = 4 @@ -65794,7 +65794,7 @@ /turf/open/floor/iron, /area/station/hallway/secondary/entry) "pZo" = ( -/obj/machinery/mineral/equipment_vendor, +/obj/machinery/computer/order_console/mining, /obj/effect/decal/cleanable/dirt, /obj/machinery/light/directional/north, /obj/effect/turf_decal/bot, diff --git a/_maps/map_files/IceBoxStation/IceBoxStation.dmm b/_maps/map_files/IceBoxStation/IceBoxStation.dmm index 26b085f44c8..8d139891e5f 100644 --- a/_maps/map_files/IceBoxStation/IceBoxStation.dmm +++ b/_maps/map_files/IceBoxStation/IceBoxStation.dmm @@ -12030,7 +12030,7 @@ /turf/open/floor/plating/snowed/icemoon, /area/mine/laborcamp/security) "dBx" = ( -/obj/machinery/mineral/equipment_vendor, +/obj/machinery/computer/order_console/mining, /obj/machinery/light/small/directional/south, /obj/machinery/light_switch/directional/south, /obj/machinery/newscaster/directional/east, @@ -24945,7 +24945,7 @@ /turf/open/floor/engine, /area/station/science/genetics) "hDx" = ( -/obj/machinery/mineral/equipment_vendor, +/obj/machinery/computer/order_console/mining, /obj/effect/decal/cleanable/dirt, /obj/machinery/camera{ c_tag = "Mining Bunks"; @@ -31546,7 +31546,7 @@ /turf/open/floor/iron, /area/station/engineering/atmos) "jHT" = ( -/obj/machinery/computer/chef_order{ +/obj/machinery/computer/order_console/cook{ dir = 1 }, /obj/effect/turf_decal/stripes/line{ @@ -44368,7 +44368,7 @@ /turf/open/floor/iron/dark, /area/station/engineering/main) "nFk" = ( -/obj/machinery/mineral/equipment_vendor, +/obj/machinery/computer/order_console/mining, /obj/effect/turf_decal/tile/brown{ dir = 4 }, @@ -52083,7 +52083,7 @@ /turf/open/floor/iron, /area/station/engineering/atmos) "pYl" = ( -/obj/machinery/mineral/equipment_vendor, +/obj/machinery/computer/order_console/mining, /obj/effect/turf_decal/tile/brown{ dir = 4 }, diff --git a/_maps/map_files/KiloStation/KiloStation.dmm b/_maps/map_files/KiloStation/KiloStation.dmm index e87bf01f3ce..3d3826e8df2 100644 --- a/_maps/map_files/KiloStation/KiloStation.dmm +++ b/_maps/map_files/KiloStation/KiloStation.dmm @@ -38471,7 +38471,7 @@ /turf/open/floor/grass, /area/station/medical/psychology) "kUy" = ( -/obj/machinery/computer/chef_order{ +/obj/machinery/computer/order_console/cook{ dir = 8 }, /obj/effect/turf_decal/bot, @@ -45206,7 +45206,7 @@ /turf/open/floor/iron/showroomfloor, /area/station/science/xenobiology) "mQj" = ( -/obj/machinery/mineral/equipment_vendor, +/obj/machinery/computer/order_console/mining, /obj/effect/turf_decal/bot, /obj/effect/turf_decal/tile/neutral{ dir = 1 diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index f3ad55a3bba..a33413edcd8 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -15341,7 +15341,7 @@ }, /obj/structure/cable, /obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4, -/obj/machinery/computer/chef_order{ +/obj/machinery/computer/order_console/cook{ dir = 8 }, /obj/effect/mapping_helpers/burnt_floor, @@ -49644,7 +49644,7 @@ /turf/open/floor/wood, /area/station/service/library) "rFF" = ( -/obj/machinery/mineral/equipment_vendor, +/obj/machinery/computer/order_console/mining, /obj/effect/turf_decal/tile/brown/anticorner/contrasted{ dir = 8 }, diff --git a/_maps/map_files/Mining/Lavaland.dmm b/_maps/map_files/Mining/Lavaland.dmm index ca023c86f6f..24d4882e646 100644 --- a/_maps/map_files/Mining/Lavaland.dmm +++ b/_maps/map_files/Mining/Lavaland.dmm @@ -1665,7 +1665,7 @@ /turf/open/floor/plating, /area/mine/maintenance/living/north) "kx" = ( -/obj/machinery/mineral/equipment_vendor, +/obj/machinery/computer/order_console/mining, /obj/effect/turf_decal/trimline/brown/filled/line, /turf/open/floor/iron/dark/smooth_edge{ dir = 1 @@ -1803,7 +1803,7 @@ /turf/open/floor/iron/dark, /area/mine/production) "lg" = ( -/obj/machinery/mineral/equipment_vendor, +/obj/machinery/computer/order_console/mining, /obj/effect/turf_decal/trimline/brown/filled/line{ dir = 1 }, diff --git a/_maps/map_files/tramstation/tramstation.dmm b/_maps/map_files/tramstation/tramstation.dmm index 32e3db9c0c1..1c1c2d6b544 100644 --- a/_maps/map_files/tramstation/tramstation.dmm +++ b/_maps/map_files/tramstation/tramstation.dmm @@ -25144,7 +25144,7 @@ /turf/open/floor/iron, /area/station/hallway/secondary/exit) "jgk" = ( -/obj/machinery/computer/chef_order, +/obj/machinery/computer/order_console/cook, /obj/effect/turf_decal/tile/neutral/fourcorners, /obj/item/radio/intercom/directional/north, /turf/open/floor/iron, @@ -63042,7 +63042,7 @@ /turf/open/floor/iron, /area/station/commons/storage/tools) "wGF" = ( -/obj/machinery/mineral/equipment_vendor, +/obj/machinery/computer/order_console/mining, /obj/effect/turf_decal/tile/brown{ dir = 4 }, diff --git a/code/__DEFINES/computers.dm b/code/__DEFINES/computers.dm new file mode 100644 index 00000000000..1349913c183 --- /dev/null +++ b/code/__DEFINES/computers.dm @@ -0,0 +1,10 @@ +//Categories used for the order console +#define CATEGORY_FRUITS_VEGGIES "Veggies" +#define CATEGORY_MILK_EGGS "Milk & Eggs" +#define CATEGORY_SAUCES_REAGENTS "Reagents" + +#define CATEGORY_GOLEM "Golem" +#define CATEGORY_MINING "Mining" +#define CATEGORY_CONSUMABLES "Consumables" +#define CATEGORY_TOYS_DRONE "Toys & Drones" +#define CATEGORY_PKA "PKAs" diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index a9dc419c30b..4be1918ced6 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -57,3 +57,6 @@ GLOBAL_LIST_EMPTY(air_vent_names) // Name list of all air vents GLOBAL_LIST_EMPTY(roundstart_station_borgcharger_areas) // List of area names of roundstart station cyborg rechargers, for the low charge/no charge cyborg screen alert tooltips. GLOBAL_LIST_EMPTY(roundstart_station_mechcharger_areas) // List of area names of roundstart station mech rechargers, for the low charge/no charge mech screen alert tooltips. + +///List of all types of '/obj/machinery/mining_ltsrbt' +GLOBAL_LIST_EMPTY(mining_ltsrbt) diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm index 23741ea34ba..f89c94e9dc0 100644 --- a/code/controllers/subsystem/shuttle.dm +++ b/code/controllers/subsystem/shuttle.dm @@ -142,6 +142,8 @@ SUBSYSTEM_DEF(shuttle) while(length(pack_processing)) var/datum/supply_pack/pack = pack_processing[length(pack_processing)] pack_processing.len-- + if(!initial(pack.contains)) + continue if(ispath(pack, /datum/supply_pack)) pack = new pack @@ -150,9 +152,6 @@ SUBSYSTEM_DEF(shuttle) pack_processing += generated_packs continue - if(!pack.contains) - continue - supply_packs[pack.id] = pack setup_shuttles(stationary_docking_ports) diff --git a/code/game/machinery/computer/_computer.dm b/code/game/machinery/computer/_computer.dm index 6e1174cde49..8c964dfe152 100644 --- a/code/game/machinery/computer/_computer.dm +++ b/code/game/machinery/computer/_computer.dm @@ -42,8 +42,9 @@ if(machine_stat & NOPOWER) // Your screen can't be on if you've got no damn charge return - . += mutable_appearance(icon, icon_screen) - . += emissive_appearance(icon, icon_screen, src) + if(icon_screen) + . += mutable_appearance(icon, icon_screen) + . += emissive_appearance(icon, icon_screen, src) /obj/machinery/computer/power_change() . = ..() diff --git a/code/game/machinery/computer/chef_orders/chef_order.dm b/code/game/machinery/computer/chef_orders/chef_order.dm deleted file mode 100644 index 524839c2a7b..00000000000 --- a/code/game/machinery/computer/chef_orders/chef_order.dm +++ /dev/null @@ -1,125 +0,0 @@ - -/obj/machinery/computer/chef_order - name = "Produce Orders Console" - desc = "An interface for ordering fresh produce and other. A far more expensive option than the botanists, but oh well." - icon_screen = "request" - icon_keyboard = "generic_key" - circuit = /obj/item/circuitboard/computer/chef_order - light_color = LIGHT_COLOR_ORANGE - - COOLDOWN_DECLARE(order_cooldown) - var/static/list/order_datums = list() - var/list/grocery_list = list() - - var/obj/item/radio/radio - var/radio_channel = RADIO_CHANNEL_SUPPLY - -/obj/machinery/computer/chef_order/Initialize(mapload) - . = ..() - radio = new(src) - radio.set_frequency(FREQ_SUPPLY) - radio.subspace_transmission = TRUE - radio.canhear_range = 0 - radio.recalculateChannels() - - if(!order_datums.len) - for(var/path in subtypesof(/datum/orderable_item)) - order_datums += new path - -/obj/machinery/computer/chef_order/Destroy() - QDEL_NULL(radio) - . = ..() - -/obj/machinery/computer/chef_order/proc/get_total_cost() - . = 0 - for(var/datum/orderable_item/item as anything in grocery_list) - . += grocery_list[item] * item.cost_per_order - -/obj/machinery/computer/chef_order/ui_interact(mob/user, datum/tgui/ui) - . = ..() - ui = SStgui.try_update_ui(user, src, ui) - if(!ui) - ui = new(user, src, "ProduceConsole", name) - ui.open() - -/obj/machinery/computer/chef_order/ui_data(mob/user) - . = ..() - .["off_cooldown"] = COOLDOWN_FINISHED(src, order_cooldown) - -/obj/machinery/computer/chef_order/ui_static_data(mob/user) - . = ..() - .["total_cost"] = get_total_cost() - .["order_datums"] = list() - for(var/datum/orderable_item/item as anything in order_datums) - .["order_datums"] += list(list( - "name" = item.name, - "desc" = item.desc, - "cat" = item.category_index, - "ref" = REF(item), - "cost" = item.cost_per_order, - "amt" = grocery_list[item] - )) - -/obj/machinery/computer/chef_order/ui_act(action, params) - . = ..() - if(.) - return - if(!isliving(usr)) - return - var/mob/living/chef = usr - //this is null if the action doesn't need it (purchase, quickpurchase) - var/datum/orderable_item/wanted_item = locate(params["target"]) in order_datums - switch(action) - if("cart_set") - grocery_list[wanted_item] = clamp(params["amt"], 0, 20) - if(!grocery_list[wanted_item]) - grocery_list -= wanted_item - update_static_data(chef) - if("purchase") - if(!grocery_list.len || !COOLDOWN_FINISHED(src, order_cooldown)) - return - var/obj/item/card/id/chef_card = chef.get_idcard(TRUE) - if(!chef_card || !chef_card.registered_account) - say("No bank account detected!") - return - var/final_cost = get_total_cost() - if(!chef_card.registered_account.adjust_money(-final_cost, "Chef Order: Purchase")) - say("Sorry, but you do not have enough money.") - return - say("Thank you for your purchase! It will arrive on the next cargo shuttle!") - var/message = "The kitchen has ordered groceries which will arrive on the cargo shuttle! Please make sure it gets to them as soon as possible!" - radio.talk_into(src, message, radio_channel) - COOLDOWN_START(src, order_cooldown, 60 SECONDS) - for(var/datum/orderable_item/ordered_item in grocery_list) - if(ordered_item in SSshuttle.chef_groceries) - SSshuttle.chef_groceries[ordered_item] += grocery_list[ordered_item] - else - SSshuttle.chef_groceries[ordered_item] = grocery_list[ordered_item] - grocery_list.Cut() - update_static_data(chef) - if("express") - if(!grocery_list.len || !COOLDOWN_FINISHED(src, order_cooldown)) - return - var/obj/item/card/id/chef_card = chef.get_idcard(TRUE) - if(!chef_card || !chef_card.registered_account) - say("No bank account detected!") - return - var/final_cost = get_total_cost() - final_cost *= 2 - if(!chef_card.registered_account.adjust_money(-final_cost, "Chef Order: Purchase")) - say("Sorry, but you do not have enough money. Remember, Express upcharges the cost!") - return - say("Thank you for your purchase! Please note: The charge of this purchase and machine cooldown has been doubled!") - COOLDOWN_START(src, order_cooldown, 120 SECONDS) - var/list/ordered_paths = list() - for(var/datum/orderable_item/item as anything in grocery_list)//every order - for(var/amt in 1 to grocery_list[item])//every order amount - ordered_paths += item.item_path - podspawn(list( - "target" = get_turf(chef), - "style" = STYLE_BLUESPACE, - "spawn" = ordered_paths - )) - grocery_list.Cut() - update_static_data(chef) - . = TRUE diff --git a/code/game/machinery/computer/chef_orders/order_datum.dm b/code/game/machinery/computer/chef_orders/order_datum.dm deleted file mode 100644 index 796f503c501..00000000000 --- a/code/game/machinery/computer/chef_orders/order_datum.dm +++ /dev/null @@ -1,341 +0,0 @@ - -#define CATEGORY_FRUITS_VEGGIES 1 -#define CATEGORY_MILK_EGGS 2 -#define CATEGORY_SAUCES_REAGENTS 3 - -///A datum for chef ordering options from the chef's computer. -/datum/orderable_item - var/name = "Orderable Item Name" - //description set automatically unless it's hard set by the subtype - var/desc - var/category_index = CATEGORY_FRUITS_VEGGIES - var/obj/item/item_path - var/cost_per_order = 10 - -/datum/orderable_item/New() - . = ..() - if(type == /datum/orderable_item) - return - if(!item_path) - CRASH("[type] orderable item datum has NO ITEM PATH!") - if(!desc) - desc = initial(item_path.desc) - -/datum/orderable_item/Destroy(force, ...) - . = ..() - qdel(item_path) - -//Fruits and Veggies - -/datum/orderable_item/potato - name = "Potato" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/food/grown/potato - -/datum/orderable_item/tomato - name = "Tomato" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/food/grown/tomato - -/datum/orderable_item/carrot - name = "Carrot" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/food/grown/carrot - -/datum/orderable_item/eggplant - name = "Eggplant" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/food/grown/eggplant - -/datum/orderable_item/mushroom - name = "Plump Helmet" - desc = "Plumus Hellmus: Plump, soft and s-so inviting~" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/food/grown/mushroom/plumphelmet - -/datum/orderable_item/cabbage - name = "Cabbage" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/food/grown/cabbage - -/datum/orderable_item/beets - name = "Onion" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/food/grown/onion - -/datum/orderable_item/apple - name = "Apple" - category_index = CATEGORY_FRUITS_VEGGIES - item_path =/obj/item/food/grown/apple - -/datum/orderable_item/pumpkin - name = "Pumpkin" - category_index = CATEGORY_FRUITS_VEGGIES - item_path =/obj/item/food/grown/pumpkin - -/datum/orderable_item/watermelon - name = "Watermelon" - category_index = CATEGORY_FRUITS_VEGGIES - item_path =/obj/item/food/grown/watermelon - -/datum/orderable_item/corn - name = "Corn" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/food/grown/corn - -/datum/orderable_item/soybean - name = "Soybeans" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/food/grown/soybeans - -/datum/orderable_item/garlic - name = "Garlic" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/food/grown/garlic - -/datum/orderable_item/cherries - name = "Cherries" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/food/grown/cherries - -/datum/orderable_item/chanterelle - name = "Chanterelle" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/food/grown/mushroom/chanterelle - -/datum/orderable_item/cocoa - name = "Cocoa" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/food/grown/cocoapod - -/datum/orderable_item/herbs - name = "Bundle of Herbs" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/food/grown/herbs - cost_per_order = 5 - -/datum/orderable_item/bell_pepper - name = "Bell Pepper" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/food/grown/bell_pepper - -/datum/orderable_item/cucumbers - name = "Cucumber" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/food/grown/cucumber - cost_per_order = 10 - - -/datum/orderable_item/pickles - name = "Jar of pickles" - category_index = CATEGORY_FRUITS_VEGGIES - item_path = /obj/item/storage/fancy/pickles_jar - cost_per_order = 60 - -//Milk and Eggs - -/datum/orderable_item/milk - name = "Milk" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/reagent_containers/condiment/milk - cost_per_order = 30 - -/datum/orderable_item/soymilk - name = "Soy Milk" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/reagent_containers/condiment/soymilk - cost_per_order = 30 - -/datum/orderable_item/cream - name = "Cream" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/reagent_containers/cup/glass/bottle/juice/cream - cost_per_order = 40 - -/datum/orderable_item/yoghurt - name = "Yoghurt" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/reagent_containers/condiment/yoghurt - cost_per_order = 40 - -/datum/orderable_item/eggs - name = "Egg Carton" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/storage/fancy/egg_box - cost_per_order = 40 - -/datum/orderable_item/fillet - name = "Fish Fillet" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/food/fishmeat - cost_per_order = 12 - -/datum/orderable_item/spider_eggs - name = "Spider Eggs" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/food/spidereggs - -/datum/orderable_item/moonfish_eggs - name = "Moonfish Eggs" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/food/moonfish_eggs - cost_per_order = 30 - -/datum/orderable_item/desert_snails - name = "Canned Desert Snails" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/food/desert_snails - cost_per_order = 20 - -/datum/orderable_item/canned_jellyfish - name = "Canned Gunner Jellyfish" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/food/canned_jellyfish - cost_per_order = 20 - -/datum/orderable_item/canned_larvae - name = "Canned Larvae" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/food/larvae - cost_per_order = 20 - -/datum/orderable_item/canned_tomatoes - name = "Canned San Marzano Tomatoes" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/food/canned/tomatoes - cost_per_order = 30 - -/datum/orderable_item/canned_pine_nuts - name = "Canned Pine Nuts" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/food/canned/pine_nuts - cost_per_order = 20 - -/datum/orderable_item/ready_donk - name = "Ready-Donk Meal: Bachelor Chow" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/food/ready_donk - cost_per_order = 40 - -/datum/orderable_item/ready_donk_mac - name = "Ready-Donk Meal: Donk-a-Roni" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/food/ready_donk/mac_n_cheese - cost_per_order = 40 - -/datum/orderable_item/ready_donk_mex - name = "Ready-Donk Meal: Donkhiladas" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/food/ready_donk/donkhiladas - cost_per_order = 40 - -/datum/orderable_item/tiziran_goods - name = "Tiziran Farm-Fresh Pack" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/storage/box/tiziran_goods - cost_per_order = 120 - -/datum/orderable_item/tiziran_cans - name = "Tiziran Canned Goods Pack" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/storage/box/tiziran_cans - cost_per_order = 120 - -/datum/orderable_item/tiziran_meats - name = "Tiziran Meatmarket Pack" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/storage/box/tiziran_meats - cost_per_order = 120 - -/datum/orderable_item/mothic_goods - name = "Mothic Farm-Fresh Pack" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/storage/box/mothic_goods - cost_per_order = 120 - -/datum/orderable_item/mothic_cans_sauces - name = "Mothic Pantry Pack" - category_index = CATEGORY_MILK_EGGS - item_path = /obj/item/storage/box/mothic_cans_sauces - cost_per_order = 120 - -//Reagents - -/datum/orderable_item/flour - name = "Flour Sack" - category_index = CATEGORY_SAUCES_REAGENTS - item_path = /obj/item/reagent_containers/condiment/flour - cost_per_order = 30 - -/datum/orderable_item/sugar - name = "Sugar Sack" - category_index = CATEGORY_SAUCES_REAGENTS - item_path = /obj/item/reagent_containers/condiment/sugar - cost_per_order = 30 - -/datum/orderable_item/rice - name = "Rice Sack" - category_index = CATEGORY_SAUCES_REAGENTS - item_path = /obj/item/reagent_containers/condiment/rice - cost_per_order = 30 - -/datum/orderable_item/cornmeal - name = "Cornmeal Box" - category_index = CATEGORY_SAUCES_REAGENTS - item_path = /obj/item/reagent_containers/condiment/cornmeal - cost_per_order = 30 - -/datum/orderable_item/enzyme - name = "Universal Enzyme" - category_index = CATEGORY_SAUCES_REAGENTS - item_path = /obj/item/reagent_containers/condiment/enzyme - cost_per_order = 40 - -/datum/orderable_item/salt - name = "Salt Shaker" - category_index = CATEGORY_SAUCES_REAGENTS - item_path = /obj/item/reagent_containers/condiment/saltshaker - cost_per_order = 15 - -/datum/orderable_item/pepper - name = "Pepper Mill" - category_index = CATEGORY_SAUCES_REAGENTS - item_path = /obj/item/reagent_containers/condiment/peppermill - cost_per_order = 15 - -/datum/orderable_item/soysauce - name = "Soy Sauce" - category_index = CATEGORY_SAUCES_REAGENTS - item_path = /obj/item/reagent_containers/condiment/soysauce - cost_per_order = 15 - -/datum/orderable_item/bbqsauce - name = "BBQ Sauce" - category_index = CATEGORY_SAUCES_REAGENTS - item_path = /obj/item/reagent_containers/condiment/bbqsauce - cost_per_order = 60 - -/datum/orderable_item/vinegar - name = "Vinegar" - category_index = CATEGORY_SAUCES_REAGENTS - item_path = /obj/item/reagent_containers/condiment/vinegar - cost_per_order = 30 - -/datum/orderable_item/quality_oil - name = "Quality Oil" - category_index = CATEGORY_SAUCES_REAGENTS - item_path = /obj/item/reagent_containers/condiment/quality_oil - cost_per_order = 50 //Extra Virgin, just like you, the reader - -/datum/orderable_item/peanut_butter - name = "Peanut Butter" - category_index = CATEGORY_SAUCES_REAGENTS - item_path = /obj/item/reagent_containers/condiment/peanut_butter - cost_per_order = 30 - -/datum/orderable_item/cherryjelly - name = "Cherry Jelly" - category_index = CATEGORY_SAUCES_REAGENTS - item_path = /obj/item/reagent_containers/condiment/cherryjelly - cost_per_order = 30 -// diff --git a/code/game/machinery/computer/orders/order_computer/cook_order.dm b/code/game/machinery/computer/orders/order_computer/cook_order.dm new file mode 100644 index 00000000000..0b0de93b713 --- /dev/null +++ b/code/game/machinery/computer/orders/order_computer/cook_order.dm @@ -0,0 +1,21 @@ +/obj/machinery/computer/order_console/cook + name = "Produce Orders Console" + desc = "An interface for ordering fresh produce and other. A far more expensive option than the botanists, but oh well." + circuit = /obj/item/circuitboard/computer/order_console + order_categories = list( + CATEGORY_FRUITS_VEGGIES, + CATEGORY_MILK_EGGS, + CATEGORY_SAUCES_REAGENTS, + ) + +/obj/machinery/computer/order_console/cook/order_groceries(mob/living/purchaser, obj/item/card/id/card, list/groceries, ltsrbt_delivered = FALSE) + say("Thank you for your purchase! It will arrive on the next cargo shuttle!") + radio.talk_into(src, "The kitchen has ordered groceries which will arrive on the cargo shuttle! Please make sure it gets to them as soon as possible!", radio_channel) + for(var/datum/orderable_item/ordered_item in groceries) + if(!(ordered_item.category_index in order_categories)) + groceries.Remove(ordered_item) + continue + if(ordered_item in SSshuttle.chef_groceries) + SSshuttle.chef_groceries[ordered_item] += groceries[ordered_item] + else + SSshuttle.chef_groceries[ordered_item] = groceries[ordered_item] diff --git a/code/game/machinery/computer/orders/order_computer/golem_order.dm b/code/game/machinery/computer/orders/order_computer/golem_order.dm new file mode 100644 index 00000000000..848cd720f39 --- /dev/null +++ b/code/game/machinery/computer/orders/order_computer/golem_order.dm @@ -0,0 +1,13 @@ +/obj/machinery/computer/order_console/mining/golem + name = "golem ship equipment vendor" + circuit = /obj/item/circuitboard/computer/order_console/mining/golem + forced_express = TRUE + express_cost_multiplier = 1 + uses_ltsrbt = FALSE + order_categories = list( + CATEGORY_GOLEM, + CATEGORY_MINING, + CATEGORY_CONSUMABLES, + CATEGORY_TOYS_DRONE, + CATEGORY_PKA, + ) diff --git a/code/game/machinery/computer/orders/order_computer/mining_order.dm b/code/game/machinery/computer/orders/order_computer/mining_order.dm new file mode 100644 index 00000000000..8819d9e5a38 --- /dev/null +++ b/code/game/machinery/computer/orders/order_computer/mining_order.dm @@ -0,0 +1,199 @@ +/obj/machinery/computer/order_console/mining + name = "mining equipment vendor" + desc = "An equipment shop for miners, points collected at an ore redemption machine can be spent here." + icon = 'icons/obj/machines/mining_machines.dmi' + icon_state = "mining" + icon_keyboard = null + icon_screen = null + circuit = /obj/item/circuitboard/computer/order_console/mining + + cooldown_time = 10 SECONDS //just time to let you know your order went through. + express_cost_multiplier = 1.5 + uses_ltsrbt = TRUE + order_categories = list( + CATEGORY_MINING, + CATEGORY_CONSUMABLES, + CATEGORY_TOYS_DRONE, + CATEGORY_PKA, + ) + +/obj/machinery/computer/order_console/mining/purchase_items(obj/item/card/id/card, express = FALSE) + var/final_cost = get_total_cost() + var/failure_message = "Sorry, but you do not have enough mining points." + if(express) + final_cost *= express_cost_multiplier + failure_message += "Remember, Express upcharges the cost!" + if(final_cost <= card.mining_points) + card.mining_points -= final_cost + return TRUE + say(failure_message) + return FALSE + +/obj/machinery/computer/order_console/mining/order_groceries(mob/living/purchaser, obj/item/card/id/card, list/groceries, ltsrbt_delivered = FALSE) + var/list/things_to_order = list() + for(var/datum/orderable_item/item as anything in groceries) + things_to_order[item.item_path] = groceries[item] + + var/datum/supply_pack/custom/mining_pack = new(purchaser, things_to_order) + var/datum/supply_order/new_order = new( + pack = mining_pack, \ + orderer = purchaser, \ + orderer_rank = "Mining Vendor", \ + orderer_ckey = purchaser.ckey, \ + reason = "", \ + paying_account = card.registered_account, \ + department_destination = null, \ + coupon = null, \ + charge_on_purchase = FALSE, + ) + if(ltsrbt_delivered) + var/obj/machinery/mining_ltsrbt/ltsrbt + for(var/obj/machinery/mining_ltsrbt/all_ltsrbts as anything in GLOB.mining_ltsrbt) + if(all_ltsrbts.machine_stat & (NOPOWER|BROKEN|MAINT)) //not functional + continue + if(!all_ltsrbts.enabled) //not enabled + continue + ltsrbt = all_ltsrbts + break + if(ltsrbt && ltsrbt.recieve_order(new_order)) + return + say("Found no functional mining LTSRBTs. If there is one, it is likely destroyed, powered down, or under maintenance. Your delivery has instead been rerouted to Cargo.") + else + say("Thank you for your purchase! It will arrive on the next cargo shuttle!") + radio.talk_into(src, "A shaft miner has ordered equipment which will arrive on the cargo shuttle! Please make sure it gets to them as soon as possible!", radio_channel) + SSshuttle.shopping_list += new_order + +/obj/machinery/computer/order_console/mining/ui_data(mob/user) + var/list/data = ..() + if(!isliving(user)) + return data + var/mob/living/living_user = user + var/obj/item/card/id/id_card = living_user.get_idcard(TRUE) + if(id_card) + data["points"] = id_card.mining_points + + return data + +/obj/machinery/computer/order_console/mining/ui_act(action, params) + . = ..() + if(!.) + flick("mining-deny", src) + +/obj/machinery/computer/order_console/mining/attackby(obj/item/weapon, mob/user, params) + if(istype(weapon, /obj/item/mining_voucher)) + redeem_voucher(weapon, user) + return + return ..() + +/obj/machinery/computer/order_console/mining/update_icon_state() + icon_state = "[initial(icon_state)][powered() ? null : "-off"]" + return ..() + + +/** + * Allows user to redeem a mining voucher for one set of a mining equipment + * + * * Arguments: + * * voucher The mining voucher that is being used to redeem the mining equipment + * * redeemer The mob that is redeeming the mining equipment + */ +/obj/machinery/computer/order_console/mining/proc/redeem_voucher(obj/item/mining_voucher/voucher, mob/redeemer) + var/static/list/set_types + if(!set_types) + set_types = list() + for(var/datum/voucher_set/static_set as anything in subtypesof(/datum/voucher_set)) + set_types[initial(static_set.name)] = new static_set + + var/list/items = list() + for(var/set_name in set_types) + var/datum/voucher_set/current_set = set_types[set_name] + var/datum/radial_menu_choice/option = new + option.image = image(icon = current_set.icon, icon_state = current_set.icon_state) + option.info = span_boldnotice(current_set.description) + items[set_name] = option + + var/selection = show_radial_menu(redeemer, src, items, custom_check = CALLBACK(src, PROC_REF(check_menu), voucher, redeemer), radius = 38, require_near = TRUE, tooltips = TRUE) + if(!selection) + return + + var/datum/voucher_set/chosen_set = set_types[selection] + for(var/item in chosen_set.set_items) + new item(drop_location()) + + SSblackbox.record_feedback("tally", "mining_voucher_redeemed", 1, selection) + qdel(voucher) + +/** + * Checks if we are allowed to interact with a radial menu + * + * * Arguments: + * * voucher The mining voucher that is being used to redeem a mining equipment + * * redeemer The living mob interacting with the menu + */ +/obj/machinery/computer/order_console/mining/proc/check_menu(obj/item/mining_voucher/voucher, mob/living/redeemer) + if(!istype(redeemer)) + return FALSE + if(redeemer.incapacitated()) + return FALSE + if(QDELETED(voucher)) + return FALSE + if(!redeemer.is_holding(voucher)) + return FALSE + return TRUE + +/**********************Mining Equipment Voucher**********************/ + +/obj/item/mining_voucher + name = "mining voucher" + desc = "A token to redeem a piece of equipment. Use it on a mining equipment vendor." + icon = 'icons/obj/mining.dmi' + icon_state = "mining_voucher" + w_class = WEIGHT_CLASS_TINY + +/**********************Mining Point Card**********************/ + +#define TO_USER_ID "To ID" +#define TO_POINT_CARD "To Card" + +/obj/item/card/mining_point_card + name = "mining point transfer card" + desc = "A small, reusable card for transferring mining points. Swipe your ID card over it to start the process." + icon_state = "data_1" + + ///Amount of points this card contains. + var/points = 500 + +/obj/item/card/mining_point_card/examine(mob/user) + . = ..() + . += span_notice("There's [points] point\s on the card.") + +/obj/item/card/mining_point_card/attackby(obj/item/attacking_item, mob/user, params) + if(!isidcard(attacking_item)) + return ..() + if(!points) + to_chat(user, span_alert("There's no points left on [src].")) + return + var/obj/item/card/id/attacking_id = attacking_item + balloon_alert(user, "starting transfer") + var/point_movement = tgui_alert(user, "To ID (from card) or to card (from ID)?", "Mining Points Transfer", list(TO_USER_ID, TO_POINT_CARD)) + if(!point_movement) + return + var/amount = tgui_input_number(user, "How much do you want to transfer? ID Balance: [attacking_id.mining_points], Card Balance: [points]", "Transfer Points", min_value = 0, round_value = 1) + if(!amount) + return + switch(point_movement) + if(TO_USER_ID) + if(amount > points) + amount = points + attacking_id.mining_points += amount + points -= amount + to_chat(user, span_notice("You transfer [amount] mining points from [src] to [attacking_id].")) + if(TO_POINT_CARD) + if(amount > attacking_id.mining_points) + amount = attacking_id.mining_points + attacking_id.mining_points -= amount + points += amount + to_chat(user, span_notice("You transfer [amount] mining points from [attacking_id] to [src].")) + +#undef TO_POINT_CARD +#undef TO_USER_ID diff --git a/code/game/machinery/computer/orders/order_computer/order_computer.dm b/code/game/machinery/computer/orders/order_computer/order_computer.dm new file mode 100644 index 00000000000..736bb7cfb20 --- /dev/null +++ b/code/game/machinery/computer/orders/order_computer/order_computer.dm @@ -0,0 +1,176 @@ +///List of all items that can be found in the different types of order consoles, to purchase. +GLOBAL_LIST_EMPTY(order_console_products) + +/obj/machinery/computer/order_console + name = "Orders Console" + desc = "An interface for ordering specific ingredients from Cargo, with an express option at the cost of more money." + icon_screen = "request" + icon_keyboard = "generic_key" + light_color = LIGHT_COLOR_ORANGE + + ///Cooldown between order uses. + COOLDOWN_DECLARE(order_cooldown) + ///Cooldown time between uses, express console will have extra time depending on express_cost_multiplier. + var/cooldown_time = 60 SECONDS + ///Boolean on whether they can bluespace orders using a '/obj/machinery/mining_ltsrbt' + var/uses_ltsrbt = FALSE + + ///The radio the console can speak into + var/obj/item/radio/radio + ///The channel we will attempt to speak into through our radio. + var/radio_channel = RADIO_CHANNEL_SUPPLY + + ///Whether the console can only use express mode ONLY + var/forced_express = FALSE + ///Multiplied cost to use express mode + var/express_cost_multiplier = 2 + ///The categories of orderable items this console can view and purchase. + var/list/order_categories = list() + ///The current list of things we're trying to order, waiting for checkout. + var/list/datum/orderable_item/grocery_list = list() + +/obj/machinery/computer/order_console/Initialize(mapload) + . = ..() + radio = new(src) + radio.set_frequency(FREQ_SUPPLY) + radio.subspace_transmission = TRUE + radio.canhear_range = 0 + radio.recalculateChannels() + + if(GLOB.order_console_products.len) + return + for(var/datum/orderable_item/path as anything in subtypesof(/datum/orderable_item)) + if(!initial(path.item_path)) + continue + GLOB.order_console_products += new path + +/obj/machinery/computer/order_console/Destroy() + QDEL_NULL(radio) + return ..() + +/obj/machinery/computer/order_console/proc/get_total_cost() + var/cost = 0 + for(var/datum/orderable_item/item as anything in grocery_list) + cost += grocery_list[item] * item.cost_per_order + return cost + +/obj/machinery/computer/order_console/ui_interact(mob/user, datum/tgui/ui) + . = ..() + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "ProduceConsole", name) + ui.open() + +/obj/machinery/computer/order_console/ui_data(mob/user) + var/list/data = list() + data["total_cost"] = get_total_cost() + data["off_cooldown"] = COOLDOWN_FINISHED(src, order_cooldown) + + if(!isliving(user)) + return data + var/mob/living/living_user = user + var/obj/item/card/id/id_card = living_user.get_idcard(TRUE) + if(id_card) + data["points"] = id_card.registered_account?.account_balance + + return data + +/obj/machinery/computer/order_console/ui_static_data(mob/user) + var/list/data = list() + data["ltsrbt_available"] = (uses_ltsrbt && GLOB.mining_ltsrbt.len) + data["forced_express"] = forced_express + data["order_categories"] = order_categories + data["order_datums"] = list() + for(var/datum/orderable_item/item as anything in GLOB.order_console_products) + if(!(item.category_index in order_categories)) + continue + data["order_datums"] += list(list( + "name" = item.name, + "desc" = item.desc, + "cat" = item.category_index, + "ref" = REF(item), + "cost" = item.cost_per_order, + "amt" = grocery_list[item], + )) + return data + +/obj/machinery/computer/order_console/ui_act(action, params) + . = ..() + if(.) + return + if(!isliving(usr)) + return + var/mob/living/living_user = usr + switch(action) + if("cart_set") + //this is null if the action doesn't need it (purchase, quickpurchase) + var/datum/orderable_item/wanted_item = locate(params["target"]) in GLOB.order_console_products + grocery_list[wanted_item] = clamp(params["amt"], 0, 20) + if(!grocery_list[wanted_item]) + grocery_list -= wanted_item + update_static_data(living_user) + if("purchase", "ltsrbt_deliver") + if(!grocery_list.len || !COOLDOWN_FINISHED(src, order_cooldown)) + return + if(forced_express) + return ui_act(action = "express") + var/obj/item/card/id/used_id_card = living_user.get_idcard(TRUE) + if(!used_id_card || !used_id_card.registered_account) + say("No bank account detected!") + return + if(!purchase_items(used_id_card)) + return + order_groceries(living_user, used_id_card, grocery_list, ltsrbt_delivered = (action == "ltsrbt_deliver")) + grocery_list.Cut() + COOLDOWN_START(src, order_cooldown, cooldown_time) + if("express") + if(!grocery_list.len || !COOLDOWN_FINISHED(src, order_cooldown)) + return + var/obj/item/card/id/used_id_card = living_user.get_idcard(TRUE) + if(!used_id_card || !used_id_card.registered_account) + say("No bank account detected!") + return + if(!purchase_items(used_id_card, express = TRUE)) + return + var/say_message = "Thank you for your purchase!" + if(express_cost_multiplier > 1) + say_message += "Please note: The charge of this purchase and machine cooldown has been multiplied by [express_cost_multiplier]!" + COOLDOWN_START(src, order_cooldown, cooldown_time * express_cost_multiplier) + say(say_message) + var/list/ordered_paths = list() + for(var/datum/orderable_item/item as anything in grocery_list)//every order + if(!(item.category_index in order_categories)) + stack_trace("[src] somehow delivered [item] which is not purchasable at this order console.") + grocery_list.Remove(item) + continue + for(var/amt in 1 to grocery_list[item])//every order amount + ordered_paths += item.item_path + podspawn(list( + "target" = get_turf(living_user), + "style" = STYLE_BLUESPACE, + "spawn" = ordered_paths, + )) + grocery_list.Cut() + return TRUE + +/** + * Checks if an ID card is able to afford the total cost of the current console's grocieries + * and deducts the cost if they can. + * Args: + * card - The ID card we check for balance + * express - Boolean on whether we need to add the express cost mulitplier + * returns TRUE if we can afford, FALSE otherwise. + */ +/obj/machinery/computer/order_console/proc/purchase_items(obj/item/card/id/card, express = FALSE) + var/final_cost = get_total_cost() + var/failure_message = "Sorry, but you do not have enough money." + if(express) + final_cost *= express_cost_multiplier + failure_message += "Remember, Express upcharges the cost!" + if(card.registered_account.adjust_money(-final_cost, "[name]: Purchase")) + return TRUE + say(failure_message) + return FALSE + +/obj/machinery/computer/order_console/proc/order_groceries(mob/living/purchaser, obj/item/card/id/card, list/groceries, ltsrbt_delivered = FALSE) + return diff --git a/code/game/machinery/computer/orders/order_items/cook/order_milk_eggs.dm b/code/game/machinery/computer/orders/order_items/cook/order_milk_eggs.dm new file mode 100644 index 00000000000..37541f5cb4d --- /dev/null +++ b/code/game/machinery/computer/orders/order_items/cook/order_milk_eggs.dm @@ -0,0 +1,106 @@ +/datum/orderable_item/milk_eggs + category_index = CATEGORY_MILK_EGGS + +/datum/orderable_item/milk_eggs/milk + name = "Milk" + item_path = /obj/item/reagent_containers/condiment/milk + cost_per_order = 30 + +/datum/orderable_item/milk_eggs/soymilk + name = "Soy Milk" + item_path = /obj/item/reagent_containers/condiment/soymilk + cost_per_order = 30 + +/datum/orderable_item/milk_eggs/cream + name = "Cream" + item_path = /obj/item/reagent_containers/cup/glass/bottle/juice/cream + cost_per_order = 40 + +/datum/orderable_item/milk_eggs/yoghurt + name = "Yoghurt" + item_path = /obj/item/reagent_containers/condiment/yoghurt + cost_per_order = 40 + +/datum/orderable_item/milk_eggs/eggs + name = "Egg Carton" + item_path = /obj/item/storage/fancy/egg_box + cost_per_order = 40 + +/datum/orderable_item/milk_eggs/fillet + name = "Fish Fillet" + item_path = /obj/item/food/fishmeat + cost_per_order = 12 + +/datum/orderable_item/milk_eggs/spider_eggs + name = "Spider Eggs" + item_path = /obj/item/food/spidereggs + +/datum/orderable_item/milk_eggs/moonfish_eggs + name = "Moonfish Eggs" + item_path = /obj/item/food/moonfish_eggs + cost_per_order = 30 + +/datum/orderable_item/milk_eggs/desert_snails + name = "Canned Desert Snails" + item_path = /obj/item/food/desert_snails + cost_per_order = 20 + +/datum/orderable_item/milk_eggs/canned_jellyfish + name = "Canned Gunner Jellyfish" + item_path = /obj/item/food/canned_jellyfish + cost_per_order = 20 + +/datum/orderable_item/milk_eggs/canned_larvae + name = "Canned Larvae" + item_path = /obj/item/food/larvae + cost_per_order = 20 + +/datum/orderable_item/milk_eggs/canned_tomatoes + name = "Canned San Marzano Tomatoes" + item_path = /obj/item/food/canned/tomatoes + cost_per_order = 30 + +/datum/orderable_item/milk_eggs/canned_pine_nuts + name = "Canned Pine Nuts" + item_path = /obj/item/food/canned/pine_nuts + cost_per_order = 20 + +/datum/orderable_item/milk_eggs/ready_donk + name = "Ready-Donk Meal: Bachelor Chow" + item_path = /obj/item/food/ready_donk + cost_per_order = 40 + +/datum/orderable_item/milk_eggs/ready_donk_mac + name = "Ready-Donk Meal: Donk-a-Roni" + item_path = /obj/item/food/ready_donk/mac_n_cheese + cost_per_order = 40 + +/datum/orderable_item/milk_eggs/ready_donk_mex + name = "Ready-Donk Meal: Donkhiladas" + item_path = /obj/item/food/ready_donk/donkhiladas + cost_per_order = 40 + +/datum/orderable_item/milk_eggs/tiziran_goods + name = "Tiziran Farm-Fresh Pack" + item_path = /obj/item/storage/box/tiziran_goods + cost_per_order = 120 + +/datum/orderable_item/milk_eggs/tiziran_cans + name = "Tiziran Canned Goods Pack" + item_path = /obj/item/storage/box/tiziran_cans + cost_per_order = 120 + +/datum/orderable_item/milk_eggs/tiziran_meats + name = "Tiziran Meatmarket Pack" + item_path = /obj/item/storage/box/tiziran_meats + cost_per_order = 120 + +/datum/orderable_item/milk_eggs/mothic_goods + name = "Mothic Farm-Fresh Pack" + item_path = /obj/item/storage/box/mothic_goods + cost_per_order = 120 + +/datum/orderable_item/milk_eggs/mothic_cans_sauces + name = "Mothic Pantry Pack" + item_path = /obj/item/storage/box/mothic_cans_sauces + cost_per_order = 120 diff --git a/code/game/machinery/computer/orders/order_items/cook/order_reagents.dm b/code/game/machinery/computer/orders/order_items/cook/order_reagents.dm new file mode 100644 index 00000000000..db9d20a676f --- /dev/null +++ b/code/game/machinery/computer/orders/order_items/cook/order_reagents.dm @@ -0,0 +1,67 @@ +/datum/orderable_item/reagents + category_index = CATEGORY_SAUCES_REAGENTS + +/datum/orderable_item/reagents/flour + name = "Flour Sack" + item_path = /obj/item/reagent_containers/condiment/flour + cost_per_order = 30 + +/datum/orderable_item/reagents/sugar + name = "Sugar Sack" + item_path = /obj/item/reagent_containers/condiment/sugar + cost_per_order = 30 + +/datum/orderable_item/reagents/rice + name = "Rice Sack" + item_path = /obj/item/reagent_containers/condiment/rice + cost_per_order = 30 + +/datum/orderable_item/reagents/cornmeal + name = "Cornmeal Box" + item_path = /obj/item/reagent_containers/condiment/cornmeal + cost_per_order = 30 + +/datum/orderable_item/reagents/enzyme + name = "Universal Enzyme" + item_path = /obj/item/reagent_containers/condiment/enzyme + cost_per_order = 40 + +/datum/orderable_item/reagents/salt + name = "Salt Shaker" + item_path = /obj/item/reagent_containers/condiment/saltshaker + cost_per_order = 15 + +/datum/orderable_item/reagents/pepper + name = "Pepper Mill" + item_path = /obj/item/reagent_containers/condiment/peppermill + cost_per_order = 15 + +/datum/orderable_item/reagents/soysauce + name = "Soy Sauce" + item_path = /obj/item/reagent_containers/condiment/soysauce + cost_per_order = 15 + +/datum/orderable_item/reagents/bbqsauce + name = "BBQ Sauce" + item_path = /obj/item/reagent_containers/condiment/bbqsauce + cost_per_order = 60 + +/datum/orderable_item/reagents/vinegar + name = "Vinegar" + item_path = /obj/item/reagent_containers/condiment/vinegar + cost_per_order = 30 + +/datum/orderable_item/reagents/quality_oil + name = "Quality Oil" + item_path = /obj/item/reagent_containers/condiment/quality_oil + cost_per_order = 50 //Extra Virgin, just like you, the reader + +/datum/orderable_item/reagents/peanut_butter + name = "Peanut Butter" + item_path = /obj/item/reagent_containers/condiment/peanut_butter + cost_per_order = 30 + +/datum/orderable_item/reagents/cherryjelly + name = "Cherry Jelly" + item_path = /obj/item/reagent_containers/condiment/cherryjelly + cost_per_order = 30 diff --git a/code/game/machinery/computer/orders/order_items/cook/order_veggies.dm b/code/game/machinery/computer/orders/order_items/cook/order_veggies.dm new file mode 100644 index 00000000000..8b0f9d71a4c --- /dev/null +++ b/code/game/machinery/computer/orders/order_items/cook/order_veggies.dm @@ -0,0 +1,86 @@ +/datum/orderable_item/veggies + category_index = CATEGORY_FRUITS_VEGGIES + +/datum/orderable_item/veggies/potato + name = "Potato" + item_path = /obj/item/food/grown/potato + +/datum/orderable_item/veggies/tomato + name = "Tomato" + item_path = /obj/item/food/grown/tomato + +/datum/orderable_item/veggies/carrot + name = "Carrot" + item_path = /obj/item/food/grown/carrot + +/datum/orderable_item/veggies/eggplant + name = "Eggplant" + item_path = /obj/item/food/grown/eggplant + +/datum/orderable_item/veggies/mushroom + name = "Plump Helmet" + desc = "Plumus Hellmus: Plump, soft and s-so inviting~" + item_path = /obj/item/food/grown/mushroom/plumphelmet + +/datum/orderable_item/veggies/cabbage + name = "Cabbage" + item_path = /obj/item/food/grown/cabbage + +/datum/orderable_item/veggies/beets + name = "Onion" + item_path = /obj/item/food/grown/onion + +/datum/orderable_item/veggies/apple + name = "Apple" + item_path = /obj/item/food/grown/apple + +/datum/orderable_item/veggies/pumpkin + name = "Pumpkin" + item_path = /obj/item/food/grown/pumpkin + +/datum/orderable_item/veggies/watermelon + name = "Watermelon" + item_path = /obj/item/food/grown/watermelon + +/datum/orderable_item/veggies/corn + name = "Corn" + item_path = /obj/item/food/grown/corn + +/datum/orderable_item/veggies/soybean + name = "Soybeans" + item_path = /obj/item/food/grown/soybeans + +/datum/orderable_item/veggies/garlic + name = "Garlic" + item_path = /obj/item/food/grown/garlic + +/datum/orderable_item/veggies/cherries + name = "Cherries" + item_path = /obj/item/food/grown/cherries + +/datum/orderable_item/veggies/chanterelle + name = "Chanterelle" + item_path = /obj/item/food/grown/mushroom/chanterelle + +/datum/orderable_item/veggies/cocoa + name = "Cocoa" + item_path = /obj/item/food/grown/cocoapod + +/datum/orderable_item/veggies/herbs + name = "Bundle of Herbs" + item_path = /obj/item/food/grown/herbs + cost_per_order = 5 + +/datum/orderable_item/veggies/bell_pepper + name = "Bell Pepper" + item_path = /obj/item/food/grown/bell_pepper + +/datum/orderable_item/veggies/cucumbers + name = "Cucumber" + item_path = /obj/item/food/grown/cucumber + cost_per_order = 10 + +/datum/orderable_item/veggies/pickles + name = "Jar of pickles" + item_path = /obj/item/storage/fancy/pickles_jar + cost_per_order = 60 diff --git a/code/game/machinery/computer/orders/order_items/mining/order_consumables.dm b/code/game/machinery/computer/orders/order_items/mining/order_consumables.dm new file mode 100644 index 00000000000..f911116049e --- /dev/null +++ b/code/game/machinery/computer/orders/order_items/mining/order_consumables.dm @@ -0,0 +1,43 @@ +/datum/orderable_item/consumables + category_index = CATEGORY_CONSUMABLES + +/datum/orderable_item/consumables/survival_pen + item_path = /obj/item/reagent_containers/hypospray/medipen/survival + cost_per_order = 500 + +/datum/orderable_item/consumables/luxury_pen + item_path = /obj/item/reagent_containers/hypospray/medipen/survival/luxury + cost_per_order = 1000 + +/datum/orderable_item/consumables/medkit + item_path = /obj/item/storage/medkit/brute + cost_per_order = 600 + +/datum/orderable_item/consumables/whiskey + item_path = /obj/item/reagent_containers/cup/glass/bottle/whiskey + cost_per_order = 100 + +/datum/orderable_item/consumables/absinthe + item_path = /obj/item/reagent_containers/cup/glass/bottle/absinthe/premium + cost_per_order = 100 + +/datum/orderable_item/consumables/bubblegum + item_path = /obj/item/storage/box/gum/bubblegum + cost_per_order = 100 + +/datum/orderable_item/consumables/havana_cigars + item_path = /obj/item/clothing/mask/cigarette/cigar/havana + cost_per_order = 150 + +/datum/orderable_item/consumables/havana_cigars + item_path = /obj/item/clothing/mask/cigarette/cigar/havana + cost_per_order = 150 + +/datum/orderable_item/consumables/tracking_implants + item_path = /obj/item/storage/box/minertracker + cost_per_order = 600 + +/datum/orderable_item/consumables/space_cash + item_path = /obj/item/stack/spacecash/c1000 + desc = "A stack of space cash worth 1000 credits." + cost_per_order = 2000 diff --git a/code/game/machinery/computer/orders/order_items/mining/order_golem.dm b/code/game/machinery/computer/orders/order_items/mining/order_golem.dm new file mode 100644 index 00000000000..cbafa844afb --- /dev/null +++ b/code/game/machinery/computer/orders/order_items/mining/order_golem.dm @@ -0,0 +1,35 @@ +/datum/orderable_item/golem + category_index = CATEGORY_GOLEM + +/datum/orderable_item/golem/mining_id + item_path = /obj/item/card/id/advanced/mining + cost_per_order = 250 + +/datum/orderable_item/golem/science_goggles + item_path = /obj/item/clothing/glasses/science + cost_per_order = 250 + +/datum/orderable_item/golem/monkeycubes + item_path = /obj/item/food/monkeycube + cost_per_order = 300 + +/datum/orderable_item/golem/belt + item_path = /obj/item/storage/belt/utility + cost_per_order = 350 + +/datum/orderable_item/golem/royal_cape + item_path = /obj/item/bedsheet/rd/royal_cape + cost_per_order = 500 + +/datum/orderable_item/golem/grey_extract + item_path = /obj/item/slime_extract/grey + cost_per_order = 1000 + +/datum/orderable_item/golem/trigger_guard + item_path = /obj/item/borg/upgrade/modkit/trigger_guard + cost_per_order = 17500 + +/datum/orderable_item/golem/rnd_boards + item_path = /obj/item/storage/box/rndboards + cost_per_order = 2000 + diff --git a/code/game/machinery/computer/orders/order_items/mining/order_mining.dm b/code/game/machinery/computer/orders/order_items/mining/order_mining.dm new file mode 100644 index 00000000000..adde8dbed7e --- /dev/null +++ b/code/game/machinery/computer/orders/order_items/mining/order_mining.dm @@ -0,0 +1,105 @@ +/datum/orderable_item/mining + category_index = CATEGORY_MINING + +/datum/orderable_item/mining/marker_beacon + item_path = /obj/item/stack/marker_beacon + cost_per_order = 10 + +/datum/orderable_item/mining/skeleton_key + item_path = /obj/item/skeleton_key + cost_per_order = 777 + +/datum/orderable_item/mining/mining_stabilizer + item_path = /obj/item/mining_stabilizer + cost_per_order = 400 + +/datum/orderable_item/mining/fulton_core + item_path = /obj/item/fulton_core + cost_per_order = 400 + +/datum/orderable_item/mining/mining_modsuit + item_path = /obj/item/mod/control/pre_equipped/mining + desc = "A mining-themed MODsuit that works best when in a mining environment." + cost_per_order = 3000 + +/datum/orderable_item/mining/mining_ltsrbt + item_path = /obj/item/circuitboard/machine/mining_ltsrbt + name = "Mining LTSRBT Board" + desc = "Tired of waiting on the Cargo shuttle? This item lets you bluespace mining orders directly to the station." + cost_per_order = 750 + +/datum/orderable_item/mining/mining_belt + item_path = /obj/item/storage/belt/mining + cost_per_order = 500 + +/datum/orderable_item/mining/point_card + item_path = /obj/item/card/mining_point_card + cost_per_order = 500 + +/datum/orderable_item/mining/jaunter + item_path = /obj/item/wormhole_jaunter + cost_per_order = 750 + +/datum/orderable_item/mining/crusher + item_path = /obj/item/kinetic_crusher + cost_per_order = 750 + +/datum/orderable_item/mining/resonator + item_path = /obj/item/resonator + cost_per_order = 800 + +/datum/orderable_item/mining/resonator_advanced + item_path = /obj/item/resonator/upgraded + cost_per_order = 2500 + +/datum/orderable_item/mining/mining_scanner + item_path = /obj/item/t_scanner/adv_mining_scanner + cost_per_order = 800 + +/datum/orderable_item/mining/fulton + item_path = /obj/item/extraction_pack + cost_per_order = 1000 + +/datum/orderable_item/mining/lazarus + item_path = /obj/item/lazarus_injector + cost_per_order = 1000 + +/datum/orderable_item/mining/gar_mesons + item_path = /obj/item/clothing/glasses/meson/gar + cost_per_order = 500 + +/datum/orderable_item/mining/silver_pickaxe + item_path = /obj/item/pickaxe/silver + cost_per_order = 1000 + +/datum/orderable_item/mining/diamond_pickaxe + item_path = /obj/item/pickaxe/diamond + cost_per_order = 2000 + +/datum/orderable_item/mining/conscription_kit + item_path = /obj/item/storage/backpack/duffelbag/mining_conscript + cost_per_order = 1500 + +/datum/orderable_item/mining/capsule + item_path = /obj/item/survivalcapsule + cost_per_order = 400 + +/datum/orderable_item/mining/capsule_luxury + item_path = /obj/item/survivalcapsule/luxury + cost_per_order = 3000 + +/datum/orderable_item/mining/capsule_luxuryelite + item_path = /obj/item/survivalcapsule/luxuryelite + cost_per_order = 10000 + +/datum/orderable_item/mining/kheiralcuffs + item_path = /obj/item/kheiral_cuffs + cost_per_order = 2000 + +/datum/orderable_item/mining/bhop + item_path = /obj/item/clothing/shoes/bhop + cost_per_order = 2500 + +/datum/orderable_item/mining/hiking_boots + item_path = /obj/item/clothing/shoes/winterboots/ice_boots + cost_per_order = 2500 diff --git a/code/game/machinery/computer/orders/order_items/mining/order_pka.dm b/code/game/machinery/computer/orders/order_items/mining/order_pka.dm new file mode 100644 index 00000000000..7ba37721e36 --- /dev/null +++ b/code/game/machinery/computer/orders/order_items/mining/order_pka.dm @@ -0,0 +1,42 @@ +/datum/orderable_item/accelerator + category_index = CATEGORY_PKA + +/datum/orderable_item/accelerator/gun + item_path = /obj/item/gun/energy/recharge/kinetic_accelerator + cost_per_order = 750 + +/datum/orderable_item/accelerator/range + item_path = /obj/item/borg/upgrade/modkit/range + cost_per_order = 1000 + +/datum/orderable_item/accelerator/damage + item_path = /obj/item/borg/upgrade/modkit/damage + cost_per_order = 1000 + +/datum/orderable_item/accelerator/cooldown + item_path = /obj/item/borg/upgrade/modkit/cooldown + cost_per_order = 1000 + +/datum/orderable_item/accelerator/chasis + item_path = /obj/item/borg/upgrade/modkit/chassis_mod + cost_per_order = 250 + +/datum/orderable_item/accelerator/chasis_orange + item_path = /obj/item/borg/upgrade/modkit/chassis_mod/orange + cost_per_order = 300 + +/datum/orderable_item/accelerator/tracer + item_path = /obj/item/borg/upgrade/modkit/tracer + cost_per_order = 100 + +/datum/orderable_item/accelerator/adjustable_tracer + item_path = /obj/item/borg/upgrade/modkit/tracer/adjustable + cost_per_order = 150 + +/datum/orderable_item/accelerator/aoe_mobs + item_path = /obj/item/borg/upgrade/modkit/aoe/mobs + cost_per_order = 2000 + +/datum/orderable_item/accelerator/minebot_passthrough + item_path = /obj/item/borg/upgrade/modkit/minebot_passthrough + cost_per_order = 1000 diff --git a/code/game/machinery/computer/orders/order_items/mining/order_toys.dm b/code/game/machinery/computer/orders/order_items/mining/order_toys.dm new file mode 100644 index 00000000000..06bd9032e74 --- /dev/null +++ b/code/game/machinery/computer/orders/order_items/mining/order_toys.dm @@ -0,0 +1,31 @@ +/datum/orderable_item/toys_drones + category_index = CATEGORY_TOYS_DRONE + +/datum/orderable_item/toys_drones/soap + item_path = /obj/item/soap/nanotrasen + cost_per_order = 200 + +/datum/orderable_item/toys_drones/laser_pointer + item_path = /obj/item/laser_pointer + cost_per_order = 300 + +/datum/orderable_item/toys_drones/facehugger + item_path = /obj/item/clothing/mask/facehugger/toy + cost_per_order = 300 + +/datum/orderable_item/toys_drones/mining_drone + item_path = /mob/living/simple_animal/hostile/mining_drone + cost_per_order = 800 + +/datum/orderable_item/toys_drones/drone_health + item_path = /obj/item/mine_bot_upgrade/health + cost_per_order = 400 + +/datum/orderable_item/toys_drones/drone_pka + item_path = /obj/item/borg/upgrade/modkit/cooldown/minebot + cost_per_order = 600 + +/datum/orderable_item/toys_drones/drone_sentience + item_path = /obj/item/slimepotion/slime/sentience/mining + cost_per_order = 1000 + diff --git a/code/game/machinery/computer/orders/order_items/order_datum.dm b/code/game/machinery/computer/orders/order_items/order_datum.dm new file mode 100644 index 00000000000..e7bb3c35e56 --- /dev/null +++ b/code/game/machinery/computer/orders/order_items/order_datum.dm @@ -0,0 +1,28 @@ +///A datum for chef ordering options from the chef's computer. +/datum/orderable_item + ///Name of the item shown in the shop. + var/name + ///Description shown in the shop, set automatically unless it's hard set by the subtype + var/desc + ///Path of the item that is purchased when ordering us. + var/obj/item/item_path + ///The category this item will be displayed in. + var/category_index = NONE + ///How much this item costs to order. + var/cost_per_order = 10 + +/datum/orderable_item/New() + . = ..() + if(!category_index) + CRASH("[type] doesn't have a category_index assigned!") + if(!item_path) + CRASH("[type] orderable item datum with no item path was created!") + if(!name) + name = initial(item_path.name) + if(!desc) + desc = initial(item_path.desc) + +/datum/orderable_item/Destroy(force, ...) + if(item_path) + qdel(item_path) + return ..() diff --git a/code/game/objects/effects/spawners/random/techstorage.dm b/code/game/objects/effects/spawners/random/techstorage.dm index 8025d2c19bd..ad347539201 100644 --- a/code/game/objects/effects/spawners/random/techstorage.dm +++ b/code/game/objects/effects/spawners/random/techstorage.dm @@ -32,7 +32,7 @@ /obj/item/circuitboard/machine/autolathe, /obj/item/circuitboard/computer/mining, /obj/item/circuitboard/machine/ore_redemption, - /obj/item/circuitboard/machine/mining_equipment_vendor, + /obj/item/circuitboard/computer/order_console/mining, /obj/item/circuitboard/machine/microwave, /obj/item/circuitboard/machine/deep_fryer, /obj/item/circuitboard/machine/griddle, diff --git a/code/game/objects/items/circuitboards/computer_circuitboards.dm b/code/game/objects/items/circuitboards/computer_circuitboards.dm index 011fd851545..98a066a9324 100644 --- a/code/game/objects/items/circuitboards/computer_circuitboards.dm +++ b/code/game/objects/items/circuitboards/computer_circuitboards.dm @@ -466,11 +466,10 @@ build_path = /obj/machinery/computer/camera_advanced/syndie //Service - -/obj/item/circuitboard/computer/chef_order +/obj/item/circuitboard/computer/order_console name = "Produce Orders Console" - greyscale_colors = CIRCUIT_COLOR_SUPPLY - build_path = /obj/machinery/computer/chef_order + greyscale_colors = CIRCUIT_COLOR_SERVICE + build_path = /obj/machinery/computer/order_console/cook //Supply @@ -527,6 +526,15 @@ name = "Supply Request Console" build_path = /obj/machinery/computer/cargo/request +/obj/item/circuitboard/computer/order_console/mining + name = "Mining Vending Console" + greyscale_colors = CIRCUIT_COLOR_SUPPLY + build_path = /obj/machinery/computer/order_console/mining + +/obj/item/circuitboard/computer/order_console/mining/golem + name = "Golem Ship Equipment Vendor Console" + build_path = /obj/machinery/computer/order_console/mining/golem + /obj/item/circuitboard/computer/ferry name = "Transport Ferry" greyscale_colors = CIRCUIT_COLOR_SUPPLY diff --git a/code/game/objects/items/circuitboards/machines/machine_circuitboards.dm b/code/game/objects/items/circuitboards/machines/machine_circuitboards.dm index 6a52b776cfc..ff72460222d 100644 --- a/code/game/objects/items/circuitboards/machines/machine_circuitboards.dm +++ b/code/game/objects/items/circuitboards/machines/machine_circuitboards.dm @@ -1196,19 +1196,6 @@ /obj/item/stock_parts/card_reader = 1) //Supply - -/obj/item/circuitboard/machine/mining_equipment_vendor - name = "Mining Equipment Vendor" - greyscale_colors = CIRCUIT_COLOR_SUPPLY - build_path = /obj/machinery/mineral/equipment_vendor - req_components = list( - /obj/item/stack/sheet/glass = 1, - /obj/item/stock_parts/matter_bin = 3) - -/obj/item/circuitboard/machine/mining_equipment_vendor/golem - name = "Golem Ship Equipment Vendor" - build_path = /obj/machinery/mineral/equipment_vendor/golem - /obj/item/circuitboard/machine/ore_redemption name = "Ore Redemption" greyscale_colors = CIRCUIT_COLOR_SUPPLY diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index 2bcf82a7191..af940170062 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -680,3 +680,21 @@ name = "police bag" desc = "A large duffel bag for holding extra police gear." slowdown = 0 + +/obj/item/storage/backpack/duffelbag/mining_conscript + name = "mining conscription kit" + desc = "A kit containing everything a crewmember needs to support a shaft miner in the field." + icon_state = "duffel-explorer" + inhand_icon_state = "duffel-explorer" + +/obj/item/storage/backpack/duffelbag/mining_conscript/PopulateContents() + new /obj/item/clothing/glasses/meson(src) + new /obj/item/t_scanner/adv_mining_scanner/lesser(src) + new /obj/item/storage/bag/ore(src) + new /obj/item/clothing/suit/hooded/explorer(src) + new /obj/item/encryptionkey/headset_mining(src) + new /obj/item/clothing/mask/gas/explorer(src) + new /obj/item/card/id/advanced/mining(src) + new /obj/item/gun/energy/recharge/kinetic_accelerator(src) + new /obj/item/knife/combat/survival(src) + new /obj/item/flashlight/seclite(src) diff --git a/code/modules/cargo/order.dm b/code/modules/cargo/order.dm index 105944c2aee..d610559ef01 100644 --- a/code/modules/cargo/order.dm +++ b/code/modules/cargo/order.dm @@ -42,13 +42,25 @@ var/orderer_ckey var/reason var/discounted_pct + ///If set to FALSE, we won't charge when the cargo shuttle arrives with this. + var/charge_on_purchase = TRUE ///area this order wants to reach, if not null then it will come with the deliver_first component set to this area var/department_destination var/datum/supply_pack/pack var/datum/bank_account/paying_account var/obj/item/coupon/applied_coupon -/datum/supply_order/New(datum/supply_pack/pack, orderer, orderer_rank, orderer_ckey, reason, paying_account, department_destination, coupon) +/datum/supply_order/New( + datum/supply_pack/pack, + orderer, + orderer_rank, + orderer_ckey, + reason, + paying_account, + department_destination, + coupon, + charge_on_purchase, +) id = SSshuttle.order_number++ src.pack = pack src.orderer = orderer @@ -58,6 +70,7 @@ src.paying_account = paying_account src.department_destination = department_destination src.applied_coupon = coupon + src.charge_on_purchase = charge_on_purchase /datum/supply_order/proc/generateRequisition(turf/T) var/obj/item/paper/requisition_paper = new(T) diff --git a/code/modules/cargo/packs/_packs.dm b/code/modules/cargo/packs/_packs.dm index 1352c57da20..3f8259fb7db 100644 --- a/code/modules/cargo/packs/_packs.dm +++ b/code/modules/cargo/packs/_packs.dm @@ -78,3 +78,19 @@ /// For generating supply packs at runtime. Returns a list of supply packs to use instead of this one. /datum/supply_pack/proc/generate_supply_packs() return + +/** + * Custom supply pack + * The contents are given on New rather than being static + * This is for adding custom orders to the Cargo console (like order consoles) + */ +/datum/supply_pack/custom + name = "mining order" + hidden = TRUE + crate_name = "shaft mining delivery crate" + access = list(ACCESS_MINING) + +/datum/supply_pack/custom/New(purchaser, list/given_contents) + . = ..() + name = "[purchaser]'s Mining Order" + contains = given_contents diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm deleted file mode 100644 index d9529e12b8c..00000000000 --- a/code/modules/mining/machine_vending.dm +++ /dev/null @@ -1,313 +0,0 @@ -/**********************Mining Equipment Vendor**************************/ - -/obj/machinery/mineral/equipment_vendor - name = "mining equipment vendor" - desc = "An equipment vendor for miners, points collected at an ore redemption machine can be spent here." - icon = 'icons/obj/machines/mining_machines.dmi' - icon_state = "mining" - density = TRUE - circuit = /obj/item/circuitboard/machine/mining_equipment_vendor - var/icon_deny = "mining-deny" - var/obj/item/card/id/inserted_id - var/list/prize_list = list( //if you add something to this, please, for the love of god, sort it by price/type. use tabs and not spaces. - new /datum/data/mining_equipment("1 Marker Beacon", /obj/item/stack/marker_beacon, 10), - new /datum/data/mining_equipment("10 Marker Beacons", /obj/item/stack/marker_beacon/ten, 100), - new /datum/data/mining_equipment("30 Marker Beacons", /obj/item/stack/marker_beacon/thirty, 300), - new /datum/data/mining_equipment("Skeleton Key", /obj/item/skeleton_key, 777), - new /datum/data/mining_equipment("Whiskey", /obj/item/reagent_containers/cup/glass/bottle/whiskey, 100), - new /datum/data/mining_equipment("Absinthe", /obj/item/reagent_containers/cup/glass/bottle/absinthe/premium, 100), - new /datum/data/mining_equipment("Bubblegum Gum Packet", /obj/item/storage/box/gum/bubblegum, 100), - new /datum/data/mining_equipment("Cigar", /obj/item/clothing/mask/cigarette/cigar/havana, 150), - new /datum/data/mining_equipment("Soap", /obj/item/soap/nanotrasen, 200), - new /datum/data/mining_equipment("Laser Pointer", /obj/item/laser_pointer, 300), - new /datum/data/mining_equipment("Alien Toy", /obj/item/clothing/mask/facehugger/toy, 300), - new /datum/data/mining_equipment("Stabilizing Serum", /obj/item/mining_stabilizer, 400), - new /datum/data/mining_equipment("Fulton Beacon", /obj/item/fulton_core, 400), - new /datum/data/mining_equipment("Shelter Capsule", /obj/item/survivalcapsule, 400), - new /datum/data/mining_equipment("GAR Meson Scanners", /obj/item/clothing/glasses/meson/gar, 500), - new /datum/data/mining_equipment("Explorer's Webbing", /obj/item/storage/belt/mining, 500), - new /datum/data/mining_equipment("Point Transfer Card", /obj/item/card/mining_point_card, 500), - new /datum/data/mining_equipment("Survival Medipen", /obj/item/reagent_containers/hypospray/medipen/survival, 500), - new /datum/data/mining_equipment("Brute Medkit", /obj/item/storage/medkit/brute, 600), - new /datum/data/mining_equipment("Tracking Implant Kit", /obj/item/storage/box/minertracker, 600), - new /datum/data/mining_equipment("Jaunter", /obj/item/wormhole_jaunter, 750), - new /datum/data/mining_equipment("Kinetic Crusher", /obj/item/kinetic_crusher, 750), - new /datum/data/mining_equipment("Kinetic Accelerator", /obj/item/gun/energy/recharge/kinetic_accelerator, 750), - new /datum/data/mining_equipment("Advanced Scanner", /obj/item/t_scanner/adv_mining_scanner, 800), - new /datum/data/mining_equipment("Resonator", /obj/item/resonator, 800), - new /datum/data/mining_equipment("Luxury Medipen", /obj/item/reagent_containers/hypospray/medipen/survival/luxury, 1000), - new /datum/data/mining_equipment("Fulton Pack", /obj/item/extraction_pack, 1000), - new /datum/data/mining_equipment("Lazarus Injector", /obj/item/lazarus_injector, 1000), - new /datum/data/mining_equipment("Silver Pickaxe", /obj/item/pickaxe/silver, 1000), - new /datum/data/mining_equipment("Mining Conscription Kit", /obj/item/storage/backpack/duffelbag/mining_conscript, 1500), - new /datum/data/mining_equipment("Space Cash", /obj/item/stack/spacecash/c1000, 2000), - new /datum/data/mining_equipment("Diamond Pickaxe", /obj/item/pickaxe/diamond, 2000), - new /datum/data/mining_equipment("Kheiral Cuffs", /obj/item/kheiral_cuffs, 2000), - new /datum/data/mining_equipment("Super Resonator", /obj/item/resonator/upgraded, 2500), - new /datum/data/mining_equipment("Jump Boots", /obj/item/clothing/shoes/bhop, 2500), - new /datum/data/mining_equipment("Ice Hiking Boots", /obj/item/clothing/shoes/winterboots/ice_boots, 2500), - new /datum/data/mining_equipment("Mining MODsuit", /obj/item/mod/control/pre_equipped/mining, 3000), - new /datum/data/mining_equipment("Luxury Shelter Capsule", /obj/item/survivalcapsule/luxury, 3000), - new /datum/data/mining_equipment("Luxury Bar Capsule", /obj/item/survivalcapsule/luxuryelite, 10000), - new /datum/data/mining_equipment("Nanotrasen Minebot", /mob/living/simple_animal/hostile/mining_drone, 800), - new /datum/data/mining_equipment("Minebot Melee Upgrade", /obj/item/mine_bot_upgrade, 400), - new /datum/data/mining_equipment("Minebot Armor Upgrade", /obj/item/mine_bot_upgrade/health, 400), - new /datum/data/mining_equipment("Minebot Cooldown Upgrade", /obj/item/borg/upgrade/modkit/cooldown/minebot, 600), - new /datum/data/mining_equipment("Minebot AI Upgrade", /obj/item/slimepotion/slime/sentience/mining, 1000), - new /datum/data/mining_equipment("KA Minebot Passthrough", /obj/item/borg/upgrade/modkit/minebot_passthrough, 100), - new /datum/data/mining_equipment("KA White Tracer Rounds", /obj/item/borg/upgrade/modkit/tracer, 100), - new /datum/data/mining_equipment("KA Adjustable Tracer Rounds", /obj/item/borg/upgrade/modkit/tracer/adjustable, 150), - new /datum/data/mining_equipment("KA Super Chassis", /obj/item/borg/upgrade/modkit/chassis_mod, 250), - new /datum/data/mining_equipment("KA Hyper Chassis", /obj/item/borg/upgrade/modkit/chassis_mod/orange, 300), - new /datum/data/mining_equipment("KA Range Increase", /obj/item/borg/upgrade/modkit/range, 1000), - new /datum/data/mining_equipment("KA Damage Increase", /obj/item/borg/upgrade/modkit/damage, 1000), - new /datum/data/mining_equipment("KA Cooldown Decrease", /obj/item/borg/upgrade/modkit/cooldown, 1000), - new /datum/data/mining_equipment("KA AoE Damage", /obj/item/borg/upgrade/modkit/aoe/mobs, 2000) - ) - -/datum/data/mining_equipment - var/equipment_name = "generic" - var/equipment_path = null - var/cost = 0 - -/datum/data/mining_equipment/New(name, path, cost) - src.equipment_name = name - src.equipment_path = path - src.cost = cost - -/obj/machinery/mineral/equipment_vendor/Initialize(mapload) - . = ..() - build_inventory() - -/obj/machinery/mineral/equipment_vendor/proc/build_inventory() - for(var/p in prize_list) - var/datum/data/mining_equipment/M = p - GLOB.vending_products[M.equipment_path] = 1 - -/obj/machinery/mineral/equipment_vendor/update_icon_state() - icon_state = "[initial(icon_state)][powered() ? null : "-off"]" - return ..() - -/obj/machinery/mineral/equipment_vendor/ui_assets(mob/user) - return list( - get_asset_datum(/datum/asset/spritesheet/vending), - ) - -/obj/machinery/mineral/equipment_vendor/ui_interact(mob/user, datum/tgui/ui) - ui = SStgui.try_update_ui(user, src, ui) - if(!ui) - ui = new(user, src, "MiningVendor", name) - ui.open() - -/obj/machinery/mineral/equipment_vendor/ui_static_data(mob/user) - . = list() - .["product_records"] = list() - for(var/datum/data/mining_equipment/prize in prize_list) - var/list/product_data = list( - path = replacetext(replacetext("[prize.equipment_path]", "/obj/item/", ""), "/", "-"), - name = prize.equipment_name, - price = prize.cost, - ref = REF(prize) - ) - .["product_records"] += list(product_data) - -/obj/machinery/mineral/equipment_vendor/ui_data(mob/user) - . = list() - var/obj/item/card/id/C - if(isliving(user)) - var/mob/living/L = user - C = L.get_idcard(TRUE) - if(C) - .["user"] = list() - .["user"]["points"] = C.mining_points - if(C.registered_account) - .["user"]["name"] = C.registered_account.account_holder - if(C.registered_account.account_job) - .["user"]["job"] = C.registered_account.account_job.title - else - .["user"]["job"] = "No Job" - -/obj/machinery/mineral/equipment_vendor/ui_act(action, params) - . = ..() - if(.) - return - - switch(action) - if("purchase") - var/obj/item/card/id/I - if(isliving(usr)) - var/mob/living/L = usr - I = L.get_idcard(TRUE) - if(!istype(I)) - to_chat(usr, span_alert("Error: An ID is required!")) - flick(icon_deny, src) - return - var/datum/data/mining_equipment/prize = locate(params["ref"]) in prize_list - if(!prize || !(prize in prize_list)) - to_chat(usr, span_alert("Error: Invalid choice!")) - flick(icon_deny, src) - return - if(prize.cost > I.mining_points) - to_chat(usr, span_alert("Error: Insufficient points for [prize.equipment_name] on [I]!")) - flick(icon_deny, src) - return - I.mining_points -= prize.cost - to_chat(usr, span_notice("[src] clanks to life briefly before vending [prize.equipment_name]!")) - new prize.equipment_path(loc) - SSblackbox.record_feedback("nested tally", "mining_equipment_bought", 1, list("[type]", "[prize.equipment_path]")) - . = TRUE - -/obj/machinery/mineral/equipment_vendor/attackby(obj/item/I, mob/user, params) - if(istype(I, /obj/item/mining_voucher)) - redeem_voucher(I, user) - return - if(default_deconstruction_screwdriver(user, "mining-open", "mining", I)) - return - if(default_deconstruction_crowbar(I)) - return - return ..() - -/** - * Allows user to redeem a mining voucher for one set of a mining equipment - * - * * Arguments: - * * voucher The mining voucher that is being used to redeem the mining equipment - * * redeemer The mob that is redeeming the mining equipment - */ -/obj/machinery/mineral/equipment_vendor/proc/redeem_voucher(obj/item/mining_voucher/voucher, mob/redeemer) - var/static/list/set_types - if(!set_types) - set_types = list() - for(var/datum/voucher_set/static_set as anything in subtypesof(/datum/voucher_set)) - set_types[initial(static_set.name)] = new static_set - - var/list/items = list() - for(var/set_name in set_types) - var/datum/voucher_set/current_set = set_types[set_name] - var/datum/radial_menu_choice/option = new - option.image = image(icon = current_set.icon, icon_state = current_set.icon_state) - option.info = span_boldnotice(current_set.description) - items[set_name] = option - - var/selection = show_radial_menu(redeemer, src, items, custom_check = CALLBACK(src, PROC_REF(check_menu), voucher, redeemer), radius = 38, require_near = TRUE, tooltips = TRUE) - if(!selection) - return - - var/datum/voucher_set/chosen_set = set_types[selection] - for(var/item in chosen_set.set_items) - new item(drop_location()) - - SSblackbox.record_feedback("tally", "mining_voucher_redeemed", 1, selection) - qdel(voucher) - -/** - * Checks if we are allowed to interact with a radial menu - * - * * Arguments: - * * voucher The mining voucher that is being used to redeem a mining equipment - * * redeemer The living mob interacting with the menu - */ -/obj/machinery/mineral/equipment_vendor/proc/check_menu(obj/item/mining_voucher/voucher, mob/living/redeemer) - if(!istype(redeemer)) - return FALSE - if(redeemer.incapacitated()) - return FALSE - if(QDELETED(voucher)) - return FALSE - if(!redeemer.is_holding(voucher)) - return FALSE - return TRUE - -/obj/machinery/mineral/equipment_vendor/ex_act(severity, target) - do_sparks(5, TRUE, src) - if(severity > EXPLODE_LIGHT && prob(17 * severity)) - qdel(src) - -/****************Golem Point Vendor**************************/ - -/obj/machinery/mineral/equipment_vendor/golem - name = "golem ship equipment vendor" - circuit = /obj/item/circuitboard/machine/mining_equipment_vendor/golem - -/obj/machinery/mineral/equipment_vendor/golem/Initialize(mapload) - desc += "\nIt seems a few selections have been added." - prize_list += list( - new /datum/data/mining_equipment("Extra Id", /obj/item/card/id/advanced/mining, 250), - new /datum/data/mining_equipment("Science Goggles", /obj/item/clothing/glasses/science, 250), - new /datum/data/mining_equipment("Monkey Cube", /obj/item/food/monkeycube, 300), - new /datum/data/mining_equipment("Toolbelt", /obj/item/storage/belt/utility, 350), - new /datum/data/mining_equipment("Royal Cape of the Liberator", /obj/item/bedsheet/rd/royal_cape, 500), - new /datum/data/mining_equipment("Grey Slime Extract", /obj/item/slime_extract/grey, 1000), - new /datum/data/mining_equipment("Modification Kit", /obj/item/borg/upgrade/modkit/trigger_guard, 1700), - new /datum/data/mining_equipment("The Liberator's Legacy", /obj/item/storage/box/rndboards, 2000) - ) - return ..() - -/**********************Mining Equipment Vendor Items**************************/ - -/**********************Mining Equipment Voucher**********************/ - -/obj/item/mining_voucher - name = "mining voucher" - desc = "A token to redeem a piece of equipment. Use it on a mining equipment vendor." - icon = 'icons/obj/mining.dmi' - icon_state = "mining_voucher" - w_class = WEIGHT_CLASS_TINY - -/**********************Mining Point Card**********************/ -#define TO_USER_ID "To ID" -#define TO_POINT_CARD "To Card" -/obj/item/card/mining_point_card - name = "mining point transfer card" - desc = "A small, reusable card for transferring mining points. Swipe your ID card over it to start the process." - icon_state = "data_1" - var/points = 500 - -/obj/item/card/mining_point_card/attackby(obj/item/I, mob/user, params) - if(isidcard(I)) - var/obj/item/card/id/swiped = I - balloon_alert(user, "starting transfer") - var/point_movement = tgui_alert(user, "To ID (from card) or to card (from ID)?", "Mining Points Transfer", list(TO_USER_ID, TO_POINT_CARD)) - if(!point_movement) - return - var/amount = tgui_input_number(user, "How much do you want to transfer? ID Balance: [swiped.mining_points], Card Balance: [points]", "Transfer Points", min_value = 0, round_value = 1) - if(!amount) - return - switch(point_movement) - if(TO_USER_ID) - if(amount > points) - amount = points - swiped.mining_points += amount - points -= amount - to_chat(user, span_notice("You transfer [amount] mining points from [src] to [swiped].")) - if(TO_POINT_CARD) - if(amount > swiped.mining_points) - amount = swiped.mining_points - swiped.mining_points -= amount - points += amount - to_chat(user, span_notice("You transfer [amount] mining points from [swiped] to [src].")) - ..() - -/obj/item/card/mining_point_card/examine(mob/user) - . = ..() - . += span_notice("There's [points] point\s on the card.") - -#undef TO_POINT_CARD -#undef TO_USER_ID -/obj/item/storage/backpack/duffelbag/mining_conscript - name = "mining conscription kit" - desc = "A kit containing everything a crewmember needs to support a shaft miner in the field." - icon_state = "duffel-explorer" - inhand_icon_state = "duffel-explorer" - -/obj/item/storage/backpack/duffelbag/mining_conscript/PopulateContents() - new /obj/item/clothing/glasses/meson(src) - new /obj/item/t_scanner/adv_mining_scanner/lesser(src) - new /obj/item/storage/bag/ore(src) - new /obj/item/clothing/suit/hooded/explorer(src) - new /obj/item/encryptionkey/headset_mining(src) - new /obj/item/clothing/mask/gas/explorer(src) - new /obj/item/card/id/advanced/mining(src) - new /obj/item/gun/energy/recharge/kinetic_accelerator(src) - new /obj/item/knife/combat/survival(src) - new /obj/item/flashlight/seclite(src) diff --git a/code/modules/mining/mining_ltsrbt.dm b/code/modules/mining/mining_ltsrbt.dm new file mode 100644 index 00000000000..81e6fd80c15 --- /dev/null +++ b/code/modules/mining/mining_ltsrbt.dm @@ -0,0 +1,103 @@ +/obj/item/circuitboard/machine/mining_ltsrbt + name = "Mining LTSRBT" + icon_state = "bluespacearray" + build_path = /obj/machinery/mining_ltsrbt + req_components = list( + /obj/item/stack/ore/bluespace_crystal = 2, + /obj/item/stock_parts/subspace/ansible = 1, + /obj/item/stock_parts/micro_laser = 1, + ) + def_components = list( + /obj/item/stack/ore/bluespace_crystal = /obj/item/stack/ore/bluespace_crystal/artificial, + ) + +/** + * Mining LTSRBT + * + * Recieves orders from the mining produce console + * Uses power (scaling with parts) to get that item delivered + * Only works if it's enabled, and can only be enabled on-station. + */ +/obj/machinery/mining_ltsrbt + name = "mining LTSRBT" + desc = "A variant of the Long-To-Short-Range-Bluespace-Transceiver used to deliver Mining equipment to the station as required. Nanotrasen denies the existence of any other forms of the LTSRBT." + icon_state = "exonet_node" + circuit = /obj/item/circuitboard/machine/mining_ltsrbt + density = TRUE + + ///Boolean on whether the machine is active or not + var/enabled = FALSE + ///The amount of power each use of the machine costs. + var/power_usage_per_teleport = 10000 + +/obj/machinery/mining_ltsrbt/Initialize(mapload) + . = ..() + GLOB.mining_ltsrbt += src + register_context() + +/obj/machinery/mining_ltsrbt/Destroy() + GLOB.mining_ltsrbt -= src + return ..() + +/obj/machinery/mining_ltsrbt/add_context(atom/source, list/context, obj/item/held_item, mob/user) + . = ..() + if(!held_item) + context[SCREENTIP_CONTEXT_LMB] = "turn [enabled ? "off" : "on"]" + return CONTEXTUAL_SCREENTIP_SET + + if(held_item.tool_behaviour == TOOL_SCREWDRIVER) + context[SCREENTIP_CONTEXT_LMB] = "[panel_open ? "Close" : "Open"] panel" + return CONTEXTUAL_SCREENTIP_SET + if(held_item.tool_behaviour == TOOL_CROWBAR && panel_open) + context[SCREENTIP_CONTEXT_LMB] = "Deconstruct" + return CONTEXTUAL_SCREENTIP_SET + return . + +/obj/machinery/mining_ltsrbt/attack_hand(mob/living/user, list/modifiers) + . = ..() + if(!is_station_level(z)) + balloon_alert(user, "not on station!") + user.playsound_local(loc, 'sound/machines/buzz-two.ogg', 30, TRUE) + return + enabled = !enabled + balloon_alert(user, "turned [enabled ? "on" : "off"]") + update_appearance(UPDATE_ICON) + +/obj/machinery/mining_ltsrbt/update_icon_state() + . = ..() + icon_state = enabled ? initial(icon_state) : "[icon_state]_idle" + +/obj/machinery/mining_ltsrbt/RefreshParts() + . = ..() + for(var/obj/item/stock_parts/micro_laser/laser in component_parts) + power_usage_per_teleport = (initial(power_usage_per_teleport) % laser.rating) + +/obj/machinery/mining_ltsrbt/screwdriver_act(mob/living/user, obj/item/tool) + . = ..() + if(enabled) + enabled = FALSE + update_appearance(UPDATE_ICON) + default_deconstruction_screwdriver(user, icon_state, icon_state, tool) + return TRUE + +/obj/machinery/mining_ltsrbt/crowbar_act(mob/living/user, obj/item/tool) + . = ..() + default_deconstruction_crowbar(tool) + return TRUE + +/** + * # Recieve order + * + * Recieves the order and, if successfully goes through, returns TRUE + * Otherwise will return FALSE to cancel the order. + */ +/obj/machinery/mining_ltsrbt/proc/recieve_order(datum/supply_order/order) + if(!enabled) + return FALSE + order.generate(get_turf(src)) + use_power(power_usage_per_teleport) + var/datum/effect_system/spark_spread/sparks = new + sparks.set_up(5, 1, get_turf(src)) + sparks.attach(src) + sparks.start() + return TRUE diff --git a/code/modules/research/designs/machine_designs.dm b/code/modules/research/designs/machine_designs.dm index 87ce5cbfe32..11b23341abc 100644 --- a/code/modules/research/designs/machine_designs.dm +++ b/code/modules/research/designs/machine_designs.dm @@ -616,7 +616,7 @@ name = "Mining Rewards Vendor Board" desc = "The circuit board for a Mining Rewards Vendor." id = "mining_equipment_vendor" - build_path = /obj/item/circuitboard/machine/mining_equipment_vendor + build_path = /obj/item/circuitboard/computer/order_console/mining category = list( RND_CATEGORY_MACHINE + RND_SUBCATEGORY_MACHINE_CARGO ) diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm index affa2b6728a..e3059c659e9 100644 --- a/code/modules/shuttle/supply.dm +++ b/code/modules/shuttle/supply.dm @@ -93,8 +93,7 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( var/list/misc_costs = list() //list of overall costs sustained by each buyer. var/list/empty_turfs = list() - for(var/place in shuttle_areas) - var/area/shuttle/shuttle_area = place + for(var/area/shuttle/shuttle_area as anything in shuttle_areas) for(var/turf/open/floor/T in shuttle_area) if(T.is_blocked_turf()) continue @@ -129,7 +128,7 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( var/datum/bank_account/paying_for_this //department orders EARN money for cargo, not the other way around - if(!spawning_order.department_destination) + if(!spawning_order.department_destination && spawning_order.charge_on_purchase) if(spawning_order.paying_account) //Someone paid out of pocket paying_for_this = spawning_order.paying_account var/list/current_buyer_orders = goodies_by_buyer[spawning_order.paying_account] // so we can access the length a few lines down @@ -149,6 +148,7 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( continue if(spawning_order.paying_account) + paying_for_this = spawning_order.paying_account if(spawning_order.pack.goody) LAZYADD(goodies_by_buyer[spawning_order.paying_account], spawning_order) paying_for_this.bank_card_talk("Cargo order #[spawning_order.id] has shipped. [price] credits have been charged to your bank account.") @@ -191,8 +191,7 @@ GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( miscboxes[buyer].name = "goody case - purchased by [buyer]" misc_contents[buyer] = list() - for(var/O in buying_account_orders) - var/datum/supply_order/our_order = O + for(var/datum/supply_order/our_order as anything in buying_account_orders) for (var/item in our_order.pack.contains) misc_contents[buyer] += item misc_costs[buyer] += our_order.pack.cost diff --git a/code/modules/unit_tests/orderable_items.dm b/code/modules/unit_tests/orderable_items.dm index 877824546c2..26b25db9634 100644 --- a/code/modules/unit_tests/orderable_items.dm +++ b/code/modules/unit_tests/orderable_items.dm @@ -1,16 +1,24 @@ /// Makes sure that no orderable items have dynamic descriptions, if they /// don't explicitly set a description. -/datum/unit_test/orderable_item_descriptions +/// Also makes sure 2 orderable items don't sell the same thing. +/datum/unit_test/orderable_items -/datum/unit_test/orderable_item_descriptions/Run() +/datum/unit_test/orderable_items/Run() + var/list/all_paths = list() for (var/datum/orderable_item/orderable_item as anything in subtypesof(/datum/orderable_item)) - if (!isnull(initial(orderable_item.desc))) + if(isnull(initial(orderable_item.item_path))) // don't check if they're not actual orderable items + continue + if (!isnull(initial(orderable_item.desc))) //don't check if they have a custom description continue var/item_path = initial(orderable_item.item_path) - var/obj/item/item_instance = new item_path + var/obj/item/item_instance = allocate(item_path) var/initial_desc = initial(item_instance.desc) + if(item_path in all_paths) + Fail("[orderable_item] is purchasable under two different orderable_item types,") + all_paths += item_path + if (item_instance.desc != initial_desc) Fail("[orderable_item] has an item ([item_path]) that has a dynamic description. [item_instance.desc] (dynamic description) != [initial_desc] (initial description)") diff --git a/tgstation.dme b/tgstation.dme index fd93fa1449a..904b2ae1d6c 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -58,6 +58,7 @@ #include "code\__DEFINES\colors.dm" #include "code\__DEFINES\combat.dm" #include "code\__DEFINES\communications.dm" +#include "code\__DEFINES\computers.dm" #include "code\__DEFINES\configuration.dm" #include "code\__DEFINES\construction.dm" #include "code\__DEFINES\cooldowns.dm" @@ -1465,8 +1466,19 @@ #include "code\game\machinery\computer\atmos_computers\inlets.dm" #include "code\game\machinery\computer\atmos_computers\meters.dm" #include "code\game\machinery\computer\atmos_computers\outlets.dm" -#include "code\game\machinery\computer\chef_orders\chef_order.dm" -#include "code\game\machinery\computer\chef_orders\order_datum.dm" +#include "code\game\machinery\computer\orders\order_computer\cook_order.dm" +#include "code\game\machinery\computer\orders\order_computer\golem_order.dm" +#include "code\game\machinery\computer\orders\order_computer\mining_order.dm" +#include "code\game\machinery\computer\orders\order_computer\order_computer.dm" +#include "code\game\machinery\computer\orders\order_items\order_datum.dm" +#include "code\game\machinery\computer\orders\order_items\cook\order_milk_eggs.dm" +#include "code\game\machinery\computer\orders\order_items\cook\order_reagents.dm" +#include "code\game\machinery\computer\orders\order_items\cook\order_veggies.dm" +#include "code\game\machinery\computer\orders\order_items\mining\order_consumables.dm" +#include "code\game\machinery\computer\orders\order_items\mining\order_golem.dm" +#include "code\game\machinery\computer\orders\order_items\mining\order_mining.dm" +#include "code\game\machinery\computer\orders\order_items\mining\order_pka.dm" +#include "code\game\machinery\computer\orders\order_items\mining\order_toys.dm" #include "code\game\machinery\computer\prisoner\_prisoner.dm" #include "code\game\machinery\computer\prisoner\gulag_teleporter.dm" #include "code\game\machinery\computer\prisoner\management.dm" @@ -3488,9 +3500,9 @@ #include "code\modules\mining\machine_silo.dm" #include "code\modules\mining\machine_stacking.dm" #include "code\modules\mining\machine_unloading.dm" -#include "code\modules\mining\machine_vending.dm" #include "code\modules\mining\mine_items.dm" #include "code\modules\mining\minebot.dm" +#include "code\modules\mining\mining_ltsrbt.dm" #include "code\modules\mining\money_bag.dm" #include "code\modules\mining\ores_coins.dm" #include "code\modules\mining\satchel_ore_boxdm.dm" diff --git a/tgui/packages/tgui/interfaces/Cargo.js b/tgui/packages/tgui/interfaces/Cargo.js index 0eaf14441ef..c25689924ae 100644 --- a/tgui/packages/tgui/interfaces/Cargo.js +++ b/tgui/packages/tgui/interfaces/Cargo.js @@ -100,7 +100,8 @@ const CargoStatus = (props, context) => { color={(grocery && 'orange') || 'green'} content={location} tooltip={ - (grocery && 'The chef is waiting on their grocery supplies.') || + (grocery && + 'The kitchen is waiting for their grocery supply delivery!') || '' } tooltipPosition="right" diff --git a/tgui/packages/tgui/interfaces/MiningVendor.js b/tgui/packages/tgui/interfaces/MiningVendor.js deleted file mode 100644 index db30906b0fe..00000000000 --- a/tgui/packages/tgui/interfaces/MiningVendor.js +++ /dev/null @@ -1,65 +0,0 @@ -import { classes } from 'common/react'; -import { useBackend } from '../backend'; -import { Box, Button, Section, Table } from '../components'; -import { Window } from '../layouts'; - -export const MiningVendor = (props, context) => { - const { act, data } = useBackend(context); - let inventory = [...data.product_records]; - return ( - - -
- {(data.user && ( - - Welcome, {data.user.name || 'Unknown'},{' '} - {data.user.job || 'Unemployed'}! -
- Your balance is {data.user.points} mining points. -
- )) || ( - - No registered ID card! -
- Please contact your local HoP! -
- )} -
-
- - {inventory.map((product) => { - return ( - - - {' '} - {product.name} - - -
-
-
-
- ); -}; diff --git a/tgui/packages/tgui/interfaces/ProduceConsole.js b/tgui/packages/tgui/interfaces/ProduceConsole.js index 6b92f13cefb..07f89b5d23c 100644 --- a/tgui/packages/tgui/interfaces/ProduceConsole.js +++ b/tgui/packages/tgui/interfaces/ProduceConsole.js @@ -1,4 +1,4 @@ -import { multiline } from 'common/string'; +import { capitalize, multiline } from 'common/string'; import { useBackend, useLocalState } from '../backend'; import { Box, Button, Dimmer, Divider, Icon, NumberInput, Section, Stack } from '../components'; import { Window } from '../layouts'; @@ -16,7 +16,7 @@ const TAB2NAME = [ const ShoppingTab = (props, context) => { const { data, act } = useBackend(context); - const { order_datums } = data; + const { order_categories, order_datums } = data; const [shopIndex, setShopIndex] = useLocalState(context, 'shop-index', 1); const mapped_food = order_datums.filter( (food) => food && food.cat === shopIndex @@ -26,30 +26,15 @@ const ShoppingTab = (props, context) => {
- -
@@ -60,8 +45,13 @@ const ShoppingTab = (props, context) => { {mapped_food.map((item) => ( - {item.name} - + {' '} + {capitalize(item.name)} + {'"' + item.desc + '"'}
@@ -96,7 +86,7 @@ const ShoppingTab = (props, context) => { const CheckoutTab = (props, context) => { const { data, act } = useBackend(context); - const { order_datums, total_cost } = data; + const { ltsrbt_available, forced_express, order_datums, total_cost } = data; const checkout_list = order_datums.filter((food) => food && food.amt); return ( @@ -120,8 +110,8 @@ const CheckoutTab = (props, context) => { {checkout_list.map((item) => ( - {item.name} - + {capitalize(item.name)} + {'"' + item.desc + '"'}
@@ -156,19 +146,36 @@ const CheckoutTab = (props, context) => { Total Cost: {total_cost} - -