From f9517853e062ff446c13b89d0b45d573f29a3747 Mon Sep 17 00:00:00 2001 From: Will <7099514+Willburd@users.noreply.github.com> Date: Tue, 24 Mar 2026 01:54:56 -0400 Subject: [PATCH] Autolathe Disk Loading (#19331) * disk loading autolathe * rsf too * oops * kick ci --- code/game/machinery/autolathe.dm | 40 ++++++++++++++----- .../research/tg/design_disks/engineering.dm | 11 +++++ .../research/tg/designs/stock_part_designs.dm | 2 +- vorestation.dme | 1 + 4 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 code/modules/research/tg/design_disks/engineering.dm diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 07e03eafab..598a0ee2e0 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -426,7 +426,7 @@ to_chat(user, "close the panel first!") return - if(!istype(O, /obj/item/disk/design_disk)) + if(!istype(O, /obj/item/disk/design_disk) && !istype(O, /obj/item/disk/tech_disk)) return ..() // The rest has to do with loading from design disks @@ -441,15 +441,37 @@ balloon_alert(user, "interrupted!") return - var/obj/item/disk/design_disk/disky = O var/list/not_imported - for(var/datum/design_techweb/blueprint as anything in disky.blueprints) - if(!blueprint) - continue - if(blueprint.build_type & AUTOLATHE) - imported_designs[blueprint.id] = TRUE - else - LAZYADD(not_imported, blueprint.name) + var/design_count = 0 + // Basic design loot disks + if(istype(O, /obj/item/disk/design_disk)) + var/obj/item/disk/design_disk/disky = O + for(var/datum/design_techweb/blueprint as anything in disky.blueprints) + if(!blueprint) + continue + if(imported_designs[blueprint.id] || stored_research.researched_designs[blueprint.id]) + continue + if(blueprint.build_type & AUTOLATHE) + imported_designs[blueprint.id] = TRUE + design_count++ + else + LAZYADD(not_imported, blueprint.name) + + // More complex as it holds multiple nodes of research + else if(istype(O, /obj/item/disk/tech_disk)) + var/obj/item/disk/tech_disk/disky = O + var/datum/techweb/disk_web = disky.stored_research + for(var/design_id in disk_web.researched_designs) + var/datum/design_techweb/blueprint = SSresearch.techweb_design_by_id(design_id) + if(imported_designs[blueprint.id] || stored_research.researched_designs[blueprint.id]) + continue + if(blueprint.build_type & AUTOLATHE) + imported_designs[blueprint.id] = TRUE + design_count++ + // Don't report failed designs here, techwebs can be huge and the message would be massive for something like the debug disk + + if(design_count) + to_chat(user, span_notice("[design_count] design\s imported.")) if(not_imported) to_chat(user, span_warning("The following design[length(not_imported) > 1 ? "s" : ""] couldn't be imported: [english_list(not_imported)]")) diff --git a/code/modules/research/tg/design_disks/engineering.dm b/code/modules/research/tg/design_disks/engineering.dm new file mode 100644 index 0000000000..fb5fff37a2 --- /dev/null +++ b/code/modules/research/tg/design_disks/engineering.dm @@ -0,0 +1,11 @@ +/obj/item/disk/design_disk/rapid_construction + name = "rapid fabricator design disk" + desc = "A disk containing several rapid fabrication devices." + +/obj/item/disk/design_disk/rapid_construction/Initialize(mapload) + . = ..() + blueprints += SSresearch.techweb_design_by_id(/datum/design_techweb/rcd_loaded::id) + blueprints += SSresearch.techweb_design_by_id(/datum/design_techweb/rcd_ammo::id) + blueprints += SSresearch.techweb_design_by_id(/datum/design_techweb/rpd::id) + blueprints += SSresearch.techweb_design_by_id(/datum/design_techweb/rms::id) + blueprints += SSresearch.techweb_design_by_id(/datum/design_techweb/rsf::id) // may as well diff --git a/code/modules/research/tg/designs/stock_part_designs.dm b/code/modules/research/tg/designs/stock_part_designs.dm index c4b9d5b3d9..85a0c54654 100644 --- a/code/modules/research/tg/designs/stock_part_designs.dm +++ b/code/modules/research/tg/designs/stock_part_designs.dm @@ -227,7 +227,7 @@ name = "Advanced Sensor" desc = "A tier 2 stock part used in the construction of various devices." id = "adv_sensor" - build_type = PROTOLATHE | AUTOLATHE + build_type = PROTOLATHE materials = list(MAT_STEEL = 50, MAT_GLASS = 20) build_path = /obj/item/stock_parts/scanning_module/adv category = list( diff --git a/vorestation.dme b/vorestation.dme index b3ee6bc298..55a4f70b8d 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -4501,6 +4501,7 @@ #include "code\modules\research\tg\rdmachines.dm" #include "code\modules\research\tg\server.dm" #include "code\modules\research\tg\server_control.dm" +#include "code\modules\research\tg\design_disks\engineering.dm" #include "code\modules\research\tg\design_disks\security.dm" #include "code\modules\research\tg\designs\ai_designs.dm" #include "code\modules\research\tg\designs\ammunition_designs.dm"