Files
Bubberstation/code/modules/mining/mining_ltsrbt.dm
John Willard fd19f6d5a0 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

🆑
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.
/🆑
2022-11-30 19:29:28 -08:00

104 lines
3.3 KiB
Plaintext

/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