diff --git a/_maps/RandomRuins/IceRuins/icemoon_surface_engioutpost.dmm b/_maps/RandomRuins/IceRuins/icemoon_surface_engioutpost.dmm index 449cefd1b39..2cf2ab4a196 100644 --- a/_maps/RandomRuins/IceRuins/icemoon_surface_engioutpost.dmm +++ b/_maps/RandomRuins/IceRuins/icemoon_surface_engioutpost.dmm @@ -966,7 +966,7 @@ /turf/open/floor/plasteel/icemoon, /area/icemoon/surface/outdoors) "cI" = ( -/obj/machinery/computer/rdconsole/production, +/obj/machinery/modular_computer/console/preset/civilian, /turf/open/floor/plasteel/icemoon, /area/icemoon/surface/outdoors) "cJ" = ( diff --git a/_maps/RandomRuins/SpaceRuins/oldstation.dmm b/_maps/RandomRuins/SpaceRuins/oldstation.dmm index b8d38a5cd5c..1eaa1651511 100644 --- a/_maps/RandomRuins/SpaceRuins/oldstation.dmm +++ b/_maps/RandomRuins/SpaceRuins/oldstation.dmm @@ -1815,7 +1815,7 @@ /turf/open/floor/plasteel/white, /area/ruin/space/has_grav/ancientstation/rnd) "eF" = ( -/obj/machinery/computer/rdconsole/core, +/obj/machinery/computer/rdconsole, /obj/effect/decal/cleanable/dirt, /turf/open/floor/plasteel/white, /area/ruin/space/has_grav/ancientstation/rnd) diff --git a/_maps/RandomZLevels/undergroundoutpost45.dmm b/_maps/RandomZLevels/undergroundoutpost45.dmm index 5a18530a5d4..f9ac85ee7ac 100644 --- a/_maps/RandomZLevels/undergroundoutpost45.dmm +++ b/_maps/RandomZLevels/undergroundoutpost45.dmm @@ -3886,7 +3886,7 @@ }, /area/awaymission/undergroundoutpost45/gateway) "ig" = ( -/obj/machinery/computer/rdconsole/core{ +/obj/machinery/computer/rdconsole{ dir = 4; req_access = null }, diff --git a/_maps/map_files/Deltastation/DeltaStation2.dmm b/_maps/map_files/Deltastation/DeltaStation2.dmm index b67a8bb59e4..64bb8e8d8b9 100644 --- a/_maps/map_files/Deltastation/DeltaStation2.dmm +++ b/_maps/map_files/Deltastation/DeltaStation2.dmm @@ -38777,7 +38777,7 @@ /area/bridge) "byo" = ( /obj/structure/cable, -/obj/machinery/computer/rdconsole/core, +/obj/machinery/computer/rdconsole, /obj/effect/turf_decal/tile/yellow{ dir = 1 }, @@ -39292,7 +39292,7 @@ /turf/open/floor/plasteel, /area/engine/storage_shared) "bzj" = ( -/obj/machinery/computer/rdconsole/production, +/obj/machinery/modular_computer/console/preset/civilian, /obj/structure/sign/poster/official/random{ pixel_y = 32 }, @@ -83422,7 +83422,7 @@ /turf/open/floor/plasteel/white, /area/science/lab) "deh" = ( -/obj/machinery/computer/rdconsole/production{ +/obj/machinery/modular_computer/console/preset/civilian{ dir = 4 }, /obj/effect/turf_decal/stripes/line{ @@ -90646,7 +90646,7 @@ /area/crew_quarters/heads/hor) "duM" = ( /obj/structure/cable, -/obj/machinery/computer/rdconsole/core{ +/obj/machinery/computer/rdconsole{ dir = 4 }, /obj/machinery/atmospherics/pipe/manifold/supply/hidden/layer3{ @@ -94781,7 +94781,7 @@ /obj/structure/sign/departments/medbay/alt{ pixel_x = 32 }, -/obj/machinery/computer/rdconsole/production{ +/obj/machinery/modular_computer/console/preset/civilian{ dir = 8 }, /obj/effect/turf_decal/bot, diff --git a/_maps/map_files/IceBoxStation/IceBoxStation.dmm b/_maps/map_files/IceBoxStation/IceBoxStation.dmm index 555e3d50a15..69ed7e48236 100644 --- a/_maps/map_files/IceBoxStation/IceBoxStation.dmm +++ b/_maps/map_files/IceBoxStation/IceBoxStation.dmm @@ -27286,7 +27286,7 @@ /obj/effect/turf_decal/tile/green{ dir = 8 }, -/obj/machinery/computer/rdconsole/core, +/obj/machinery/computer/rdconsole, /turf/open/floor/plasteel, /area/bridge) "blP" = ( @@ -28355,7 +28355,7 @@ /turf/closed/wall/r_wall, /area/science/genetics) "bop" = ( -/obj/machinery/computer/rdconsole/production, +/obj/machinery/modular_computer/console/preset/civilian, /turf/open/floor/plasteel/white, /area/science/robotics/lab) "boq" = ( @@ -28674,7 +28674,7 @@ /turf/open/floor/carpet, /area/crew_quarters/heads/hop) "bpf" = ( -/obj/machinery/computer/rdconsole/production{ +/obj/machinery/modular_computer/console/preset/civilian{ dir = 4 }, /turf/open/floor/plasteel, @@ -32025,7 +32025,7 @@ /obj/structure/window/reinforced{ dir = 4 }, -/obj/machinery/computer/rdconsole/core{ +/obj/machinery/computer/rdconsole{ dir = 8 }, /turf/open/floor/plasteel/cafeteria, @@ -53899,7 +53899,7 @@ /turf/open/floor/plating, /area/maintenance/aft) "pjA" = ( -/obj/machinery/computer/rdconsole/production{ +/obj/machinery/modular_computer/console/preset/civilian{ dir = 4 }, /obj/effect/turf_decal/tile/yellow{ diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index 745fdb0e9c1..db556361094 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -25344,7 +25344,7 @@ /obj/effect/turf_decal/tile/red{ dir = 4 }, -/obj/machinery/computer/rdconsole/core, +/obj/machinery/computer/rdconsole, /turf/open/floor/plasteel/dark, /area/bridge) "bht" = ( @@ -47408,7 +47408,7 @@ /area/medical/pharmacy) "cjX" = ( /obj/effect/turf_decal/stripes/line, -/obj/machinery/computer/rdconsole/production{ +/obj/machinery/modular_computer/console/preset/civilian{ dir = 4 }, /turf/open/floor/plasteel, @@ -51356,7 +51356,7 @@ pixel_y = 30; receive_ore_updates = 1 }, -/obj/machinery/computer/rdconsole/core{ +/obj/machinery/computer/rdconsole{ dir = 8 }, /turf/open/floor/plasteel/cafeteria{ @@ -55330,7 +55330,7 @@ receive_ore_updates = 1 }, /obj/effect/turf_decal/bot, -/obj/machinery/computer/rdconsole/production{ +/obj/machinery/modular_computer/console/preset/civilian{ dir = 4 }, /turf/open/floor/plasteel, @@ -71130,7 +71130,7 @@ /obj/machinery/light_switch{ pixel_x = 26 }, -/obj/machinery/computer/rdconsole/production, +/obj/machinery/modular_computer/console/preset/civilian, /turf/open/floor/plasteel/checker, /area/engine/storage_shared) "mIU" = ( @@ -77649,7 +77649,7 @@ dir = 1; layer = 2.9 }, -/obj/machinery/computer/rdconsole/production, +/obj/machinery/modular_computer/console/preset/civilian, /turf/open/floor/plasteel/white, /area/science/misc_lab/range) "xgL" = ( diff --git a/_maps/map_files/PubbyStation/PubbyStation.dmm b/_maps/map_files/PubbyStation/PubbyStation.dmm index e3336f8bf34..9b758dffcc3 100644 --- a/_maps/map_files/PubbyStation/PubbyStation.dmm +++ b/_maps/map_files/PubbyStation/PubbyStation.dmm @@ -928,7 +928,7 @@ /obj/machinery/light/small{ dir = 1 }, -/obj/machinery/computer/rdconsole/robotics, +/obj/machinery/modular_computer/console/preset/civilian, /turf/open/floor/plating, /area/ai_monitored/turret_protected/ai_sat_ext_as) "adg" = ( @@ -6883,7 +6883,7 @@ /obj/effect/turf_decal/tile/red{ dir = 4 }, -/obj/machinery/computer/rdconsole/core, +/obj/machinery/computer/rdconsole, /turf/open/floor/plasteel/dark, /area/bridge) "arS" = ( @@ -25896,7 +25896,7 @@ pixel_x = -25; pixel_y = -8 }, -/obj/machinery/computer/rdconsole/production{ +/obj/machinery/modular_computer/console/preset/civilian{ dir = 4 }, /turf/open/floor/plasteel/dark, @@ -25985,7 +25985,7 @@ /obj/effect/turf_decal/tile/neutral{ dir = 8 }, -/obj/machinery/computer/rdconsole/production, +/obj/machinery/modular_computer/console/preset/civilian, /turf/open/floor/plasteel/dark, /area/science/explab) "bpf" = ( @@ -28531,7 +28531,7 @@ /area/medical/chemistry) "bvw" = ( /obj/effect/turf_decal/delivery, -/obj/machinery/computer/rdconsole/production{ +/obj/machinery/modular_computer/console/preset/civilian{ dir = 4 }, /turf/open/floor/plasteel, @@ -31937,7 +31937,7 @@ /obj/effect/turf_decal/tile/purple{ dir = 8 }, -/obj/machinery/computer/rdconsole/core{ +/obj/machinery/computer/rdconsole{ dir = 4 }, /turf/open/floor/plasteel/dark, @@ -37268,7 +37268,7 @@ dir = 4 }, /obj/effect/turf_decal/tile/yellow, -/obj/machinery/computer/rdconsole/production{ +/obj/machinery/modular_computer/console/preset/civilian{ dir = 8 }, /turf/open/floor/plasteel, diff --git a/_maps/map_files/debug/runtimestation.dmm b/_maps/map_files/debug/runtimestation.dmm index f9a12a6927b..25803a6ab14 100644 --- a/_maps/map_files/debug/runtimestation.dmm +++ b/_maps/map_files/debug/runtimestation.dmm @@ -445,7 +445,7 @@ /turf/open/floor/plasteel, /area/hallway/primary/central) "bF" = ( -/obj/machinery/computer/rdconsole/core, +/obj/machinery/computer/rdconsole, /turf/open/floor/plasteel, /area/science) "bG" = ( diff --git a/code/__DEFINES/research.dm b/code/__DEFINES/research.dm index fa5f74f3ad1..88095844a85 100644 --- a/code/__DEFINES/research.dm +++ b/code/__DEFINES/research.dm @@ -7,19 +7,7 @@ #define RDSCREEN_TECHDISK 1 #define RDSCREEN_DESIGNDISK 20 #define RDSCREEN_DESIGNDISK_UPLOAD 21 -#define RDSCREEN_DECONSTRUCT 3 -#define RDSCREEN_PROTOLATHE 40 -#define RDSCREEN_PROTOLATHE_MATERIALS 41 -#define RDSCREEN_PROTOLATHE_CHEMICALS 42 -#define RDSCREEN_PROTOLATHE_CATEGORY_VIEW 43 -#define RDSCREEN_PROTOLATHE_SEARCH 44 -#define RDSCREEN_IMPRINTER 50 -#define RDSCREEN_IMPRINTER_MATERIALS 51 -#define RDSCREEN_IMPRINTER_CHEMICALS 52 -#define RDSCREEN_IMPRINTER_CATEGORY_VIEW 53 -#define RDSCREEN_IMPRINTER_SEARCH 54 #define RDSCREEN_SETTINGS 61 -#define RDSCREEN_DEVICE_LINKING 62 #define RDSCREEN_TECHWEB 70 #define RDSCREEN_TECHWEB_NODEVIEW 71 #define RDSCREEN_TECHWEB_DESIGNVIEW 72 @@ -60,7 +48,7 @@ #define DESIGN_ID_IGNORE "IGNORE_THIS_DESIGN" ///For instances where we don't want a design showing up due to it being for debug/sanity purposes -#define RESEARCH_MATERIAL_RECLAMATION_ID "__materials" +#define RESEARCH_MATERIAL_DESTROY_ID "__destroy" ///Techweb names for new point types. Can be used to define specific point values for specific types of research (science, security, engineering, etc.) #define TECHWEB_POINT_TYPE_GENERIC "General Research" diff --git a/code/game/objects/items/circuitboards/computer_circuitboards.dm b/code/game/objects/items/circuitboards/computer_circuitboards.dm index 4f180e8b2b9..145b7ce08c4 100644 --- a/code/game/objects/items/circuitboards/computer_circuitboards.dm +++ b/code/game/objects/items/circuitboards/computer_circuitboards.dm @@ -327,11 +327,7 @@ /obj/item/circuitboard/computer/rdconsole name = "R&D Console (Computer Board)" icon_state = "science" - build_path = /obj/machinery/computer/rdconsole/core - -/obj/item/circuitboard/computer/rdconsole/production - name = "R&D Console Production Only (Computer Board)" - build_path = /obj/machinery/computer/rdconsole/production + build_path = /obj/machinery/computer/rdconsole /obj/item/circuitboard/computer/rdservercontrol name = "R&D Server Control (Computer Board)" diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm index 0c14330400a..020dd683c7c 100644 --- a/code/modules/research/destructive_analyzer.dm +++ b/code/modules/research/destructive_analyzer.dm @@ -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, "You add the [O.name] to the [src.name]!") 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 += "
No item loaded. Standing-by...
" + else + l += "
[RDSCREEN_NOBREAK]" + l += "
[icon2html(loaded_item, usr)][loaded_item.name] Eject
[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 += "
[RDSCREEN_NOBREAK]" + if (stored_research.researched_nodes[N.id]) // already researched + l += "[N.display_name]" + l += "This node has already been researched." + else if(!length(worth)) // reveal only + if (stored_research.hidden_nodes[N.id]) + l += "[N.display_name]" + l += "This node will be revealed." + else + l += "[N.display_name]" + 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 += "[N.display_name]" + l += "This node will be boosted with the following:
[techweb_point_display_generic(differences)]" + else + l += "[N.display_name]" + l += "This node has already been boosted." + l += "
[RDSCREEN_NOBREAK]" + + var/list/point_values = techweb_item_point_check(loaded_item) + if(point_values) + anything = TRUE + l += "
[RDSCREEN_NOBREAK]" + if (stored_research.deconstructed_items[loaded_item.type]) + l += "Point Deconstruction" + l += "This item's points have already been claimed." + else + l += "Point Deconstruction" + l += "This item is worth:
[techweb_point_display_generic(point_values)]!" + l += "
[RDSCREEN_NOBREAK]" + + if(!(loaded_item.resistance_flags & INDESTRUCTIBLE)) + l += "
Destroy Item" + l += "
[RDSCREEN_NOBREAK]" + anything = TRUE + + if (!anything) + l += "Nothing!" + + l += "
" + + for(var/i in 1 to length(l)) + if(!findtextEx(l[i], RDSCREEN_NOBREAK)) + l[i] += "
" + . = 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, "The destructive analyzer is busy at the moment.") + return + if(loaded_item) + unload_item() + if(ls["deconstruct"]) + if(!user_try_decon_id(ls["deconstruct"], usr)) + say("Destructive analysis failed!") + + updateUsrDialog() diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index e952e780273..1e6362c32a6 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -124,8 +124,6 @@ /obj/machinery/rnd/experimentor/ui_interact(mob/user) var/list/dat = list("
") - if(!linked_console) - dat += "Scan for R&D Console" if(loaded_item) dat += "Loaded Item: [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("[exp_on] activates the crushing mechanism, [exp_on] is destroyed!") - 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("[src]'s crushing mechanism slowly and smoothly descends, flattening the [exp_on]!") new /obj/item/stack/sheet/plasteel(get_turf(pick(oview(1,src)))) diff --git a/code/modules/research/machinery/_production.dm b/code/modules/research/machinery/_production.dm index 6370edce77a..712857bd21e 100644 --- a/code/modules/research/machinery/_production.dm +++ b/code/modules/research/machinery/_production.dm @@ -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 += "
[host_research.organization] [department_tag] Department Lathe" + l += "
[stored_research.organization] [department_tag] Department Lathe" l += "Security protocols: [(obj_flags & EMAGGED)? "Disabled" : "Enabled"]" if (materials.mat_container) l += "Material Amount: [materials.format_amount()]" @@ -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"] diff --git a/code/modules/research/machinery/circuit_imprinter.dm b/code/modules/research/machinery/circuit_imprinter.dm index 948dad61db9..d147330fb02 100644 --- a/code/modules/research/machinery/circuit_imprinter.dm +++ b/code/modules/research/machinery/circuit_imprinter.dm @@ -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 diff --git a/code/modules/research/machinery/departmental_circuit_imprinter.dm b/code/modules/research/machinery/departmental_circuit_imprinter.dm index a243e9fbbb2..69c04d16a01 100644 --- a/code/modules/research/machinery/departmental_circuit_imprinter.dm +++ b/code/modules/research/machinery/departmental_circuit_imprinter.dm @@ -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)" diff --git a/code/modules/research/machinery/departmental_protolathe.dm b/code/modules/research/machinery/departmental_protolathe.dm index dd038ce3d80..dcd691eb4c8 100644 --- a/code/modules/research/machinery/departmental_protolathe.dm +++ b/code/modules/research/machinery/departmental_protolathe.dm @@ -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)" diff --git a/code/modules/research/machinery/protolathe.dm b/code/modules/research/machinery/protolathe.dm index 684f27ccadf..773284d0ef5 100644 --- a/code/modules/research/machinery/protolathe.dm +++ b/code/modules/research/machinery/protolathe.dm @@ -19,7 +19,3 @@ ) production_animation = "protolathe_n" allowed_buildtypes = PROTOLATHE - -/obj/machinery/rnd/production/protolathe/disconnect_console() - linked_console.linked_lathe = null - ..() diff --git a/code/modules/research/machinery/techfab.dm b/code/modules/research/machinery/techfab.dm index 885f27c2cb5..68a57bf54ef 100644 --- a/code/modules/research/machinery/techfab.dm +++ b/code/modules/research/machinery/techfab.dm @@ -30,6 +30,4 @@ ) console_link = FALSE production_animation = "protolathe_n" - requires_console = FALSE - consoleless_interface = TRUE allowed_buildtypes = PROTOLATHE | IMPRINTER diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 5408ace8beb..37c368dab55 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -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, "Machine cannot accept disks in that format.") return to_chat(user, "You insert [D] into \the [src]!") - 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, "You disable the security protocols[locked? " and unlock the console":""].") @@ -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 += "
Design Disk" if(t_disk) l += "
Tech Disk" - if(linked_destroy) - l += "
Destructive Analyzer" - if(linked_lathe) - l += "
Protolathe" - if(linked_imprinter) - l += "
Circuit Imprinter" l += "
Settings" 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 += "

R&D Console Settings:

" - l += "Device Linkage Menu" l += "Lock Console
" return l -/obj/machinery/computer/rdconsole/proc/ui_device_linking() - var/list/l = list() - l += "Settings Menu
" - l += "

R&D Console Device Linkage Menu:

" - l += "Re-sync with Nearby Devices" - l += "

Linked Devices:

" - l += linked_destroy? "* Destructive Analyzer Disconnect" : "* No Destructive Analyzer Linked" - l += linked_lathe? "* Protolathe Disconnect" : "* No Protolathe Linked" - l += linked_imprinter? "* Circuit Imprinter Disconnect" : "* No Circuit Imprinter Linked" - l += "
" - return l - -/obj/machinery/computer/rdconsole/proc/ui_protolathe_header() - var/list/l = list() - l += "
Protolathe Menu" - if(linked_lathe.materials.mat_container) - l += "Material Amount: [linked_lathe.materials.format_amount()]" - else - l += "No material storage connected, please contact the quartermaster." - l += "Chemical volume: [linked_lathe.reagents.total_volume] / [linked_lathe.reagents.maximum_volume]
" - 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 += "

Browsing [selected_category]:

" - 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 += "[all_materials[M]/coeff] [CallMaterialName(M)]" - else - temp_material += " [all_materials[M]/coeff] [CallMaterialName(M)]" - c = min(c,t) - - if (c >= 1) - l += "[D.name][RDSCREEN_NOBREAK]" - if(c >= 5) - l += "x5[RDSCREEN_NOBREAK]" - if(c >= 10) - l += "x10[RDSCREEN_NOBREAK]" - l += "[temp_material][RDSCREEN_NOBREAK]" - else - l += "[D.name][temp_material][RDSCREEN_NOBREAK]" - l += "" - l += "
" - return l - -/obj/machinery/computer/rdconsole/proc/ui_protolathe() //Legacy code - RDSCREEN_UI_LATHE_CHECK - var/list/l = list() - l += ui_protolathe_header() - - l += "
\ - \ - \ - \ - \ - \ -

" - - 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 += "[all_materials[M]/coeff] [CallMaterialName(M)]" - else - temp_material += " [all_materials[M]/coeff] [CallMaterialName(M)]" - c = min(c,t) - - if (c >= 1) - l += "[D.name][RDSCREEN_NOBREAK]" - if(c >= 5) - l += "x5[RDSCREEN_NOBREAK]" - if(c >= 10) - l += "x10[RDSCREEN_NOBREAK]" - l += "[temp_material][RDSCREEN_NOBREAK]" - else - l += "[D.name][temp_material][RDSCREEN_NOBREAK]" - l += "" - l += "
" - 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 += "

Material Storage:

" - 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 += "Eject [RDSCREEN_NOBREAK]" - if(amount >= MINERAL_MATERIAL_AMOUNT*5) l += "5x [RDSCREEN_NOBREAK]" - if(amount >= MINERAL_MATERIAL_AMOUNT) l += "All[RDSCREEN_NOBREAK]" - l += "" - l += "
[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 += "
Disposal All Chemicals in Storage" - l += "

Chemical Storage:

" - for(var/datum/reagent/R in linked_lathe.reagents.reagent_list) - l += "[R.name]: [R.volume]" - l += "Purge" - l += "
" - return l - -/obj/machinery/computer/rdconsole/proc/ui_circuit_header() //Legacy Code - var/list/l = list() - l += "
Circuit Imprinter Menu" - if (linked_imprinter.materials.mat_container) - l += "Material Amount: [linked_imprinter.materials.format_amount()]" - else - l += "No material storage connected, please contact the quartermaster." - l += "Chemical volume: [linked_imprinter.reagents.total_volume] / [linked_imprinter.reagents.maximum_volume]
" - return l - -/obj/machinery/computer/rdconsole/proc/ui_circuit() //Legacy code - RDSCREEN_UI_IMPRINTER_CHECK - var/list/l = list() - l += ui_circuit_header() - l += "

Circuit Imprinter Menu:

" - - l += "
\ - \ - \ - \ - \ - \ -

" - - 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 += "

Browsing [selected_category]:

" - - 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 += " [all_materials[M]/coeff] [CallMaterialName(M)]" - else - temp_materials += " [all_materials[M]/coeff] [CallMaterialName(M)]" - if (check_materials) - l += "[D.name][temp_materials]" - else - l += "[D.name][temp_materials]" - l += "
" - 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 += "

Search results:

" - - 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 += " [all_materials[M]/coeff] [CallMaterialName(M)]" - else - temp_materials += " [all_materials[M]/coeff] [CallMaterialName(M)]" - if (check_materials) - l += "[D.name][temp_materials]" - else - l += "[D.name][temp_materials]" - l += "
" - 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 += "Disposal All Chemicals in Storage
" - l += "

Chemical Storage:

" - for(var/datum/reagent/R in linked_imprinter.reagents.reagent_list) - l += "[R.name]: [R.volume]" - l += "Purge" - 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 += "

Material Storage:

" - 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 += "Eject [RDSCREEN_NOBREAK]" - if(amount >= MINERAL_MATERIAL_AMOUNT*5) l += "5x [RDSCREEN_NOBREAK]" - if(amount >= MINERAL_MATERIAL_AMOUNT) l += "All[RDSCREEN_NOBREAK]" - l += "" - l += "
[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 += "
" 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 += "
No item loaded. Standing-by...
" - else - l += "
[RDSCREEN_NOBREAK]" - l += "
[icon2html(linked_destroy.loaded_item, usr)][linked_destroy.loaded_item.name] Eject
[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 += "
[RDSCREEN_NOBREAK]" - if (stored_research.researched_nodes[N.id]) // already researched - l += "[N.display_name]" - l += "This node has already been researched." - else if(!length(worth)) // reveal only - if (stored_research.hidden_nodes[N.id]) - l += "[N.display_name]" - l += "This node will be revealed." - else - l += "[N.display_name]" - 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 += "[N.display_name]" - l += "This node will be boosted with the following:
[techweb_point_display_generic(differences)]" - else - l += "[N.display_name]" - l += "This node has already been boosted." - l += "
[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 += "
[RDSCREEN_NOBREAK]" - if (stored_research.deconstructed_items[linked_destroy.loaded_item.type]) - l += "Point Deconstruction" - l += "This item's points have already been claimed." - else - l += "Point Deconstruction" - l += "This item is worth:
[techweb_point_display_generic(point_values)]!" - l += "
[RDSCREEN_NOBREAK]" - - if(!(linked_destroy.loaded_item.resistance_flags & INDESTRUCTIBLE)) - var/list/materials = linked_destroy.loaded_item.custom_materials - l += "
[LAZYLEN(materials)? "Material Reclamation" : "Destroy Item"]" - for (var/M in materials) - l += "* [CallMaterialName(M)] x [materials[M]]" - l += "
[RDSCREEN_NOBREAK]" - anything = TRUE - - if (!anything) - l += "Nothing!" - - l += "
" - 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 += "[machine_icon(/obj/machinery/rnd/production/circuit_imprinter)][RDSCREEN_NOBREAK]" - if (linked_imprinter && stored_research.researched_designs[selected_design.id]) - l += "Imprint" if(selected_design.build_type & PROTOLATHE) lathes += "[machine_icon(/obj/machinery/rnd/production/protolathe)][RDSCREEN_NOBREAK]" - if (linked_lathe && stored_research.researched_designs[selected_design.id]) - l += "Construct" if(selected_design.build_type & AUTOLATHE) lathes += "[machine_icon(/obj/machinery/autolathe)][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, "Unauthorized Access.") - 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, "The destructive analyzer is busy at the moment.") - 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" diff --git a/code/modules/research/rdmachines.dm b/code/modules/research/rdmachines.dm index 113d40b03f0..c8e4eb942b1 100644 --- a/code/modules/research/rdmachines.dm +++ b/code/modules/research/rdmachines.dm @@ -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, "The insertion belts of [src] won't engage!") return FALSE - if(requires_console && !linked_console) - to_chat(user, "[src] must be linked to an R&D console first!") - return FALSE if(busy) to_chat(user, "[src] is busy right now.") return FALSE diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index e6b71d7658f..d98fb0333d5 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -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() diff --git a/code/modules/research/techweb/_techweb.dm b/code/modules/research/techweb/_techweb.dm index 765da01887b..13210982656 100644 --- a/code/modules/research/techweb/_techweb.dm +++ b/code/modules/research/techweb/_techweb.dm @@ -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! diff --git a/code/modules/vehicles/mecha/mech_fabricator.dm b/code/modules/vehicles/mecha/mech_fabricator.dm index 1de7c6fedcc..9689dc2e6fc 100644 --- a/code/modules/vehicles/mecha/mech_fabricator.dm +++ b/code/modules/vehicles/mecha/mech_fabricator.dm @@ -34,8 +34,8 @@ /// Coefficient for the efficiency of material usage in item building. Based on the installed parts. var/component_coeff = 1 - /// Copy of the currently synced techweb. - var/datum/techweb/specialized/autounlocking/exofab/stored_research + /// Reference to the techweb. + var/datum/techweb/stored_research /// Whether the Exofab links to the ore silo on init. Special derelict or maintanance variants should set this to FALSE. var/link_on_init = TRUE @@ -63,7 +63,7 @@ ) /obj/machinery/mecha_part_fabricator/Initialize(mapload) - stored_research = new + stored_research = SSresearch.science_tech rmat = AddComponent(/datum/component/remote_materials, "mechfab", mapload && link_on_init) RefreshParts() //Recalculating local material sizes if the fab isn't linked return ..() @@ -419,21 +419,6 @@ queued_parts += list(part) return queued_parts -/** - * Syncs machine with R&D servers. - * - * Requires an R&D Console visible within 7 tiles. Copies techweb research. Updates tgui's state data. - */ -/obj/machinery/mecha_part_fabricator/proc/sync() - for(var/obj/machinery/computer/rdconsole/RDC in orange(7,src)) - RDC.stored_research.copy_research_to(stored_research) - update_static_data(usr) - say("Successfully synchronized with R&D server.") - return - - say("Unable to connect to local R&D server.") - return - /** * Calculates the coefficient-modified resource cost of a single material component of a design's recipe. * @@ -537,8 +522,9 @@ switch(action) if("sync_rnd") - // Sync with R&D Servers - sync() + // Syncronises designs on interface with R&D techweb. + update_static_data(usr) + say("Successfully synchronized with R&D server.") return if("add_queue_set") // Add all parts of a set to queue