[MIRROR] [R&D Machine Overhaul, Part 1] - Various machines no longer require R&D machines to function. (#618)

* [R&D Machine Overhaul, Part 1] - Various machines no longer require R&D machines to function. (#53339)

Removes various R&D machine requirements including circuit imprinters, protolathes, destructive analyzer and the mechfabs. All machines that previously required an R&D console to function are standalone, including omni protolathes and omni imprinters.

Replaces "production"-class R&D consoles with civilian modular computers on all maps. There are no longer "production"-class consoles.

Removes the concept of "core" R&D consoles. R&D consoles only research and handle tech disks and stuff. All existing core consoles have been switched to their basic archetype.

Because it's a pain in the ass to manage, material reclaimation has been removed from the destructive analyzer. The destructive analyzer is now ONLY for destroying items and unlocking research nodes such as illegal and alien tech.

* [R&D Machine Overhaul, Part 1] - Various machines no longer require R&D machines to function.

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
Co-authored-by: Azarak <azarak10@gmail.com>
This commit is contained in:
SkyratBot
2020-09-02 03:36:16 +02:00
committed by GitHub
co-authored by Timberpoes Azarak
parent 2a7d21ad35
commit f93ca59e1d
23 changed files with 158 additions and 770 deletions
+111 -52
View File
@@ -1,5 +1,3 @@
/*
Destructive Analyzer
@@ -27,10 +25,6 @@ Note: Must be placed within 3 tiles of the R&D Console
temp_list[O] = text2num(temp_list[O])
return temp_list
/obj/machinery/rnd/destructive_analyzer/disconnect_console()
linked_console.linked_destroy = null
..()
/obj/machinery/rnd/destructive_analyzer/Insert_Item(obj/item/O, mob/user)
if(user.a_intent != INTENT_HARM)
. = 1
@@ -44,8 +38,7 @@ Note: Must be placed within 3 tiles of the R&D Console
to_chat(user, "<span class='notice'>You add the [O.name] to the [src.name]!</span>")
flick("d_analyzer_la", src)
addtimer(CALLBACK(src, .proc/finish_loading), 10)
if (linked_console)
linked_console.updateUsrDialog()
updateUsrDialog()
/obj/machinery/rnd/destructive_analyzer/proc/finish_loading()
update_icon()
@@ -57,28 +50,8 @@ Note: Must be placed within 3 tiles of the R&D Console
else
icon_state = initial(icon_state)
/obj/machinery/rnd/destructive_analyzer/proc/reclaim_materials_from(obj/item/thing)
. = 0
var/datum/component/material_container/storage = linked_console?.linked_lathe?.materials.mat_container
if(!storage) // If we have no storage drop out
return
// sends salvaged materials to a linked protolathe, if any.
for(var/material in thing.custom_materials)
var/can_insert = 0 // the amount of material to insert
if(istype(thing, /obj/item/stack/sheet))
var/obj/item/stack/sheet/stack = thing
if(stack.mats_per_unit)
can_insert += stack.mats_per_unit[material]
can_insert = min((storage.max_amount - storage.total_amount), (min(can_insert*(decon_mod/10), can_insert)))
else
can_insert = min((storage.max_amount - storage.total_amount), (min(thing.custom_materials[material]*(decon_mod/10), thing.custom_materials[material])))
storage.insert_amount_mat(can_insert, material)
. += can_insert
if (.)
linked_console.linked_lathe.materials.silo_log(src, "reclaimed", 1, "[thing.name]", thing.custom_materials)
/obj/machinery/rnd/destructive_analyzer/proc/destroy_item(obj/item/thing, innermode = FALSE)
if(QDELETED(thing) || QDELETED(src) || QDELETED(linked_console))
if(QDELETED(thing) || QDELETED(src))
return FALSE
if(!innermode)
flick("d_analyzer_process", src)
@@ -90,36 +63,27 @@ Note: Must be placed within 3 tiles of the R&D Console
var/list/food = thing.GetDeconstructableContents()
for(var/obj/item/innerthing in food)
destroy_item(innerthing, TRUE)
reclaim_materials_from(thing)
for(var/mob/M in thing)
M.death()
if(istype(thing, /obj/item/stack/sheet))
var/obj/item/stack/sheet/S = thing
if(S.amount > 1 && !innermode)
S.use(1, check=FALSE)
loaded_item = S
else
qdel(thing)
loaded_item = null
else
qdel(thing)
loaded_item = null
qdel(thing)
loaded_item = null
if (!innermode)
update_icon()
return TRUE
/obj/machinery/rnd/destructive_analyzer/proc/user_try_decon_id(id, mob/user)
if(!istype(loaded_item) || !istype(linked_console))
if(!istype(loaded_item))
return FALSE
if (id && id != RESEARCH_MATERIAL_RECLAMATION_ID)
if (id && id != RESEARCH_MATERIAL_DESTROY_ID)
var/datum/techweb_node/TN = SSresearch.techweb_node_by_id(id)
if(!istype(TN))
return FALSE
var/dpath = loaded_item.type
var/list/worths = TN.boost_item_paths[dpath]
var/list/differences = list()
var/list/already_boosted = linked_console.stored_research.boosted_nodes[TN.id]
var/list/already_boosted = stored_research.boosted_nodes[TN.id]
for(var/i in worths)
var/used = already_boosted? already_boosted[i] : 0
var/value = min(worths[i], TN.research_costs[i]) - used
@@ -130,30 +94,28 @@ Note: Must be placed within 3 tiles of the R&D Console
var/choice = input("Are you sure you want to destroy [loaded_item] to [!length(worths) ? "reveal [TN.display_name]" : "boost [TN.display_name] by [json_encode(differences)] point\s"]?") in list("Proceed", "Cancel")
if(choice == "Cancel")
return FALSE
if(QDELETED(loaded_item) || QDELETED(linked_console) || !user.Adjacent(linked_console) || QDELETED(src))
if(QDELETED(loaded_item) || QDELETED(src))
return FALSE
SSblackbox.record_feedback("nested tally", "item_deconstructed", 1, list("[TN.id]", "[loaded_item.type]"))
if(destroy_item(loaded_item))
linked_console.stored_research.boost_with_path(SSresearch.techweb_node_by_id(TN.id), dpath)
stored_research.boost_with_path(SSresearch.techweb_node_by_id(TN.id), dpath)
else
var/list/point_value = techweb_item_point_check(loaded_item)
if(linked_console.stored_research.deconstructed_items[loaded_item.type])
if(stored_research.deconstructed_items[loaded_item.type])
point_value = list()
var/user_mode_string = ""
if(length(point_value))
user_mode_string = " for [json_encode(point_value)] points"
else if(length(loaded_item.custom_materials))
user_mode_string = " for material reclamation"
var/choice = input("Are you sure you want to destroy [loaded_item][user_mode_string]?") in list("Proceed", "Cancel")
if(choice == "Cancel")
return FALSE
if(QDELETED(loaded_item) || QDELETED(linked_console) || !user.Adjacent(linked_console) || QDELETED(src))
if(QDELETED(loaded_item) || QDELETED(src))
return FALSE
var/loaded_type = loaded_item.type
if(destroy_item(loaded_item))
linked_console.stored_research.add_point_list(point_value)
linked_console.stored_research.deconstructed_items[loaded_type] = point_value
stored_research.add_point_list(point_value)
stored_research.deconstructed_items[loaded_type] = point_value
return TRUE
@@ -164,3 +126,100 @@ Note: Must be placed within 3 tiles of the R&D Console
loaded_item = null
update_icon()
return TRUE
/obj/machinery/rnd/destructive_analyzer/ui_interact(mob/user)
. = ..()
var/datum/browser/popup = new(user, "destructive_analyzer", name, 900, 600)
popup.set_content(ui_deconstruct())
popup.open()
/obj/machinery/rnd/destructive_analyzer/proc/ui_deconstruct() //Legacy code
var/list/l = list()
if(!loaded_item)
l += "<div class='statusDisplay'>No item loaded. Standing-by...</div>"
else
l += "<div class='statusDisplay'>[RDSCREEN_NOBREAK]"
l += "<table><tr><td>[icon2html(loaded_item, usr)]</td><td><b>[loaded_item.name]</b> <A href='?src=[REF(src)];eject_item=1'>Eject</A></td></tr></table>[RDSCREEN_NOBREAK]"
l += "Select a node to boost by deconstructing this item. This item can boost:"
var/anything = FALSE
var/list/boostable_nodes = techweb_item_boost_check(loaded_item)
for(var/id in boostable_nodes)
anything = TRUE
var/list/worth = boostable_nodes[id]
var/datum/techweb_node/N = SSresearch.techweb_node_by_id(id)
l += "<div class='statusDisplay'>[RDSCREEN_NOBREAK]"
if (stored_research.researched_nodes[N.id]) // already researched
l += "<span class='linkOff'>[N.display_name]</span>"
l += "This node has already been researched."
else if(!length(worth)) // reveal only
if (stored_research.hidden_nodes[N.id])
l += "<A href='?src=[REF(src)];deconstruct=[N.id]'>[N.display_name]</A>"
l += "This node will be revealed."
else
l += "<span class='linkOff'>[N.display_name]</span>"
l += "This node has already been revealed."
else // boost by the difference
var/list/differences = list()
var/list/already_boosted = stored_research.boosted_nodes[N.id]
for(var/i in worth)
var/already_boosted_amount = already_boosted? stored_research.boosted_nodes[N.id][i] : 0
var/amt = min(worth[i], N.research_costs[i]) - already_boosted_amount
if(amt > 0)
differences[i] = amt
if (length(differences))
l += "<A href='?src=[REF(src)];deconstruct=[N.id]'>[N.display_name]</A>"
l += "This node will be boosted with the following:<BR>[techweb_point_display_generic(differences)]"
else
l += "<span class='linkOff'>[N.display_name]</span>"
l += "This node has already been boosted.</span>"
l += "</div>[RDSCREEN_NOBREAK]"
var/list/point_values = techweb_item_point_check(loaded_item)
if(point_values)
anything = TRUE
l += "<div class='statusDisplay'>[RDSCREEN_NOBREAK]"
if (stored_research.deconstructed_items[loaded_item.type])
l += "<span class='linkOff'>Point Deconstruction</span>"
l += "This item's points have already been claimed."
else
l += "<A href='?src=[REF(src)];deconstruct=[RESEARCH_MATERIAL_DESTROY_ID]'>Point Deconstruction</A>"
l += "This item is worth: <BR>[techweb_point_display_generic(point_values)]!"
l += "</div>[RDSCREEN_NOBREAK]"
if(!(loaded_item.resistance_flags & INDESTRUCTIBLE))
l += "<div class='statusDisplay'><A href='?src=[REF(src)];deconstruct=[RESEARCH_MATERIAL_DESTROY_ID]'>Destroy Item</A>"
l += "</div>[RDSCREEN_NOBREAK]"
anything = TRUE
if (!anything)
l += "Nothing!"
l += "</div>"
for(var/i in 1 to length(l))
if(!findtextEx(l[i], RDSCREEN_NOBREAK))
l[i] += "<br>"
. = l.Join("")
return replacetextEx(., RDSCREEN_NOBREAK, "")
/obj/machinery/rnd/destructive_analyzer/Topic(raw, ls)
. = ..()
if(.)
return
add_fingerprint(usr)
usr.set_machine(src)
if(ls["eject_item"]) //Eject the item inside the destructive analyzer.
if(busy)
to_chat(usr, "<span class='danger'>The destructive analyzer is busy at the moment.</span>")
return
if(loaded_item)
unload_item()
if(ls["deconstruct"])
if(!user_try_decon_id(ls["deconstruct"], usr))
say("Destructive analysis failed!")
updateUsrDialog()
+1 -12
View File
@@ -124,8 +124,6 @@
/obj/machinery/rnd/experimentor/ui_interact(mob/user)
var/list/dat = list("<center>")
if(!linked_console)
dat += "<b><a href='byond://?src=[REF(src)];function=search'>Scan for R&D Console</A></b>"
if(loaded_item)
dat += "<b>Loaded Item:</b> [loaded_item]"
@@ -175,10 +173,6 @@
if(href_list["close"])
usr << browse(null, "window=experimentor")
return
if(scantype == "search")
var/obj/machinery/computer/rdconsole/D = locate(/obj/machinery/computer/rdconsole) in oview(3,src)
if(D)
linked_console = D
else if(scantype == "eject")
ejectItem()
else if(scantype == "refresh")
@@ -201,8 +195,7 @@
if(dotype != FAIL)
var/list/nodes = techweb_item_boost_check(process)
var/picked = pickweight(nodes) //This should work.
if(linked_console)
linked_console.stored_research.boost_with_path(SSresearch.techweb_node_by_id(picked), process.type)
stored_research.boost_with_path(SSresearch.techweb_node_by_id(picked), process.type)
updateUsrDialog()
/obj/machinery/rnd/experimentor/proc/matchReaction(matching,reaction)
@@ -438,10 +431,6 @@
////////////////////////////////////////////////////////////////////////////////////////////////
if(exp == SCANTYPE_OBLITERATE)
visible_message("<span class='warning'>[exp_on] activates the crushing mechanism, [exp_on] is destroyed!</span>")
if(linked_console.linked_lathe)
var/datum/component/material_container/linked_materials = linked_console.linked_lathe.GetComponent(/datum/component/material_container)
for(var/material in exp_on.custom_materials)
linked_materials.insert_amount_mat( min((linked_materials.max_amount - linked_materials.total_amount), (exp_on.custom_materials[material])), material)
if(prob(EFFECT_PROB_LOW) && criticalReaction)
visible_message("<span class='warning'>[src]'s crushing mechanism slowly and smoothly descends, flattening the [exp_on]!</span>")
new /obj/item/stack/sheet/plasteel(get_turf(pick(oview(1,src))))
+5 -18
View File
@@ -2,7 +2,6 @@
name = "technology fabricator"
desc = "Makes researched and prototype items with materials and energy."
layer = BELOW_OBJ_LAYER
var/consoleless_interface = FALSE //Whether it can be used without a console.
var/efficiency_coeff = 1 //Materials needed / coeff = actual.
var/list/categories = list()
var/datum/component/remote_materials/materials
@@ -12,8 +11,6 @@
var/list/datum/design/cached_designs
var/list/datum/design/matching_designs
var/department_tag = "Unidentified" //used for material distribution among other things.
var/datum/techweb/stored_research
var/datum/techweb/host_research
var/screen = RESEARCH_FABRICATOR_SCREEN_MAIN
var/selected_category
@@ -23,9 +20,7 @@
create_reagents(0, OPENCONTAINER)
matching_designs = list()
cached_designs = list()
stored_research = new
host_research = SSresearch.science_tech
update_research()
update_designs()
materials = AddComponent(/datum/component/remote_materials, "lathe", mapload)
RefreshParts()
@@ -33,14 +28,8 @@
materials = null
cached_designs = null
matching_designs = null
QDEL_NULL(stored_research)
host_research = null
return ..()
/obj/machinery/rnd/production/proc/update_research()
host_research.copy_research_to(stored_research, TRUE)
update_designs()
/obj/machinery/rnd/production/proc/update_designs()
cached_designs.Cut()
for(var/i in stored_research.researched_designs)
@@ -52,8 +41,6 @@
calculate_efficiency()
/obj/machinery/rnd/production/ui_interact(mob/user)
if(!consoleless_interface)
return ..()
user.set_machine(src)
var/datum/browser/popup = new(user, "rndconsole", name, 460, 550)
popup.set_content(generate_ui())
@@ -114,13 +101,13 @@
return !ispath(path, /obj/item/stack/sheet) && !ispath(path, /obj/item/stack/ore/bluespace_crystal)
/obj/machinery/rnd/production/proc/user_try_print_id(id, amount)
if((!istype(linked_console) && requires_console) || !id)
if(!id)
return FALSE
if(istext(amount))
amount = text2num(amount)
if(isnull(amount))
amount = 1
var/datum/design/D = (linked_console || requires_console)? (linked_console.stored_research.researched_designs[id]? SSresearch.techweb_design_by_id(id) : null) : SSresearch.techweb_design_by_id(id)
var/datum/design/D = stored_research.researched_designs[id] ? SSresearch.techweb_design_by_id(id) : null
if(!istype(D))
return FALSE
if(!(isnull(allowed_department_flags) || (D.departmental_flags & allowed_department_flags)))
@@ -195,7 +182,7 @@
/obj/machinery/rnd/production/proc/ui_header()
var/list/l = list()
l += "<div class='statusDisplay'><b>[host_research.organization] [department_tag] Department Lathe</b>"
l += "<div class='statusDisplay'><b>[stored_research.organization] [department_tag] Department Lathe</b>"
l += "Security protocols: [(obj_flags & EMAGGED)? "<font color='red'>Disabled</font>" : "<font color='green'>Enabled</font>"]"
if (materials.mat_container)
l += "<A href='?src=[REF(src)];switch_screen=[RESEARCH_FABRICATOR_SCREEN_MATERIALS]'><B>Material Amount:</B> [materials.format_amount()]</A>"
@@ -298,7 +285,7 @@
search(ls["to_search"])
screen = RESEARCH_FABRICATOR_SCREEN_SEARCH
if(ls["sync_research"])
update_research()
update_designs()
say("Synchronizing research with host technology database.")
if(ls["category"])
selected_category = ls["category"]
@@ -19,10 +19,6 @@
production_animation = "circuit_imprinter_ani"
allowed_buildtypes = IMPRINTER
/obj/machinery/rnd/production/circuit_imprinter/disconnect_console()
linked_console.linked_imprinter = null
..()
/obj/machinery/rnd/production/circuit_imprinter/calculate_efficiency()
. = ..()
var/total_rating = 0
@@ -3,8 +3,6 @@
desc = "A special circuit imprinter with a built in interface meant for departmental usage, with built in ExoSync receivers allowing it to print designs researched that match its ROM-encoded department type."
icon_state = "circuit_imprinter"
circuit = /obj/item/circuitboard/machine/circuit_imprinter/department
requires_console = FALSE
consoleless_interface = TRUE
/obj/machinery/rnd/production/circuit_imprinter/department/science
name = "department circuit imprinter (Science)"
@@ -3,8 +3,6 @@
desc = "A special protolathe with a built in interface meant for departmental usage, with built in ExoSync receivers allowing it to print designs researched that match its ROM-encoded department type."
icon_state = "protolathe"
circuit = /obj/item/circuitboard/machine/protolathe/department
requires_console = FALSE
consoleless_interface = TRUE
/obj/machinery/rnd/production/protolathe/department/engineering
name = "department protolathe (Engineering)"
@@ -19,7 +19,3 @@
)
production_animation = "protolathe_n"
allowed_buildtypes = PROTOLATHE
/obj/machinery/rnd/production/protolathe/disconnect_console()
linked_console.linked_lathe = null
..()
@@ -30,6 +30,4 @@
)
console_link = FALSE
production_animation = "protolathe_n"
requires_console = FALSE
consoleless_interface = TRUE
allowed_buildtypes = PROTOLATHE | IMPRINTER
+2 -594
View File
@@ -24,10 +24,6 @@ Nothing else in the console has ID requirements.
var/obj/item/disk/design_disk/d_disk //Stores the design disk.
circuit = /obj/item/circuitboard/computer/rdconsole
var/obj/machinery/rnd/destructive_analyzer/linked_destroy //Linked Destructive Analyzer
var/obj/machinery/rnd/production/protolathe/linked_lathe //Linked Protolathe
var/obj/machinery/rnd/production/circuit_imprinter/linked_imprinter //Linked Circuit Imprinter
req_access = list(ACCESS_RND) //lA AND SETTING MANIPULATION REQUIRES SCIENTIST ACCESS.
//UI VARS
@@ -39,7 +35,6 @@ Nothing else in the console has ID requirements.
var/datum/selected_node_id
var/datum/selected_design_id
var/selected_category
var/list/matching_design_ids
var/disk_slot_selected
var/searchstring = ""
var/searchtype = ""
@@ -47,10 +42,6 @@ Nothing else in the console has ID requirements.
var/research_control = TRUE
/obj/machinery/computer/rdconsole/production
circuit = /obj/item/circuitboard/computer/rdconsole/production
research_control = FALSE
/proc/CallMaterialName(ID)
if (istype(ID, /datum/material))
var/datum/material/material = ID
@@ -61,55 +52,20 @@ Nothing else in the console has ID requirements.
return reagent.name
return ID
/obj/machinery/computer/rdconsole/proc/SyncRDevices() //Makes sure it is properly sync'ed up with the devices attached to it (if any).
for(var/obj/machinery/rnd/D in oview(3,src))
if(D.linked_console != null || D.disabled || D.panel_open)
continue
if(istype(D, /obj/machinery/rnd/destructive_analyzer))
if(linked_destroy == null)
linked_destroy = D
D.linked_console = src
else if(istype(D, /obj/machinery/rnd/production/protolathe))
if(linked_lathe == null)
var/obj/machinery/rnd/production/protolathe/P = D
if(!P.console_link)
continue
linked_lathe = D
D.linked_console = src
else if(istype(D, /obj/machinery/rnd/production/circuit_imprinter))
if(linked_imprinter == null)
var/obj/machinery/rnd/production/circuit_imprinter/C = D
if(!C.console_link)
continue
linked_imprinter = D
D.linked_console = src
/obj/machinery/computer/rdconsole/Initialize()
. = ..()
stored_research = SSresearch.science_tech
stored_research.consoles_accessing[src] = TRUE
matching_design_ids = list()
SyncRDevices()
/obj/machinery/computer/rdconsole/Destroy()
if(stored_research)
stored_research.consoles_accessing -= src
if(linked_destroy)
linked_destroy.linked_console = null
linked_destroy = null
if(linked_lathe)
linked_lathe.linked_console = null
linked_lathe = null
if(linked_imprinter)
linked_imprinter.linked_console = null
linked_imprinter = null
if(t_disk)
t_disk.forceMove(get_turf(src))
t_disk = null
if(d_disk)
d_disk.forceMove(get_turf(src))
d_disk = null
matching_design_ids = null
return ..()
/obj/machinery/computer/rdconsole/attackby(obj/item/D, mob/user, params)
@@ -141,8 +97,8 @@ Nothing else in the console has ID requirements.
to_chat(user, "<span class='warning'>Machine cannot accept disks in that format.</span>")
return
to_chat(user, "<span class='notice'>You insert [D] into \the [src]!</span>")
else if(!(linked_destroy && linked_destroy.busy) && !(linked_lathe && linked_lathe.busy) && !(linked_imprinter && linked_imprinter.busy))
. = ..()
return
return ..()
/obj/machinery/computer/rdconsole/proc/research_node(id, mob/user)
if(!stored_research.available_nodes[id] || stored_research.researched_nodes[id])
@@ -183,18 +139,6 @@ Nothing else in the console has ID requirements.
say("Not enough research points...")
return FALSE
/obj/machinery/computer/rdconsole/on_deconstruction()
if(linked_destroy)
linked_destroy.linked_console = null
linked_destroy = null
if(linked_lathe)
linked_lathe.linked_console = null
linked_lathe = null
if(linked_imprinter)
linked_imprinter.linked_console = null
linked_imprinter = null
..()
/obj/machinery/computer/rdconsole/emag_act(mob/user)
if(!(obj_flags & EMAGGED))
to_chat(user, "<span class='notice'>You disable the security protocols[locked? " and unlock the console":""].</span>")
@@ -203,12 +147,6 @@ Nothing else in the console has ID requirements.
locked = FALSE
return ..()
/obj/machinery/computer/rdconsole/multitool_act(mob/user, obj/item/multitool/I)
. = ..()
var/lathe = linked_lathe && linked_lathe.multitool_act(user, I)
var/print = linked_imprinter && linked_imprinter.multitool_act(user, I)
return lathe || print || .
/obj/machinery/computer/rdconsole/proc/list_categories(list/categories, menu_num as num)
if(!categories)
return
@@ -246,12 +184,6 @@ Nothing else in the console has ID requirements.
l += "<hr><a href='?src=[REF(src)];switch_screen=[RDSCREEN_DESIGNDISK]'>Design Disk</a>"
if(t_disk)
l += "<hr><a href='?src=[REF(src)];switch_screen=[RDSCREEN_TECHDISK]'>Tech Disk</a>"
if(linked_destroy)
l += "<hr><a href='?src=[REF(src)];switch_screen=[RDSCREEN_DECONSTRUCT]'>Destructive Analyzer</a>"
if(linked_lathe)
l += "<hr><a href='?src=[REF(src)];switch_screen=[RDSCREEN_PROTOLATHE]'>Protolathe</a>"
if(linked_imprinter)
l += "<hr><a href='?src=[REF(src)];switch_screen=[RDSCREEN_IMPRINTER]'>Circuit Imprinter</a>"
l += "<hr><a href='?src=[REF(src)];switch_screen=[RDSCREEN_SETTINGS]'>Settings</a></H2>"
return l
@@ -261,281 +193,9 @@ Nothing else in the console has ID requirements.
/obj/machinery/computer/rdconsole/proc/ui_settings()
var/list/l = list()
l += "<div class='statusDisplay'><h3>R&D Console Settings:</h3>"
l += "<A href='?src=[REF(src)];switch_screen=[RDSCREEN_DEVICE_LINKING]'>Device Linkage Menu</A>"
l += "<A href='?src=[REF(src)];lock_console=1'>Lock Console</A></div>"
return l
/obj/machinery/computer/rdconsole/proc/ui_device_linking()
var/list/l = list()
l += "<A href='?src=[REF(src)];switch_screen=[RDSCREEN_SETTINGS]'>Settings Menu</A><div class='statusDisplay'>"
l += "<h3>R&D Console Device Linkage Menu:</h3>"
l += "<A href='?src=[REF(src)];find_device=1'>Re-sync with Nearby Devices</A>"
l += "<h3>Linked Devices:</h3>"
l += linked_destroy? "* Destructive Analyzer <A href='?src=[REF(src)];disconnect=destroy'>Disconnect</A>" : "* No Destructive Analyzer Linked"
l += linked_lathe? "* Protolathe <A href='?src=[REF(src)];disconnect=lathe'>Disconnect</A>" : "* No Protolathe Linked"
l += linked_imprinter? "* Circuit Imprinter <A href='?src=[REF(src)];disconnect=imprinter'>Disconnect</A>" : "* No Circuit Imprinter Linked"
l += "</div>"
return l
/obj/machinery/computer/rdconsole/proc/ui_protolathe_header()
var/list/l = list()
l += "<div class='statusDisplay'><A href='?src=[REF(src)];switch_screen=[RDSCREEN_PROTOLATHE]'>Protolathe Menu</A>"
if(linked_lathe.materials.mat_container)
l += "<A href='?src=[REF(src)];switch_screen=[RDSCREEN_PROTOLATHE_MATERIALS]'><B>Material Amount:</B> [linked_lathe.materials.format_amount()]</A>"
else
l += "<font color='red'>No material storage connected, please contact the quartermaster.</font>"
l += "<A href='?src=[REF(src)];switch_screen=[RDSCREEN_PROTOLATHE_CHEMICALS]'><B>Chemical volume:</B> [linked_lathe.reagents.total_volume] / [linked_lathe.reagents.maximum_volume]</A></div>"
return l
/obj/machinery/computer/rdconsole/proc/ui_protolathe_category_view() //Legacy code
RDSCREEN_UI_LATHE_CHECK
var/list/l = list()
l += ui_protolathe_header()
l += "<div class='statusDisplay'><h3>Browsing [selected_category]:</h3>"
for(var/v in stored_research.researched_designs)
var/datum/design/D = SSresearch.techweb_design_by_id(v)
if(!(selected_category in D.category)|| !(D.build_type & PROTOLATHE))
continue
if(!(isnull(linked_lathe.allowed_department_flags) || (D.departmental_flags & linked_lathe.allowed_department_flags)))
continue
var/temp_material
var/c = 50
var/coeff = linked_lathe.efficiency_coeff
if(!linked_lathe.efficient_with(D.build_path))
coeff = 1
var/all_materials = D.materials + D.reagents_list
for(var/M in all_materials)
var/t = linked_lathe.check_mat(D, M)
temp_material += " | "
if (t < 1)
temp_material += "<span class='bad'>[all_materials[M]/coeff] [CallMaterialName(M)]</span>"
else
temp_material += " [all_materials[M]/coeff] [CallMaterialName(M)]"
c = min(c,t)
if (c >= 1)
l += "<A href='?src=[REF(src)];build=[D.id];amount=1'>[D.name]</A>[RDSCREEN_NOBREAK]"
if(c >= 5)
l += "<A href='?src=[REF(src)];build=[D.id];amount=5'>x5</A>[RDSCREEN_NOBREAK]"
if(c >= 10)
l += "<A href='?src=[REF(src)];build=[D.id];amount=10'>x10</A>[RDSCREEN_NOBREAK]"
l += "[temp_material][RDSCREEN_NOBREAK]"
else
l += "<span class='linkOff'>[D.name]</span>[temp_material][RDSCREEN_NOBREAK]"
l += ""
l += "</div>"
return l
/obj/machinery/computer/rdconsole/proc/ui_protolathe() //Legacy code
RDSCREEN_UI_LATHE_CHECK
var/list/l = list()
l += ui_protolathe_header()
l += "<form name='search' action='?src=[REF(src)]'>\
<input type='hidden' name='src' value='[REF(src)]'>\
<input type='hidden' name='search' value='to_search'>\
<input type='hidden' name='type' value='proto'>\
<input type='text' name='to_search'>\
<input type='submit' value='Search'>\
</form><HR>"
l += list_categories(linked_lathe.categories, RDSCREEN_PROTOLATHE_CATEGORY_VIEW)
return l
/obj/machinery/computer/rdconsole/proc/ui_protolathe_search() //Legacy code
RDSCREEN_UI_LATHE_CHECK
var/list/l = list()
l += ui_protolathe_header()
for(var/id in matching_design_ids)
var/datum/design/D = SSresearch.techweb_design_by_id(id)
if(!(isnull(linked_lathe.allowed_department_flags) || (D.departmental_flags & linked_lathe.allowed_department_flags)))
continue
var/temp_material
var/c = 50
var/all_materials = D.materials + D.reagents_list
var/coeff = linked_lathe.efficiency_coeff
if(!linked_lathe.efficient_with(D.build_path))
coeff = 1
for(var/M in all_materials)
var/t = linked_lathe.check_mat(D, M)
temp_material += " | "
if (t < 1)
temp_material += "<span class='bad'>[all_materials[M]/coeff] [CallMaterialName(M)]</span>"
else
temp_material += " [all_materials[M]/coeff] [CallMaterialName(M)]"
c = min(c,t)
if (c >= 1)
l += "<A href='?src=[REF(src)];build=[D.id];amount=1'>[D.name]</A>[RDSCREEN_NOBREAK]"
if(c >= 5)
l += "<A href='?src=[REF(src)];build=[D.id];amount=5'>x5</A>[RDSCREEN_NOBREAK]"
if(c >= 10)
l += "<A href='?src=[REF(src)];build=[D.id];amount=10'>x10</A>[RDSCREEN_NOBREAK]"
l += "[temp_material][RDSCREEN_NOBREAK]"
else
l += "<span class='linkOff'>[D.name]</span>[temp_material][RDSCREEN_NOBREAK]"
l += ""
l += "</div>"
return l
/obj/machinery/computer/rdconsole/proc/ui_protolathe_materials() //Legacy code
RDSCREEN_UI_LATHE_CHECK
var/datum/component/material_container/mat_container = linked_lathe.materials.mat_container
if (!mat_container)
screen = RDSCREEN_PROTOLATHE
return ui_protolathe()
var/list/l = list()
l += ui_protolathe_header()
l += "<div class='statusDisplay'><h3>Material Storage:</h3>"
for(var/mat_id in mat_container.materials)
var/datum/material/M = mat_id
var/amount = mat_container.materials[mat_id]
var/ref = REF(M)
l += "* [amount] of [M.name]: "
if(amount >= MINERAL_MATERIAL_AMOUNT) l += "<A href='?src=[REF(src)];ejectsheet=[ref];eject_amt=1'>Eject</A> [RDSCREEN_NOBREAK]"
if(amount >= MINERAL_MATERIAL_AMOUNT*5) l += "<A href='?src=[REF(src)];ejectsheet=[ref];eject_amt=5'>5x</A> [RDSCREEN_NOBREAK]"
if(amount >= MINERAL_MATERIAL_AMOUNT) l += "<A href='?src=[REF(src)];ejectsheet=[ref];eject_amt=50'>All</A>[RDSCREEN_NOBREAK]"
l += ""
l += "</div>[RDSCREEN_NOBREAK]"
return l
/obj/machinery/computer/rdconsole/proc/ui_protolathe_chemicals() //Legacy code
RDSCREEN_UI_LATHE_CHECK
var/list/l = list()
l += ui_protolathe_header()
l += "<div class='statusDisplay'><A href='?src=[REF(src)];disposeallP=1'>Disposal All Chemicals in Storage</A>"
l += "<h3>Chemical Storage:</h3>"
for(var/datum/reagent/R in linked_lathe.reagents.reagent_list)
l += "[R.name]: [R.volume]"
l += "<A href='?src=[REF(src)];disposeP=[R]'>Purge</A>"
l += "</div>"
return l
/obj/machinery/computer/rdconsole/proc/ui_circuit_header() //Legacy Code
var/list/l = list()
l += "<div class='statusDisplay'><A href='?src=[REF(src)];switch_screen=[RDSCREEN_IMPRINTER]'>Circuit Imprinter Menu</A>"
if (linked_imprinter.materials.mat_container)
l += "<A href='?src=[REF(src)];switch_screen=[RDSCREEN_IMPRINTER_MATERIALS]'><B>Material Amount:</B> [linked_imprinter.materials.format_amount()]</A>"
else
l += "<font color='red'>No material storage connected, please contact the quartermaster.</font>"
l += "<A href='?src=[REF(src)];switch_screen=[RDSCREEN_IMPRINTER_CHEMICALS]'><B>Chemical volume:</B> [linked_imprinter.reagents.total_volume] / [linked_imprinter.reagents.maximum_volume]</A></div>"
return l
/obj/machinery/computer/rdconsole/proc/ui_circuit() //Legacy code
RDSCREEN_UI_IMPRINTER_CHECK
var/list/l = list()
l += ui_circuit_header()
l += "<h3>Circuit Imprinter Menu:</h3>"
l += "<form name='search' action='?src=[REF(src)]'>\
<input type='hidden' name='src' value='[REF(src)]'>\
<input type='hidden' name='search' value='to_search'>\
<input type='hidden' name='type' value='imprint'>\
<input type='text' name='to_search'>\
<input type='submit' value='Search'>\
</form><HR>"
l += list_categories(linked_imprinter.categories, RDSCREEN_IMPRINTER_CATEGORY_VIEW)
return l
/obj/machinery/computer/rdconsole/proc/ui_circuit_category_view() //Legacy code
RDSCREEN_UI_IMPRINTER_CHECK
var/list/l = list()
l += ui_circuit_header()
l += "<div class='statusDisplay'><h3>Browsing [selected_category]:</h3>"
for(var/v in stored_research.researched_designs)
var/datum/design/D = SSresearch.techweb_design_by_id(v)
if(!(selected_category in D.category) || !(D.build_type & IMPRINTER))
continue
if(!(isnull(linked_imprinter.allowed_department_flags) || (D.departmental_flags & linked_imprinter.allowed_department_flags)))
continue
var/temp_materials
var/check_materials = TRUE
var/all_materials = D.materials + D.reagents_list
var/coeff = linked_imprinter.efficiency_coeff
if(!linked_imprinter.efficient_with(D.build_path))
coeff = 1
for(var/M in all_materials)
temp_materials += " | "
if (!linked_imprinter.check_mat(D, M))
check_materials = FALSE
temp_materials += " <span class='bad'>[all_materials[M]/coeff] [CallMaterialName(M)]</span>"
else
temp_materials += " [all_materials[M]/coeff] [CallMaterialName(M)]"
if (check_materials)
l += "<A href='?src=[REF(src)];imprint=[D.id]'>[D.name]</A>[temp_materials]"
else
l += "<span class='linkOff'>[D.name]</span>[temp_materials]"
l += "</div>"
return l
/obj/machinery/computer/rdconsole/proc/ui_circuit_search() //Legacy code
RDSCREEN_UI_IMPRINTER_CHECK
var/list/l = list()
l += ui_circuit_header()
l += "<div class='statusDisplay'><h3>Search results:</h3>"
for(var/id in matching_design_ids)
var/datum/design/D = SSresearch.techweb_design_by_id(id)
if(!(isnull(linked_imprinter.allowed_department_flags) || (D.departmental_flags & linked_imprinter.allowed_department_flags)))
continue
var/temp_materials
var/check_materials = TRUE
var/all_materials = D.materials + D.reagents_list
var/coeff = linked_imprinter.efficiency_coeff
if(!linked_imprinter.efficient_with(D.build_path))
coeff = 1
for(var/M in all_materials)
temp_materials += " | "
if (!linked_imprinter.check_mat(D, M))
check_materials = FALSE
temp_materials += " <span class='bad'>[all_materials[M]/coeff] [CallMaterialName(M)]</span>"
else
temp_materials += " [all_materials[M]/coeff] [CallMaterialName(M)]"
if (check_materials)
l += "<A href='?src=[REF(src)];imprint=[D.id]'>[D.name]</A>[temp_materials]"
else
l += "<span class='linkOff'>[D.name]</span>[temp_materials]"
l += "</div>"
return l
/obj/machinery/computer/rdconsole/proc/ui_circuit_chemicals() //legacy code
RDSCREEN_UI_IMPRINTER_CHECK
var/list/l = list()
l += ui_circuit_header()
l += "<A href='?src=[REF(src)];disposeallI=1'>Disposal All Chemicals in Storage</A><div class='statusDisplay'>"
l += "<h3>Chemical Storage:</h3>"
for(var/datum/reagent/R in linked_imprinter.reagents.reagent_list)
l += "[R.name]: [R.volume]"
l += "<A href='?src=[REF(src)];disposeI=[R]'>Purge</A>"
return l
/obj/machinery/computer/rdconsole/proc/ui_circuit_materials() //Legacy code!
RDSCREEN_UI_IMPRINTER_CHECK
var/datum/component/material_container/mat_container = linked_imprinter.materials.mat_container
if (!mat_container)
screen = RDSCREEN_IMPRINTER
return ui_circuit()
var/list/l = list()
l += ui_circuit_header()
l += "<h3><div class='statusDisplay'>Material Storage:</h3>"
for(var/mat_id in mat_container.materials)
var/datum/material/M = mat_id
var/amount = mat_container.materials[mat_id]
var/ref = REF(M)
l += "* [amount] of [M.name]: "
if(amount >= MINERAL_MATERIAL_AMOUNT) l += "<A href='?src=[REF(src)];imprinter_ejectsheet=[ref];eject_amt=1'>Eject</A> [RDSCREEN_NOBREAK]"
if(amount >= MINERAL_MATERIAL_AMOUNT*5) l += "<A href='?src=[REF(src)];imprinter_ejectsheet=[ref];eject_amt=5'>5x</A> [RDSCREEN_NOBREAK]"
if(amount >= MINERAL_MATERIAL_AMOUNT) l += "<A href='?src=[REF(src)];imprinter_ejectsheet=[ref];eject_amt=50'>All</A>[RDSCREEN_NOBREAK]"
l += ""
l += "</div>[RDSCREEN_NOBREAK]"
return l
/obj/machinery/computer/rdconsole/proc/ui_techdisk() //Legacy code
RDSCREEN_UI_TDISK_CHECK
var/list/l = list()
@@ -577,77 +237,6 @@ Nothing else in the console has ID requirements.
l += "</div>"
return l
/obj/machinery/computer/rdconsole/proc/ui_deconstruct() //Legacy code
RDSCREEN_UI_DECONSTRUCT_CHECK
var/list/l = list()
if(!linked_destroy.loaded_item)
l += "<div class='statusDisplay'>No item loaded. Standing-by...</div>"
else
l += "<div class='statusDisplay'>[RDSCREEN_NOBREAK]"
l += "<table><tr><td>[icon2html(linked_destroy.loaded_item, usr)]</td><td><b>[linked_destroy.loaded_item.name]</b> <A href='?src=[REF(src)];eject_item=1'>Eject</A></td></tr></table>[RDSCREEN_NOBREAK]"
l += "Select a node to boost by deconstructing this item. This item can boost:"
var/anything = FALSE
var/list/boostable_nodes = techweb_item_boost_check(linked_destroy.loaded_item)
for(var/id in boostable_nodes)
anything = TRUE
var/list/worth = boostable_nodes[id]
var/datum/techweb_node/N = SSresearch.techweb_node_by_id(id)
l += "<div class='statusDisplay'>[RDSCREEN_NOBREAK]"
if (stored_research.researched_nodes[N.id]) // already researched
l += "<span class='linkOff'>[N.display_name]</span>"
l += "This node has already been researched."
else if(!length(worth)) // reveal only
if (stored_research.hidden_nodes[N.id])
l += "<A href='?src=[REF(src)];deconstruct=[N.id]'>[N.display_name]</A>"
l += "This node will be revealed."
else
l += "<span class='linkOff'>[N.display_name]</span>"
l += "This node has already been revealed."
else // boost by the difference
var/list/differences = list()
var/list/already_boosted = stored_research.boosted_nodes[N.id]
for(var/i in worth)
var/already_boosted_amount = already_boosted? stored_research.boosted_nodes[N.id][i] : 0
var/amt = min(worth[i], N.research_costs[i]) - already_boosted_amount
if(amt > 0)
differences[i] = amt
if (length(differences))
l += "<A href='?src=[REF(src)];deconstruct=[N.id]'>[N.display_name]</A>"
l += "This node will be boosted with the following:<BR>[techweb_point_display_generic(differences)]"
else
l += "<span class='linkOff'>[N.display_name]</span>"
l += "This node has already been boosted.</span>"
l += "</div>[RDSCREEN_NOBREAK]"
// point deconstruction and material reclamation use the same ID to prevent accidentally missing the points
var/list/point_values = techweb_item_point_check(linked_destroy.loaded_item)
if(point_values)
anything = TRUE
l += "<div class='statusDisplay'>[RDSCREEN_NOBREAK]"
if (stored_research.deconstructed_items[linked_destroy.loaded_item.type])
l += "<span class='linkOff'>Point Deconstruction</span>"
l += "This item's points have already been claimed."
else
l += "<A href='?src=[REF(src)];deconstruct=[RESEARCH_MATERIAL_RECLAMATION_ID]'>Point Deconstruction</A>"
l += "This item is worth: <BR>[techweb_point_display_generic(point_values)]!"
l += "</div>[RDSCREEN_NOBREAK]"
if(!(linked_destroy.loaded_item.resistance_flags & INDESTRUCTIBLE))
var/list/materials = linked_destroy.loaded_item.custom_materials
l += "<div class='statusDisplay'><A href='?src=[REF(src)];deconstruct=[RESEARCH_MATERIAL_RECLAMATION_ID]'>[LAZYLEN(materials)? "Material Reclamation" : "Destroy Item"]</A>"
for (var/M in materials)
l += "* [CallMaterialName(M)] x [materials[M]]"
l += "</div>[RDSCREEN_NOBREAK]"
anything = TRUE
if (!anything)
l += "Nothing!"
l += "</div>"
return l
/obj/machinery/computer/rdconsole/proc/ui_techweb()
var/list/l = list()
if(ui_mode != RDCONSOLE_UI_MODE_LIST)
@@ -770,12 +359,8 @@ Nothing else in the console has ID requirements.
var/lathes = list()
if(selected_design.build_type & IMPRINTER)
lathes += "<span data-tooltip='Circuit Imprinter'>[machine_icon(/obj/machinery/rnd/production/circuit_imprinter)]</span>[RDSCREEN_NOBREAK]"
if (linked_imprinter && stored_research.researched_designs[selected_design.id])
l += "<A href='?src=[REF(src)];search=1;type=imprint;to_search=[selected_design.name]'>Imprint</A>"
if(selected_design.build_type & PROTOLATHE)
lathes += "<span data-tooltip='Protolathe'>[machine_icon(/obj/machinery/rnd/production/protolathe)]</span>[RDSCREEN_NOBREAK]"
if (linked_lathe && stored_research.researched_designs[selected_design.id])
l += "<A href='?src=[REF(src)];search=1;type=proto;to_search=[selected_design.name]'>Construct</A>"
if(selected_design.build_type & AUTOLATHE)
lathes += "<span data-tooltip='Autolathe'>[machine_icon(/obj/machinery/autolathe)]</span>[RDSCREEN_NOBREAK]"
if(selected_design.build_type & MECHFAB)
@@ -821,32 +406,8 @@ Nothing else in the console has ID requirements.
ui += ui_designdisk_upload()
if(RDSCREEN_TECHDISK)
ui += ui_techdisk()
if(RDSCREEN_DECONSTRUCT)
ui += ui_deconstruct()
if(RDSCREEN_PROTOLATHE)
ui += ui_protolathe()
if(RDSCREEN_PROTOLATHE_CATEGORY_VIEW)
ui += ui_protolathe_category_view()
if(RDSCREEN_PROTOLATHE_MATERIALS)
ui += ui_protolathe_materials()
if(RDSCREEN_PROTOLATHE_CHEMICALS)
ui += ui_protolathe_chemicals()
if(RDSCREEN_PROTOLATHE_SEARCH)
ui += ui_protolathe_search()
if(RDSCREEN_IMPRINTER)
ui += ui_circuit()
if(RDSCREEN_IMPRINTER_CATEGORY_VIEW)
ui += ui_circuit_category_view()
if(RDSCREEN_IMPRINTER_MATERIALS)
ui += ui_circuit_materials()
if(RDSCREEN_IMPRINTER_CHEMICALS)
ui += ui_circuit_chemicals()
if(RDSCREEN_IMPRINTER_SEARCH)
ui += ui_circuit_search()
if(RDSCREEN_SETTINGS)
ui += ui_settings()
if(RDSCREEN_DEVICE_LINKING)
ui += ui_device_linking()
for(var/i in 1 to length(ui))
if(!findtextEx(ui[i], RDSCREEN_NOBREAK))
@@ -877,49 +438,10 @@ Nothing else in the console has ID requirements.
unlock_console(usr)
else
to_chat(usr, "<span class='boldwarning'>Unauthorized Access.</span>")
if(ls["find_device"])
SyncRDevices()
say("Resynced with nearby devices.")
if(ls["back_screen"])
back = text2num(ls["back_screen"])
if(ls["build"]) //Causes the Protolathe to build something.
if(QDELETED(linked_lathe))
say("No Protolathe Linked!")
return
if(linked_lathe.busy)
say("Warning: Protolathe busy!")
else
linked_lathe.user_try_print_id(ls["build"], ls["amount"])
if(ls["imprint"])
if(QDELETED(linked_imprinter))
say("No Circuit Imprinter Linked!")
return
if(linked_imprinter.busy)
say("Warning: Imprinter busy!")
else
linked_imprinter.user_try_print_id(ls["imprint"])
if(ls["category"])
selected_category = ls["category"]
if(ls["disconnect"]) //The R&D console disconnects with a specific device.
switch(ls["disconnect"])
if("destroy")
if(QDELETED(linked_destroy))
say("No Destructive Analyzer Linked!")
return
linked_destroy.linked_console = null
linked_destroy = null
if("lathe")
if(QDELETED(linked_lathe))
say("No Protolathe Linked!")
return
linked_lathe.linked_console = null
linked_lathe = null
if("imprinter")
if(QDELETED(linked_imprinter))
say("No Circuit Imprinter Linked!")
return
linked_imprinter.linked_console = null
linked_imprinter = null
if(ls["eject_design"]) //Eject the design disk.
eject_disk("design")
screen = RDSCREEN_MENU
@@ -928,52 +450,6 @@ Nothing else in the console has ID requirements.
eject_disk("tech")
screen = RDSCREEN_MENU
say("Ejecting Technology Disk")
if(ls["deconstruct"])
if(QDELETED(linked_destroy))
say("No Destructive Analyzer Linked!")
return
if(!linked_destroy.user_try_decon_id(ls["deconstruct"], usr))
say("Destructive analysis failed!")
//Protolathe Materials
if(ls["disposeP"]) //Causes the protolathe to dispose of a single reagent (all of it)
if(QDELETED(linked_lathe))
say("No Protolathe Linked!")
return
linked_lathe.reagents.del_reagent(ls["disposeP"])
if(ls["disposeallP"]) //Causes the protolathe to dispose of all it's reagents.
if(QDELETED(linked_lathe))
say("No Protolathe Linked!")
return
linked_lathe.reagents.clear_reagents()
if(ls["ejectsheet"]) //Causes the protolathe to eject a sheet of material
if(QDELETED(linked_lathe))
say("No Protolathe Linked!")
return
if(!linked_lathe.materials.mat_container)
say("No material storage linked to protolathe!")
return
var/datum/material/M = locate(ls["ejectsheet"]) in linked_lathe.materials.mat_container.materials
linked_lathe.eject_sheets(M, ls["eject_amt"])
//Circuit Imprinter Materials
if(ls["disposeI"]) //Causes the circuit imprinter to dispose of a single reagent (all of it)
if(QDELETED(linked_imprinter))
say("No Circuit Imprinter Linked!")
return
linked_imprinter.reagents.del_reagent(ls["disposeI"])
if(ls["disposeallI"]) //Causes the circuit imprinter to dispose of all it's reagents.
if(QDELETED(linked_imprinter))
say("No Circuit Imprinter Linked!")
return
linked_imprinter.reagents.clear_reagents()
if(ls["imprinter_ejectsheet"]) //Causes the imprinter to eject a sheet of material
if(QDELETED(linked_imprinter))
say("No Circuit Imprinter Linked!")
return
if(!linked_imprinter.materials.mat_container)
say("No material storage linked to circuit imprinter!")
return
var/datum/material/M = locate(ls["imprinter_ejectsheet"]) in linked_imprinter.materials.mat_container.materials
linked_imprinter.eject_sheets(M, ls["eject_amt"])
if(ls["disk_slot"])
disk_slot_selected = text2num(ls["disk_slot"])
if(ls["research_node"])
@@ -1009,14 +485,6 @@ Nothing else in the console has ID requirements.
var/datum/design/D = d_disk.blueprints[n]
say("Wiping design [D.name] from design disk.")
d_disk.blueprints[n] = null
if(ls["search"]) //Search for designs with name matching pattern
searchstring = ls["to_search"]
searchtype = ls["type"]
rescan_views()
if(searchtype == "proto")
screen = RDSCREEN_PROTOLATHE_SEARCH
else
screen = RDSCREEN_IMPRINTER_SEARCH
if(ls["updt_tech"]) //Uple the research holder with information from the technology disk.
if(QDELETED(t_disk))
say("No Technology Disk Inserted!")
@@ -1045,15 +513,6 @@ Nothing else in the console has ID requirements.
D.category |= "Imported"
d_disk.blueprints[slot] = D
screen = RDSCREEN_DESIGNDISK
if(ls["eject_item"]) //Eject the item inside the destructive analyzer.
if(QDELETED(linked_destroy))
say("No Destructive Analyzer Linked!")
return
if(linked_destroy.busy)
to_chat(usr, "<span class='danger'>The destructive analyzer is busy at the moment.</span>")
else if(linked_destroy.loaded_item)
linked_destroy.unload_item()
screen = RDSCREEN_MENU
if(ls["view_node"])
selected_node_id = ls["view_node"]
screen = RDSCREEN_TECHWEB_NODEVIEW
@@ -1097,59 +556,8 @@ Nothing else in the console has ID requirements.
t_disk.forceMove(get_turf(src))
t_disk = null
/obj/machinery/computer/rdconsole/proc/rescan_views()
var/compare
matching_design_ids.Cut()
if(searchtype == "proto")
compare = PROTOLATHE
else if(searchtype == "imprint")
compare = IMPRINTER
for(var/v in stored_research.researched_designs)
var/datum/design/D = SSresearch.techweb_design_by_id(v)
if(!(D.build_type & compare))
continue
if(findtext(D.name,searchstring))
matching_design_ids.Add(D.id)
/obj/machinery/computer/rdconsole/proc/check_canprint(datum/design/D, buildtype)
var/amount = 50
if(buildtype == IMPRINTER)
if(QDELETED(linked_imprinter))
return FALSE
for(var/M in D.materials + D.reagents_list)
amount = min(amount, linked_imprinter.check_mat(D, M))
if(amount < 1)
return FALSE
else if(buildtype == PROTOLATHE)
if(QDELETED(linked_lathe))
return FALSE
for(var/M in D.materials + D.reagents_list)
amount = min(amount, linked_lathe.check_mat(D, M))
if(amount < 1)
return FALSE
else
return FALSE
return amount
/obj/machinery/computer/rdconsole/proc/lock_console(mob/user)
locked = TRUE
/obj/machinery/computer/rdconsole/proc/unlock_console(mob/user)
locked = FALSE
/obj/machinery/computer/rdconsole/robotics
name = "Robotics R&D Console"
req_access = null
req_access_txt = "29"
/obj/machinery/computer/rdconsole/robotics/Initialize()
. = ..()
if(circuit)
circuit.name = "R&D Console - Robotics (Computer Board)"
circuit.build_path = /obj/machinery/computer/rdconsole/robotics
/obj/machinery/computer/rdconsole/core
name = "Core R&D Console"
/obj/machinery/computer/rdconsole/experiment
name = "E.X.P.E.R.I-MENTOR R&D Console"
+4 -11
View File
@@ -10,19 +10,21 @@
var/busy = FALSE
var/hacked = FALSE
var/console_link = TRUE //allow console link.
var/requires_console = TRUE
var/disabled = FALSE
var/obj/machinery/computer/rdconsole/linked_console
var/obj/item/loaded_item = null //the item loaded inside the machine (currently only used by experimentor and destructive analyzer)
/// Ref to global science techweb.
var/datum/techweb/stored_research
/obj/machinery/rnd/proc/reset_busy()
busy = FALSE
/obj/machinery/rnd/Initialize()
. = ..()
stored_research = SSresearch.science_tech
wires = new /datum/wires/rnd(src)
/obj/machinery/rnd/Destroy()
stored_research = null
QDEL_NULL(wires)
return ..()
@@ -39,8 +41,6 @@
/obj/machinery/rnd/attackby(obj/item/O, mob/user, params)
if (default_deconstruction_screwdriver(user, "[initial(icon_state)]_t", initial(icon_state), O))
if(linked_console)
disconnect_console()
return
if(default_deconstruction_crowbar(O))
return
@@ -54,10 +54,6 @@
else
return ..()
//to disconnect the machine from the r&d console it's linked to
/obj/machinery/rnd/proc/disconnect_console()
linked_console = null
//proc used to handle inserting items or reagents into rnd machines
/obj/machinery/rnd/proc/Insert_Item(obj/item/I, mob/user)
return
@@ -70,9 +66,6 @@
if(disabled)
to_chat(user, "<span class='warning'>The insertion belts of [src] won't engage!</span>")
return FALSE
if(requires_console && !linked_console)
to_chat(user, "<span class='warning'>[src] must be linked to an R&D console first!</span>")
return FALSE
if(busy)
to_chat(user, "<span class='warning'>[src] is busy right now.</span>")
return FALSE
-2
View File
@@ -3,7 +3,6 @@
desc = "A computer system running a deep neural network that processes arbitrary information to produce data useable in the development of new technologies. In layman's terms, it makes research points."
icon = 'icons/obj/machines/research.dmi'
icon_state = "RD-server-on"
var/datum/techweb/stored_research
var/heat_health = 100
//Code for point mining here.
var/working = TRUE //temperature should break it.
@@ -23,7 +22,6 @@
. = ..()
name += " [num2hex(rand(1,65535), -1)]" //gives us a random four-digit hex number as part of the name. Y'know, for fluff.
SSresearch.servers |= src
stored_research = SSresearch.science_tech
var/obj/item/circuitboard/machine/B = new /obj/item/circuitboard/machine/rdserver(null)
B.apply_default_parts(src)
current_temp = get_env_temp()
@@ -87,7 +87,6 @@
CHECK_TICK
for(var/v in consoles_accessing)
var/obj/machinery/computer/rdconsole/V = v
V.rescan_views()
V.updateUsrDialog()
/datum/techweb/proc/add_point_list(list/pointlist)
@@ -309,7 +308,6 @@
if(autoupdate_consoles)
for(var/v in consoles_accessing)
var/obj/machinery/computer/rdconsole/V = v
V.rescan_views()
V.updateUsrDialog()
//Laggy procs to do specific checks, just in case. Don't use them if you can just use the vars that already store all this!