Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 77d9096

Browse files
committed
Turns out the LTSRBT exists
1 parent 5fada85 commit 77d9096

File tree

14 files changed

+213
-32
lines changed

14 files changed

+213
-32
lines changed

code/__DEFINES/blackmarket.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
// Shipping methods
33

4+
// The BEST way of shipping items: accurate, "undetectable"
5+
#define SHIPPING_METHOD_LTSRBT "LTSRBT"
46
// Picks a random area to teleport the item to and gives you a minute to get there before it is sent.
57
#define SHIPPING_METHOD_TELEPORT "Teleport"
68
// Throws the item from somewhere at the station.

code/_globalvars/lists/maintenance_loot.dm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,8 @@ GLOBAL_LIST_INIT(maintenance_loot_makeshift,list(
620620
/obj/item/stack/spacecash/c200 = W_RARE,
621621
/obj/item/stack/spacecash/c50 = W_UNCOMMON,
622622
/obj/item/stack/spacecash/c500 = W_MYTHICAL,
623-
/obj/item/stock_parts/cell/potato = W_UNCOMMON
623+
/obj/item/stock_parts/cell/potato = W_UNCOMMON,
624+
/obj/item/blackmarket_uplink = W_UNCOMMON
624625
))
625626

626627
//Has minor mechanical usage; stuff you'd usually only find in a lathe, through crafting, or through a vendor.

code/controllers/subsystem/blackmarket.dm

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ SUBSYSTEM_DEF(blackmarket)
66
/// Descriptions for each shipping methods.
77
var/shipping_method_descriptions = list(
88
SHIPPING_METHOD_LAUNCH="Launches the item at the station from space, cheap but you might not recieve your item at all.",
9+
SHIPPING_METHOD_LTSRBT="Long-To-Short-Range-Bluespace-Transceiver, a machine that recieves items outside the station and then teleports them to the location of the uplink.",
910
SHIPPING_METHOD_TELEPORT="Teleports the item in a random area in the station, you get 60 seconds to get there first though."
1011
)
1112

@@ -45,6 +46,29 @@ SUBSYSTEM_DEF(blackmarket)
4546
continue
4647

4748
switch(purchase.method)
49+
// Find a ltsrbt pad and make it handle the shipping.
50+
if(SHIPPING_METHOD_LTSRBT)
51+
if(!telepads.len)
52+
continue
53+
// Prioritize pads that don't have a cooldown active.
54+
var/free_pad_found = FALSE
55+
for(var/obj/machinery/ltsrbt/pad in telepads)
56+
if(pad.recharge_cooldown)
57+
continue
58+
pad.add_to_queue(purchase)
59+
queued_purchases -= purchase
60+
free_pad_found = TRUE
61+
break
62+
63+
if(free_pad_found)
64+
continue
65+
66+
var/obj/machinery/ltsrbt/pad = pick(telepads)
67+
68+
to_chat(recursive_loc_check(purchase.uplink.loc, /mob), span_notice("[purchase.uplink] flashes a message noting that the order is being processed by [pad]."))
69+
70+
queued_purchases -= purchase
71+
pad.add_to_queue(purchase)
4872
// Get random area, throw it somewhere there.
4973
if(SHIPPING_METHOD_TELEPORT)
5074
var/turf/targetturf = get_safe_random_station_turf()
@@ -85,5 +109,7 @@ SUBSYSTEM_DEF(blackmarket)
85109

86110
/// Used to add /datum/blackmarket_purchase to queued_purchases var. Returns TRUE when queued.
87111
/datum/controller/subsystem/blackmarket/proc/queue_item(datum/blackmarket_purchase/P)
112+
if(P.method == SHIPPING_METHOD_LTSRBT && !telepads.len)
113+
return FALSE
88114
queued_purchases += P
89115
return TRUE

code/modules/cargo/blackmarket_items/clothing.dm renamed to code/modules/cargo/blackmarket/blackmarket_items/clothing.dm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
name = "Nanotrasen Branded Spacesuit Box"
3636
desc = "A few boxes of \"Old Style\" space suits fell off the back of a space truck."
3737
item = /obj/item/storage/box
38-
3938
price_min = 1500
4039
price_max = 4000
4140
stock_max = 3

code/modules/cargo/blackmarket_items/consumables.dm renamed to code/modules/cargo/blackmarket/blackmarket_items/consumables.dm

File renamed without changes.

code/modules/cargo/blackmarket_items/misc.dm renamed to code/modules/cargo/blackmarket/blackmarket_items/misc.dm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
/datum/blackmarket_item/misc
22
category = "Miscellaneous"
33

4+
/datum/blackmarket_item/misc/jade_Lantern
5+
name = "Jade Lantern"
6+
desc = "Found in a box labeled 'Danger: Radioactive'. Probably safe."
7+
item = /obj/item/flashlight/lantern/jade
8+
price_min = 150
9+
price_max = 500
10+
stock_max = 2
11+
availability_prob = 45
12+
413
/datum/blackmarket_item/misc/cap_gun
514
name = "Cap Gun"
615
desc = "Prank your friends with this harmless gun! Harmlessness guranteed."
File renamed without changes.
File renamed without changes.

code/modules/cargo/blackmarket/blackmarket_market.dm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,6 @@
4848

4949
/datum/blackmarket_market/blackmarket
5050
name = "Black Market"
51-
shipping = list(SHIPPING_METHOD_LAUNCH =10,
51+
shipping = list(SHIPPING_METHOD_LTSRBT =50,
52+
SHIPPING_METHOD_LAUNCH =10,
5253
SHIPPING_METHOD_TELEPORT=75)
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
/obj/item/circuitboard/machine/ltsrbt
2+
name = "LTSRBT (Machine Board)"
3+
icon_state = "bluespacearray"
4+
build_path = /obj/machinery/ltsrbt
5+
req_components = list(
6+
/obj/item/stack/ore/bluespace_crystal = 2,
7+
/obj/item/stock_parts/subspace/ansible = 1,
8+
/obj/item/stock_parts/micro_laser = 1,
9+
/obj/item/stock_parts/scanning_module = 2)
10+
def_components = list(/obj/item/stack/ore/bluespace_crystal = /obj/item/stack/ore/bluespace_crystal/artificial)
11+
12+
/obj/machinery/ltsrbt
13+
name = "Long-To-Short-Range-Bluespace-Transciever"
14+
desc = "The LTSRBT is a compact teleportation machine for recieving and sending items outside the station and inside the station.\nUsing teleportation frequencies stolen from NT it is near undetectable.\nEssential for any illegal market operations on NT stations.\n"
15+
icon_state = "exonet_node"
16+
circuit = /obj/item/circuitboard/machine/ltsrbt
17+
density = TRUE
18+
19+
idle_power_usage = 200
20+
21+
/// Divider for power_usage_per_teleport.
22+
var/power_efficiency = 1
23+
/// Power used per teleported which gets divided by power_efficiency.
24+
var/power_usage_per_teleport = 10000
25+
/// The time it takes for the machine to recharge before being able to send or recieve items.
26+
var/recharge_time = 0
27+
/// Current recharge progress.
28+
var/recharge_cooldown = 0
29+
/// Base recharge time which is used to get recharge_time.
30+
var/base_recharge_time = 100
31+
/// Current /datum/blackmarket_purchase being recieved.
32+
var/recieving
33+
/// Current /datum/blackmarket_purchase being sent to the target uplink.
34+
var/transmitting
35+
/// Queue for purchases that the machine should recieve and send.
36+
var/list/datum/blackmarket_purchase/queue = list()
37+
38+
/obj/machinery/ltsrbt/Initialize()
39+
. = ..()
40+
SSblackmarket.telepads += src
41+
42+
/obj/machinery/ltsrbt/examine(mob/user)
43+
. = ..()
44+
if(queue.len)
45+
. += span_notice("It is currently recharging. Progress: [recharge_cooldown]%")
46+
47+
/obj/machinery/ltsrbt/Destroy()
48+
SSblackmarket.telepads -= src
49+
// Bye bye orders.
50+
if(SSblackmarket.telepads.len)
51+
for(var/datum/blackmarket_purchase/P in queue)
52+
SSblackmarket.queue_item(P)
53+
. = ..()
54+
55+
/obj/machinery/ltsrbt/RefreshParts()
56+
recharge_time = base_recharge_time
57+
// On tier 4 recharge_time should be 20 and by default it is 80 as scanning modules should be tier 1.
58+
for(var/obj/item/stock_parts/scanning_module/scan in component_parts)
59+
recharge_time -= scan.rating * 10
60+
recharge_cooldown = recharge_time
61+
62+
power_efficiency = 0
63+
for(var/obj/item/stock_parts/micro_laser/laser in component_parts)
64+
power_efficiency += laser.rating
65+
// Shouldn't happen but you never know.
66+
if(!power_efficiency)
67+
power_efficiency = 1
68+
69+
/// Adds /datum/blackmarket_purchase to queue unless the machine is free, then it sets the purchase to be instantly recieved
70+
/obj/machinery/ltsrbt/proc/add_to_queue(datum/blackmarket_purchase/purchase)
71+
if(!recharge_cooldown && !recieving && !transmitting)
72+
recieving = purchase
73+
return
74+
queue += purchase
75+
76+
/obj/machinery/ltsrbt/process()
77+
if(stat & NOPOWER)
78+
return
79+
80+
if(recharge_cooldown)
81+
recharge_cooldown--
82+
return
83+
84+
var/turf/T = get_turf(src)
85+
if(recieving)
86+
var/datum/blackmarket_purchase/P = recieving
87+
88+
if(!P.item || ispath(P.item))
89+
P.item = P.entry.spawn_item(T)
90+
else
91+
var/atom/movable/M = P.item
92+
M.forceMove(T)
93+
94+
use_power(power_usage_per_teleport / power_efficiency)
95+
var/datum/effect_system/spark_spread/sparks = new
96+
sparks.set_up(5, 1, get_turf(src))
97+
sparks.attach(P.item)
98+
sparks.start()
99+
100+
recieving = null
101+
transmitting = P
102+
103+
recharge_cooldown = recharge_time
104+
return
105+
else if(transmitting)
106+
var/datum/blackmarket_purchase/P = transmitting
107+
if(!P.item)
108+
QDEL_NULL(transmitting)
109+
if(!P.item in T.contents)
110+
QDEL_NULL(transmitting)
111+
return
112+
do_teleport(P.item, get_turf(P.uplink))
113+
use_power(power_usage_per_teleport / power_efficiency)
114+
QDEL_NULL(transmitting)
115+
116+
recharge_cooldown = recharge_time
117+
return
118+
119+
if(queue.len)
120+
recieving = pick_n_take(queue)

0 commit comments

Comments
 (0)