Files
Aurora.3/code/controllers/subsystems/processing/electronics.dm
mineymonkeyandGitHub 6c6f596d89 Integrated Circuit Overhaul 2.0 (#22647)
Complete overhaul of Integrated Circuits Final Edition!

- Adds phoron cost to circuits (not assemblies).
- Printer searching capability.
- Changed names of assemblies to better match their description.
- Adds cloning and auto appending JSON for large builds.
- Adds database, debug, advanced math circuits.
- Reworks the list circuits to finally accept anything other than NUM.
- Adds plenty of list circuits to allow functional building and clearing
of lists.
- Reworks Complexity/Space to allow a bit better flexibility in creation
of devices.
- Adds a "Headroom" concept where space/complexity can go beyond the
maximum to a very slight degree. Concretely, unused space gives `2`
extra complexity per unused component slot, capped at `15%` of
`max_complexity`. Unused complexity gives `1` extra component slot per
`6` unused complexity, capped at `15%` of `max_components`.
- Groups math and logic circuits and adds subgroups.
- Doesn't mess with the circuit tool kit.
- Adds a xenoarch drill assembly with a nice sprite. Thank you
@EnchantedCrocolisk for the sprite!
- Changes activation limit time to 1 second from 2 seconds, adds a 1
second timer that is unique to the INTEGRATED CIRCUIT PRINTER with the
advanced design disk.
- Ports several Baystation integrated-circuit manipulation components,
primarily from
Baystation12/Baystation12https://github.com/Baystation12/Baystation12/pull/22458,
with anchoring bolts and hatch lock sourced from
Baystation12/Baystation12https://github.com/Baystation12/Baystation12/pull/25052.
- Changes the electronic ear piece into a workable radio headset with
working encryption keys capability and unique ways the Microphone and
TTS interacts with it.
- Removed the ability for all the electronic wearables to spawn with a
basic cell.
- Combines https://github.com/Aurorastation/Aurora.3/pull/22466,
https://github.com/Aurorastation/Aurora.3/pull/22456,
https://github.com/Aurorastation/Aurora.3/pull/22455,
https://github.com/Aurorastation/Aurora.3/pull/22446 that are now
closed.
2026-07-26 19:52:31 +00:00

110 lines
4.5 KiB
Plaintext

#define IC_SPAWN_DEFAULT 1 // If the circuit comes in the default circuit box and able to be printed in the IC printer.
#define IC_SPAWN_RESEARCH 2 // If the circuit design will be available in the IC printer after upgrading it.
PROCESSING_SUBSYSTEM_DEF(electronics)
name = "Electronics"
wait = 1 SECOND
priority = SS_PRIORITY_ELECTRONICS
flags = SS_KEEP_TIMING
init_order = INIT_ORDER_MISC_FIRST
var/list/all_integrated_circuits = list()
var/list/printer_recipe_list = list()
var/list/printer_recipe_list_basic = list()
var/list/printer_recipe_list_upgraded = list()
var/list/found_categories = list()
/datum/controller/subsystem/processing/electronics/Initialize(timeofday)
init_subtypes(/obj/item/integrated_circuit, all_integrated_circuits)
// First loop is to seperate the actual circuits from base circuits.
var/list/circuits_to_use = list()
for(var/obj/item/integrated_circuit/IC in all_integrated_circuits)
if((IC.get_printer_spawn_flags() & (IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH)))
circuits_to_use += IC
// Second loop is to find all categories.
for(var/obj/item/integrated_circuit/IC in circuits_to_use)
if(!(IC.category_text in found_categories))
found_categories += IC.category_text
found_categories += "Assemblies"
found_categories += "Tools"
// Third loop is to initialize lists by category names, then put circuits matching the category inside.
for(var/category in found_categories)
printer_recipe_list[category] = list()
var/list/current_list = printer_recipe_list[category]
for(var/obj/item/integrated_circuit/IC in circuits_to_use)
if(IC.category_text == category)
current_list += IC
// Now for non-circuit things.
printer_recipe_list["Assemblies"] = list(
new /obj/item/electronic_assembly/default,
new /obj/item/electronic_assembly/calc,
new /obj/item/electronic_assembly/clam,
new /obj/item/electronic_assembly/simple,
new /obj/item/electronic_assembly/hook,
new /obj/item/electronic_assembly/pda,
new /obj/item/electronic_assembly/tiny/default,
new /obj/item/electronic_assembly/tiny/cylinder,
new /obj/item/electronic_assembly/tiny/scanner,
new /obj/item/electronic_assembly/tiny/hook,
new /obj/item/electronic_assembly/tiny/box,
new /obj/item/electronic_assembly/medium/default,
new /obj/item/electronic_assembly/medium/box,
new /obj/item/electronic_assembly/medium/clam,
new /obj/item/electronic_assembly/medium/medical,
new /obj/item/electronic_assembly/medium/gun,
new /obj/item/electronic_assembly/medium/radio,
new /obj/item/electronic_assembly/medium/anomaly_drill,
new /obj/item/electronic_assembly/large/default,
new /obj/item/electronic_assembly/large/scope,
new /obj/item/electronic_assembly/large/terminal,
new /obj/item/electronic_assembly/large/arm,
new /obj/item/electronic_assembly/large/tall,
new /obj/item/electronic_assembly/large/industrial,
new /obj/item/electronic_assembly/drone/default,
new /obj/item/electronic_assembly/drone/arms,
new /obj/item/electronic_assembly/drone/medbot,
new /obj/item/electronic_assembly/drone/genbot,
new /obj/item/electronic_assembly/drone/android,
new /obj/item/electronic_assembly/wallmount/tiny,
new /obj/item/electronic_assembly/wallmount/light,
new /obj/item/electronic_assembly/wallmount,
new /obj/item/electronic_assembly/wallmount/heavy,
new /obj/item/implant/integrated_circuit,
new /obj/item/clothing/under/circuitry,
new /obj/item/clothing/gloves/circuitry,
new /obj/item/clothing/glasses/circuitry,
new /obj/item/clothing/shoes/circuitry,
new /obj/item/clothing/head/circuitry,
new /obj/item/radio/headset/circuitry,
new /obj/item/clothing/suit/circuitry
)
printer_recipe_list["Tools"] = list(
new /obj/item/integrated_electronics/wirer,
new /obj/item/integrated_electronics/debugger,
new /obj/item/integrated_electronics/detailer
)
for(var/category in printer_recipe_list)
var/items = printer_recipe_list[category]
for(var/obj/O in items)
var/is_basic = TRUE
if(istype(O, /obj/item/integrated_circuit))
var/obj/item/integrated_circuit/IC = O
var/printer_spawn_flags = IC.get_printer_spawn_flags()
if((printer_spawn_flags & IC_SPAWN_RESEARCH) && (!(printer_spawn_flags & IC_SPAWN_DEFAULT)))
is_basic = FALSE
var/list/recipe = list(path = "[O.type]", name = "[O.name]", desc = "[O.desc]", "basic" = is_basic, "category" = category)
if(is_basic)
printer_recipe_list_basic += list(recipe)
printer_recipe_list_upgraded += list(recipe)
return SS_INIT_SUCCESS
#undef IC_SPAWN_DEFAULT
#undef IC_SPAWN_RESEARCH