mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
Plumbing teleporters (#51881)
* Makes the plumbing RCD accept every object * Adds simple plumbing teleporter * Polishes plumbing teleporters * Fixes runtime * this to src * circuitboard doesnt need anchoring * Fixes overlay flickering being weird * Makes the Chemical Recipient's positioning less awkward * Comments and documentation * uh * Fixes dme * Revert "uh" This reverts commit af6f30089f9f31d527f6ab3e2b1c72cf6ab6d60d. * Update code/_globalvars/lists/construction.dm Co-authored-by: girl <11748095+ExcessiveUseOfCobblestone@users.noreply.github.com> * Update code/game/objects/items/RCD.dm Co-authored-by: girl <11748095+ExcessiveUseOfCobblestone@users.noreply.github.com> * Update code/modules/plumbing/plumbers/_plumb_machinery.dm Co-authored-by: girl <11748095+ExcessiveUseOfCobblestone@users.noreply.github.com> * uncasts loop * update icons Co-authored-by: girl <11748095+ExcessiveUseOfCobblestone@users.noreply.github.com>
This commit is contained in:
@@ -16,11 +16,6 @@
|
||||
///Flags for reagents, like INJECTABLE, TRANSPARENT bla bla everything thats in DEFINES/reagents.dm
|
||||
var/reagent_flags = TRANSPARENT
|
||||
///wheter we partake in rcd construction or not
|
||||
var/rcd_constructable = TRUE
|
||||
///cost of the plumbing rcd construction
|
||||
var/rcd_cost = 15
|
||||
///delay of constructing it throught the plumbing rcd
|
||||
var/rcd_delay = 10
|
||||
|
||||
/obj/machinery/plumbing/Initialize(mapload, bolt = TRUE)
|
||||
. = ..()
|
||||
@@ -53,7 +48,7 @@
|
||||
to_chat(user, "<span class='warning'>The [name] needs to be unbolted to do that!</span")
|
||||
if(I.tool_start_check(user, amount=0))
|
||||
to_chat(user, "<span class='notice'>You start slicing the [name] apart.</span")
|
||||
if(I.use_tool(src, user, rcd_delay * 2, volume=50))
|
||||
if(I.use_tool(src, user, (1.5 SECONDS), volume=50))
|
||||
deconstruct(TRUE)
|
||||
to_chat(user, "<span class='notice'>You slice the [name] apart.</span")
|
||||
return TRUE
|
||||
@@ -64,8 +59,6 @@
|
||||
desc = "Can be manually filled with reagents from containers."
|
||||
icon_state = "pipe_input"
|
||||
reagent_flags = TRANSPARENT | REFILLABLE
|
||||
rcd_cost = 5
|
||||
rcd_delay = 5
|
||||
|
||||
/obj/machinery/plumbing/input/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
@@ -77,8 +70,6 @@
|
||||
desc = "A manual output for plumbing systems, for taking reagents directly into containers."
|
||||
icon_state = "pipe_output"
|
||||
reagent_flags = TRANSPARENT | DRAINABLE
|
||||
rcd_cost = 5
|
||||
rcd_delay = 5
|
||||
|
||||
/obj/machinery/plumbing/output/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
@@ -89,8 +80,6 @@
|
||||
desc = "A massive chemical holding tank."
|
||||
icon_state = "tank"
|
||||
buffer = 400
|
||||
rcd_cost = 25
|
||||
rcd_delay = 20
|
||||
|
||||
/obj/machinery/plumbing/tank/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
desc = "Puts reagents into containers, like bottles and beakers."
|
||||
icon_state = "bottler"
|
||||
layer = ABOVE_ALL_MOB_LAYER
|
||||
|
||||
reagent_flags = TRANSPARENT | DRAINABLE
|
||||
rcd_cost = 50
|
||||
rcd_delay = 50
|
||||
buffer = 100
|
||||
|
||||
///how much do we fill
|
||||
var/wanted_amount = 10
|
||||
///where things are sent
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
desc = "Turns plants into various types of booze."
|
||||
icon_state = "fermenter"
|
||||
layer = ABOVE_ALL_MOB_LAYER
|
||||
|
||||
reagent_flags = TRANSPARENT | DRAINABLE
|
||||
rcd_cost = 30
|
||||
rcd_delay = 30
|
||||
buffer = 400
|
||||
|
||||
///input dir
|
||||
var/eat_dir = SOUTH
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
desc = "A chemical filter for filtering chemicals. The left and right outputs appear to be from the perspective of the input port."
|
||||
icon_state = "filter"
|
||||
density = FALSE
|
||||
|
||||
///whitelist of chems id's that go to the left side. Empty to disable port
|
||||
var/list/left = list()
|
||||
///whitelist of chem id's that go to the right side. Empty to disable port
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
desc = "chemical grinder."
|
||||
icon_state = "grinder_chemical"
|
||||
layer = ABOVE_ALL_MOB_LAYER
|
||||
|
||||
reagent_flags = TRANSPARENT | DRAINABLE
|
||||
rcd_cost = 30
|
||||
rcd_delay = 30
|
||||
buffer = 400
|
||||
|
||||
var/eat_dir = SOUTH
|
||||
|
||||
/obj/machinery/plumbing/grinder_chemical/Initialize(mapload, bolt)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
name = "chemical press"
|
||||
desc = "A press that makes pills, patches and bottles."
|
||||
icon_state = "pill_press"
|
||||
|
||||
///maximum size of a pill
|
||||
var/max_pill_volume = 50
|
||||
///maximum size of a patch
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
idle_power_usage = 10
|
||||
active_power_usage = 1000
|
||||
|
||||
rcd_cost = 30
|
||||
rcd_delay = 40
|
||||
|
||||
///units we pump per process (2 seconds)
|
||||
var/pump_power = 2
|
||||
///set to true if the loop couldnt find a geyser in process, so it remembers and stops checking every loop until moved. more accurate name would be absolutely_no_geyser_under_me_so_dont_try
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
icon_state = "reaction_chamber"
|
||||
buffer = 200
|
||||
reagent_flags = TRANSPARENT | NO_REACT
|
||||
|
||||
/**list of set reagents that the reaction_chamber allows in, and must all be present before mixing is enabled.
|
||||
* example: list(/datum/reagent/water = 20, /datum/reagent/fuel/oil = 50)
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
name = "Chemical Splitter"
|
||||
desc = "A chemical splitter for smart chemical factorization. Waits till a set of conditions is met and then stops all input and splits the buffer evenly or other in two ducts."
|
||||
icon_state = "splitter"
|
||||
|
||||
buffer = 100
|
||||
density = FALSE
|
||||
|
||||
|
||||
@@ -5,13 +5,9 @@
|
||||
|
||||
icon_state = "synthesizer"
|
||||
icon = 'icons/obj/plumbing/plumbers.dmi'
|
||||
rcd_cost = 25
|
||||
rcd_delay = 15
|
||||
|
||||
///Amount we produce for every process. Ideally keep under 5 since thats currently the standard duct capacity
|
||||
var/amount = 1
|
||||
///The maximum we can produce for every process
|
||||
buffer = 5
|
||||
///I track them here because I have no idea how I'd make tgui loop like that
|
||||
var/static/list/possible_amounts = list(0,1,2,3,4,5)
|
||||
///The reagent we are producing. We are a typepath, but are also typecast because there's several occations where we need to use initial.
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
///A bluespace input pipe for plumbing
|
||||
/obj/machinery/plumbing/sender
|
||||
name = "chemical beacon"
|
||||
desc = "A bluespace anchor for chemicals. Does not require power. Use a multitool linked to a Chemical Recipient on this machine to start teleporting reagents."
|
||||
icon_state = "beacon"
|
||||
|
||||
density = FALSE
|
||||
|
||||
///whoever we teleport our chems to
|
||||
var/obj/machinery/plumbing/receiver/target = null
|
||||
|
||||
/obj/machinery/plumbing/sender/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/simple_demand, bolt)
|
||||
|
||||
/obj/machinery/plumbing/sender/multitool_act(mob/living/user, obj/item/I)
|
||||
if(!multitool_check_buffer(user, I))
|
||||
return
|
||||
|
||||
var/obj/item/multitool/M = I
|
||||
|
||||
if(!istype(M.buffer, /obj/machinery/plumbing/receiver))
|
||||
to_chat(user, "<span class='warning'>Invalid buffer.</span>")
|
||||
return
|
||||
|
||||
if(target)
|
||||
lose_teleport_target()
|
||||
|
||||
set_teleport_target(M.buffer)
|
||||
|
||||
to_chat(user, "<span class='green'>You succesfully link [src] to the [M.buffer].</span>")
|
||||
return TRUE
|
||||
|
||||
///Lose our previous target and make our previous target lose us. Seperate proc because I feel like I'll need this again
|
||||
/obj/machinery/plumbing/sender/proc/lose_teleport_target()
|
||||
target.senders.Remove(src)
|
||||
target = null
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
///Set a receiving plumbing object
|
||||
/obj/machinery/plumbing/sender/proc/set_teleport_target(new_target)
|
||||
target = new_target
|
||||
target.senders.Add(src)
|
||||
icon_state = initial(icon_state) + "_idle"
|
||||
|
||||
///Transfer reagents and display a flashing icon
|
||||
/obj/machinery/plumbing/sender/proc/teleport_chemicals(obj/machinery/plumbing/receiver/R, amount)
|
||||
flick(initial(icon_state) + "_flash", src)
|
||||
reagents.trans_to(R, amount, round_robin = TRUE)
|
||||
|
||||
///A bluespace output pipe for plumbing. Supports multiple recipients. Must be constructed with a circuit board
|
||||
/obj/machinery/plumbing/receiver
|
||||
name = "chemical recipient"
|
||||
desc = "Receives chemicals from one or more chemical beacons. Use a multitool on this machine and then all subsequent chemical beacons. Reset by opening the \
|
||||
panel and cutting the main wire."
|
||||
icon_state = "recipient"
|
||||
|
||||
buffer = 150
|
||||
|
||||
///How much chemicals we can teleport per process
|
||||
var/pull_amount = 20
|
||||
///All synced up chemical beacons we can tap from
|
||||
var/list/senders = list()
|
||||
///We only grab one machine per process, so store which one is next
|
||||
var/next_index = 1
|
||||
|
||||
/obj/machinery/plumbing/receiver/Initialize(mapload, bolt)
|
||||
. = ..()
|
||||
AddComponent(/datum/component/plumbing/simple_supply, bolt)
|
||||
|
||||
/obj/machinery/plumbing/receiver/multitool_act(mob/living/user, obj/item/I)
|
||||
if(!multitool_check_buffer(user, I))
|
||||
return
|
||||
|
||||
var/obj/item/multitool/M = I
|
||||
M.buffer = src
|
||||
to_chat(user, "<span class='notice'>You store linkage information in [I]'s buffer.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/plumbing/receiver/process()
|
||||
if(machine_stat & NOPOWER || panel_open)
|
||||
return
|
||||
|
||||
if(senders.len)
|
||||
if(senders.len < next_index)
|
||||
next_index = 1
|
||||
|
||||
var/obj/machinery/plumbing/sender/S = senders[next_index]
|
||||
if(QDELETED(S))
|
||||
senders.Remove(S)
|
||||
return
|
||||
|
||||
S.teleport_chemicals(src, pull_amount)
|
||||
|
||||
flick(initial(icon_state) + "_flash", src)
|
||||
|
||||
next_index++
|
||||
|
||||
///Notify all senders to forget us
|
||||
/obj/machinery/plumbing/receiver/proc/lose_senders()
|
||||
for(var/A in senders)
|
||||
var/obj/machinery/plumbing/sender/S = A
|
||||
if(S == null)
|
||||
continue
|
||||
S.lose_teleport_target()
|
||||
|
||||
senders = list()
|
||||
|
||||
/obj/machinery/plumbing/receiver/attackby(obj/item/I, mob/user, params)
|
||||
if(default_deconstruction_screwdriver(user, icon_state + "_open", initial(icon_state), I))
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(default_pry_open(I))
|
||||
return
|
||||
|
||||
if(default_deconstruction_crowbar(I))
|
||||
return
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/plumbing/receiver/wirecutter_act(mob/living/user, obj/item/I)
|
||||
. = ..()
|
||||
|
||||
if(panel_open)
|
||||
lose_senders()
|
||||
@@ -609,6 +609,15 @@
|
||||
category = list ("Medical Machinery")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_MEDICAL
|
||||
|
||||
/datum/design/board/plumbing_receiver
|
||||
name = "Machine Design (Chemical Recipient)"
|
||||
desc = "The circuit board for a Chemical Recipient."
|
||||
id = "plumbing_receiver"
|
||||
build_path = /obj/item/circuitboard/machine/plumbing_receiver
|
||||
category = list ("Teleportation Machinery")
|
||||
departmental_flags = DEPARTMENTAL_FLAG_MEDICAL
|
||||
|
||||
|
||||
/datum/design/board/sheetifier
|
||||
name = "Machine Design (Sheet-meister 2000)"
|
||||
desc = "The circuit board for a Sheet-meister 2000."
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
display_name = "Applied Bluespace Research"
|
||||
description = "Using bluespace to make things faster and better."
|
||||
prereq_ids = list("bluespace_basic", "engineering")
|
||||
design_ids = list("bs_rped","minerbag_holding", "bluespacebeaker", "bluespacesyringe", "phasic_scanning", "roastingstick", "ore_silo")
|
||||
design_ids = list("bs_rped","minerbag_holding", "bluespacebeaker", "bluespacesyringe", "phasic_scanning", "roastingstick", "ore_silo", "plumbing_receiver")
|
||||
research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000)
|
||||
export_price = 5000
|
||||
|
||||
|
||||
Reference in New Issue
Block a user